Browse Source

Remove trail spaces

pull/1154/head
raysan5 5 years ago
parent
commit
7ae7a87f8a
6 changed files with 28 additions and 28 deletions
  1. +10
    -10
      src/core.c
  2. +3
    -3
      src/raudio.c
  3. +2
    -2
      src/rlgl.h
  4. +3
    -3
      src/text.c
  5. +9
    -9
      src/textures.c
  6. +1
    -1
      src/utils.c

+ 10
- 10
src/core.c View File

@ -148,7 +148,7 @@
#if defined(SUPPORT_GIF_RECORDING) #if defined(SUPPORT_GIF_RECORDING)
#define RGIF_MALLOC RL_MALLOC #define RGIF_MALLOC RL_MALLOC
#define RGIF_FREE RL_FREE #define RGIF_FREE RL_FREE
#define RGIF_IMPLEMENTATION #define RGIF_IMPLEMENTATION
#include "external/rgif.h" // Support GIF recording #include "external/rgif.h" // Support GIF recording
#endif #endif
@ -168,7 +168,7 @@
#if (defined(PLATFORM_DESKTOP) || defined(PLATFORM_UWP)) && defined(_WIN32) && (defined(_MSC_VER) || defined(__TINYC__)) #if (defined(PLATFORM_DESKTOP) || defined(PLATFORM_UWP)) && defined(_WIN32) && (defined(_MSC_VER) || defined(__TINYC__))
#define DIRENT_MALLOC RL_MALLOC #define DIRENT_MALLOC RL_MALLOC
#define DIRENT_FREE RL_FREE #define DIRENT_FREE RL_FREE
#include "external/dirent.h" // Required for: DIR, opendir(), closedir() [Used in GetDirectoryFiles()] #include "external/dirent.h" // Required for: DIR, opendir(), closedir() [Used in GetDirectoryFiles()]
#else #else
#include <dirent.h> // Required for: DIR, opendir(), closedir() [Used in GetDirectoryFiles()] #include <dirent.h> // Required for: DIR, opendir(), closedir() [Used in GetDirectoryFiles()]
@ -2537,7 +2537,7 @@ bool IsMouseButtonReleased(int button)
bool released = false; bool released = false;
if ((CORE.Input.Mouse.currentButtonState[button] == 0) && (CORE.Input.Mouse.previousButtonState[button] == 1)) released = true; if ((CORE.Input.Mouse.currentButtonState[button] == 0) && (CORE.Input.Mouse.previousButtonState[button] == 1)) released = true;
// Map touches to mouse buttons checking // Map touches to mouse buttons checking
if ((CORE.Input.Touch.currentTouchState[button] == 0) && (CORE.Input.Touch.previousTouchState[button] == 1)) released = true; if ((CORE.Input.Touch.currentTouchState[button] == 0) && (CORE.Input.Touch.previousTouchState[button] == 1)) released = true;
@ -3971,7 +3971,7 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i
} }
#endif // SUPPORT_SCREEN_CAPTURE #endif // SUPPORT_SCREEN_CAPTURE
} }
else
else
{ {
// WARNING: GLFW could return GLFW_REPEAT, we need to consider it as 1 // WARNING: GLFW could return GLFW_REPEAT, we need to consider it as 1
// to work properly with our implementation (IsKeyDown/IsKeyUp checks) // to work properly with our implementation (IsKeyDown/IsKeyUp checks)
@ -3983,10 +3983,10 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i
// GLFW3 Mouse Button Callback, runs on mouse button pressed // GLFW3 Mouse Button Callback, runs on mouse button pressed
static void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods) static void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods)
{ {
// WARNING: GLFW could only return GLFW_PRESS (1) or GLFW_RELEASE (0) for now,
// WARNING: GLFW could only return GLFW_PRESS (1) or GLFW_RELEASE (0) for now,
// but future releases may add more actions (i.e. GLFW_REPEAT) // but future releases may add more actions (i.e. GLFW_REPEAT)
CORE.Input.Mouse.currentButtonState[button] = action; CORE.Input.Mouse.currentButtonState[button] = action;
#if defined(SUPPORT_GESTURES_SYSTEM) && defined(SUPPORT_MOUSE_GESTURES) #if defined(SUPPORT_GESTURES_SYSTEM) && defined(SUPPORT_MOUSE_GESTURES)
// Process mouse events as touches to be able to use mouse-gestures // Process mouse events as touches to be able to use mouse-gestures
GestureEvent gestureEvent = { 0 }; GestureEvent gestureEvent = { 0 };
@ -3994,7 +3994,7 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
// Register touch actions // Register touch actions
if ((CORE.Input.Mouse.currentButtonState[button] == 1) && (CORE.Input.Mouse.previousButtonState[button] == 0)) gestureEvent.touchAction = TOUCH_DOWN; if ((CORE.Input.Mouse.currentButtonState[button] == 1) && (CORE.Input.Mouse.previousButtonState[button] == 0)) gestureEvent.touchAction = TOUCH_DOWN;
else if ((CORE.Input.Mouse.currentButtonState[button] == 0) && (CORE.Input.Mouse.previousButtonState[button] == 1)) gestureEvent.touchAction = TOUCH_UP; else if ((CORE.Input.Mouse.currentButtonState[button] == 0) && (CORE.Input.Mouse.previousButtonState[button] == 1)) gestureEvent.touchAction = TOUCH_UP;
// NOTE: TOUCH_MOVE event is registered in MouseCursorPosCallback() // NOTE: TOUCH_MOVE event is registered in MouseCursorPosCallback()
// Assign a pointer ID // Assign a pointer ID
@ -4021,7 +4021,7 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y)
CORE.Input.Mouse.position.x = (float)x; CORE.Input.Mouse.position.x = (float)x;
CORE.Input.Mouse.position.y = (float)y; CORE.Input.Mouse.position.y = (float)y;
CORE.Input.Touch.position[0] = CORE.Input.Mouse.position; CORE.Input.Touch.position[0] = CORE.Input.Mouse.position;
#if defined(SUPPORT_GESTURES_SYSTEM) && defined(SUPPORT_MOUSE_GESTURES) #if defined(SUPPORT_GESTURES_SYSTEM) && defined(SUPPORT_MOUSE_GESTURES)
// Process mouse events as touches to be able to use mouse-gestures // Process mouse events as touches to be able to use mouse-gestures
GestureEvent gestureEvent = { 0 }; GestureEvent gestureEvent = { 0 };
@ -4413,7 +4413,7 @@ static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent
// Register touch input events // Register touch input events
static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) static EM_BOOL EmscriptenTouchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData)
{ {
for (int i = 0; i < touchEvent->numTouches; i++)
for (int i = 0; i < touchEvent->numTouches; i++)
{ {
if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART) CORE.Input.Touch.currentTouchState[i] = 1; if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART) CORE.Input.Touch.currentTouchState[i] = 1;
else if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) CORE.Input.Touch.currentTouchState[i] = 0; else if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) CORE.Input.Touch.currentTouchState[i] = 0;
@ -4561,7 +4561,7 @@ static void ProcessKeyboard(void)
// Reset pressed keys array (it will be filled below) // Reset pressed keys array (it will be filled below)
for (int i = 0; i < 512; i++) CORE.Input.Keyboard.currentKeyState[i] = 0; for (int i = 0; i < 512; i++) CORE.Input.Keyboard.currentKeyState[i] = 0;
// Check keys from event input workers (This is the new keyboard reading method) // Check keys from event input workers (This is the new keyboard reading method)
//for (int i = 0; i < 512; i++) CORE.Input.Keyboard.currentKeyState[i] = CORE.Input.Keyboard.currentKeyStateEvdev[i]; //for (int i = 0; i < 512; i++) CORE.Input.Keyboard.currentKeyState[i] = CORE.Input.Keyboard.currentKeyStateEvdev[i];

+ 3
- 3
src/raudio.c View File

@ -184,7 +184,7 @@ typedef struct tagBITMAPINFOHEADER {
#if defined(SUPPORT_FILEFORMAT_XM) #if defined(SUPPORT_FILEFORMAT_XM)
#define JARXM_MALLOC RL_MALLOC #define JARXM_MALLOC RL_MALLOC
#define JARXM_FREE RL_FREE #define JARXM_FREE RL_FREE
#define JAR_XM_IMPLEMENTATION #define JAR_XM_IMPLEMENTATION
#include "external/jar_xm.h" // XM loading functions #include "external/jar_xm.h" // XM loading functions
#endif #endif
@ -192,7 +192,7 @@ typedef struct tagBITMAPINFOHEADER {
#if defined(SUPPORT_FILEFORMAT_MOD) #if defined(SUPPORT_FILEFORMAT_MOD)
#define JARMOD_MALLOC RL_MALLOC #define JARMOD_MALLOC RL_MALLOC
#define JARMOD_FREE RL_FREE #define JARMOD_FREE RL_FREE
#define JAR_MOD_IMPLEMENTATION #define JAR_MOD_IMPLEMENTATION
#include "external/jar_mod.h" // MOD loading functions #include "external/jar_mod.h" // MOD loading functions
#endif #endif
@ -211,7 +211,7 @@ typedef struct tagBITMAPINFOHEADER {
#define DRMP3_MALLOC RL_MALLOC #define DRMP3_MALLOC RL_MALLOC
#define DRMP3_REALLOC RL_REALLOC #define DRMP3_REALLOC RL_REALLOC
#define DRMP3_FREE RL_FREE #define DRMP3_FREE RL_FREE
#define DR_MP3_IMPLEMENTATION #define DR_MP3_IMPLEMENTATION
#include "external/dr_mp3.h" // MP3 loading functions #include "external/dr_mp3.h" // MP3 loading functions
#endif #endif

+ 2
- 2
src/rlgl.h View File

@ -652,7 +652,7 @@ RLAPI int GetPixelDataSize(int width, int height, int format);// Get pixel data
#else #else
#define GLAD_REALLOC RL_REALLOC #define GLAD_REALLOC RL_REALLOC
#define GLAD_FREE RL_FREE #define GLAD_FREE RL_FREE
#define GLAD_IMPLEMENTATION #define GLAD_IMPLEMENTATION
#if defined(RLGL_STANDALONE) #if defined(RLGL_STANDALONE)
#include "glad.h" // GLAD extensions loading library, includes OpenGL headers #include "glad.h" // GLAD extensions loading library, includes OpenGL headers
@ -4631,7 +4631,7 @@ char *LoadFileText(const char *fileName)
// Zero-terminate the string // Zero-terminate the string
text[count] = '\0'; text[count] = '\0';
TRACELOG(LOG_INFO, "[%s] Text file loaded successfully", fileName); TRACELOG(LOG_INFO, "[%s] Text file loaded successfully", fileName);
} }
else TRACELOG(LOG_WARNING, "[%s] Text file could not be read", fileName); else TRACELOG(LOG_WARNING, "[%s] Text file could not be read", fileName);

+ 3
- 3
src/text.c View File

@ -506,7 +506,7 @@ CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int c
{ {
int genFontChars = false; int genFontChars = false;
stbtt_fontinfo fontInfo = { 0 }; stbtt_fontinfo fontInfo = { 0 };
if (stbtt_InitFont(&fontInfo, fileData, 0)) // Init font for data reading if (stbtt_InitFont(&fontInfo, fileData, 0)) // Init font for data reading
{ {
// Calculate font scale factor // Calculate font scale factor
@ -1352,8 +1352,8 @@ const char *TextToUpper(const char *text)
{ {
buffer[i] = (char)toupper(text[i]); buffer[i] = (char)toupper(text[i]);
//if ((text[i] >= 'a') && (text[i] <= 'z')) buffer[i] = text[i] - 32; //if ((text[i] >= 'a') && (text[i] <= 'z')) buffer[i] = text[i] - 32;
// TODO: Support Utf8 diacritics!
// TODO: Support Utf8 diacritics!
//if ((text[i] >= 'à') && (text[i] <= 'ý')) buffer[i] = text[i] - 32; //if ((text[i] >= 'à') && (text[i] <= 'ý')) buffer[i] = text[i] - 32;
} }
else { buffer[i] = '\0'; break; } else { buffer[i] = '\0'; break; }

+ 9
- 9
src/textures.c View File

@ -127,7 +127,7 @@
#define STBIW_MALLOC RL_MALLOC #define STBIW_MALLOC RL_MALLOC
#define STBIW_FREE RL_FREE #define STBIW_FREE RL_FREE
#define STBIW_REALLOC RL_REALLOC #define STBIW_REALLOC RL_REALLOC
#define STB_IMAGE_WRITE_IMPLEMENTATION #define STB_IMAGE_WRITE_IMPLEMENTATION
#include "external/stb_image_write.h" // Required for: stbi_write_*() #include "external/stb_image_write.h" // Required for: stbi_write_*()
#endif #endif
@ -135,7 +135,7 @@
#if defined(SUPPORT_IMAGE_MANIPULATION) #if defined(SUPPORT_IMAGE_MANIPULATION)
#define STBIR_MALLOC(size,c) ((void)(c), RL_MALLOC(size)) #define STBIR_MALLOC(size,c) ((void)(c), RL_MALLOC(size))
#define STBIR_FREE(ptr,c) ((void)(c), RL_FREE(ptr)) #define STBIR_FREE(ptr,c) ((void)(c), RL_FREE(ptr))
#define STB_IMAGE_RESIZE_IMPLEMENTATION #define STB_IMAGE_RESIZE_IMPLEMENTATION
#include "external/stb_image_resize.h" // Required for: stbir_resize_uint8() [ImageResize()] #include "external/stb_image_resize.h" // Required for: stbir_resize_uint8() [ImageResize()]
#endif #endif
@ -1966,17 +1966,17 @@ Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Co
textOffsetX = 0.0f; textOffsetX = 0.0f;
} }
else else
{
{
if ((codepoint != ' ') && (codepoint != '\t')) if ((codepoint != ' ') && (codepoint != '\t'))
{ {
Rectangle rec = { textOffsetX + font.chars[index].offsetX, textOffsetY + font.chars[index].offsetY, font.recs[index].width, font.recs[index].height }; Rectangle rec = { textOffsetX + font.chars[index].offsetX, textOffsetY + font.chars[index].offsetY, font.recs[index].width, font.recs[index].height };
ImageDraw(&imText, font.chars[index].image, (Rectangle){ 0, 0, font.chars[index].image.width, font.chars[index].image.height }, rec, tint); ImageDraw(&imText, font.chars[index].image, (Rectangle){ 0, 0, font.chars[index].image.width, font.chars[index].image.height }, rec, tint);
} }
if (font.chars[index].advanceX == 0) textOffsetX += (int)(font.recs[index].width + spacing); if (font.chars[index].advanceX == 0) textOffsetX += (int)(font.recs[index].width + spacing);
else textOffsetX += font.chars[index].advanceX + (int)spacing; else textOffsetX += font.chars[index].advanceX + (int)spacing;
} }
i += (codepointByteCount - 1); // Move text bytes counter to next codepoint i += (codepointByteCount - 1); // Move text bytes counter to next codepoint
} }
@ -2021,7 +2021,7 @@ void ImageClearBackground(Image *dst, Color color)
} }
// Draw pixel within an image // Draw pixel within an image
void ImageDrawPixel(Image *dst, Vector2 position, Color color)
void ImageDrawPixel(Image *dst, Vector2 position, Color color)
{ {
ImageDrawRectangle(dst, (Rectangle){ position.x, position.y, 1.0f, 1.0f }, color); ImageDrawRectangle(dst, (Rectangle){ position.x, position.y, 1.0f, 1.0f }, color);
} }
@ -2043,7 +2043,7 @@ void ImageDrawCircle(Image *dst, Vector2 center, int radius, Color color)
ImageDrawPixel(dst, (Vector2){ xc + y, yc - x }, color); ImageDrawPixel(dst, (Vector2){ xc + y, yc - x }, color);
ImageDrawPixel(dst, (Vector2){ xc - y, yc - x }, color); ImageDrawPixel(dst, (Vector2){ xc - y, yc - x }, color);
x++; x++;
if (decesionParameter > 0) if (decesionParameter > 0)
{ {
y--; y--;
@ -2061,13 +2061,13 @@ void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, Color color)
int slopeError = m - (x2 - x1); int slopeError = m - (x2 - x1);
for (int x = x1, y = y1; x <= x2; x++) for (int x = x1, y = y1; x <= x2; x++)
{
{
ImageDrawPixel(dst, (Vector2){ x, y }, color); ImageDrawPixel(dst, (Vector2){ x, y }, color);
slopeError += m; slopeError += m;
if (slopeError >= 0) if (slopeError >= 0)
{ {
y++;
y++;
slopeError -= 2*(x2 - x1); slopeError -= 2*(x2 - x1);
} }
} }

+ 1
- 1
src/utils.c View File

@ -256,7 +256,7 @@ char *LoadFileText(const char *fileName)
// Zero-terminate the string // Zero-terminate the string
text[count] = '\0'; text[count] = '\0';
TRACELOG(LOG_INFO, "[%s] Text file loaded successfully", fileName); TRACELOG(LOG_INFO, "[%s] Text file loaded successfully", fileName);
} }
else TRACELOG(LOG_WARNING, "[%s] Text file could not be read", fileName); else TRACELOG(LOG_WARNING, "[%s] Text file could not be read", fileName);

Loading…
Cancel
Save