Remove trailing spaces
This commit is contained in:
parent
1b047995d1
commit
646d70e93a
8 changed files with 23 additions and 23 deletions
|
@ -15,7 +15,7 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
||||||
|
|
||||||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
|
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1739,7 +1739,7 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
|
||||||
// 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;
|
||||||
CORE.Input.Touch.currentTouchState[button] = action;
|
CORE.Input.Touch.currentTouchState[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 };
|
||||||
|
|
|
@ -942,13 +942,13 @@ Sound LoadSoundAlias(Sound source)
|
||||||
if (source.stream.buffer->data != NULL)
|
if (source.stream.buffer->data != NULL)
|
||||||
{
|
{
|
||||||
AudioBuffer *audioBuffer = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, 0, AUDIO_BUFFER_USAGE_STATIC);
|
AudioBuffer *audioBuffer = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, 0, AUDIO_BUFFER_USAGE_STATIC);
|
||||||
|
|
||||||
if (audioBuffer == NULL)
|
if (audioBuffer == NULL)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "SOUND: Failed to create buffer");
|
TRACELOG(LOG_WARNING, "SOUND: Failed to create buffer");
|
||||||
return sound; // Early return to avoid dereferencing the audioBuffer null pointer
|
return sound; // Early return to avoid dereferencing the audioBuffer null pointer
|
||||||
}
|
}
|
||||||
|
|
||||||
audioBuffer->sizeInFrames = source.stream.buffer->sizeInFrames;
|
audioBuffer->sizeInFrames = source.stream.buffer->sizeInFrames;
|
||||||
audioBuffer->volume = source.stream.buffer->volume;
|
audioBuffer->volume = source.stream.buffer->volume;
|
||||||
audioBuffer->data = source.stream.buffer->data;
|
audioBuffer->data = source.stream.buffer->data;
|
||||||
|
@ -1081,7 +1081,7 @@ bool ExportWaveAsCode(Wave wave, const char *fileName)
|
||||||
int waveDataSize = wave.frameCount*wave.channels*wave.sampleSize/8;
|
int waveDataSize = wave.frameCount*wave.channels*wave.sampleSize/8;
|
||||||
|
|
||||||
// NOTE: Text data buffer size is estimated considering wave data size in bytes
|
// NOTE: Text data buffer size is estimated considering wave data size in bytes
|
||||||
// and requiring 12 char bytes for every byte; the actual size varies, but
|
// and requiring 12 char bytes for every byte; the actual size varies, but
|
||||||
// the longest possible char being appended is "%.4ff,\n ", which is 12 bytes.
|
// the longest possible char being appended is "%.4ff,\n ", which is 12 bytes.
|
||||||
char *txtData = (char *)RL_CALLOC(waveDataSize*12 + 2000, sizeof(char));
|
char *txtData = (char *)RL_CALLOC(waveDataSize*12 + 2000, sizeof(char));
|
||||||
|
|
||||||
|
@ -2752,7 +2752,7 @@ static bool SaveFileData(const char *fileName, void *data, int dataSize)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "FILEIO: File name provided is not valid");
|
TRACELOG(LOG_WARNING, "FILEIO: File name provided is not valid");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -777,7 +777,7 @@ RMAPI Vector3 Vector3Normalize(Vector3 v)
|
||||||
RMAPI Vector3 Vector3Project(Vector3 v1, Vector3 v2)
|
RMAPI Vector3 Vector3Project(Vector3 v1, Vector3 v2)
|
||||||
{
|
{
|
||||||
Vector3 result = { 0 };
|
Vector3 result = { 0 };
|
||||||
|
|
||||||
float v1dv2 = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);
|
float v1dv2 = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);
|
||||||
float v2dv2 = (v2.x*v2.x + v2.y*v2.y + v2.z*v2.z);
|
float v2dv2 = (v2.x*v2.x + v2.y*v2.y + v2.z*v2.z);
|
||||||
|
|
||||||
|
@ -794,7 +794,7 @@ RMAPI Vector3 Vector3Project(Vector3 v1, Vector3 v2)
|
||||||
RMAPI Vector3 Vector3Reject(Vector3 v1, Vector3 v2)
|
RMAPI Vector3 Vector3Reject(Vector3 v1, Vector3 v2)
|
||||||
{
|
{
|
||||||
Vector3 result = { 0 };
|
Vector3 result = { 0 };
|
||||||
|
|
||||||
float v1dv2 = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);
|
float v1dv2 = (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);
|
||||||
float v2dv2 = (v2.x*v2.x + v2.y*v2.y + v2.z*v2.z);
|
float v2dv2 = (v2.x*v2.x + v2.y*v2.y + v2.z*v2.z);
|
||||||
|
|
||||||
|
@ -1213,7 +1213,7 @@ RMAPI Vector3 Vector3Refract(Vector3 v, Vector3 n, float r)
|
||||||
RMAPI Vector4 Vector4Zero(void)
|
RMAPI Vector4 Vector4Zero(void)
|
||||||
{
|
{
|
||||||
Vector4 result = { 0.0f, 0.0f, 0.0f, 0.0f };
|
Vector4 result = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
RMAPI Vector4 Vector4One(void)
|
RMAPI Vector4 Vector4One(void)
|
||||||
|
@ -1296,7 +1296,7 @@ RMAPI float Vector4Distance(Vector4 v1, Vector4 v2)
|
||||||
// Calculate square distance between two vectors
|
// Calculate square distance between two vectors
|
||||||
RMAPI float Vector4DistanceSqr(Vector4 v1, Vector4 v2)
|
RMAPI float Vector4DistanceSqr(Vector4 v1, Vector4 v2)
|
||||||
{
|
{
|
||||||
float result =
|
float result =
|
||||||
(v1.x - v2.x)*(v1.x - v2.x) + (v1.y - v2.y)*(v1.y - v2.y) +
|
(v1.x - v2.x)*(v1.x - v2.x) + (v1.y - v2.y)*(v1.y - v2.y) +
|
||||||
(v1.z - v2.z)*(v1.z - v2.z) + (v1.w - v2.w)*(v1.w - v2.w);
|
(v1.z - v2.z)*(v1.z - v2.z) + (v1.w - v2.w)*(v1.w - v2.w);
|
||||||
|
|
||||||
|
|
12
src/rcore.c
12
src/rcore.c
|
@ -118,12 +118,12 @@
|
||||||
|
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
||||||
#define RGESTURES_IMPLEMENTATION
|
#define RGESTURES_IMPLEMENTATION
|
||||||
#include "rgestures.h" // Gestures detection functionality
|
#include "rgestures.h" // Gestures detection functionality
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SUPPORT_CAMERA_SYSTEM)
|
#if defined(SUPPORT_CAMERA_SYSTEM)
|
||||||
#define RCAMERA_IMPLEMENTATION
|
#define RCAMERA_IMPLEMENTATION
|
||||||
#include "rcamera.h" // Camera system functionality
|
#include "rcamera.h" // Camera system functionality
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SUPPORT_GIF_RECORDING)
|
#if defined(SUPPORT_GIF_RECORDING)
|
||||||
|
@ -1799,7 +1799,7 @@ void TakeScreenshot(const char *fileName)
|
||||||
|
|
||||||
char path[512] = { 0 };
|
char path[512] = { 0 };
|
||||||
strcpy(path, TextFormat("%s/%s", CORE.Storage.basePath, GetFileName(fileName)));
|
strcpy(path, TextFormat("%s/%s", CORE.Storage.basePath, GetFileName(fileName)));
|
||||||
|
|
||||||
ExportImage(image, path); // WARNING: Module required: rtextures
|
ExportImage(image, path); // WARNING: Module required: rtextures
|
||||||
RL_FREE(imgData);
|
RL_FREE(imgData);
|
||||||
|
|
||||||
|
@ -1955,7 +1955,7 @@ const char *GetFileName(const char *filePath)
|
||||||
const char *GetFileNameWithoutExt(const char *filePath)
|
const char *GetFileNameWithoutExt(const char *filePath)
|
||||||
{
|
{
|
||||||
#define MAX_FILENAME_LENGTH 256
|
#define MAX_FILENAME_LENGTH 256
|
||||||
|
|
||||||
static char fileName[MAX_FILENAME_LENGTH] = { 0 };
|
static char fileName[MAX_FILENAME_LENGTH] = { 0 };
|
||||||
memset(fileName, 0, MAX_FILENAME_LENGTH);
|
memset(fileName, 0, MAX_FILENAME_LENGTH);
|
||||||
|
|
||||||
|
@ -1963,7 +1963,7 @@ const char *GetFileNameWithoutExt(const char *filePath)
|
||||||
{
|
{
|
||||||
strcpy(fileName, GetFileName(filePath)); // Get filename.ext without path
|
strcpy(fileName, GetFileName(filePath)); // Get filename.ext without path
|
||||||
int size = (int)strlen(fileName); // Get size in bytes
|
int size = (int)strlen(fileName); // Get size in bytes
|
||||||
|
|
||||||
for (int i = size; i > 0; i--) // Reverse search '.'
|
for (int i = size; i > 0; i--) // Reverse search '.'
|
||||||
{
|
{
|
||||||
if (fileName[i] == '.')
|
if (fileName[i] == '.')
|
||||||
|
@ -1974,7 +1974,7 @@ const char *GetFileNameWithoutExt(const char *filePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -623,7 +623,7 @@ RLAPI void rlDisableFramebuffer(void); // Disable render textur
|
||||||
RLAPI unsigned int rlGetActiveFramebuffer(void); // Get the currently active render texture (fbo), 0 for default framebuffer
|
RLAPI unsigned int rlGetActiveFramebuffer(void); // Get the currently active render texture (fbo), 0 for default framebuffer
|
||||||
RLAPI void rlActiveDrawBuffers(int count); // Activate multiple draw color buffers
|
RLAPI void rlActiveDrawBuffers(int count); // Activate multiple draw color buffers
|
||||||
RLAPI void rlBlitFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, int bufferMask); // Blit active framebuffer to main framebuffer
|
RLAPI void rlBlitFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, int bufferMask); // Blit active framebuffer to main framebuffer
|
||||||
RLAPI void rlBindFramebuffer(unsigned int target, unsigned int framebuffer); // Bind framebuffer (FBO)
|
RLAPI void rlBindFramebuffer(unsigned int target, unsigned int framebuffer); // Bind framebuffer (FBO)
|
||||||
|
|
||||||
// General render state
|
// General render state
|
||||||
RLAPI void rlEnableColorBlend(void); // Enable color blending
|
RLAPI void rlEnableColorBlend(void); // Enable color blending
|
||||||
|
@ -3828,8 +3828,8 @@ void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool norma
|
||||||
{
|
{
|
||||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
// NOTE: Data type could be: GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT
|
// NOTE: Data type could be: GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT
|
||||||
// Additional types (depends on OpenGL version or extensions):
|
// Additional types (depends on OpenGL version or extensions):
|
||||||
// - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED,
|
// - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED,
|
||||||
// - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV
|
// - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV
|
||||||
glVertexAttribPointer(index, compSize, type, normalized, stride, pointer);
|
glVertexAttribPointer(index, compSize, type, normalized, stride, pointer);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -5804,7 +5804,7 @@ static Model LoadM3D(const char *fileName)
|
||||||
// If no map is provided, or we have colors defined, we allocate storage for vertex colors
|
// If no map is provided, or we have colors defined, we allocate storage for vertex colors
|
||||||
// M3D specs only consider vertex colors if no material is provided, however raylib uses both and mixes the colors
|
// M3D specs only consider vertex colors if no material is provided, however raylib uses both and mixes the colors
|
||||||
if ((mi == M3D_UNDEF) || vcolor) model.meshes[k].colors = RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(unsigned char));
|
if ((mi == M3D_UNDEF) || vcolor) model.meshes[k].colors = RL_CALLOC(model.meshes[k].vertexCount*4, sizeof(unsigned char));
|
||||||
|
|
||||||
// If no map is provided and we allocated vertex colors, set them to white
|
// If no map is provided and we allocated vertex colors, set them to white
|
||||||
if ((mi == M3D_UNDEF) && (model.meshes[k].colors != NULL))
|
if ((mi == M3D_UNDEF) && (model.meshes[k].colors != NULL))
|
||||||
{
|
{
|
||||||
|
@ -6076,7 +6076,7 @@ static ModelAnimation *LoadModelAnimationsM3D(const char *fileName, int *animCou
|
||||||
animations[a].framePoses = RL_MALLOC(animations[a].frameCount*sizeof(Transform *));
|
animations[a].framePoses = RL_MALLOC(animations[a].frameCount*sizeof(Transform *));
|
||||||
strncpy(animations[a].name, m3d->action[a].name, sizeof(animations[a].name));
|
strncpy(animations[a].name, m3d->action[a].name, sizeof(animations[a].name));
|
||||||
animations[a].name[sizeof(animations[a].name) - 1] = '\0';
|
animations[a].name[sizeof(animations[a].name) - 1] = '\0';
|
||||||
|
|
||||||
TRACELOG(LOG_INFO, "MODEL: [%s] animation #%i: %i msec, %i frames", fileName, a, m3d->action[a].durationmsec, animations[a].frameCount);
|
TRACELOG(LOG_INFO, "MODEL: [%s] animation #%i: %i msec, %i frames", fileName, a, m3d->action[a].durationmsec, animations[a].frameCount);
|
||||||
|
|
||||||
for (i = 0; i < (int)m3d->numbone; i++)
|
for (i = 0; i < (int)m3d->numbone; i++)
|
||||||
|
|
|
@ -211,13 +211,13 @@ unsigned char *LoadFileData(const char *fileName, int *dataSize)
|
||||||
{
|
{
|
||||||
// NOTE: fread() returns number of read elements instead of bytes, so we read [1 byte, size elements]
|
// NOTE: fread() returns number of read elements instead of bytes, so we read [1 byte, size elements]
|
||||||
size_t count = fread(data, sizeof(unsigned char), size, file);
|
size_t count = fread(data, sizeof(unsigned char), size, file);
|
||||||
|
|
||||||
// WARNING: fread() returns a size_t value, usually 'unsigned int' (32bit compilation) and 'unsigned long long' (64bit compilation)
|
// WARNING: fread() returns a size_t value, usually 'unsigned int' (32bit compilation) and 'unsigned long long' (64bit compilation)
|
||||||
// dataSize is unified along raylib as a 'int' type, so, for file-sizes > INT_MAX (2147483647 bytes) we have a limitation
|
// dataSize is unified along raylib as a 'int' type, so, for file-sizes > INT_MAX (2147483647 bytes) we have a limitation
|
||||||
if (count > 2147483647)
|
if (count > 2147483647)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "FILEIO: [%s] File is bigger than 2147483647 bytes, avoid using LoadFileData()", fileName);
|
TRACELOG(LOG_WARNING, "FILEIO: [%s] File is bigger than 2147483647 bytes, avoid using LoadFileData()", fileName);
|
||||||
|
|
||||||
RL_FREE(data);
|
RL_FREE(data);
|
||||||
data = NULL;
|
data = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue