From 3d7d174c70b2d00fd879ade64c5085d4ff34d4aa Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 20 May 2019 16:40:30 +0200 Subject: Review and recompile ALL examples --- .../src/shapes/shapes_easings_rectangle_array.c | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'examples/src/shapes/shapes_easings_rectangle_array.c') diff --git a/examples/src/shapes/shapes_easings_rectangle_array.c b/examples/src/shapes/shapes_easings_rectangle_array.c index 27bad5c..9844af6 100644 --- a/examples/src/shapes/shapes_easings_rectangle_array.c +++ b/examples/src/shapes/shapes_easings_rectangle_array.c @@ -2,7 +2,7 @@ * * raylib [shapes] example - easings rectangle array * -* NOTE: This example requires 'easings.h' library, provided on raylib/src. Just copy +* NOTE: This example requires 'easings.h' library, provided on raylib/src. Just copy * the library to same directory as example or make sure it's available on include path. * * This example has been created using raylib 2.0 (www.raylib.com) @@ -24,17 +24,17 @@ #define PLAY_TIME_IN_FRAMES 240 // At 60 fps = 4 seconds -int main() +int main(void) { // Initialization //-------------------------------------------------------------------------------------- - int screenWidth = 800; - int screenHeight = 450; + const int screenWidth = 800; + const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib [shapes] example - easings rectangle array"); - + Rectangle recs[MAX_RECS_X*MAX_RECS_Y]; - + for (int y = 0; y < MAX_RECS_Y; y++) { for (int x = 0; x < MAX_RECS_X; x++) @@ -45,12 +45,12 @@ int main() recs[y*MAX_RECS_X + x].height = RECS_HEIGHT; } } - + float rotation = 0.0f; int framesCounter = 0; - int state = 0; // Rectangles animation state: 0-Playing, 1-Finished - - SetTargetFPS(60); + int state = 0; // Rectangles animation state: 0-Playing, 1-Finished + + SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- // Main game loop @@ -62,16 +62,16 @@ int main() { framesCounter++; - for (int i = 0; i < MAX_RECS_X*MAX_RECS_Y; i++) + for (int i = 0; i < MAX_RECS_X*MAX_RECS_Y; i++) { recs[i].height = EaseCircOut(framesCounter, RECS_HEIGHT, -RECS_HEIGHT, PLAY_TIME_IN_FRAMES); recs[i].width = EaseCircOut(framesCounter, RECS_WIDTH, -RECS_WIDTH, PLAY_TIME_IN_FRAMES); - + if (recs[i].height < 0) recs[i].height = 0; if (recs[i].width < 0) recs[i].width = 0; - + if ((recs[i].height == 0) && (recs[i].width == 0)) state = 1; // Finish playing - + rotation = EaseLinearIn(framesCounter, 0.0f, 360.0f, PLAY_TIME_IN_FRAMES); } } @@ -79,13 +79,13 @@ int main() { // When animation has finished, press space to restart framesCounter = 0; - - for (int i = 0; i < MAX_RECS_X*MAX_RECS_Y; i++) + + for (int i = 0; i < MAX_RECS_X*MAX_RECS_Y; i++) { recs[i].height = RECS_HEIGHT; recs[i].width = RECS_WIDTH; } - + state = 0; } //---------------------------------------------------------------------------------- @@ -110,7 +110,7 @@ int main() } // De-Initialization - //-------------------------------------------------------------------------------------- + //-------------------------------------------------------------------------------------- CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- -- cgit v1.2.3