mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Removed trailing spaces
This commit is contained in:
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user