Selaa lähdekoodia

Corrected issue with types

raysan5 5 vuotta sitten
vanhempi
commit
9c52a4932d
2 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 3 2
      src/external/jar_xm.h
  2. 2 2
      src/text.c

+ 3 - 2
src/external/jar_xm.h

@@ -51,6 +51,8 @@
 #ifndef INCLUDE_JAR_XM_H
 #define INCLUDE_JAR_XM_H
 
+#include <stdint.h>
+
 #define JAR_XM_DEBUG 0
 #define JAR_XM_LINEAR_INTERPOLATION 1 // speed increase with decrease in quality
 #define JAR_XM_DEFENSIVE 1
@@ -69,7 +71,7 @@ struct jar_xm_context_s;
 typedef struct jar_xm_context_s jar_xm_context_t;
 
 #ifdef __cplusplus
-extern "C" {
+extern "C" { 
 #endif
 
 /** Create a XM context.
@@ -308,7 +310,6 @@ uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx);
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdint.h>
 #include <limits.h>
 #include <string.h>
 

+ 2 - 2
src/text.c

@@ -557,7 +557,7 @@ CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int c
             else chars[i].image.data = NULL;
             
             stbtt_GetCodepointHMetrics(&fontInfo, ch, &chars[i].advanceX, NULL);
-            chars[i].advanceX *= scaleFactor;
+            chars[i].advanceX = (int)((float)chars[i].advanceX*scaleFactor);
 
             // Load characters images
             chars[i].image.width = chw;
@@ -977,7 +977,7 @@ void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, f
                 bool isGlyphSelected = false;
                 if ((selectStart >= 0) && (k >= selectStart) && (k < (selectStart + selectLength)))
                 {
-                    DrawRectangleRec((Rectangle){ rec.x + textOffsetX - 1, rec.y + textOffsetY, glyphWidth, font.baseSize*scaleFactor }, selectBackTint);
+                    DrawRectangleRec((Rectangle){ rec.x + textOffsetX - 1, rec.y + textOffsetY, glyphWidth, (int)((float)font.baseSize*scaleFactor) }, selectBackTint);
                     isGlyphSelected = true;
                 }