Remove trailing spaces

This commit is contained in:
Ray 2023-03-06 14:58:58 +01:00
parent cf1ebada0e
commit 614e0518a7
6 changed files with 37 additions and 37 deletions

View File

@ -297,17 +297,17 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
# --preload-file resources # specify a resources folder for data compilation
# --source-map-base # allow debugging in browser with source map
LDFLAGS += -s USE_GLFW=3 -s TOTAL_MEMORY=$(BUILD_WEB_HEAP_SIZE) -s FORCE_FILESYSTEM=1
# Build using asyncify
ifeq ($(BUILD_WEB_ASYNCIFY),TRUE)
LDFLAGS += -s ASYNCIFY
endif
# Add resources building if required
ifeq ($(BUILD_WEB_RESOURCES),TRUE)
LDFLAGS += --preload-file $(BUILD_WEB_RESOURCES_PATH)
endif
# Add debug mode flags if required
ifeq ($(BUILD_MODE),DEBUG)
LDFLAGS += -s ASSERTIONS=1 --profiling
@ -316,7 +316,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
# Define a custom shell .html and output extension
LDFLAGS += --shell-file $(BUILD_WEB_SHELL)
EXT = .html
# NOTE: Simple raylib examples are compiled to be interpreter with asyncify, that way,
# we can compile same code for ALL platforms with no change required, but, working on bigger
# projects, code needs to be refactored to avoid a blocking while() loop, moving Update and Draw
@ -354,7 +354,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(RAYLIB_LIBTYPE),SHARED)
LDLIBS += -lc
endif
# NOTE: On ARM 32bit arch, miniaudio requires atomics library
LDLIBS += -latomic
endif

View File

@ -34,7 +34,7 @@ int main(void)
int filePathCounter = 0;
char *filePaths[MAX_FILEPATH_RECORDED] = { 0 }; // We will register a maximum of filepaths
// Allocate space for the required file paths
for (int i = 0; i < MAX_FILEPATH_RECORDED; i++)
{
@ -94,7 +94,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
for (int i = 0; i < MAX_FILEPATH_RECORDED; i++)
for (int i = 0; i < MAX_FILEPATH_RECORDED; i++)
{
RL_FREE(filePaths[i]); // Free allocated memory for all filepaths
}

View File

@ -7,19 +7,19 @@
* qoaplay also provides some functions to seek to a specific frame.
*
* LICENSE: MIT License
*
*
* Copyright (c) 2023 Dominic Szablewski (@phoboslab), reviewed by Ramon Santamaria (@raysan5)
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -121,7 +121,7 @@ qoaplay_desc *qoaplay_open(char *path)
qoa_ctx->info.channels = qoa.channels;
qoa_ctx->info.samplerate = qoa.samplerate;
qoa_ctx->info.samples = qoa.samples;
return qoa_ctx;
}
@ -174,15 +174,15 @@ void qoaplay_close(qoaplay_desc *qoa_ctx)
QOA_FREE(qoa_ctx->file_data);
qoa_ctx->file_data_size = 0;
}
QOA_FREE(qoa_ctx);
}
// Decode one frame from QOA data
unsigned int qoaplay_decode_frame(qoaplay_desc *qoa_ctx)
{
{
if (qoa_ctx->file) qoa_ctx->buffer_len = fread(qoa_ctx->buffer, 1, qoa_max_frame_size(&qoa_ctx->info), qoa_ctx->file);
else
else
{
qoa_ctx->buffer_len = qoa_max_frame_size(&qoa_ctx->info);
memcpy(qoa_ctx->buffer, qoa_ctx->file_data + qoa_ctx->file_data_offset, qoa_ctx->buffer_len);
@ -193,14 +193,14 @@ unsigned int qoaplay_decode_frame(qoaplay_desc *qoa_ctx)
qoa_decode_frame(qoa_ctx->buffer, qoa_ctx->buffer_len, &qoa_ctx->info, qoa_ctx->sample_data, &frame_len);
qoa_ctx->sample_data_pos = 0;
qoa_ctx->sample_data_len = frame_len;
return frame_len;
}
// Rewind QOA file or memory pointer to beginning
void qoaplay_rewind(qoaplay_desc *qoa_ctx)
{
if (qoa_ctx->file) fseek(qoa_ctx->file, qoa_ctx->first_frame_pos, SEEK_SET);
if (qoa_ctx->file) fseek(qoa_ctx->file, qoa_ctx->first_frame_pos, SEEK_SET);
else qoa_ctx->file_data_offset = 0;
qoa_ctx->sample_position = 0;
@ -213,7 +213,7 @@ unsigned int qoaplay_decode(qoaplay_desc *qoa_ctx, float *sample_data, int num_s
{
int src_index = qoa_ctx->sample_data_pos*qoa_ctx->info.channels;
int dst_index = 0;
for (int i = 0; i < num_samples; i++)
{
// Do we have to decode more samples?
@ -225,20 +225,20 @@ unsigned int qoaplay_decode(qoaplay_desc *qoa_ctx, float *sample_data, int num_s
qoaplay_rewind(qoa_ctx);
qoaplay_decode_frame(qoa_ctx);
}
src_index = 0;
}
// Normalize to -1..1 floats and write to dest
for (int c = 0; c < qoa_ctx->info.channels; c++)
for (int c = 0; c < qoa_ctx->info.channels; c++)
{
sample_data[dst_index++] = qoa_ctx->sample_data[src_index++]/32768.0;
}
qoa_ctx->sample_data_pos++;
qoa_ctx->sample_position++;
}
return num_samples;
}
@ -272,7 +272,7 @@ void qoaplay_seek_frame(qoaplay_desc *qoa_ctx, int frame)
qoa_ctx->sample_data_pos = 0;
unsigned int offset = qoa_ctx->first_frame_pos + frame*qoa_max_frame_size(&qoa_ctx->info);
if (qoa_ctx->file) fseek(qoa_ctx->file, offset, SEEK_SET);
else qoa_ctx->file_data_offset = offset;
}

View File

@ -160,7 +160,7 @@ Matrix GetCameraProjectionMatrix(Camera* camera, float aspect);
// MatrixOrtho()
// MatrixIdentity()
// raylib required functionality:
// raylib required functionality:
// GetMouseDelta()
// GetMouseWheelMove()
// IsKeyDown()
@ -223,7 +223,7 @@ Vector3 GetCameraRight(Camera *camera)
{
Vector3 forward = GetCameraForward(camera);
Vector3 up = GetCameraUp(camera);
return Vector3CrossProduct(forward, up);
}
@ -251,7 +251,7 @@ void CameraMoveForward(Camera *camera, float distance, bool moveInWorldPlane)
void CameraMoveUp(Camera *camera, float distance)
{
Vector3 up = GetCameraUp(camera);
// Scale by distance
up = Vector3Scale(up, distance);
@ -410,7 +410,7 @@ Matrix GetCameraProjectionMatrix(Camera *camera, float aspect)
return MatrixOrtho(-right, right, -top, top, CAMERA_CULL_DISTANCE_NEAR, CAMERA_CULL_DISTANCE_FAR);
}
return MatrixIdentity();
}
@ -425,7 +425,7 @@ void UpdateCamera(Camera *camera, int mode)
bool rotateAroundTarget = ((mode == CAMERA_THIRD_PERSON) || (mode == CAMERA_ORBITAL));
bool lockView = ((mode == CAMERA_FIRST_PERSON) || (mode == CAMERA_THIRD_PERSON) || (mode == CAMERA_ORBITAL));
bool rotateUp = (mode == CAMERA_FREE);
if (mode == CAMERA_ORBITAL)
{
// Orbital can just orbit
@ -446,7 +446,7 @@ void UpdateCamera(Camera *camera, int mode)
CameraYaw(camera, -mousePositionDelta.x*CAMERA_MOUSE_MOVE_SENSITIVITY, rotateAroundTarget);
CameraPitch(camera, -mousePositionDelta.y*CAMERA_MOUSE_MOVE_SENSITIVITY, lockView, rotateAroundTarget, rotateUp);
// Camera movement
if (IsKeyDown(KEY_W)) CameraMoveForward(camera, CAMERA_MOVE_SPEED, moveInWorldPlane);
if (IsKeyDown(KEY_A)) CameraMoveRight(camera, -CAMERA_MOVE_SPEED, moveInWorldPlane);

View File

@ -1555,7 +1555,7 @@ void ClearWindowState(unsigned int flags)
// Set icon for window (only PLATFORM_DESKTOP)
// NOTE 1: Image must be in RGBA format, 8bit per channel
// NOTE 2: Image is scaled by the OS for all required sizes
// NOTE 2: Image is scaled by the OS for all required sizes
void SetWindowIcon(Image image)
{
#if defined(PLATFORM_DESKTOP)
@ -1586,7 +1586,7 @@ void SetWindowIcon(Image image)
// Set icon for window (multiple images, only PLATFORM_DESKTOP)
// NOTE 1: Images must be in RGBA format, 8bit per channel
// NOTE 2: The multiple images are used depending on provided sizes
// Standard Windows icon sizes: 256, 128, 96, 64, 48, 32, 24, 16
// Standard Windows icon sizes: 256, 128, 96, 64, 48, 32, 24, 16
void SetWindowIcons(Image *images, int count)
{
#if defined(PLATFORM_DESKTOP)
@ -2580,7 +2580,7 @@ bool IsShaderReady(Shader shader)
// The following locations are tried to be set automatically (locs[i] >= 0),
// any of them can be checked for validation but the only mandatory one is, afaik, SHADER_LOC_VERTEX_POSITION
// NOTE: Users can also setup manually their own attributes/uniforms and do not used the default raylib ones
// Vertex shader attribute locations (default)
// shader.locs[SHADER_LOC_VERTEX_POSITION] // Set by default internal shader
// shader.locs[SHADER_LOC_VERTEX_TEXCOORD01] // Set by default internal shader

View File

@ -320,7 +320,7 @@ Image LoadImageAnim(const char *fileName, int *frames)
#else
if (false) { }
#endif
else
else
{
image = LoadImage(fileName);
frameCount = 1;
@ -507,7 +507,7 @@ Image LoadImageFromScreen(void)
bool IsImageReady(Image image)
{
return ((image.data != NULL) && // Validate pixel data available
(image.width > 0) &&
(image.width > 0) &&
(image.height > 0) && // Validate image size
(image.format > 0) && // Validate image format
(image.mipmaps > 0)); // Validate image mipmaps (at least 1 for basic mipmap level)
@ -3340,10 +3340,10 @@ RenderTexture2D LoadRenderTexture(int width, int height)
bool IsTextureReady(Texture2D texture)
{
// TODO: Validate maximum texture size supported by GPU?
return ((texture.id > 0) && // Validate OpenGL id
(texture.width > 0) &&
(texture.height > 0) && // Validate texture size
(texture.width > 0) &&
(texture.height > 0) && // Validate texture size
(texture.format > 0) && // Validate texture pixel format
(texture.mipmaps > 0)); // Validate texture mipmaps (at least 1 for basic mipmap level)
}