Remove trailing spaces

This commit is contained in:
raysan5 2021-10-17 21:00:20 +02:00
parent 67a1e84859
commit cf12992b6a
8 changed files with 60 additions and 60 deletions

View file

@ -38,15 +38,15 @@ int main(void)
SetTargetFPS(60); // Set desired framerate (frames-per-second)
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
switch(currentScreen)
switch(currentScreen)
{
case LOGO:
case LOGO:
{
// TODO: Update LOGO screen variables here!
@ -58,7 +58,7 @@ int main(void)
currentScreen = TITLE;
}
} break;
case TITLE:
case TITLE:
{
// TODO: Update TITLE screen variables here!
@ -69,16 +69,16 @@ int main(void)
}
} break;
case GAMEPLAY:
{
{
// TODO: Update GAMEPLAY screen variables here!
// Press enter to change to ENDING screen
if (IsKeyPressed(KEY_ENTER) || IsGestureDetected(GESTURE_TAP))
{
currentScreen = ENDING;
}
}
} break;
case ENDING:
case ENDING:
{
// TODO: Update ENDING screen variables here!
@ -86,63 +86,63 @@ int main(void)
if (IsKeyPressed(KEY_ENTER) || IsGestureDetected(GESTURE_TAP))
{
currentScreen = TITLE;
}
}
} break;
default: break;
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
switch(currentScreen)
switch(currentScreen)
{
case LOGO:
case LOGO:
{
// TODO: Draw LOGO screen here!
DrawText("LOGO SCREEN", 20, 20, 40, LIGHTGRAY);
DrawText("WAIT for 2 SECONDS...", 290, 220, 20, GRAY);
} break;
case TITLE:
case TITLE:
{
// TODO: Draw TITLE screen here!
DrawRectangle(0, 0, screenWidth, screenHeight, GREEN);
DrawText("TITLE SCREEN", 20, 20, 40, DARKGREEN);
DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, DARKGREEN);
} break;
case GAMEPLAY:
{
{
// TODO: Draw GAMEPLAY screen here!
DrawRectangle(0, 0, screenWidth, screenHeight, PURPLE);
DrawText("GAMEPLAY SCREEN", 20, 20, 40, MAROON);
DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, MAROON);
} break;
case ENDING:
case ENDING:
{
// TODO: Draw ENDING screen here!
DrawRectangle(0, 0, screenWidth, screenHeight, BLUE);
DrawText("ENDING SCREEN", 20, 20, 40, DARKBLUE);
DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, DARKBLUE);
} break;
default: break;
}
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
// TODO: Unload all loaded data (textures, fonts, audio) here!
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

View file

@ -39,13 +39,13 @@ int main(void)
// Generic quaternion for operations
Quaternion q1 = { 0 };
// Transform matrices required to draw 4 cylinders
Matrix m1 = { 0 };
Matrix m2 = { 0 };
Matrix m3 = { 0 };
Matrix m4 = { 0 };
// Generic vectors for rotations
Vector3 v1 = { 0 };
Vector3 v2 = { 0 };
@ -95,13 +95,13 @@ int main(void)
model.transform = m1;
DrawModel(model, (Vector3){ -1, 0, 0 }, 1.0f, RED);
model.transform = m2;
DrawModel(model, (Vector3){ 1, 0, 0 }, 1.0f, RED);
model.transform = m3;
DrawModel(model, (Vector3){ 0, 0, 0 }, 1.0f, RED);
model.transform = m4;
DrawModel(model, (Vector3){ 0, 0, -1 }, 1.0f, RED);

View file

@ -84,14 +84,14 @@ int main(void)
//----------------------------------------------------------------------------------
BeginTextureMode(target);
ClearBackground(RAYWHITE);
BeginMode2D(worldSpaceCamera);
DrawRectanglePro(rec01, origin, rotation, BLACK);
DrawRectanglePro(rec02, origin, -rotation, RED);
DrawRectanglePro(rec03, origin, rotation + 45.0f, BLUE);
EndMode2D();
EndTextureMode();
BeginDrawing();
ClearBackground(RED);
@ -109,7 +109,7 @@ int main(void)
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadRenderTexture(target); // Unload render texture
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

View file

@ -22,7 +22,7 @@ void DrawScene(void)
{
int count = 5;
float spacing = 4;
// Grid of cube trees on a plane to make a "world"
DrawPlane((Vector3){ 0, 0, 0 }, (Vector2){ 50, 50 }, BEIGE); // Simple world plane
@ -73,10 +73,10 @@ int main(void)
cameraPlayer2.position.y = 3.0f;
RenderTexture screenPlayer2 = LoadRenderTexture(screenWidth / 2, screenHeight);
// Build a flipped rectangle the size of the split view to use for drawing later
Rectangle splitScreenRect = { 0.0f, 0.0f, (float)screenPlayer1.texture.width, (float)-screenPlayer1.texture.height };
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@ -147,7 +147,7 @@ int main(void)
UnloadRenderTexture(screenPlayer1); // Unload render texture
UnloadRenderTexture(screenPlayer2); // Unload render texture
UnloadTexture(textureGrid); // Unload texture
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------

View file

@ -46,7 +46,7 @@ int main(void)
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
// Load animation data
int animsCount = 0;
unsigned int animsCount = 0;
ModelAnimation *anims = LoadModelAnimations("resources/models/iqm/guyanim.iqm", &animsCount);
int animFrameCounter = 0;

View file

@ -23,7 +23,7 @@ int main(void)
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
const char *voxFileNames[] = {
"resources/models/vox/chr_knight.vox",
"resources/models/vox/chr_sword.vox",
@ -31,7 +31,7 @@ int main(void)
};
InitWindow(screenWidth, screenHeight, "raylib [models] example - magicavoxel loading");
// Define the camera to look into our 3d world
Camera camera = { 0 };
camera.position = (Vector3){ 10.0f, 10.0f, 10.0f }; // Camera position
@ -52,7 +52,7 @@ int main(void)
TraceLog(LOG_WARNING, TextFormat("[%s] File loaded in %.3f ms", voxFileNames[i], t1 - t0));
// Compute model translation matrix to center model on draw position (0, 0 , 0)
// Compute model translation matrix to center model on draw position (0, 0 , 0)
BoundingBox bb = GetModelBoundingBox(models[i]);
Vector3 center = { 0 };
center.x = bb.min.x + (((bb.max.x - bb.min.x)/2));
@ -68,7 +68,7 @@ int main(void)
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
@ -77,7 +77,7 @@ int main(void)
UpdateCamera(&camera); // Update our camera to orbit
// Cycle between models on mouse click
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) currentModel = (currentModel + 1)%MAX_VOX_FILES;
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) currentModel = (currentModel + 1)%MAX_VOX_FILES;
// Cycle between models on key pressed
if (IsKeyPressed(KEY_RIGHT))
@ -91,13 +91,13 @@ int main(void)
if (currentModel < 0) currentModel = MAX_VOX_FILES - 1;
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
// Draw 3D model
BeginMode3D(camera);