diff options
| author | raysan5 <[email protected]> | 2021-10-17 21:00:20 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2021-10-17 21:00:20 +0200 |
| commit | cf12992b6a3bdf1f5332111708aa0200525cc60a (patch) | |
| tree | 70d3e92415c077e626607ee321e7326f123cbe95 /examples | |
| parent | 67a1e84859f903adb0b1d1ab0605c472d31dab8a (diff) | |
| download | raylib-cf12992b6a3bdf1f5332111708aa0200525cc60a.tar.gz raylib-cf12992b6a3bdf1f5332111708aa0200525cc60a.zip | |
Remove trailing spaces
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/core/core_basic_screen_manager.c | 44 | ||||
| -rw-r--r-- | examples/core/core_quat_conversion.c | 10 | ||||
| -rw-r--r-- | examples/core/core_smooth_pixelperfect.c | 6 | ||||
| -rw-r--r-- | examples/core/core_split_screen.c | 8 | ||||
| -rw-r--r-- | examples/models/models_animation.c | 2 | ||||
| -rw-r--r-- | examples/models/models_loading_vox.c | 14 |
6 files changed, 42 insertions, 42 deletions
diff --git a/examples/core/core_basic_screen_manager.c b/examples/core/core_basic_screen_manager.c index 9c19d862..6051f175 100644 --- a/examples/core/core_basic_screen_manager.c +++ b/examples/core/core_basic_screen_manager.c @@ -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 //-------------------------------------------------------------------------------------- diff --git a/examples/core/core_quat_conversion.c b/examples/core/core_quat_conversion.c index 3fc98b3d..a60e4000 100644 --- a/examples/core/core_quat_conversion.c +++ b/examples/core/core_quat_conversion.c @@ -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); diff --git a/examples/core/core_smooth_pixelperfect.c b/examples/core/core_smooth_pixelperfect.c index 86a64701..e0c6d197 100644 --- a/examples/core/core_smooth_pixelperfect.c +++ b/examples/core/core_smooth_pixelperfect.c @@ -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 //-------------------------------------------------------------------------------------- diff --git a/examples/core/core_split_screen.c b/examples/core/core_split_screen.c index 1f4242e7..c05c0b32 100644 --- a/examples/core/core_split_screen.c +++ b/examples/core/core_split_screen.c @@ -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 //-------------------------------------------------------------------------------------- diff --git a/examples/models/models_animation.c b/examples/models/models_animation.c index 6386ad76..0a375c90 100644 --- a/examples/models/models_animation.c +++ b/examples/models/models_animation.c @@ -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; diff --git a/examples/models/models_loading_vox.c b/examples/models/models_loading_vox.c index c693861e..7836cdd3 100644 --- a/examples/models/models_loading_vox.c +++ b/examples/models/models_loading_vox.c @@ -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); |
