Removed trailing spaces

This commit is contained in:
Ray
2025-10-21 13:51:03 +02:00
parent 3c5b3f1c17
commit ec06f9be37
13 changed files with 91 additions and 93 deletions

View File

@ -119,7 +119,6 @@ int main(void)
// Some default standard keyboard/mouse inputs are hardcoded to simplify use
// For advanced camera controls, it's recommended to compute camera movement manually
UpdateCamera(&camera, cameraMode); // Update camera
/*
// Camera PRO usage example (EXPERIMENTAL)
// This new camera function allows custom movement/rotation values to be directly provided

View File

@ -26,7 +26,7 @@ int main(void)
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - render texture");
// Define a render texture to render
int renderTextureWidth = 300;
int renderTextureHeight = 300;
@ -62,14 +62,14 @@ int main(void)
//-----------------------------------------------------
// Draw our scene to the render texture
BeginTextureMode(target);
ClearBackground(SKYBLUE);
DrawRectangle(0, 0, 20, 20, RED);
DrawCircleV(ballPosition, (float)ballRadius, MAROON);
EndTextureMode();
// Draw render texture to main framebuffer
BeginDrawing();
@ -77,14 +77,14 @@ int main(void)
// Draw our render texture with rotation applied
// NOTE 1: We set the origin of the texture to the center of the render texture
// NOTE 2: We flip vertically the texture setting negative source rectangle height
DrawTexturePro(target.texture,
// NOTE 2: We flip vertically the texture setting negative source rectangle height
DrawTexturePro(target.texture,
(Rectangle){ 0, 0, (float)target.texture.width, (float)-target.texture.height },
(Rectangle){ screenWidth/2.0f, screenHeight/2.0f, (float)target.texture.width, (float)target.texture.height },
(Vector2){ target.texture.width/2.0f, target.texture.height/2.0f }, rotation, WHITE);
DrawText("DRAWING BOUNCING BALL INSIDE RENDER TEXTURE!", 10, screenHeight - 40, 20, BLACK);
DrawFPS(10, 10);

View File

@ -64,7 +64,7 @@ int main(void)
if (lines[i][j] == ' ')
{
// Making a C Style string by adding a '\0' at the required location so that we can use the MeasureText function
lines[i][j] = '\0';
lines[i][j] = '\0';
// Checking if the text has crossed the wrapWidth, then going back and inserting a newline
if (MeasureText(lines[i] + lastWrapStart, fontSize) > wrapWidth)
@ -112,8 +112,8 @@ int main(void)
cam.target.y -= scroll*fontSize*1.5f; // Choosing an arbitrary speed for scroll
if (cam.target.y < 0) cam.target.y = 0; // Snapping to 0 if we go too far back
// Ensuring that the camera does not scroll past all text
// Ensuring that the camera does not scroll past all text
if (cam.target.y > textHeight - screenHeight + textTop)
cam.target.y = textHeight - screenHeight + textTop;
@ -133,10 +133,10 @@ int main(void)
{
// Each time we go through and calculate the height of the text to move the cursor appropriately
Vector2 size = MeasureTextEx(GetFontDefault(), lines[i], fontSize, 2);
DrawText(lines[i], 10, t, fontSize, RED);
// Inserting extra space for real newlines,
// Inserting extra space for real newlines,
// wrapped lines are rendered closer together
t += size.y + 10;
}

View File

@ -74,7 +74,7 @@ int main(void)
// Definition of particles
Particle *particles = (Particle*)RL_CALLOC(MAX_PARTICLES, sizeof(Particle)); // Particle array
CircularBuffer circularBuffer = { 0, 0, particles };
// Particle emitter parameters
int emissionRate = -2; // Negative: on average every -X frames. Positive: particles per frame
ParticleType currentType = WATER;
@ -100,7 +100,7 @@ int main(void)
// Update the parameters of each particle
UpdateParticles(&circularBuffer, screenWidth, screenHeight);
// Remove dead particles from the circular buffer
UpdateCircularBuffer(&circularBuffer);
@ -252,10 +252,10 @@ static void UpdateParticles(CircularBuffer *circularBuffer, int screenWidth, int
// Disable particle when out of screen
Vector2 center = circularBuffer->buffer[i].position;
float radius = circularBuffer->buffer[i].radius;
if ((center.x < -radius) || (center.x > (screenWidth + radius)) ||
(center.y < -radius) || (center.y > (screenHeight + radius)))
{
{
circularBuffer->buffer[i].alive = false;
}
}