From b6cb51e3e856e31b1518ae7f97e2f41d1f84dc36 Mon Sep 17 00:00:00 2001 From: Marco Lizza Date: Thu, 20 Dec 2018 16:15:55 +0100 Subject: [PATCH] Fixing all other macros by adding `RL_` prefix. --- examples/audio/audio_module_playing.c | 12 +- examples/audio/audio_music_stream.c | 14 +- examples/audio/audio_raw_stream.c | 8 +- examples/audio/audio_sound_loading.c | 6 +- examples/core/core_2d_camera.c | 34 ++-- examples/core/core_3d_camera_first_person.c | 22 +- examples/core/core_3d_camera_free.c | 22 +- examples/core/core_3d_mode.c | 8 +- examples/core/core_3d_picking.c | 18 +- examples/core/core_basic_window.c | 4 +- examples/core/core_basic_window.cpp | 4 +- examples/core/core_basic_window_web.c | 4 +- examples/core/core_color_select.c | 16 +- examples/core/core_custom_logging.c | 4 +- examples/core/core_drop_files.c | 14 +- examples/core/core_gestures_detection.c | 22 +- examples/core/core_input_gamepad.c | 126 ++++++------ examples/core/core_input_keys.c | 6 +- examples/core/core_input_mouse.c | 12 +- examples/core/core_mouse_wheel.c | 8 +- examples/core/core_multitouch.c | 18 +- examples/core/core_random_values.c | 6 +- examples/core/core_storage_values.c | 14 +- examples/core/core_vr_simulator.c | 6 +- examples/core/core_world_screen.c | 10 +- examples/models/models_billboard.c | 4 +- examples/models/models_box_collisions.c | 18 +- examples/models/models_cubicmap.c | 12 +- examples/models/models_geometric_shapes.c | 22 +- examples/models/models_heightmap.c | 8 +- examples/models/models_material_pbr.c | 4 +- examples/models/models_mesh_generation.c | 28 +-- examples/models/models_mesh_picking.c | 40 ++-- examples/models/models_obj_loading.c | 6 +- examples/models/models_obj_viewer.c | 24 +-- .../models/models_orthographic_projection.c | 28 +-- examples/models/models_rlgl_solar_system.c | 12 +- examples/models/models_skybox.c | 4 +- examples/models/models_yaw_pitch_roll.c | 34 ++-- examples/others/bunnymark.c | 10 +- .../others/iqm_loader/models_iqm_animation.c | 8 +- examples/others/rlgl_standalone.c | 12 +- examples/others/standard_lighting.c | 30 +-- examples/physac/physics_demo.c | 14 +- examples/physac/physics_friction.c | 18 +- examples/physac/physics_movement.c | 12 +- examples/physac/physics_restitution.c | 18 +- examples/physac/physics_shatter.c | 10 +- examples/shaders/shaders_custom_uniform.c | 12 +- examples/shaders/shaders_model_shader.c | 10 +- examples/shaders/shaders_postprocessing.c | 18 +- examples/shaders/shaders_raymarching.c | 6 +- examples/shaders/shaders_shapes_textures.c | 30 +-- examples/shapes/shapes_basic_shapes.c | 24 +-- examples/shapes/shapes_colors_palette.c | 88 ++++---- examples/shapes/shapes_lines_bezier.c | 6 +- examples/shapes/shapes_logo_raylib.c | 10 +- examples/shapes/shapes_logo_raylib_anim.c | 30 +-- examples/text/text_bmfont_ttf.c | 6 +- examples/text/text_bmfont_unordered.c | 10 +- examples/text/text_font_sdf.c | 22 +- examples/text/text_format_text.c | 10 +- examples/text/text_input_box.c | 18 +- examples/text/text_raylib_fonts.c | 8 +- examples/text/text_sprite_fonts.c | 8 +- examples/text/text_ttf_loading.c | 28 +-- examples/text/text_writing_anim.c | 8 +- examples/textures/textures_image_drawing.c | 12 +- examples/textures/textures_image_generation.c | 32 +-- examples/textures/textures_image_loading.c | 6 +- examples/textures/textures_image_npatch.c | 26 +-- examples/textures/textures_image_processing.c | 16 +- examples/textures/textures_image_text.c | 12 +- examples/textures/textures_logo_raylib.c | 6 +- .../textures/textures_particles_blending.c | 8 +- examples/textures/textures_raw_data.c | 18 +- examples/textures/textures_rectangle.c | 22 +- examples/textures/textures_srcrec_dstrec.c | 10 +- examples/textures/textures_to_image.c | 6 +- games/arkanoid.c | 16 +- games/asteroids.c | 40 ++-- games/asteroids_survival.c | 24 +-- games/drturtle/00_drturtle_screens.c | 14 +- games/drturtle/01_drturtle_scrolling.c | 20 +- games/drturtle/02_drturtle_player.c | 36 ++-- games/drturtle/03_drturtle_enemies.c | 60 +++--- games/drturtle/04_drturtle_gui.c | 66 +++--- games/drturtle/05_drturtle_audio.c | 66 +++--- games/drturtle/06_drturtle_final.c | 66 +++--- games/drturtle/drturtle_final_web.c | 66 +++--- games/floppy.c | 18 +- games/gold_fever.c | 24 +-- games/gorilas.c | 46 ++--- games/just_do/just_do.c | 4 +- games/just_do/screens/screen_level00.c | 26 +-- games/just_do/screens/screen_level01.c | 20 +- games/just_do/screens/screen_level02.c | 14 +- games/just_do/screens/screen_level03.c | 14 +- games/just_do/screens/screen_level04.c | 14 +- games/just_do/screens/screen_level05.c | 46 ++--- games/just_do/screens/screen_level06.c | 14 +- games/just_do/screens/screen_level07.c | 40 ++-- games/just_do/screens/screen_level08.c | 18 +- games/just_do/screens/screen_level09.c | 30 +-- games/just_do/screens/screen_level10.c | 18 +- games/just_do/screens/screen_logo.c | 34 ++-- games/koala_seasons/koala_seasons.c | 8 +- games/koala_seasons/screens/screen_ending.c | 124 ++++++------ games/koala_seasons/screens/screen_gameplay.c | 188 +++++++++--------- games/koala_seasons/screens/screen_logo.c | 34 ++-- games/koala_seasons/screens/screen_title.c | 48 ++--- games/light_my_ritual/light_my_ritual.c | 4 +- .../light_my_ritual/screens/screen_gameplay.c | 112 +++++------ .../screens/screen_logo_raylib.c | 40 ++-- games/light_my_ritual/screens/screen_title.c | 8 +- games/missile_commander.c | 20 +- games/pang.c | 30 +-- games/skully_escape/monster.c | 6 +- games/skully_escape/player.c | 8 +- games/skully_escape/screens/screen_aisle01.c | 34 ++-- games/skully_escape/screens/screen_aisle02.c | 30 +-- games/skully_escape/screens/screen_armory.c | 32 +-- games/skully_escape/screens/screen_attic.c | 26 +-- games/skully_escape/screens/screen_bathroom.c | 28 +-- games/skully_escape/screens/screen_ending.c | 8 +- games/skully_escape/screens/screen_kitchen.c | 32 +-- .../skully_escape/screens/screen_livingroom.c | 32 +-- games/skully_escape/screens/screen_logo.c | 6 +- .../screens/screen_logo_raylib.c | 40 ++-- games/skully_escape/screens/screen_title.c | 8 +- games/skully_escape/skully_escape.c | 4 +- games/snake.c | 16 +- games/space_invaders.c | 22 +- games/tetris.c | 40 ++-- games/transmission/screens/screen_ending.c | 12 +- games/transmission/screens/screen_gameplay.c | 22 +- games/transmission/screens/screen_logo.c | 2 +- games/transmission/screens/screen_mission.c | 10 +- games/transmission/screens/screen_title.c | 4 +- games/transmission/transmission.c | 10 +- games/wave_collector/screens/screen_ending.c | 20 +- .../wave_collector/screens/screen_gameplay.c | 72 +++---- games/wave_collector/screens/screen_logo.c | 28 +-- games/wave_collector/screens/screen_title.c | 14 +- games/wave_collector/wave_collector.c | 4 +- projects/CMake/core_basic_window.c | 4 +- projects/CodeBlocks/core_basic_window.c | 4 +- projects/Geany/core_basic_window.c | 4 +- projects/VS2015.UWP/raylib.App.UWP/App.cpp | 20 +- projects/VSCode/main.c | 8 +- src/core.c | 40 ++-- src/external/glfw/src/mappings.h | 2 +- src/models.c | 10 +- src/raylib.h | 68 +++---- src/rlgl.h | 20 +- src/text.c | 12 +- src/textures.c | 12 +- templates/advance_game/advance_game.c | 4 +- .../advance_game/screens/screen_ending.c | 6 +- .../advance_game/screens/screen_gameplay.c | 6 +- templates/advance_game/screens/screen_logo.c | 6 +- templates/advance_game/screens/screen_title.c | 6 +- templates/simple_game/simple_game.c | 24 +-- .../standard_game/screens/screen_ending.c | 6 +- .../standard_game/screens/screen_gameplay.c | 6 +- templates/standard_game/screens/screen_logo.c | 4 +- .../standard_game/screens/screen_title.c | 6 +- templates/standard_game/standard_game.c | 2 +- 168 files changed, 1820 insertions(+), 1820 deletions(-) diff --git a/examples/audio/audio_module_playing.c b/examples/audio/audio_module_playing.c index 671a119f7..5575f27fa 100644 --- a/examples/audio/audio_module_playing.c +++ b/examples/audio/audio_module_playing.c @@ -36,8 +36,8 @@ int main() InitAudioDevice(); // Initialize audio device - Color colors[14] = { ORANGE, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK, - YELLOW, GREEN, SKYBLUE, PURPLE, BEIGE }; + Color colors[14] = { RL_ORANGE, RL_RED, RL_GOLD, RL_LIME, RL_BLUE, RL_VIOLET, RL_BROWN, RL_LIGHTGRAY, RL_PINK, + RL_YELLOW, RL_GREEN, RL_SKYBLUE, RL_PURPLE, RL_BEIGE }; // Creates ome circles for visual effect CircleWave circles[MAX_CIRCLES]; @@ -112,7 +112,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); for (int i = MAX_CIRCLES - 1; i >= 0; i--) { @@ -120,9 +120,9 @@ int main() } // Draw time bar - DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, LIGHTGRAY); - DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, MAROON); - DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, GRAY); + DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, RL_LIGHTGRAY); + DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, RL_MAROON); + DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/audio/audio_music_stream.c b/examples/audio/audio_music_stream.c index 26450a869..8a6b5b793 100644 --- a/examples/audio/audio_music_stream.c +++ b/examples/audio/audio_music_stream.c @@ -67,16 +67,16 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, LIGHTGRAY); + DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, RL_LIGHTGRAY); - DrawRectangle(200, 200, 400, 12, LIGHTGRAY); - DrawRectangle(200, 200, (int)timePlayed, 12, MAROON); - DrawRectangleLines(200, 200, 400, 12, GRAY); + DrawRectangle(200, 200, 400, 12, RL_LIGHTGRAY); + DrawRectangle(200, 200, (int)timePlayed, 12, RL_MAROON); + DrawRectangleLines(200, 200, 400, 12, RL_GRAY); - DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, LIGHTGRAY); - DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 280, 20, LIGHTGRAY); + DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, RL_LIGHTGRAY); + DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 280, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/audio/audio_raw_stream.c b/examples/audio/audio_raw_stream.c index 700c8a7b7..1de1a17a8 100644 --- a/examples/audio/audio_raw_stream.c +++ b/examples/audio/audio_raw_stream.c @@ -132,10 +132,10 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText(FormatText("sine frequency: %i",(int)frequency), GetScreenWidth() - 220, 10, 20, RED); - DrawText("click mouse button to change frequency", 10, 10, 20, DARKGRAY); + DrawText(FormatText("sine frequency: %i",(int)frequency), GetScreenWidth() - 220, 10, 20, RL_RED); + DrawText("click mouse button to change frequency", 10, 10, 20, RL_DARKGRAY); // Draw the current buffer state proportionate to the screen for (int i = 0; i < screenWidth; i++) @@ -143,7 +143,7 @@ int main() position.x = i; position.y = 250 + 50*data[i*MAX_SAMPLES/screenWidth]/32000; - DrawPixelV(position, RED); + DrawPixelV(position, RL_RED); } EndDrawing(); diff --git a/examples/audio/audio_sound_loading.c b/examples/audio/audio_sound_loading.c index 00e583264..080b5bc0d 100644 --- a/examples/audio/audio_sound_loading.c +++ b/examples/audio/audio_sound_loading.c @@ -43,11 +43,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Press SPACE to PLAY the WAV sound!", 200, 180, 20, LIGHTGRAY); + DrawText("Press SPACE to PLAY the WAV sound!", 200, 180, 20, RL_LIGHTGRAY); - DrawText("Press ENTER to PLAY the OGG sound!", 200, 220, 20, LIGHTGRAY); + DrawText("Press ENTER to PLAY the OGG sound!", 200, 220, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_2d_camera.c b/examples/core/core_2d_camera.c index 6a0b11ad9..5b1d6983c 100644 --- a/examples/core/core_2d_camera.c +++ b/examples/core/core_2d_camera.c @@ -95,36 +95,36 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode2D(camera); - DrawRectangle(-6000, 320, 13000, 8000, DARKGRAY); + DrawRectangle(-6000, 320, 13000, 8000, RL_DARKGRAY); for (int i = 0; i < MAX_BUILDINGS; i++) DrawRectangleRec(buildings[i], buildColors[i]); - DrawRectangleRec(player, RED); + DrawRectangleRec(player, RL_RED); - DrawLine(camera.target.x, -screenHeight*10, camera.target.x, screenHeight*10, GREEN); - DrawLine(-screenWidth*10, camera.target.y, screenWidth*10, camera.target.y, GREEN); + DrawLine(camera.target.x, -screenHeight*10, camera.target.x, screenHeight*10, RL_GREEN); + DrawLine(-screenWidth*10, camera.target.y, screenWidth*10, camera.target.y, RL_GREEN); EndMode2D(); - DrawText("SCREEN AREA", 640, 10, 20, RED); + DrawText("SCREEN AREA", 640, 10, 20, RL_RED); - DrawRectangle(0, 0, screenWidth, 5, RED); - DrawRectangle(0, 5, 5, screenHeight - 10, RED); - DrawRectangle(screenWidth - 5, 5, 5, screenHeight - 10, RED); - DrawRectangle(0, screenHeight - 5, screenWidth, 5, RED); + DrawRectangle(0, 0, screenWidth, 5, RL_RED); + DrawRectangle(0, 5, 5, screenHeight - 10, RL_RED); + DrawRectangle(screenWidth - 5, 5, 5, screenHeight - 10, RL_RED); + DrawRectangle(0, screenHeight - 5, screenWidth, 5, RL_RED); - DrawRectangle( 10, 10, 250, 113, Fade(SKYBLUE, 0.5f)); - DrawRectangleLines( 10, 10, 250, 113, BLUE); + DrawRectangle( 10, 10, 250, 113, Fade(RL_SKYBLUE, 0.5f)); + DrawRectangleLines( 10, 10, 250, 113, RL_BLUE); - DrawText("Free 2d camera controls:", 20, 20, 10, BLACK); - DrawText("- Right/Left to move Offset", 40, 40, 10, DARKGRAY); - DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, DARKGRAY); - DrawText("- A / S to Rotate", 40, 80, 10, DARKGRAY); - DrawText("- R to reset Zoom and Rotation", 40, 100, 10, DARKGRAY); + DrawText("Free 2d camera controls:", 20, 20, 10, RL_BLACK); + DrawText("- Right/Left to move Offset", 40, 40, 10, RL_DARKGRAY); + DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, RL_DARKGRAY); + DrawText("- A / S to Rotate", 40, 80, 10, RL_DARKGRAY); + DrawText("- R to reset Zoom and Rotation", 40, 100, 10, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_3d_camera_first_person.c b/examples/core/core_3d_camera_first_person.c index d3a8f2e4b..a83521f91 100644 --- a/examples/core/core_3d_camera_first_person.c +++ b/examples/core/core_3d_camera_first_person.c @@ -59,30 +59,30 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawPlane((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector2){ 32.0f, 32.0f }, LIGHTGRAY); // Draw ground - DrawCube((Vector3){ -16.0f, 2.5f, 0.0f }, 1.0f, 5.0f, 32.0f, BLUE); // Draw a blue wall - DrawCube((Vector3){ 16.0f, 2.5f, 0.0f }, 1.0f, 5.0f, 32.0f, LIME); // Draw a green wall - DrawCube((Vector3){ 0.0f, 2.5f, 16.0f }, 32.0f, 5.0f, 1.0f, GOLD); // Draw a yellow wall + DrawPlane((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector2){ 32.0f, 32.0f }, RL_LIGHTGRAY); // Draw ground + DrawCube((Vector3){ -16.0f, 2.5f, 0.0f }, 1.0f, 5.0f, 32.0f, RL_BLUE); // Draw a blue wall + DrawCube((Vector3){ 16.0f, 2.5f, 0.0f }, 1.0f, 5.0f, 32.0f, RL_LIME); // Draw a green wall + DrawCube((Vector3){ 0.0f, 2.5f, 16.0f }, 32.0f, 5.0f, 1.0f, RL_GOLD); // Draw a yellow wall // Draw some cubes around for (int i = 0; i < MAX_COLUMNS; i++) { DrawCube(positions[i], 2.0f, heights[i], 2.0f, colors[i]); - DrawCubeWires(positions[i], 2.0f, heights[i], 2.0f, MAROON); + DrawCubeWires(positions[i], 2.0f, heights[i], 2.0f, RL_MAROON); } EndMode3D(); - DrawRectangle( 10, 10, 220, 70, Fade(SKYBLUE, 0.5f)); - DrawRectangleLines( 10, 10, 220, 70, BLUE); + DrawRectangle( 10, 10, 220, 70, Fade(RL_SKYBLUE, 0.5f)); + DrawRectangleLines( 10, 10, 220, 70, RL_BLUE); - DrawText("First person camera default controls:", 20, 20, 10, BLACK); - DrawText("- Move with keys: W, A, S, D", 40, 40, 10, DARKGRAY); - DrawText("- Mouse move to look around", 40, 60, 10, DARKGRAY); + DrawText("First person camera default controls:", 20, 20, 10, RL_BLACK); + DrawText("- Move with keys: W, A, S, D", 40, 40, 10, RL_DARKGRAY); + DrawText("- Mouse move to look around", 40, 60, 10, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_3d_camera_free.c b/examples/core/core_3d_camera_free.c index 9131ddf87..839236b11 100644 --- a/examples/core/core_3d_camera_free.c +++ b/examples/core/core_3d_camera_free.c @@ -49,26 +49,26 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); - DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); + DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RL_RED); + DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RL_MAROON); DrawGrid(10, 1.0f); EndMode3D(); - DrawRectangle( 10, 10, 320, 133, Fade(SKYBLUE, 0.5f)); - DrawRectangleLines( 10, 10, 320, 133, BLUE); + DrawRectangle( 10, 10, 320, 133, Fade(RL_SKYBLUE, 0.5f)); + DrawRectangleLines( 10, 10, 320, 133, RL_BLUE); - DrawText("Free camera default controls:", 20, 20, 10, BLACK); - DrawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, DARKGRAY); - DrawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, DARKGRAY); - DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 80, 10, DARKGRAY); - DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 100, 10, DARKGRAY); - DrawText("- Z to zoom to (0, 0, 0)", 40, 120, 10, DARKGRAY); + DrawText("Free camera default controls:", 20, 20, 10, RL_BLACK); + DrawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, RL_DARKGRAY); + DrawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, RL_DARKGRAY); + DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 80, 10, RL_DARKGRAY); + DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 100, 10, RL_DARKGRAY); + DrawText("- Z to zoom to (0, 0, 0)", 40, 120, 10, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_3d_mode.c b/examples/core/core_3d_mode.c index 39c0752ab..cd6713372 100644 --- a/examples/core/core_3d_mode.c +++ b/examples/core/core_3d_mode.c @@ -45,18 +45,18 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); - DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); + DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RL_RED); + DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RL_MAROON); DrawGrid(10, 1.0f); EndMode3D(); - DrawText("Welcome to the third dimension!", 10, 40, 20, DARKGRAY); + DrawText("Welcome to the third dimension!", 10, 40, 20, RL_DARKGRAY); DrawFPS(10, 10); diff --git a/examples/core/core_3d_picking.c b/examples/core/core_3d_picking.c index 1c63e2a7f..631d3b754 100644 --- a/examples/core/core_3d_picking.c +++ b/examples/core/core_3d_picking.c @@ -62,31 +62,31 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); if (collision) { - DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, RED); - DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, MAROON); + DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, RL_RED); + DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, RL_MAROON); - DrawCubeWires(cubePosition, cubeSize.x + 0.2f, cubeSize.y + 0.2f, cubeSize.z + 0.2f, GREEN); + DrawCubeWires(cubePosition, cubeSize.x + 0.2f, cubeSize.y + 0.2f, cubeSize.z + 0.2f, RL_GREEN); } else { - DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, GRAY); - DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, DARKGRAY); + DrawCube(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, RL_GRAY); + DrawCubeWires(cubePosition, cubeSize.x, cubeSize.y, cubeSize.z, RL_DARKGRAY); } - DrawRay(ray, MAROON); + DrawRay(ray, RL_MAROON); DrawGrid(10, 1.0f); EndMode3D(); - DrawText("Try selecting the box with mouse!", 240, 10, 20, DARKGRAY); + DrawText("Try selecting the box with mouse!", 240, 10, 20, RL_DARKGRAY); - if(collision) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, screenHeight * 0.1f, 30, GREEN); + if(collision) DrawText("BOX SELECTED", (screenWidth - MeasureText("BOX SELECTED", 30)) / 2, screenHeight * 0.1f, 30, RL_GREEN); DrawFPS(10, 10); diff --git a/examples/core/core_basic_window.c b/examples/core/core_basic_window.c index b30f05dec..2aa2f18eb 100644 --- a/examples/core/core_basic_window.c +++ b/examples/core/core_basic_window.c @@ -45,9 +45,9 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); + DrawText("Congrats! You created your first window!", 190, 200, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_basic_window.cpp b/examples/core/core_basic_window.cpp index fa12026a0..1882829bd 100644 --- a/examples/core/core_basic_window.cpp +++ b/examples/core/core_basic_window.cpp @@ -45,9 +45,9 @@ int main(int argc, char* argv[]) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); + DrawText("Congrats! You created your first window!", 190, 200, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_basic_window_web.c b/examples/core/core_basic_window_web.c index 1ecb22f35..9debc835b 100644 --- a/examples/core/core_basic_window_web.c +++ b/examples/core/core_basic_window_web.c @@ -76,9 +76,9 @@ void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); + DrawText("Congrats! You created your first window!", 190, 200, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_color_select.c b/examples/core/core_color_select.c index 002a69312..c8b14fbcf 100644 --- a/examples/core/core_color_select.c +++ b/examples/core/core_color_select.c @@ -20,9 +20,9 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [core] example - color selection (collision detection)"); - Color colors[21] = { DARKGRAY, MAROON, ORANGE, DARKGREEN, DARKBLUE, DARKPURPLE, DARKBROWN, - GRAY, RED, GOLD, LIME, BLUE, VIOLET, BROWN, LIGHTGRAY, PINK, YELLOW, - GREEN, SKYBLUE, PURPLE, BEIGE }; + Color colors[21] = { RL_DARKGRAY, RL_MAROON, RL_ORANGE, RL_DARKGREEN, RL_DARKBLUE, RL_DARKPURPLE, RL_DARKBROWN, + RL_GRAY, RL_RED, RL_GOLD, RL_LIME, RL_BLUE, RL_VIOLET, RL_BROWN, RL_LIGHTGRAY, RL_PINK, RL_YELLOW, + RL_GREEN, RL_SKYBLUE, RL_PURPLE, RL_BEIGE }; Rectangle colorsRecs[21]; // Rectangles array @@ -65,7 +65,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); for (int i = 0; i < 21; i++) // Draw all rectangles { @@ -74,10 +74,10 @@ int main() // Draw four rectangles around selected rectangle if (selected[i]) { - DrawRectangle(colorsRecs[i].x, colorsRecs[i].y, 100, 10, RAYWHITE); // Square top rectangle - DrawRectangle(colorsRecs[i].x, colorsRecs[i].y, 10, 100, RAYWHITE); // Square left rectangle - DrawRectangle(colorsRecs[i].x + 90, colorsRecs[i].y, 10, 100, RAYWHITE); // Square right rectangle - DrawRectangle(colorsRecs[i].x, colorsRecs[i].y + 90, 100, 10, RAYWHITE); // Square bottom rectangle + DrawRectangle(colorsRecs[i].x, colorsRecs[i].y, 100, 10, RL_RAYWHITE); // Square top rectangle + DrawRectangle(colorsRecs[i].x, colorsRecs[i].y, 10, 100, RL_RAYWHITE); // Square left rectangle + DrawRectangle(colorsRecs[i].x + 90, colorsRecs[i].y, 10, 100, RL_RAYWHITE); // Square right rectangle + DrawRectangle(colorsRecs[i].x, colorsRecs[i].y + 90, 100, 10, RL_RAYWHITE); // Square bottom rectangle } } diff --git a/examples/core/core_custom_logging.c b/examples/core/core_custom_logging.c index 4c4caf5d7..080504d3f 100644 --- a/examples/core/core_custom_logging.c +++ b/examples/core/core_custom_logging.c @@ -65,9 +65,9 @@ int main(int argc, char* argv[]) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Check out the console output to see the custom logger in action!", 60, 200, 20, LIGHTGRAY); + DrawText("Check out the console output to see the custom logger in action!", 60, 200, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_drop_files.c b/examples/core/core_drop_files.c index 5c1501b83..e6ff8443e 100644 --- a/examples/core/core_drop_files.c +++ b/examples/core/core_drop_files.c @@ -43,22 +43,22 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - if (count == 0) DrawText("Drop your files to this window!", 100, 40, 20, DARKGRAY); + if (count == 0) DrawText("Drop your files to this window!", 100, 40, 20, RL_DARKGRAY); else { - DrawText("Dropped files:", 100, 40, 20, DARKGRAY); + DrawText("Dropped files:", 100, 40, 20, RL_DARKGRAY); for (int i = 0; i < count; i++) { - if (i%2 == 0) DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f)); - else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3f)); + if (i%2 == 0) DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(RL_LIGHTGRAY, 0.5f)); + else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(RL_LIGHTGRAY, 0.3f)); - DrawText(droppedFiles[i], 120, 100 + 40*i, 10, GRAY); + DrawText(droppedFiles[i], 120, 100 + 40*i, 10, RL_GRAY); } - DrawText("Drop new files...", 100, 110 + 40*count, 20, DARKGRAY); + DrawText("Drop new files...", 100, 110 + 40*count, 20, RL_DARKGRAY); } EndDrawing(); diff --git a/examples/core/core_gestures_detection.c b/examples/core/core_gestures_detection.c index 63a1e6bdf..160f10674 100644 --- a/examples/core/core_gestures_detection.c +++ b/examples/core/core_gestures_detection.c @@ -83,26 +83,26 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawRectangleRec(touchArea, GRAY); - DrawRectangle(225, 15, screenWidth - 240, screenHeight - 30, RAYWHITE); + DrawRectangleRec(touchArea, RL_GRAY); + DrawRectangle(225, 15, screenWidth - 240, screenHeight - 30, RL_RAYWHITE); - DrawText("GESTURES TEST AREA", screenWidth - 270, screenHeight - 40, 20, Fade(GRAY, 0.5f)); + DrawText("GESTURES TEST AREA", screenWidth - 270, screenHeight - 40, 20, Fade(RL_GRAY, 0.5f)); for (int i = 0; i < gesturesCount; i++) { - if (i%2 == 0) DrawRectangle(10, 30 + 20*i, 200, 20, Fade(LIGHTGRAY, 0.5f)); - else DrawRectangle(10, 30 + 20*i, 200, 20, Fade(LIGHTGRAY, 0.3f)); + if (i%2 == 0) DrawRectangle(10, 30 + 20*i, 200, 20, Fade(RL_LIGHTGRAY, 0.5f)); + else DrawRectangle(10, 30 + 20*i, 200, 20, Fade(RL_LIGHTGRAY, 0.3f)); - if (i < gesturesCount - 1) DrawText(gestureStrings[i], 35, 36 + 20*i, 10, DARKGRAY); - else DrawText(gestureStrings[i], 35, 36 + 20*i, 10, MAROON); + if (i < gesturesCount - 1) DrawText(gestureStrings[i], 35, 36 + 20*i, 10, RL_DARKGRAY); + else DrawText(gestureStrings[i], 35, 36 + 20*i, 10, RL_MAROON); } - DrawRectangleLines(10, 29, 200, screenHeight - 50, GRAY); - DrawText("DETECTED GESTURES", 50, 15, 10, GRAY); + DrawRectangleLines(10, 29, 200, screenHeight - 50, RL_GRAY); + DrawText("DETECTED GESTURES", 50, 15, 10, RL_GRAY); - if (currentGesture != GESTURE_NONE) DrawCircleV(touchPosition, 30, MAROON); + if (currentGesture != GESTURE_NONE) DrawCircleV(touchPosition, 30, RL_MAROON); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_input_gamepad.c b/examples/core/core_input_gamepad.c index 64520a47c..0c6515eaf 100644 --- a/examples/core/core_input_gamepad.c +++ b/examples/core/core_input_gamepad.c @@ -55,127 +55,127 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (IsGamepadAvailable(GAMEPAD_PLAYER1)) { - DrawText(FormatText("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, BLACK); + DrawText(FormatText("GP1: %s", GetGamepadName(GAMEPAD_PLAYER1)), 10, 10, 10, RL_BLACK); if (IsGamepadName(GAMEPAD_PLAYER1, XBOX360_NAME_ID)) { - DrawTexture(texXboxPad, 0, 0, DARKGRAY); + DrawTexture(texXboxPad, 0, 0, RL_DARKGRAY); // Draw buttons: xbox home - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_HOME)) DrawCircle(394, 89, 19, RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_HOME)) DrawCircle(394, 89, 19, RL_RED); // Draw buttons: basic - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_START)) DrawCircle(436, 150, 9, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_SELECT)) DrawCircle(352, 150, 9, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_X)) DrawCircle(501, 151, 15, BLUE); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_A)) DrawCircle(536, 187, 15, LIME); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_B)) DrawCircle(572, 151, 15, MAROON); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_Y)) DrawCircle(536, 115, 15, GOLD); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_START)) DrawCircle(436, 150, 9, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_SELECT)) DrawCircle(352, 150, 9, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_X)) DrawCircle(501, 151, 15, RL_BLUE); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_A)) DrawCircle(536, 187, 15, RL_LIME); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_B)) DrawCircle(572, 151, 15, RL_MAROON); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_Y)) DrawCircle(536, 115, 15, RL_GOLD); // Draw buttons: d-pad - DrawRectangle(317, 202, 19, 71, BLACK); - DrawRectangle(293, 228, 69, 19, BLACK); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_UP)) DrawRectangle(317, 202, 19, 26, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_DOWN)) DrawRectangle(317, 202 + 45, 19, 26, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_LEFT)) DrawRectangle(292, 228, 25, 19, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_RIGHT)) DrawRectangle(292 + 44, 228, 26, 19, RED); + DrawRectangle(317, 202, 19, 71, RL_BLACK); + DrawRectangle(293, 228, 69, 19, RL_BLACK); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_UP)) DrawRectangle(317, 202, 19, 26, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_DOWN)) DrawRectangle(317, 202 + 45, 19, 26, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_LEFT)) DrawRectangle(292, 228, 25, 19, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_RIGHT)) DrawRectangle(292 + 44, 228, 26, 19, RL_RED); // Draw buttons: left-right back - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_LB)) DrawCircle(259, 61, 20, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_RB)) DrawCircle(536, 61, 20, RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_LB)) DrawCircle(259, 61, 20, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_XBOX_BUTTON_RB)) DrawCircle(536, 61, 20, RL_RED); // Draw axis: left joystick - DrawCircle(259, 152, 39, BLACK); - DrawCircle(259, 152, 34, LIGHTGRAY); + DrawCircle(259, 152, 39, RL_BLACK); + DrawCircle(259, 152, 34, RL_LIGHTGRAY); DrawCircle(259 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_X)*20), - 152 - (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_Y)*20), 25, BLACK); + 152 - (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LEFT_Y)*20), 25, RL_BLACK); // Draw axis: right joystick - DrawCircle(461, 237, 38, BLACK); - DrawCircle(461, 237, 33, LIGHTGRAY); + DrawCircle(461, 237, 38, RL_BLACK); + DrawCircle(461, 237, 33, RL_LIGHTGRAY); DrawCircle(461 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RIGHT_X)*20), - 237 - (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RIGHT_Y)*20), 25, BLACK); + 237 - (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RIGHT_Y)*20), 25, RL_BLACK); // Draw axis: left-right triggers - DrawRectangle(170, 30, 15, 70, GRAY); - DrawRectangle(604, 30, 15, 70, GRAY); - DrawRectangle(170, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LT))/2.0f)*70), RED); - DrawRectangle(604, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RT))/2.0f)*70), RED); + DrawRectangle(170, 30, 15, 70, RL_GRAY); + DrawRectangle(604, 30, 15, 70, RL_GRAY); + DrawRectangle(170, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LT))/2.0f)*70), RL_RED); + DrawRectangle(604, 30, 15, (((1.0f + GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RT))/2.0f)*70), RL_RED); - //DrawText(FormatText("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LT)), 10, 40, 10, BLACK); - //DrawText(FormatText("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RT)), 10, 60, 10, BLACK); + //DrawText(FormatText("Xbox axis LT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_LT)), 10, 40, 10, RL_BLACK); + //DrawText(FormatText("Xbox axis RT: %02.02f", GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_XBOX_AXIS_RT)), 10, 60, 10, RL_BLACK); } else if (IsGamepadName(GAMEPAD_PLAYER1, PS3_NAME_ID)) { - DrawTexture(texPs3Pad, 0, 0, DARKGRAY); + DrawTexture(texPs3Pad, 0, 0, RL_DARKGRAY); // Draw buttons: ps - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_PS)) DrawCircle(396, 222, 13, RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_PS)) DrawCircle(396, 222, 13, RL_RED); // Draw buttons: basic - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_SELECT)) DrawRectangle(328, 170, 32, 13, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_START)) DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_TRIANGLE)) DrawCircle(557, 144, 13, LIME); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_CIRCLE)) DrawCircle(586, 173, 13, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_CROSS)) DrawCircle(557, 203, 13, VIOLET); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_SQUARE)) DrawCircle(527, 173, 13, PINK); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_SELECT)) DrawRectangle(328, 170, 32, 13, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_START)) DrawTriangle((Vector2){ 436, 168 }, (Vector2){ 436, 185 }, (Vector2){ 464, 177 }, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_TRIANGLE)) DrawCircle(557, 144, 13, RL_LIME); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_CIRCLE)) DrawCircle(586, 173, 13, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_CROSS)) DrawCircle(557, 203, 13, RL_VIOLET); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_SQUARE)) DrawCircle(527, 173, 13, RL_PINK); // Draw buttons: d-pad - DrawRectangle(225, 132, 24, 84, BLACK); - DrawRectangle(195, 161, 84, 25, BLACK); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_UP)) DrawRectangle(225, 132, 24, 29, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_DOWN)) DrawRectangle(225, 132 + 54, 24, 30, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_LEFT)) DrawRectangle(195, 161, 30, 25, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_RIGHT)) DrawRectangle(195 + 54, 161, 30, 25, RED); + DrawRectangle(225, 132, 24, 84, RL_BLACK); + DrawRectangle(195, 161, 84, 25, RL_BLACK); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_UP)) DrawRectangle(225, 132, 24, 29, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_DOWN)) DrawRectangle(225, 132 + 54, 24, 30, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_LEFT)) DrawRectangle(195, 161, 30, 25, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_RIGHT)) DrawRectangle(195 + 54, 161, 30, 25, RL_RED); // Draw buttons: left-right back buttons - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_L1)) DrawCircle(239, 82, 20, RED); - if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_R1)) DrawCircle(557, 82, 20, RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_L1)) DrawCircle(239, 82, 20, RL_RED); + if (IsGamepadButtonDown(GAMEPAD_PLAYER1, GAMEPAD_PS3_BUTTON_R1)) DrawCircle(557, 82, 20, RL_RED); // Draw axis: left joystick - DrawCircle(319, 255, 35, BLACK); - DrawCircle(319, 255, 31, LIGHTGRAY); + DrawCircle(319, 255, 35, RL_BLACK); + DrawCircle(319, 255, 31, RL_LIGHTGRAY); DrawCircle(319 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_LEFT_X)*20), - 255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_LEFT_Y)*20), 25, BLACK); + 255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_LEFT_Y)*20), 25, RL_BLACK); // Draw axis: right joystick - DrawCircle(475, 255, 35, BLACK); - DrawCircle(475, 255, 31, LIGHTGRAY); + DrawCircle(475, 255, 35, RL_BLACK); + DrawCircle(475, 255, 31, RL_LIGHTGRAY); DrawCircle(475 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_RIGHT_X)*20), - 255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_RIGHT_Y)*20), 25, BLACK); + 255 + (GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_RIGHT_Y)*20), 25, RL_BLACK); // Draw axis: left-right triggers - DrawRectangle(169, 48, 15, 70, GRAY); - DrawRectangle(611, 48, 15, 70, GRAY); - DrawRectangle(169, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_L2))/2.0f)*70), RED); - DrawRectangle(611, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_R2))/2.0f)*70), RED); + DrawRectangle(169, 48, 15, 70, RL_GRAY); + DrawRectangle(611, 48, 15, 70, RL_GRAY); + DrawRectangle(169, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_L2))/2.0f)*70), RL_RED); + DrawRectangle(611, 48, 15, (((1.0f - GetGamepadAxisMovement(GAMEPAD_PLAYER1, GAMEPAD_PS3_AXIS_R2))/2.0f)*70), RL_RED); } else { - DrawText("- GENERIC GAMEPAD -", 280, 180, 20, GRAY); + DrawText("- GENERIC GAMEPAD -", 280, 180, 20, RL_GRAY); // TODO: Draw generic gamepad } - DrawText(FormatText("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD_PLAYER1)), 10, 50, 10, MAROON); + DrawText(FormatText("DETECTED AXIS [%i]:", GetGamepadAxisCount(GAMEPAD_PLAYER1)), 10, 50, 10, RL_MAROON); for (int i = 0; i < GetGamepadAxisCount(GAMEPAD_PLAYER1); i++) { - DrawText(FormatText("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD_PLAYER1, i)), 20, 70 + 20*i, 10, DARKGRAY); + DrawText(FormatText("AXIS %i: %.02f", i, GetGamepadAxisMovement(GAMEPAD_PLAYER1, i)), 20, 70 + 20*i, 10, RL_DARKGRAY); } - if (GetGamepadButtonPressed() != -1) DrawText(FormatText("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RED); - else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, GRAY); + if (GetGamepadButtonPressed() != -1) DrawText(FormatText("DETECTED BUTTON: %i", GetGamepadButtonPressed()), 10, 430, 10, RL_RED); + else DrawText("DETECTED BUTTON: NONE", 10, 430, 10, RL_GRAY); } else { - DrawText("GP1: NOT DETECTED", 10, 10, 10, GRAY); + DrawText("GP1: NOT DETECTED", 10, 10, 10, RL_GRAY); - DrawTexture(texXboxPad, 0, 0, LIGHTGRAY); + DrawTexture(texXboxPad, 0, 0, RL_LIGHTGRAY); } EndDrawing(); diff --git a/examples/core/core_input_keys.c b/examples/core/core_input_keys.c index 69384fd9e..5f59af3e8 100644 --- a/examples/core/core_input_keys.c +++ b/examples/core/core_input_keys.c @@ -40,11 +40,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("move the ball with arrow keys", 10, 10, 20, DARKGRAY); + DrawText("move the ball with arrow keys", 10, 10, 20, RL_DARKGRAY); - DrawCircleV(ballPosition, 50, MAROON); + DrawCircleV(ballPosition, 50, RL_MAROON); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_input_mouse.c b/examples/core/core_input_mouse.c index 24d2dfcd4..b0a5d481f 100644 --- a/examples/core/core_input_mouse.c +++ b/examples/core/core_input_mouse.c @@ -21,7 +21,7 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [core] example - mouse input"); Vector2 ballPosition = { -100.0f, -100.0f }; - Color ballColor = DARKBLUE; + Color ballColor = RL_DARKBLUE; SetTargetFPS(60); //--------------------------------------------------------------------------------------- @@ -33,20 +33,20 @@ int main() //---------------------------------------------------------------------------------- ballPosition = GetMousePosition(); - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) ballColor = MAROON; - else if (IsMouseButtonPressed(MOUSE_MIDDLE_BUTTON)) ballColor = LIME; - else if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) ballColor = DARKBLUE; + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) ballColor = RL_MAROON; + else if (IsMouseButtonPressed(MOUSE_MIDDLE_BUTTON)) ballColor = RL_LIME; + else if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) ballColor = RL_DARKBLUE; //---------------------------------------------------------------------------------- // Draw //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); DrawCircleV(ballPosition, 40, ballColor); - DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, DARKGRAY); + DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_mouse_wheel.c b/examples/core/core_mouse_wheel.c index 6a5252ee5..e099b7c15 100644 --- a/examples/core/core_mouse_wheel.c +++ b/examples/core/core_mouse_wheel.c @@ -38,12 +38,12 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawRectangle(screenWidth/2 - 40, boxPositionY, 80, 80, MAROON); + DrawRectangle(screenWidth/2 - 40, boxPositionY, 80, 80, RL_MAROON); - DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, GRAY); - DrawText(FormatText("Box position Y: %03i", boxPositionY), 10, 40, 20, LIGHTGRAY); + DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, RL_GRAY); + DrawText(FormatText("Box position Y: %03i", boxPositionY), 10, 40, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_multitouch.c b/examples/core/core_multitouch.c index 0570d3175..7b8b1ba03 100644 --- a/examples/core/core_multitouch.c +++ b/examples/core/core_multitouch.c @@ -38,11 +38,11 @@ int main() //---------------------------------------------------------------------------------- ballPosition = GetMousePosition(); - ballColor = BEIGE; + ballColor = RL_BEIGE; - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) ballColor = MAROON; - if (IsMouseButtonDown(MOUSE_MIDDLE_BUTTON)) ballColor = LIME; - if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) ballColor = DARKBLUE; + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) ballColor = RL_MAROON; + if (IsMouseButtonDown(MOUSE_MIDDLE_BUTTON)) ballColor = RL_LIME; + if (IsMouseButtonDown(MOUSE_RIGHT_BUTTON)) ballColor = RL_DARKBLUE; if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) PressedCounter = 10; if (IsMouseButtonPressed(MOUSE_MIDDLE_BUTTON)) PressedCounter = 10; @@ -55,7 +55,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Multitouch for (int i = 0; i < RL_MAX_TOUCH_POINTS; ++i) @@ -64,18 +64,18 @@ int main() if( (TouchPos.x >= 0) && (TouchPos.y >= 0) ) // Make sure point is not (-1,-1) as this means there is no touch for it { - DrawCircleV(TouchPos, 34, ORANGE); // Draw a circle there + DrawCircleV(TouchPos, 34, RL_ORANGE); // Draw a circle there sprintf(Str,"%d",i); - DrawText(Str, TouchPos.x - 10, TouchPos.y - 70, 40, BLACK); // Also show its index number + DrawText(Str, TouchPos.x - 10, TouchPos.y - 70, 40, RL_BLACK); // Also show its index number } } // Draw the normal mouse location DrawCircleV(ballPosition, 30 + (PressedCounter * 3), ballColor); - DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, DARKGRAY); - DrawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, DARKGRAY); + DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, RL_DARKGRAY); + DrawText("touch the screen at multiple locations to get multiple balls", 10, 30, 20, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_random_values.c b/examples/core/core_random_values.c index 06e550dd3..b422a8ac4 100644 --- a/examples/core/core_random_values.c +++ b/examples/core/core_random_values.c @@ -46,11 +46,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, MAROON); + DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, RL_MAROON); - DrawText(FormatText("%i", randValue), 360, 180, 80, LIGHTGRAY); + DrawText(FormatText("%i", randValue), 360, 180, 80, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_storage_values.c b/examples/core/core_storage_values.c index 43f0882fd..2f745f566 100644 --- a/examples/core/core_storage_values.c +++ b/examples/core/core_storage_values.c @@ -61,16 +61,16 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText(FormatText("SCORE: %i", score), 280, 130, 40, MAROON); - DrawText(FormatText("HI-SCORE: %i", hiscore), 210, 200, 50, BLACK); + DrawText(FormatText("SCORE: %i", score), 280, 130, 40, RL_MAROON); + DrawText(FormatText("HI-SCORE: %i", hiscore), 210, 200, 50, RL_BLACK); - DrawText(FormatText("frames: %i", framesCounter), 10, 10, 20, LIME); + DrawText(FormatText("frames: %i", framesCounter), 10, 10, 20, RL_LIME); - DrawText("Press R to generate random numbers", 220, 40, 20, LIGHTGRAY); - DrawText("Press ENTER to SAVE values", 250, 310, 20, LIGHTGRAY); - DrawText("Press SPACE to LOAD values", 252, 350, 20, LIGHTGRAY); + DrawText("Press R to generate random numbers", 220, 40, 20, RL_LIGHTGRAY); + DrawText("Press ENTER to SAVE values", 250, 310, 20, RL_LIGHTGRAY); + DrawText("Press SPACE to LOAD values", 252, 350, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/core/core_vr_simulator.c b/examples/core/core_vr_simulator.c index 3f59e8391..3fd831e53 100644 --- a/examples/core/core_vr_simulator.c +++ b/examples/core/core_vr_simulator.c @@ -54,14 +54,14 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginVrDrawing(); BeginMode3D(camera); - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); - DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); + DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RL_RED); + DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RL_MAROON); DrawGrid(40, 1.0f); diff --git a/examples/core/core_world_screen.c b/examples/core/core_world_screen.c index 460f6b85e..6ec973956 100644 --- a/examples/core/core_world_screen.c +++ b/examples/core/core_world_screen.c @@ -52,19 +52,19 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); - DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); + DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RL_RED); + DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RL_MAROON); DrawGrid(10, 1.0f); EndMode3D(); - DrawText("Enemy: 100 / 100", cubeScreenPosition.x - MeasureText("Enemy: 100 / 100", 20) / 2, cubeScreenPosition.y, 20, BLACK); - DrawText("Text is always on top of the cube", (screenWidth - MeasureText("Text is always on top of the cube", 20)) / 2, 25, 20, GRAY); + DrawText("Enemy: 100 / 100", cubeScreenPosition.x - MeasureText("Enemy: 100 / 100", 20) / 2, cubeScreenPosition.y, 20, RL_BLACK); + DrawText("Text is always on top of the cube", (screenWidth - MeasureText("Text is always on top of the cube", 20)) / 2, 25, 20, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/models/models_billboard.c b/examples/models/models_billboard.c index 596557146..8a1eba366 100644 --- a/examples/models/models_billboard.c +++ b/examples/models/models_billboard.c @@ -48,13 +48,13 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); DrawGrid(10, 1.0f); // Draw a grid - DrawBillboard(camera, bill, billPosition, 2.0f, WHITE); + DrawBillboard(camera, bill, billPosition, 2.0f, RL_WHITE); EndMode3D(); diff --git a/examples/models/models_box_collisions.c b/examples/models/models_box_collisions.c index 41f6056c0..7fc2c786b 100644 --- a/examples/models/models_box_collisions.c +++ b/examples/models/models_box_collisions.c @@ -25,7 +25,7 @@ int main() Vector3 playerPosition = { 0.0f, 1.0f, 2.0f }; Vector3 playerSize = { 1.0f, 2.0f, 1.0f }; - Color playerColor = GREEN; + Color playerColor = RL_GREEN; Vector3 enemyBoxPos = { -4.0f, 1.0f, 0.0f }; Vector3 enemyBoxSize = { 2.0f, 2.0f, 2.0f }; @@ -77,25 +77,25 @@ int main() playerPosition.z + playerSize.z/2 }}, enemySpherePos, enemySphereSize)) collision = true; - if (collision) playerColor = RED; - else playerColor = GREEN; + if (collision) playerColor = RL_RED; + else playerColor = RL_GREEN; //---------------------------------------------------------------------------------- // Draw //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); // Draw enemy-box - DrawCube(enemyBoxPos, enemyBoxSize.x, enemyBoxSize.y, enemyBoxSize.z, GRAY); - DrawCubeWires(enemyBoxPos, enemyBoxSize.x, enemyBoxSize.y, enemyBoxSize.z, DARKGRAY); + DrawCube(enemyBoxPos, enemyBoxSize.x, enemyBoxSize.y, enemyBoxSize.z, RL_GRAY); + DrawCubeWires(enemyBoxPos, enemyBoxSize.x, enemyBoxSize.y, enemyBoxSize.z, RL_DARKGRAY); // Draw enemy-sphere - DrawSphere(enemySpherePos, enemySphereSize, GRAY); - DrawSphereWires(enemySpherePos, enemySphereSize, 16, 16, DARKGRAY); + DrawSphere(enemySpherePos, enemySphereSize, RL_GRAY); + DrawSphereWires(enemySpherePos, enemySphereSize, 16, 16, RL_DARKGRAY); // Draw player DrawCubeV(playerPosition, playerSize, playerColor); @@ -104,7 +104,7 @@ int main() EndMode3D(); - DrawText("Move player with cursors to collide", 220, 40, 20, GRAY); + DrawText("Move player with cursors to collide", 220, 40, 20, RL_GRAY); DrawFPS(10, 10); diff --git a/examples/models/models_cubicmap.c b/examples/models/models_cubicmap.c index c8d62c46f..1e0fcd494 100644 --- a/examples/models/models_cubicmap.c +++ b/examples/models/models_cubicmap.c @@ -54,19 +54,19 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawModel(model, mapPosition, 1.0f, WHITE); + DrawModel(model, mapPosition, 1.0f, RL_WHITE); EndMode3D(); - DrawTextureEx(cubicmap, (Vector2){ screenWidth - cubicmap.width*4 - 20, 20 }, 0.0f, 4.0f, WHITE); - DrawRectangleLines(screenWidth - cubicmap.width*4 - 20, 20, cubicmap.width*4, cubicmap.height*4, GREEN); + DrawTextureEx(cubicmap, (Vector2){ screenWidth - cubicmap.width*4 - 20, 20 }, 0.0f, 4.0f, RL_WHITE); + DrawRectangleLines(screenWidth - cubicmap.width*4 - 20, 20, cubicmap.width*4, cubicmap.height*4, RL_GREEN); - DrawText("cubicmap image used to", 658, 90, 10, GRAY); - DrawText("generate map 3d model", 658, 104, 10, GRAY); + DrawText("cubicmap image used to", 658, 90, 10, RL_GRAY); + DrawText("generate map 3d model", 658, 104, 10, RL_GRAY); DrawFPS(10, 10); diff --git a/examples/models/models_geometric_shapes.c b/examples/models/models_geometric_shapes.c index 82ca4c605..9d370d4fb 100644 --- a/examples/models/models_geometric_shapes.c +++ b/examples/models/models_geometric_shapes.c @@ -43,23 +43,23 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawCube((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RED); - DrawCubeWires((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, GOLD); - DrawCubeWires((Vector3){-4.0f, 0.0f, -2.0f}, 3.0f, 6.0f, 2.0f, MAROON); + DrawCube((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RL_RED); + DrawCubeWires((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RL_GOLD); + DrawCubeWires((Vector3){-4.0f, 0.0f, -2.0f}, 3.0f, 6.0f, 2.0f, RL_MAROON); - DrawSphere((Vector3){-1.0f, 0.0f, -2.0f}, 1.0f, GREEN); - DrawSphereWires((Vector3){1.0f, 0.0f, 2.0f}, 2.0f, 16, 16, LIME); + DrawSphere((Vector3){-1.0f, 0.0f, -2.0f}, 1.0f, RL_GREEN); + DrawSphereWires((Vector3){1.0f, 0.0f, 2.0f}, 2.0f, 16, 16, RL_LIME); - DrawCylinder((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, SKYBLUE); - DrawCylinderWires((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, DARKBLUE); - DrawCylinderWires((Vector3){4.5f, -1.0f, 2.0f}, 1.0f, 1.0f, 2.0f, 6, BROWN); + DrawCylinder((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, RL_SKYBLUE); + DrawCylinderWires((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, RL_DARKBLUE); + DrawCylinderWires((Vector3){4.5f, -1.0f, 2.0f}, 1.0f, 1.0f, 2.0f, 6, RL_BROWN); - DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, GOLD); - DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, PINK); + DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, RL_GOLD); + DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, RL_PINK); DrawGrid(10, 1.0f); // Draw a grid diff --git a/examples/models/models_heightmap.c b/examples/models/models_heightmap.c index d131b127d..ccdc0561d 100644 --- a/examples/models/models_heightmap.c +++ b/examples/models/models_heightmap.c @@ -51,18 +51,18 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawModel(model, mapPosition, 1.0f, RED); + DrawModel(model, mapPosition, 1.0f, RL_RED); DrawGrid(20, 1.0f); EndMode3D(); - DrawTexture(texture, screenWidth - texture.width - 20, 20, WHITE); - DrawRectangleLines(screenWidth - texture.width - 20, 20, texture.width, texture.height, GREEN); + DrawTexture(texture, screenWidth - texture.width - 20, 20, RL_WHITE); + DrawRectangleLines(screenWidth - texture.width - 20, 20, texture.width, texture.height, RL_GREEN); DrawFPS(10, 10); diff --git a/examples/models/models_material_pbr.c b/examples/models/models_material_pbr.c index a4a10d60b..5beb7fa3e 100644 --- a/examples/models/models_material_pbr.c +++ b/examples/models/models_material_pbr.c @@ -71,11 +71,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawModel(model, Vector3Zero(), 1.0f, WHITE); + DrawModel(model, Vector3Zero(), 1.0f, RL_WHITE); DrawGrid(10, 1.0f); diff --git a/examples/models/models_mesh_generation.c b/examples/models/models_mesh_generation.c index d64889bdd..4e3f34346 100644 --- a/examples/models/models_mesh_generation.c +++ b/examples/models/models_mesh_generation.c @@ -23,7 +23,7 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [models] example - mesh generation"); // We generate a checked image for texturing - Image checked = GenImageChecked(2, 2, 1, 1, RED, GREEN); + Image checked = GenImageChecked(2, 2, 1, 1, RL_RED, RL_GREEN); Texture2D texture = LoadTextureFromImage(checked); UnloadImage(checked); @@ -71,30 +71,30 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawModel(models[currentModel], position, 1.0f, WHITE); + DrawModel(models[currentModel], position, 1.0f, RL_WHITE); DrawGrid(10, 1.0); EndMode3D(); - DrawRectangle(30, 400, 310, 30, Fade(SKYBLUE, 0.5f)); - DrawRectangleLines(30, 400, 310, 30, Fade(DARKBLUE, 0.5f)); - DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, BLUE); + DrawRectangle(30, 400, 310, 30, Fade(RL_SKYBLUE, 0.5f)); + DrawRectangleLines(30, 400, 310, 30, Fade(RL_DARKBLUE, 0.5f)); + DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, RL_BLUE); switch(currentModel) { - case 0: DrawText("PLANE", 680, 10, 20, DARKBLUE); break; - case 1: DrawText("CUBE", 680, 10, 20, DARKBLUE); break; - case 2: DrawText("SPHERE", 680, 10, 20, DARKBLUE); break; - case 3: DrawText("HEMISPHERE", 640, 10, 20, DARKBLUE); break; - case 4: DrawText("CYLINDER", 680, 10, 20, DARKBLUE); break; - case 5: DrawText("TORUS", 680, 10, 20, DARKBLUE); break; - case 6: DrawText("KNOT", 680, 10, 20, DARKBLUE); break; - case 7: DrawText("POLY", 680, 10, 20, DARKBLUE); break; + case 0: DrawText("PLANE", 680, 10, 20, RL_DARKBLUE); break; + case 1: DrawText("CUBE", 680, 10, 20, RL_DARKBLUE); break; + case 2: DrawText("SPHERE", 680, 10, 20, RL_DARKBLUE); break; + case 3: DrawText("HEMISPHERE", 640, 10, 20, RL_DARKBLUE); break; + case 4: DrawText("CYLINDER", 680, 10, 20, RL_DARKBLUE); break; + case 5: DrawText("TORUS", 680, 10, 20, RL_DARKBLUE); break; + case 6: DrawText("KNOT", 680, 10, 20, RL_DARKBLUE); break; + case 7: DrawText("POLY", 680, 10, 20, RL_DARKBLUE); break; default: break; } diff --git a/examples/models/models_mesh_picking.c b/examples/models/models_mesh_picking.c index 9b12e98c6..f0dd66e96 100644 --- a/examples/models/models_mesh_picking.c +++ b/examples/models/models_mesh_picking.c @@ -66,7 +66,7 @@ int main() char *hitObjectName = "None"; nearestHit.distance = FLT_MAX; nearestHit.hit = false; - Color cursorColor = WHITE; + Color cursorColor = RL_WHITE; // Get ray and test against ground, triangle, and mesh ray = GetMouseRay(GetMousePosition(), camera); @@ -77,7 +77,7 @@ int main() if ((groundHitInfo.hit) && (groundHitInfo.distance < nearestHit.distance)) { nearestHit = groundHitInfo; - cursorColor = GREEN; + cursorColor = RL_GREEN; hitObjectName = "Ground"; } @@ -87,7 +87,7 @@ int main() if ((triHitInfo.hit) && (triHitInfo.distance < nearestHit.distance)) { nearestHit = triHitInfo; - cursorColor = PURPLE; + cursorColor = RL_PURPLE; hitObjectName = "Triangle"; bary = Vector3Barycenter(nearestHit.position, ta, tb, tc); @@ -109,7 +109,7 @@ int main() if ((meshHitInfo.hit) && (meshHitInfo.distance < nearestHit.distance)) { nearestHit = meshHitInfo; - cursorColor = ORANGE; + cursorColor = RL_ORANGE; hitObjectName = "Mesh"; } @@ -122,68 +122,68 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); // Draw the tower // WARNING: If scale is different than 1.0f, // not considered by GetCollisionRayModel() - DrawModel(tower, towerPos, 1.0f, WHITE); + DrawModel(tower, towerPos, 1.0f, RL_WHITE); // Draw the test triangle - DrawLine3D(ta, tb, PURPLE); - DrawLine3D(tb, tc, PURPLE); - DrawLine3D(tc, ta, PURPLE); + DrawLine3D(ta, tb, RL_PURPLE); + DrawLine3D(tb, tc, RL_PURPLE); + DrawLine3D(tc, ta, RL_PURPLE); // Draw the mesh bbox if we hit it - if (hitMeshBBox) DrawBoundingBox(towerBBox, LIME); + if (hitMeshBBox) DrawBoundingBox(towerBBox, RL_LIME); // If we hit something, draw the cursor at the hit point if (nearestHit.hit) { DrawCube(nearestHit.position, 0.3, 0.3, 0.3, cursorColor); - DrawCubeWires(nearestHit.position, 0.3, 0.3, 0.3, RED); + DrawCubeWires(nearestHit.position, 0.3, 0.3, 0.3, RL_RED); Vector3 normalEnd; normalEnd.x = nearestHit.position.x + nearestHit.normal.x; normalEnd.y = nearestHit.position.y + nearestHit.normal.y; normalEnd.z = nearestHit.position.z + nearestHit.normal.z; - DrawLine3D(nearestHit.position, normalEnd, RED); + DrawLine3D(nearestHit.position, normalEnd, RL_RED); } - DrawRay(ray, MAROON); + DrawRay(ray, RL_MAROON); DrawGrid(10, 10.0f); EndMode3D(); // Draw some debug GUI text - DrawText(FormatText("Hit Object: %s", hitObjectName), 10, 50, 10, BLACK); + DrawText(FormatText("Hit Object: %s", hitObjectName), 10, 50, 10, RL_BLACK); if (nearestHit.hit) { int ypos = 70; - DrawText(FormatText("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, BLACK); + DrawText(FormatText("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, RL_BLACK); DrawText(FormatText("Hit Pos: %3.2f %3.2f %3.2f", nearestHit.position.x, nearestHit.position.y, - nearestHit.position.z), 10, ypos + 15, 10, BLACK); + nearestHit.position.z), 10, ypos + 15, 10, RL_BLACK); DrawText(FormatText("Hit Norm: %3.2f %3.2f %3.2f", nearestHit.normal.x, nearestHit.normal.y, - nearestHit.normal.z), 10, ypos + 30, 10, BLACK); + nearestHit.normal.z), 10, ypos + 30, 10, RL_BLACK); - if (hitTriangle) DrawText(FormatText("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK); + if (hitTriangle) DrawText(FormatText("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, RL_BLACK); } - DrawText("Use Mouse to Move Camera", 10, 430, 10, GRAY); + DrawText("Use Mouse to Move Camera", 10, 430, 10, RL_GRAY); - DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY); + DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, RL_GRAY); DrawFPS(10, 10); diff --git a/examples/models/models_obj_loading.c b/examples/models/models_obj_loading.c index 7ec2d3f05..1c725c519 100644 --- a/examples/models/models_obj_loading.c +++ b/examples/models/models_obj_loading.c @@ -48,11 +48,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawModel(model, position, 0.2f, WHITE); // Draw 3d model with texture + DrawModel(model, position, 0.2f, RL_WHITE); // Draw 3d model with texture DrawGrid(10, 1.0f); // Draw a grid @@ -60,7 +60,7 @@ int main() EndMode3D(); - DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY); + DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, RL_GRAY); DrawFPS(10, 10); diff --git a/examples/models/models_obj_viewer.c b/examples/models/models_obj_viewer.c index 15f795497..3bd0292de 100644 --- a/examples/models/models_obj_viewer.c +++ b/examples/models/models_obj_viewer.c @@ -86,29 +86,29 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawModel(model, position, 1.0f, WHITE); // Draw 3d model with texture + DrawModel(model, position, 1.0f, RL_WHITE); // Draw 3d model with texture DrawGrid(20.0, 10.0); // Draw a grid - if (selected) DrawBoundingBox(bounds, GREEN); + if (selected) DrawBoundingBox(bounds, RL_GREEN); EndMode3D(); - DrawText("Free camera default controls:", 10, 20, 10, DARKGRAY); - DrawText("- Mouse Wheel to Zoom in-out", 20, 40, 10, GRAY); - DrawText("- Mouse Wheel Pressed to Pan", 20, 60, 10, GRAY); - DrawText("- Alt + Mouse Wheel Pressed to Rotate", 20, 80, 10, GRAY); - DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 20, 100, 10, GRAY); + DrawText("Free camera default controls:", 10, 20, 10, RL_DARKGRAY); + DrawText("- Mouse Wheel to Zoom in-out", 20, 40, 10, RL_GRAY); + DrawText("- Mouse Wheel Pressed to Pan", 20, 60, 10, RL_GRAY); + DrawText("- Alt + Mouse Wheel Pressed to Rotate", 20, 80, 10, RL_GRAY); + DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 20, 100, 10, RL_GRAY); - DrawText("Drag & drop .obj/.png to load mesh/texture.", 10, GetScreenHeight() - 20, 10, DARKGRAY); - DrawText(FormatText("Current file: %s", objFilename), 250, GetScreenHeight() - 20, 10, GRAY); - if (selected) DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, GREEN); + DrawText("Drag & drop .obj/.png to load mesh/texture.", 10, GetScreenHeight() - 20, 10, RL_DARKGRAY); + DrawText(FormatText("Current file: %s", objFilename), 250, GetScreenHeight() - 20, 10, RL_GRAY); + if (selected) DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, RL_GREEN); - DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY); + DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/models/models_orthographic_projection.c b/examples/models/models_orthographic_projection.c index f9b54b6d0..6fa32f4f3 100644 --- a/examples/models/models_orthographic_projection.c +++ b/examples/models/models_orthographic_projection.c @@ -55,32 +55,32 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawCube((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RED); - DrawCubeWires((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, GOLD); - DrawCubeWires((Vector3){-4.0f, 0.0f, -2.0f}, 3.0f, 6.0f, 2.0f, MAROON); + DrawCube((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RL_RED); + DrawCubeWires((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RL_GOLD); + DrawCubeWires((Vector3){-4.0f, 0.0f, -2.0f}, 3.0f, 6.0f, 2.0f, RL_MAROON); - DrawSphere((Vector3){-1.0f, 0.0f, -2.0f}, 1.0f, GREEN); - DrawSphereWires((Vector3){1.0f, 0.0f, 2.0f}, 2.0f, 16, 16, LIME); + DrawSphere((Vector3){-1.0f, 0.0f, -2.0f}, 1.0f, RL_GREEN); + DrawSphereWires((Vector3){1.0f, 0.0f, 2.0f}, 2.0f, 16, 16, RL_LIME); - DrawCylinder((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, SKYBLUE); - DrawCylinderWires((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, DARKBLUE); - DrawCylinderWires((Vector3){4.5f, -1.0f, 2.0f}, 1.0f, 1.0f, 2.0f, 6, BROWN); + DrawCylinder((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, RL_SKYBLUE); + DrawCylinderWires((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, RL_DARKBLUE); + DrawCylinderWires((Vector3){4.5f, -1.0f, 2.0f}, 1.0f, 1.0f, 2.0f, 6, RL_BROWN); - DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, GOLD); - DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, PINK); + DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, RL_GOLD); + DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, RL_PINK); DrawGrid(10, 1.0f); // Draw a grid EndMode3D(); - DrawText("Press Spacebar to switch camera type", 10, GetScreenHeight() - 30, 20, DARKGRAY); + DrawText("Press Spacebar to switch camera type", 10, GetScreenHeight() - 30, 20, RL_DARKGRAY); - if (camera.type == CAMERA_ORTHOGRAPHIC) DrawText("ORTHOGRAPHIC", 10, 40, 20, BLACK); - else if (camera.type == CAMERA_PERSPECTIVE) DrawText("PERSPECTIVE", 10, 40, 20, BLACK); + if (camera.type == CAMERA_ORTHOGRAPHIC) DrawText("ORTHOGRAPHIC", 10, 40, 20, RL_BLACK); + else if (camera.type == CAMERA_PERSPECTIVE) DrawText("PERSPECTIVE", 10, 40, 20, RL_BLACK); DrawFPS(10, 10); diff --git a/examples/models/models_rlgl_solar_system.c b/examples/models/models_rlgl_solar_system.c index 85e26596c..0bdb7e51f 100644 --- a/examples/models/models_rlgl_solar_system.c +++ b/examples/models/models_rlgl_solar_system.c @@ -74,13 +74,13 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); rlPushMatrix(); rlScalef(sunRadius, sunRadius, sunRadius); // Scale Sun - DrawSphereBasic(GOLD); // Draw the Sun + DrawSphereBasic(RL_GOLD); // Draw the Sun rlPopMatrix(); rlPushMatrix(); @@ -92,7 +92,7 @@ int main() rlRotatef(earthRotation, 0.25, 1.0, 0.0); // Rotation for Earth itself rlScalef(earthRadius, earthRadius, earthRadius);// Scale Earth - DrawSphereBasic(BLUE); // Draw the Earth + DrawSphereBasic(RL_BLUE); // Draw the Earth rlPopMatrix(); rlRotatef(moonOrbitRotation, 0.0f, 1.0f, 0.0f); // Rotation for Moon orbit around Earth @@ -101,16 +101,16 @@ int main() rlRotatef(moonRotation, 0.0f, 1.0f, 0.0f); // Rotation for Moon itself rlScalef(moonRadius, moonRadius, moonRadius); // Scale Moon - DrawSphereBasic(LIGHTGRAY); // Draw the Moon + DrawSphereBasic(RL_LIGHTGRAY); // Draw the Moon rlPopMatrix(); // Some reference elements (not affected by previous matrix transformations) - DrawCircle3D((Vector3){ 0.0f, 0.0f, 0.0f }, earthOrbitRadius, (Vector3){ 1, 0, 0 }, 90.0f, Fade(RED, 0.5f)); + DrawCircle3D((Vector3){ 0.0f, 0.0f, 0.0f }, earthOrbitRadius, (Vector3){ 1, 0, 0 }, 90.0f, Fade(RL_RED, 0.5f)); DrawGrid(20, 1.0f); EndMode3D(); - DrawText("EARTH ORBITING AROUND THE SUN!", 400, 10, 20, MAROON); + DrawText("EARTH ORBITING AROUND THE SUN!", 400, 10, 20, RL_MAROON); DrawFPS(10, 10); EndDrawing(); diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index 6f6002b8f..c7b865535 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -63,11 +63,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawModel(skybox, (Vector3){0, 0, 0}, 1.0f, WHITE); + DrawModel(skybox, (Vector3){0, 0, 0}, 1.0f, RL_WHITE); DrawGrid(10, 1.0f); diff --git a/examples/models/models_yaw_pitch_roll.c b/examples/models/models_yaw_pitch_roll.c index c32a897c7..d3bc2d994 100644 --- a/examples/models/models_yaw_pitch_roll.c +++ b/examples/models/models_yaw_pitch_roll.c @@ -108,7 +108,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Draw framebuffer texture (Ahrs Display) int centerX = framebuffer.texture.width/2; @@ -121,15 +121,15 @@ int main() DrawTexturePro(texBackground, (Rectangle){ 0, 0, texBackground.width, texBackground.height }, (Rectangle){ centerX, centerY, texBackground.width*scaleFactor, texBackground.height*scaleFactor}, - (Vector2){ texBackground.width/2*scaleFactor, texBackground.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, WHITE); + (Vector2){ texBackground.width/2*scaleFactor, texBackground.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, RL_WHITE); DrawTexturePro(texPitch, (Rectangle){ 0, 0, texPitch.width, texPitch.height }, (Rectangle){ centerX, centerY, texPitch.width*scaleFactor, texPitch.height*scaleFactor }, - (Vector2){ texPitch.width/2*scaleFactor, texPitch.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, WHITE); + (Vector2){ texPitch.width/2*scaleFactor, texPitch.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, RL_WHITE); DrawTexturePro(texPlane, (Rectangle){ 0, 0, texPlane.width, texPlane.height }, (Rectangle){ centerX, centerY, texPlane.width*scaleFactor, texPlane.height*scaleFactor }, - (Vector2){ texPlane.width/2*scaleFactor, texPlane.height/2*scaleFactor }, 0, WHITE); + (Vector2){ texPlane.width/2*scaleFactor, texPlane.height/2*scaleFactor }, 0, RL_WHITE); EndBlendMode(); @@ -138,27 +138,27 @@ int main() // Draw 3D model (recomended to draw 3D always before 2D) BeginMode3D(camera); - DrawModel(model, (Vector3){ 0, 6.0f, 0 }, 1.0f, WHITE); // Draw 3d model with texture + DrawModel(model, (Vector3){ 0, 6.0f, 0 }, 1.0f, RL_WHITE); // Draw 3d model with texture DrawGrid(10, 10.0f); EndMode3D(); // Draw 2D GUI stuff - DrawAngleGauge(texAngleGauge, 80, 70, roll, "roll", RED); - DrawAngleGauge(texAngleGauge, 190, 70, pitch, "pitch", GREEN); - DrawAngleGauge(texAngleGauge, 300, 70, yaw, "yaw", SKYBLUE); + DrawAngleGauge(texAngleGauge, 80, 70, roll, "roll", RL_RED); + DrawAngleGauge(texAngleGauge, 190, 70, pitch, "pitch", RL_GREEN); + DrawAngleGauge(texAngleGauge, 300, 70, yaw, "yaw", RL_SKYBLUE); - DrawRectangle(30, 360, 260, 70, Fade(SKYBLUE, 0.5f)); - DrawRectangleLines(30, 360, 260, 70, Fade(DARKBLUE, 0.5f)); - DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 370, 10, DARKGRAY); - DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 390, 10, DARKGRAY); - DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 410, 10, DARKGRAY); + DrawRectangle(30, 360, 260, 70, Fade(RL_SKYBLUE, 0.5f)); + DrawRectangleLines(30, 360, 260, 70, Fade(RL_DARKBLUE, 0.5f)); + DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 370, 10, RL_DARKGRAY); + DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 390, 10, RL_DARKGRAY); + DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 410, 10, RL_DARKGRAY); // Draw framebuffer texture DrawTextureRec(framebuffer.texture, (Rectangle){ 0, 0, framebuffer.texture.width, -framebuffer.texture.height }, - (Vector2){ screenWidth - framebuffer.texture.width - 20, 20 }, Fade(WHITE, 0.8f)); + (Vector2){ screenWidth - framebuffer.texture.width - 20, 20 }, Fade(RL_WHITE, 0.8f)); - DrawRectangleLines(screenWidth - framebuffer.texture.width - 20, 20, framebuffer.texture.width, framebuffer.texture.height, DARKGRAY); + DrawRectangleLines(screenWidth - framebuffer.texture.width - 20, 20, framebuffer.texture.width, framebuffer.texture.height, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- @@ -193,6 +193,6 @@ void DrawAngleGauge(Texture2D angleGauge, int x, int y, float angle, char title[ DrawTexturePro(angleGauge, srcRec, dstRec, origin, angle, color); - DrawText(FormatText("%5.1f", angle), x - MeasureText(FormatText("%5.1f", angle), textSize) / 2, y + 10, textSize, DARKGRAY); - DrawText(title, x - MeasureText(title, textSize) / 2, y + 60, textSize, DARKGRAY); + DrawText(FormatText("%5.1f", angle), x - MeasureText(FormatText("%5.1f", angle), textSize) / 2, y + 10, textSize, RL_DARKGRAY); + DrawText(title, x - MeasureText(title, textSize) / 2, y + 60, textSize, RL_DARKGRAY); } diff --git a/examples/others/bunnymark.c b/examples/others/bunnymark.c index 8b524b011..f180b3c4f 100644 --- a/examples/others/bunnymark.c +++ b/examples/others/bunnymark.c @@ -70,7 +70,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); for (int i = 0; i < bunniesCount; i++) { @@ -78,12 +78,12 @@ int main() // batching buffer starts being filled again; before launching the draw call, // updated vertex data from internal buffer is send to GPU... it seems it generates // a stall and consequently a frame drop, limiting number of bunnies drawn at 60 fps - DrawTexture(texBunny, bunnies[i].position.x, bunnies[i].position.y, RAYWHITE); + DrawTexture(texBunny, bunnies[i].position.x, bunnies[i].position.y, RL_RAYWHITE); } - DrawRectangle(0, 0, screenWidth, 40, LIGHTGRAY); - DrawText("raylib bunnymark", 10, 10, 20, DARKGRAY); - DrawText(FormatText("bunnies: %i", bunniesCount), 400, 10, 20, RED); + DrawRectangle(0, 0, screenWidth, 40, RL_LIGHTGRAY); + DrawText("raylib bunnymark", 10, 10, 20, RL_DARKGRAY); + DrawText(FormatText("bunnies: %i", bunniesCount), 400, 10, 20, RL_RED); DrawFPS(260, 10); EndDrawing(); diff --git a/examples/others/iqm_loader/models_iqm_animation.c b/examples/others/iqm_loader/models_iqm_animation.c index 18dd8577b..89e739b75 100644 --- a/examples/others/iqm_loader/models_iqm_animation.c +++ b/examples/others/iqm_loader/models_iqm_animation.c @@ -68,19 +68,19 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawAnimatedModel(model, Vector3Zero(), 1.0f, WHITE); // Draw animated model + DrawAnimatedModel(model, Vector3Zero(), 1.0f, RL_WHITE); // Draw animated model DrawGrid(10, 1.0f); // Draw a grid EndMode3D(); - DrawText("PRESS SPACE to PLAY IQM MODEL ANIMATION", 10, 10, 20, MAROON); + DrawText("PRESS SPACE to PLAY IQM MODEL ANIMATION", 10, 10, 20, RL_MAROON); - DrawText("(c) Guy IQM 3D model by @culacant", screenWidth - 200, screenHeight - 20, 10, GRAY); + DrawText("(c) Guy IQM 3D model by @culacant", screenWidth - 200, screenHeight - 20, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/others/rlgl_standalone.c b/examples/others/rlgl_standalone.c index 57d4e43b1..d5f52bd75 100644 --- a/examples/others/rlgl_standalone.c +++ b/examples/others/rlgl_standalone.c @@ -53,9 +53,9 @@ #include // Windows/Context and inputs management -#define RED (Color){ 230, 41, 55, 255 } // Red -#define RAYWHITE (Color){ 245, 245, 245, 255 } // My own White (raylib logo) -#define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray +#define RL_RED (Color){ 230, 41, 55, 255 } // Red +#define RL_RAYWHITE (Color){ 245, 245, 245, 255 } // My own White (raylib logo) +#define RL_DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -161,8 +161,8 @@ int main(void) SetMatrixModelview(matView); // Set internal modelview matrix (default shader) SetMatrixProjection(matProj); // Set internal projection matrix (default shader) - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); - DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RAYWHITE); + DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RL_RED); + DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RL_RAYWHITE); DrawGrid(10, 1.0f); // NOTE: Internal buffers drawing (3D data) @@ -187,7 +187,7 @@ int main(void) rlMatrixMode(RL_MODELVIEW); // Enable internal modelview matrix rlLoadIdentity(); // Reset internal modelview matrix #endif - DrawRectangleV((Vector2){ 10.0f, 10.0f }, (Vector2){ 780.0f, 20.0f }, DARKGRAY); + DrawRectangleV((Vector2){ 10.0f, 10.0f }, (Vector2){ 780.0f, 20.0f }, RL_DARKGRAY); // NOTE: Internal buffers drawing (2D data) rlglDraw(); diff --git a/examples/others/standard_lighting.c b/examples/others/standard_lighting.c index 728904360..9419df22f 100644 --- a/examples/others/standard_lighting.c +++ b/examples/others/standard_lighting.c @@ -110,8 +110,8 @@ int main() material.maps[MAP_DIFFUSE].texture = LoadTexture("../models/resources/pbr/trooper_albedo.png"); // Load model diffuse texture material.maps[MAP_NORMAL].texture = LoadTexture("../models/resources/pbr/trooper_normals.png"); // Load model normal texture material.maps[MAP_SPECULAR].texture = LoadTexture("../models/resources/pbr/trooper_roughness.png"); // Load model specular texture - material.maps[MAP_DIFFUSE].color = WHITE; - material.maps[MAP_SPECULAR].color = WHITE; + material.maps[MAP_DIFFUSE].color = RL_WHITE; + material.maps[MAP_SPECULAR].color = RL_WHITE; model.material = material; // Apply material to model @@ -153,11 +153,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawModel(model, position, 2.0f, WHITE); // Draw 3d model with texture + DrawModel(model, position, 2.0f, RL_WHITE); // Draw 3d model with texture DrawLight(spotLight); // Draw spot light DrawLight(dirLight); // Draw directional light @@ -268,30 +268,30 @@ void DrawLight(Light light) { case LIGHT_POINT: { - DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : GRAY)); + DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : RL_GRAY)); - DrawCircle3D(light->position, light->radius, (Vector3){ 0, 0, 0 }, 0.0f, (light->enabled ? light->diffuse : GRAY)); - DrawCircle3D(light->position, light->radius, (Vector3){ 1, 0, 0 }, 90.0f, (light->enabled ? light->diffuse : GRAY)); - DrawCircle3D(light->position, light->radius, (Vector3){ 0, 1, 0 },90.0f, (light->enabled ? light->diffuse : GRAY)); + DrawCircle3D(light->position, light->radius, (Vector3){ 0, 0, 0 }, 0.0f, (light->enabled ? light->diffuse : RL_GRAY)); + DrawCircle3D(light->position, light->radius, (Vector3){ 1, 0, 0 }, 90.0f, (light->enabled ? light->diffuse : RL_GRAY)); + DrawCircle3D(light->position, light->radius, (Vector3){ 0, 1, 0 },90.0f, (light->enabled ? light->diffuse : RL_GRAY)); } break; case LIGHT_DIRECTIONAL: { - DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : GRAY)); + DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : RL_GRAY)); - DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : GRAY)); - DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : GRAY)); + DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : RL_GRAY)); + DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : RL_GRAY)); } break; case LIGHT_SPOT: { - DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : GRAY)); + DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : RL_GRAY)); Vector3 dir = VectorSubtract(light->target, light->position); VectorNormalize(&dir); - DrawCircle3D(light->position, 0.5f, dir, 0.0f, (light->enabled ? light->diffuse : GRAY)); + DrawCircle3D(light->position, 0.5f, dir, 0.0f, (light->enabled ? light->diffuse : RL_GRAY)); - //DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : GRAY)); - DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : GRAY)); + //DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : RL_GRAY)); + DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : RL_GRAY)); } break; default: break; } diff --git a/examples/physac/physics_demo.c b/examples/physac/physics_demo.c index a92bb9e15..6a8e1d7ce 100644 --- a/examples/physac/physics_demo.c +++ b/examples/physac/physics_demo.c @@ -93,7 +93,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(BLACK); + ClearBackground(RL_BLACK); DrawFPS(screenWidth - 90, screenHeight - 30); @@ -115,17 +115,17 @@ int main() int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape Vector2 vertexB = GetPhysicsShapeVertex(body, jj); - DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions + DrawLineV(vertexA, vertexB, RL_GREEN); // Draw a line between two vertex positions } } } - DrawText("Left mouse button to create a polygon", 10, 10, 10, WHITE); - DrawText("Right mouse button to create a circle", 10, 25, 10, WHITE); - DrawText("Press 'R' to reset example", 10, 40, 10, WHITE); + DrawText("Left mouse button to create a polygon", 10, 10, 10, RL_WHITE); + DrawText("Right mouse button to create a circle", 10, 25, 10, RL_WHITE); + DrawText("Press 'R' to reset example", 10, 40, 10, RL_WHITE); - DrawText("Physac", logoX, logoY, 30, WHITE); - DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE); + DrawText("Physac", logoX, logoY, 30, RL_WHITE); + DrawText("Powered by", logoX + 50, logoY - 7, 10, RL_WHITE); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/physac/physics_friction.c b/examples/physac/physics_friction.c index 05a611909..5a79d2ff0 100644 --- a/examples/physac/physics_friction.c +++ b/examples/physac/physics_friction.c @@ -94,7 +94,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(BLACK); + ClearBackground(RL_BLACK); DrawFPS(screenWidth - 90, screenHeight - 30); @@ -116,21 +116,21 @@ int main() int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape Vector2 vertexB = GetPhysicsShapeVertex(body, jj); - DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions + DrawLineV(vertexA, vertexB, RL_GREEN); // Draw a line between two vertex positions } } } - DrawRectangle(0, screenHeight - 49, screenWidth, 49, BLACK); + DrawRectangle(0, screenHeight - 49, screenWidth, 49, RL_BLACK); - DrawText("Friction amount", (screenWidth - MeasureText("Friction amount", 30))/2, 75, 30, WHITE); - DrawText("0.1", bodyA->position.x - MeasureText("0.1", 20)/2, bodyA->position.y - 7, 20, WHITE); - DrawText("1", bodyB->position.x - MeasureText("1", 20)/2, bodyB->position.y - 7, 20, WHITE); + DrawText("Friction amount", (screenWidth - MeasureText("Friction amount", 30))/2, 75, 30, RL_WHITE); + DrawText("0.1", bodyA->position.x - MeasureText("0.1", 20)/2, bodyA->position.y - 7, 20, RL_WHITE); + DrawText("1", bodyB->position.x - MeasureText("1", 20)/2, bodyB->position.y - 7, 20, RL_WHITE); - DrawText("Press 'R' to reset example", 10, 10, 10, WHITE); + DrawText("Press 'R' to reset example", 10, 10, 10, RL_WHITE); - DrawText("Physac", logoX, logoY, 30, WHITE); - DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE); + DrawText("Physac", logoX, logoY, 30, RL_WHITE); + DrawText("Powered by", logoX + 50, logoY - 7, 10, RL_WHITE); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/physac/physics_movement.c b/examples/physac/physics_movement.c index e799eaadb..903262b9e 100644 --- a/examples/physac/physics_movement.c +++ b/examples/physac/physics_movement.c @@ -88,7 +88,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(BLACK); + ClearBackground(RL_BLACK); DrawFPS(screenWidth - 90, screenHeight - 30); @@ -108,15 +108,15 @@ int main() int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape Vector2 vertexB = GetPhysicsShapeVertex(body, jj); - DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions + DrawLineV(vertexA, vertexB, RL_GREEN); // Draw a line between two vertex positions } } - DrawText("Use 'ARROWS' to move player", 10, 10, 10, WHITE); - DrawText("Press 'R' to reset example", 10, 30, 10, WHITE); + DrawText("Use 'ARROWS' to move player", 10, 10, 10, RL_WHITE); + DrawText("Press 'R' to reset example", 10, 30, 10, RL_WHITE); - DrawText("Physac", logoX, logoY, 30, WHITE); - DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE); + DrawText("Physac", logoX, logoY, 30, RL_WHITE); + DrawText("Powered by", logoX + 50, logoY - 7, 10, RL_WHITE); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/physac/physics_restitution.c b/examples/physac/physics_restitution.c index 3231d0cf6..33bc81a0d 100644 --- a/examples/physac/physics_restitution.c +++ b/examples/physac/physics_restitution.c @@ -80,7 +80,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(BLACK); + ClearBackground(RL_BLACK); DrawFPS(screenWidth - 90, screenHeight - 30); @@ -100,19 +100,19 @@ int main() int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape Vector2 vertexB = GetPhysicsShapeVertex(body, jj); - DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions + DrawLineV(vertexA, vertexB, RL_GREEN); // Draw a line between two vertex positions } } - DrawText("Restitution amount", (screenWidth - MeasureText("Restitution amount", 30))/2, 75, 30, WHITE); - DrawText("0", circleA->position.x - MeasureText("0", 20)/2, circleA->position.y - 7, 20, WHITE); - DrawText("0.5", circleB->position.x - MeasureText("0.5", 20)/2, circleB->position.y - 7, 20, WHITE); - DrawText("1", circleC->position.x - MeasureText("1", 20)/2, circleC->position.y - 7, 20, WHITE); + DrawText("Restitution amount", (screenWidth - MeasureText("Restitution amount", 30))/2, 75, 30, RL_WHITE); + DrawText("0", circleA->position.x - MeasureText("0", 20)/2, circleA->position.y - 7, 20, RL_WHITE); + DrawText("0.5", circleB->position.x - MeasureText("0.5", 20)/2, circleB->position.y - 7, 20, RL_WHITE); + DrawText("1", circleC->position.x - MeasureText("1", 20)/2, circleC->position.y - 7, 20, RL_WHITE); - DrawText("Press 'R' to reset example", 10, 10, 10, WHITE); + DrawText("Press 'R' to reset example", 10, 10, 10, RL_WHITE); - DrawText("Physac", logoX, logoY, 30, WHITE); - DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE); + DrawText("Physac", logoX, logoY, 30, RL_WHITE); + DrawText("Powered by", logoX + 50, logoY - 7, 10, RL_WHITE); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/physac/physics_shatter.c b/examples/physac/physics_shatter.c index 747852276..f25c57afd 100644 --- a/examples/physac/physics_shatter.c +++ b/examples/physac/physics_shatter.c @@ -83,7 +83,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(BLACK); + ClearBackground(RL_BLACK); // Draw created physics bodies int bodiesCount = GetPhysicsBodiesCount(); @@ -101,14 +101,14 @@ int main() int jj = (((j + 1) < vertexCount) ? (j + 1) : 0); // Get next vertex or first to close the shape Vector2 vertexB = GetPhysicsShapeVertex(currentBody, jj); - DrawLineV(vertexA, vertexB, GREEN); // Draw a line between two vertex positions + DrawLineV(vertexA, vertexB, RL_GREEN); // Draw a line between two vertex positions } } - DrawText("Left mouse button in polygon area to shatter body\nPress 'R' to reset example", 10, 10, 10, WHITE); + DrawText("Left mouse button in polygon area to shatter body\nPress 'R' to reset example", 10, 10, 10, RL_WHITE); - DrawText("Physac", logoX, logoY, 30, WHITE); - DrawText("Powered by", logoX + 50, logoY - 7, 10, WHITE); + DrawText("Physac", logoX, logoY, 30, RL_WHITE); + DrawText("Powered by", logoX + 50, logoY - 7, 10, RL_WHITE); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/shaders/shaders_custom_uniform.c b/examples/shaders/shaders_custom_uniform.c index de76a376c..fc071ff70 100644 --- a/examples/shaders/shaders_custom_uniform.c +++ b/examples/shaders/shaders_custom_uniform.c @@ -88,33 +88,33 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginTextureMode(target); // Enable drawing to texture - ClearBackground(RAYWHITE); // Clear texture background + ClearBackground(RL_RAYWHITE); // Clear texture background BeginMode3D(camera); // Begin 3d mode drawing - DrawModel(model, position, 0.5f, WHITE); // Draw 3d model with texture + DrawModel(model, position, 0.5f, RL_WHITE); // Draw 3d model with texture DrawGrid(10, 1.0f); // Draw a grid EndMode3D(); // End 3d mode drawing, returns to orthographic 2d mode - DrawText("TEXT DRAWN IN RENDER TEXTURE", 200, 10, 30, RED); + DrawText("TEXT DRAWN IN RENDER TEXTURE", 200, 10, 30, RL_RED); EndTextureMode(); // End drawing to texture (now we have a texture available for next passes) BeginShaderMode(shader); // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) - DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE); + DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, RL_WHITE); EndShaderMode(); // Draw some 2d text over drawn texture - DrawText("(c) Barracks 3D model by Alberto Cano", screenWidth - 220, screenHeight - 20, 10, GRAY); + DrawText("(c) Barracks 3D model by Alberto Cano", screenWidth - 220, screenHeight - 20, 10, RL_GRAY); DrawFPS(10, 10); diff --git a/examples/shaders/shaders_model_shader.c b/examples/shaders/shaders_model_shader.c index 6c64f0efd..71daac9bf 100644 --- a/examples/shaders/shaders_model_shader.c +++ b/examples/shaders/shaders_model_shader.c @@ -72,20 +72,20 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(camera); - DrawModel(model, position, 0.2f, WHITE); // Draw 3d model with texture + DrawModel(model, position, 0.2f, RL_WHITE); // Draw 3d model with texture DrawGrid(10, 1.0f); // Draw a grid EndMode3D(); - DrawText("(c) Watermill 3D model by Alberto Cano", screenWidth - 210, screenHeight - 20, 10, GRAY); + DrawText("(c) Watermill 3D model by Alberto Cano", screenWidth - 210, screenHeight - 20, 10, RL_GRAY); - DrawText(FormatText("Camera position: (%.2f, %.2f, %.2f)", camera.position.x, camera.position.y, camera.position.z), 600, 20, 10, BLACK); - DrawText(FormatText("Camera target: (%.2f, %.2f, %.2f)", camera.target.x, camera.target.y, camera.target.z), 600, 40, 10, GRAY); + DrawText(FormatText("Camera position: (%.2f, %.2f, %.2f)", camera.position.x, camera.position.y, camera.position.z), 600, 20, 10, RL_BLACK); + DrawText(FormatText("Camera target: (%.2f, %.2f, %.2f)", camera.target.x, camera.target.y, camera.target.z), 600, 40, 10, RL_GRAY); DrawFPS(10, 10); diff --git a/examples/shaders/shaders_postprocessing.c b/examples/shaders/shaders_postprocessing.c index f84835636..87cd108be 100644 --- a/examples/shaders/shaders_postprocessing.c +++ b/examples/shaders/shaders_postprocessing.c @@ -126,15 +126,15 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginTextureMode(target); // Enable drawing to texture - ClearBackground(RAYWHITE); // Clear texture background + ClearBackground(RL_RAYWHITE); // Clear texture background BeginMode3D(camera); // Begin 3d mode drawing - DrawModel(model, position, 0.1f, WHITE); // Draw 3d model with texture + DrawModel(model, position, 0.1f, RL_WHITE); // Draw 3d model with texture DrawGrid(10, 1.0f); // Draw a grid @@ -146,18 +146,18 @@ int main() BeginShaderMode(shaders[currentShader]); // NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom) - DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE); + DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, RL_WHITE); EndShaderMode(); // Draw 2d shapes and text over drawn texture - DrawRectangle(0, 9, 580, 30, Fade(LIGHTGRAY, 0.7f)); + DrawRectangle(0, 9, 580, 30, Fade(RL_LIGHTGRAY, 0.7f)); - DrawText("(c) Church 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY); + DrawText("(c) Church 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, RL_GRAY); - DrawText("CURRENT POSTPRO SHADER:", 10, 15, 20, BLACK); - DrawText(postproShaderText[currentShader], 330, 15, 20, RED); - DrawText("< >", 540, 10, 30, DARKBLUE); + DrawText("CURRENT POSTPRO SHADER:", 10, 15, 20, RL_BLACK); + DrawText(postproShaderText[currentShader], 330, 15, 20, RL_RED); + DrawText("< >", 540, 10, 30, RL_DARKBLUE); DrawFPS(700, 15); diff --git a/examples/shaders/shaders_raymarching.c b/examples/shaders/shaders_raymarching.c index d1f9d5f81..ef7af1dcb 100644 --- a/examples/shaders/shaders_raymarching.c +++ b/examples/shaders/shaders_raymarching.c @@ -81,15 +81,15 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // We only draw a white full-screen rectangle, // frame is generated in shader using raymarching BeginShaderMode(shader); - DrawRectangle(0, 0, screenWidth, screenHeight, WHITE); + DrawRectangle(0, 0, screenWidth, screenHeight, RL_WHITE); EndShaderMode(); - DrawText("(c) Raymarching shader by Iñigo Quilez. MIT License.", screenWidth - 280, screenHeight - 20, 10, GRAY); + DrawText("(c) Raymarching shader by Iñigo Quilez. MIT License.", screenWidth - 280, screenHeight - 20, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/shaders/shaders_shapes_textures.c b/examples/shaders/shaders_shapes_textures.c index 5ee5d5605..7f7ae7ad3 100644 --- a/examples/shaders/shaders_shapes_textures.c +++ b/examples/shaders/shaders_shapes_textures.c @@ -55,50 +55,50 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Start drawing with default shader - DrawText("USING DEFAULT SHADER", 20, 40, 10, RED); + DrawText("USING DEFAULT SHADER", 20, 40, 10, RL_RED); - DrawCircle(80, 120, 35, DARKBLUE); - DrawCircleGradient(80, 220, 60, GREEN, SKYBLUE); - DrawCircleLines(80, 340, 80, DARKBLUE); + DrawCircle(80, 120, 35, RL_DARKBLUE); + DrawCircleGradient(80, 220, 60, RL_GREEN, RL_SKYBLUE); + DrawCircleLines(80, 340, 80, RL_DARKBLUE); // Activate our custom shader to be applied on next shapes/textures drawings BeginShaderMode(shader); - DrawText("USING CUSTOM SHADER", 190, 40, 10, RED); + DrawText("USING CUSTOM SHADER", 190, 40, 10, RL_RED); - DrawRectangle(250 - 60, 90, 120, 60, RED); - DrawRectangleGradientH(250 - 90, 170, 180, 130, MAROON, GOLD); - DrawRectangleLines(250 - 40, 320, 80, 60, ORANGE); + DrawRectangle(250 - 60, 90, 120, 60, RL_RED); + DrawRectangleGradientH(250 - 90, 170, 180, 130, RL_MAROON, RL_GOLD); + DrawRectangleLines(250 - 40, 320, 80, 60, RL_ORANGE); // Activate our default shader for next drawings EndShaderMode(); - DrawText("USING DEFAULT SHADER", 370, 40, 10, RED); + DrawText("USING DEFAULT SHADER", 370, 40, 10, RL_RED); DrawTriangle((Vector2){430, 80}, (Vector2){430 - 60, 150}, - (Vector2){430 + 60, 150}, VIOLET); + (Vector2){430 + 60, 150}, RL_VIOLET); DrawTriangleLines((Vector2){430, 160}, (Vector2){430 - 20, 230}, - (Vector2){430 + 20, 230}, DARKBLUE); + (Vector2){430 + 20, 230}, RL_DARKBLUE); - DrawPoly((Vector2){430, 320}, 6, 80, 0, BROWN); + DrawPoly((Vector2){430, 320}, 6, 80, 0, RL_BROWN); // Activate our custom shader to be applied on next shapes/textures drawings BeginShaderMode(shader); - DrawTexture(fudesumi, 500, -30, WHITE); // Using custom shader + DrawTexture(fudesumi, 500, -30, RL_WHITE); // Using custom shader // Activate our default shader for next drawings EndShaderMode(); - DrawText("(c) Fudesumi sprite by Eiden Marsal", 380, screenHeight - 20, 10, GRAY); + DrawText("(c) Fudesumi sprite by Eiden Marsal", 380, screenHeight - 20, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/shapes/shapes_basic_shapes.c b/examples/shapes/shapes_basic_shapes.c index 67eea9d5f..f266eabce 100644 --- a/examples/shapes/shapes_basic_shapes.c +++ b/examples/shapes/shapes_basic_shapes.c @@ -35,31 +35,31 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("some basic shapes available on raylib", 20, 20, 20, DARKGRAY); + DrawText("some basic shapes available on raylib", 20, 20, 20, RL_DARKGRAY); - DrawCircle(screenWidth/4, 120, 35, DARKBLUE); + DrawCircle(screenWidth/4, 120, 35, RL_DARKBLUE); - DrawRectangle(screenWidth/4*2 - 60, 100, 120, 60, RED); - DrawRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, ORANGE); // NOTE: Uses QUADS internally, not lines - DrawRectangleGradientH(screenWidth/4*2 - 90, 170, 180, 130, MAROON, GOLD); + DrawRectangle(screenWidth/4*2 - 60, 100, 120, 60, RL_RED); + DrawRectangleLines(screenWidth/4*2 - 40, 320, 80, 60, RL_ORANGE); // NOTE: Uses QUADS internally, not lines + DrawRectangleGradientH(screenWidth/4*2 - 90, 170, 180, 130, RL_MAROON, RL_GOLD); DrawTriangle((Vector2){screenWidth/4*3, 80}, (Vector2){screenWidth/4*3 - 60, 150}, - (Vector2){screenWidth/4*3 + 60, 150}, VIOLET); + (Vector2){screenWidth/4*3 + 60, 150}, RL_VIOLET); - DrawPoly((Vector2){screenWidth/4*3, 320}, 6, 80, 0, BROWN); + DrawPoly((Vector2){screenWidth/4*3, 320}, 6, 80, 0, RL_BROWN); - DrawCircleGradient(screenWidth/4, 220, 60, GREEN, SKYBLUE); + DrawCircleGradient(screenWidth/4, 220, 60, RL_GREEN, RL_SKYBLUE); // NOTE: We draw all LINES based shapes together to optimize internal drawing, // this way, all LINES are rendered in a single draw pass - DrawLine(18, 42, screenWidth - 18, 42, BLACK); - DrawCircleLines(screenWidth/4, 340, 80, DARKBLUE); + DrawLine(18, 42, screenWidth - 18, 42, RL_BLACK); + DrawCircleLines(screenWidth/4, 340, 80, RL_DARKBLUE); DrawTriangleLines((Vector2){screenWidth/4*3, 160}, (Vector2){screenWidth/4*3 - 20, 230}, - (Vector2){screenWidth/4*3 + 20, 230}, DARKBLUE); + (Vector2){screenWidth/4*3 + 20, 230}, RL_DARKBLUE); EndDrawing(); //---------------------------------------------------------------------------------- } diff --git a/examples/shapes/shapes_colors_palette.c b/examples/shapes/shapes_colors_palette.c index dcab862e2..c31e7d870 100644 --- a/examples/shapes/shapes_colors_palette.c +++ b/examples/shapes/shapes_colors_palette.c @@ -35,54 +35,54 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("raylib color palette", 28, 42, 20, BLACK); + DrawText("raylib color palette", 28, 42, 20, RL_BLACK); - DrawRectangle(26, 80, 100, 100, DARKGRAY); - DrawRectangle(26, 188, 100, 100, GRAY); - DrawRectangle(26, 296, 100, 100, LIGHTGRAY); - DrawRectangle(134, 80, 100, 100, MAROON); - DrawRectangle(134, 188, 100, 100, RED); - DrawRectangle(134, 296, 100, 100, PINK); - DrawRectangle(242, 80, 100, 100, ORANGE); - DrawRectangle(242, 188, 100, 100, GOLD); - DrawRectangle(242, 296, 100, 100, YELLOW); - DrawRectangle(350, 80, 100, 100, DARKGREEN); - DrawRectangle(350, 188, 100, 100, LIME); - DrawRectangle(350, 296, 100, 100, GREEN); - DrawRectangle(458, 80, 100, 100, DARKBLUE); - DrawRectangle(458, 188, 100, 100, BLUE); - DrawRectangle(458, 296, 100, 100, SKYBLUE); - DrawRectangle(566, 80, 100, 100, DARKPURPLE); - DrawRectangle(566, 188, 100, 100, VIOLET); - DrawRectangle(566, 296, 100, 100, PURPLE); - DrawRectangle(674, 80, 100, 100, DARKBROWN); - DrawRectangle(674, 188, 100, 100, BROWN); - DrawRectangle(674, 296, 100, 100, BEIGE); + DrawRectangle(26, 80, 100, 100, RL_DARKGRAY); + DrawRectangle(26, 188, 100, 100, RL_GRAY); + DrawRectangle(26, 296, 100, 100, RL_LIGHTGRAY); + DrawRectangle(134, 80, 100, 100, RL_MAROON); + DrawRectangle(134, 188, 100, 100, RL_RED); + DrawRectangle(134, 296, 100, 100, RL_PINK); + DrawRectangle(242, 80, 100, 100, RL_ORANGE); + DrawRectangle(242, 188, 100, 100, RL_GOLD); + DrawRectangle(242, 296, 100, 100, RL_YELLOW); + DrawRectangle(350, 80, 100, 100, RL_DARKGREEN); + DrawRectangle(350, 188, 100, 100, RL_LIME); + DrawRectangle(350, 296, 100, 100, RL_GREEN); + DrawRectangle(458, 80, 100, 100, RL_DARKBLUE); + DrawRectangle(458, 188, 100, 100, RL_BLUE); + DrawRectangle(458, 296, 100, 100, RL_SKYBLUE); + DrawRectangle(566, 80, 100, 100, RL_DARKPURPLE); + DrawRectangle(566, 188, 100, 100, RL_VIOLET); + DrawRectangle(566, 296, 100, 100, RL_PURPLE); + DrawRectangle(674, 80, 100, 100, RL_DARKBROWN); + DrawRectangle(674, 188, 100, 100, RL_BROWN); + DrawRectangle(674, 296, 100, 100, RL_BEIGE); - DrawText("DARKGRAY", 65, 166, 10, BLACK); - DrawText("GRAY", 93, 274, 10, BLACK); - DrawText("LIGHTGRAY", 61, 382, 10, BLACK); - DrawText("MAROON", 186, 166, 10, BLACK); - DrawText("RED", 208, 274, 10, BLACK); - DrawText("PINK", 204, 382, 10, BLACK); - DrawText("ORANGE", 295, 166, 10, BLACK); - DrawText("GOLD", 310, 274, 10, BLACK); - DrawText("YELLOW", 300, 382, 10, BLACK); - DrawText("DARKGREEN", 382, 166, 10, BLACK); - DrawText("LIME", 420, 274, 10, BLACK); - DrawText("GREEN", 410, 382, 10, BLACK); - DrawText("DARKBLUE", 498, 166, 10, BLACK); - DrawText("BLUE", 526, 274, 10, BLACK); - DrawText("SKYBLUE", 505, 382, 10, BLACK); - DrawText("DARKPURPLE", 592, 166, 10, BLACK); - DrawText("VIOLET", 621, 274, 10, BLACK); - DrawText("PURPLE", 620, 382, 10, BLACK); - DrawText("DARKBROWN", 705, 166, 10, BLACK); - DrawText("BROWN", 733, 274, 10, BLACK); - DrawText("BEIGE", 737, 382, 10, BLACK); + DrawText("RL_DARKGRAY", 65, 166, 10, RL_BLACK); + DrawText("RL_GRAY", 93, 274, 10, RL_BLACK); + DrawText("RL_LIGHTGRAY", 61, 382, 10, RL_BLACK); + DrawText("RL_MAROON", 186, 166, 10, RL_BLACK); + DrawText("RL_RED", 208, 274, 10, RL_BLACK); + DrawText("RL_PINK", 204, 382, 10, RL_BLACK); + DrawText("RL_ORANGE", 295, 166, 10, RL_BLACK); + DrawText("RL_GOLD", 310, 274, 10, RL_BLACK); + DrawText("RL_YELLOW", 300, 382, 10, RL_BLACK); + DrawText("RL_DARKGREEN", 382, 166, 10, RL_BLACK); + DrawText("RL_LIME", 420, 274, 10, RL_BLACK); + DrawText("RL_GREEN", 410, 382, 10, RL_BLACK); + DrawText("RL_DARKBLUE", 498, 166, 10, RL_BLACK); + DrawText("RL_BLUE", 526, 274, 10, RL_BLACK); + DrawText("RL_SKYBLUE", 505, 382, 10, RL_BLACK); + DrawText("RL_DARKPURPLE", 592, 166, 10, RL_BLACK); + DrawText("RL_VIOLET", 621, 274, 10, RL_BLACK); + DrawText("RL_PURPLE", 620, 382, 10, RL_BLACK); + DrawText("RL_DARKBROWN", 705, 166, 10, RL_BLACK); + DrawText("RL_BROWN", 733, 274, 10, RL_BLACK); + DrawText("RL_BEIGE", 737, 382, 10, RL_BLACK); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/shapes/shapes_lines_bezier.c b/examples/shapes/shapes_lines_bezier.c index f41334594..ae42a495b 100644 --- a/examples/shapes/shapes_lines_bezier.c +++ b/examples/shapes/shapes_lines_bezier.c @@ -40,11 +40,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("USE MOUSE LEFT-RIGHT CLICK to DEFINE LINE START and END POINTS", 15, 20, 20, GRAY); + DrawText("USE MOUSE LEFT-RIGHT CLICK to DEFINE LINE START and END POINTS", 15, 20, 20, RL_GRAY); - DrawLineBezier(start, end, 2.0f, RED); + DrawLineBezier(start, end, 2.0f, RL_RED); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/shapes/shapes_logo_raylib.c b/examples/shapes/shapes_logo_raylib.c index be94988c9..a9447fcdb 100644 --- a/examples/shapes/shapes_logo_raylib.c +++ b/examples/shapes/shapes_logo_raylib.c @@ -35,13 +35,13 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256, BLACK); - DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, RAYWHITE); - DrawText("raylib", screenWidth/2 - 44, screenHeight/2 + 48, 50, BLACK); + DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256, RL_BLACK); + DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, RL_RAYWHITE); + DrawText("raylib", screenWidth/2 - 44, screenHeight/2 + 48, 50, RL_BLACK); - DrawText("this is NOT a texture!", 350, 370, 10, GRAY); + DrawText("this is NOT a texture!", 350, 370, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/shapes/shapes_logo_raylib_anim.c b/examples/shapes/shapes_logo_raylib_anim.c index c6d3796e6..5402db66c 100644 --- a/examples/shapes/shapes_logo_raylib_anim.c +++ b/examples/shapes/shapes_logo_raylib_anim.c @@ -111,40 +111,40 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (state == 0) { - if ((framesCounter/15)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, BLACK); + if ((framesCounter/15)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, RL_BLACK); } else if (state == 1) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); } else if (state == 2) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); - DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, BLACK); + DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, RL_BLACK); } else if (state == 3) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(RL_BLACK, alpha)); - DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(RL_BLACK, alpha)); - DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, Fade(RAYWHITE, alpha)); + DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, Fade(RL_RAYWHITE, alpha)); - DrawText(SubText("raylib", 0, lettersCount), screenWidth/2 - 44, screenHeight/2 + 48, 50, Fade(BLACK, alpha)); + DrawText(SubText("raylib", 0, lettersCount), screenWidth/2 - 44, screenHeight/2 + 48, 50, Fade(RL_BLACK, alpha)); } else if (state == 4) { - DrawText("[R] REPLAY", 340, 200, 20, GRAY); + DrawText("[R] REPLAY", 340, 200, 20, RL_GRAY); } EndDrawing(); diff --git a/examples/text/text_bmfont_ttf.c b/examples/text/text_bmfont_ttf.c index f71f5ddb1..ea23c6dd5 100644 --- a/examples/text/text_bmfont_ttf.c +++ b/examples/text/text_bmfont_ttf.c @@ -47,10 +47,10 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawTextEx(fontBm, msgBm, fontPosition, fontBm.baseSize, 0, MAROON); - DrawTextEx(fontTtf, msgTtf, (Vector2){ 75.0f, 240.0f }, fontTtf.baseSize*0.8f, 2, LIME); + DrawTextEx(fontBm, msgBm, fontPosition, fontBm.baseSize, 0, RL_MAROON); + DrawTextEx(fontTtf, msgTtf, (Vector2){ 75.0f, 240.0f }, fontTtf.baseSize*0.8f, 2, RL_LIME); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/text/text_bmfont_unordered.c b/examples/text/text_bmfont_unordered.c index a51476198..550c40f3d 100644 --- a/examples/text/text_bmfont_unordered.c +++ b/examples/text/text_bmfont_unordered.c @@ -42,13 +42,13 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Font name: PixAntiqua", 40, 50, 20, GRAY); - DrawText(FormatText("Font base size: %i", font.baseSize), 40, 80, 20, GRAY); - DrawText(FormatText("Font chars number: %i", font.charsCount), 40, 110, 20, GRAY); + DrawText("Font name: PixAntiqua", 40, 50, 20, RL_GRAY); + DrawText(FormatText("Font base size: %i", font.baseSize), 40, 80, 20, RL_GRAY); + DrawText(FormatText("Font chars number: %i", font.charsCount), 40, 110, 20, RL_GRAY); - DrawTextEx(font, msg, (Vector2){ 40, 180 }, font.baseSize, 0, MAROON); + DrawTextEx(font, msg, (Vector2){ 40, 180 }, font.baseSize, 0, RL_MAROON); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/text/text_font_sdf.c b/examples/text/text_font_sdf.c index 755b642dd..73dcde3b9 100644 --- a/examples/text/text_font_sdf.c +++ b/examples/text/text_font_sdf.c @@ -81,31 +81,31 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (currentFont == 1) { // NOTE: SDF fonts require a custom SDf shader to compute fragment color BeginShaderMode(shader); // Activate SDF font shader - DrawTextEx(fontSDF, msg, fontPosition, fontSize, 0, BLACK); + DrawTextEx(fontSDF, msg, fontPosition, fontSize, 0, RL_BLACK); EndShaderMode(); // Activate our default shader for next drawings - DrawTexture(fontSDF.texture, 10, 10, BLACK); + DrawTexture(fontSDF.texture, 10, 10, RL_BLACK); } else { - DrawTextEx(fontDefault, msg, fontPosition, fontSize, 0, BLACK); - DrawTexture(fontDefault.texture, 10, 10, BLACK); + DrawTextEx(fontDefault, msg, fontPosition, fontSize, 0, RL_BLACK); + DrawTexture(fontDefault.texture, 10, 10, RL_BLACK); } - if (currentFont == 1) DrawText("SDF!", 320, 20, 80, RED); - else DrawText("default font", 315, 40, 30, GRAY); + if (currentFont == 1) DrawText("SDF!", 320, 20, 80, RL_RED); + else DrawText("default font", 315, 40, 30, RL_GRAY); - DrawText("FONT SIZE: 16.0", GetScreenWidth() - 240, 20, 20, DARKGRAY); - DrawText(FormatText("RENDER SIZE: %02.02f", fontSize), GetScreenWidth() - 240, 50, 20, DARKGRAY); - DrawText("Use MOUSE WHEEL to SCALE TEXT!", GetScreenWidth() - 240, 90, 10, DARKGRAY); + DrawText("FONT SIZE: 16.0", GetScreenWidth() - 240, 20, 20, RL_DARKGRAY); + DrawText(FormatText("RENDER SIZE: %02.02f", fontSize), GetScreenWidth() - 240, 50, 20, RL_DARKGRAY); + DrawText("Use MOUSE WHEEL to SCALE TEXT!", GetScreenWidth() - 240, 90, 10, RL_DARKGRAY); - DrawText("PRESS SPACE to USE SDF FONT VERSION!", 340, GetScreenHeight() - 30, 20, MAROON); + DrawText("PRESS SPACE to USE SDF FONT VERSION!", 340, GetScreenHeight() - 30, 20, RL_MAROON); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/text/text_format_text.c b/examples/text/text_format_text.c index ca28be742..4a86532fc 100644 --- a/examples/text/text_format_text.c +++ b/examples/text/text_format_text.c @@ -39,15 +39,15 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText(FormatText("Score: %08i", score), 200, 80, 20, RED); + DrawText(FormatText("Score: %08i", score), 200, 80, 20, RL_RED); - DrawText(FormatText("HiScore: %08i", hiscore), 200, 120, 20, GREEN); + DrawText(FormatText("HiScore: %08i", hiscore), 200, 120, 20, RL_GREEN); - DrawText(FormatText("Lives: %02i", lives), 200, 160, 40, BLUE); + DrawText(FormatText("Lives: %02i", lives), 200, 160, 40, RL_BLUE); - DrawText(FormatText("Elapsed Time: %02.02f ms", GetFrameTime()*1000), 200, 220, 20, BLACK); + DrawText(FormatText("Elapsed Time: %02.02f ms", GetFrameTime()*1000), 200, 220, 20, RL_BLACK); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c index 5f8d1c018..1b4aaaef3 100644 --- a/examples/text/text_input_box.c +++ b/examples/text/text_input_box.c @@ -69,26 +69,26 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("PLACE MOUSE OVER INPUT BOX!", 240, 140, 20, GRAY); + DrawText("PLACE MOUSE OVER INPUT BOX!", 240, 140, 20, RL_GRAY); - DrawRectangleRec(textBox, LIGHTGRAY); - if (mouseOnText) DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, RED); - else DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, DARKGRAY); + DrawRectangleRec(textBox, RL_LIGHTGRAY); + if (mouseOnText) DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, RL_RED); + else DrawRectangleLines(textBox.x, textBox.y, textBox.width, textBox.height, RL_DARKGRAY); - DrawText(name, textBox.x + 5, textBox.y + 8, 40, MAROON); + DrawText(name, textBox.x + 5, textBox.y + 8, 40, RL_MAROON); - DrawText(FormatText("INPUT CHARS: %i/%i", letterCount, MAX_INPUT_CHARS), 315, 250, 20, DARKGRAY); + DrawText(FormatText("INPUT CHARS: %i/%i", letterCount, MAX_INPUT_CHARS), 315, 250, 20, RL_DARKGRAY); if (mouseOnText) { if (letterCount < MAX_INPUT_CHARS) { // Draw blinking underscore char - if (((framesCounter/20)%2) == 0) DrawText("_", textBox.x + 8 + MeasureText(name, 40), textBox.y + 12, 40, MAROON); + if (((framesCounter/20)%2) == 0) DrawText("_", textBox.x + 8 + MeasureText(name, 40), textBox.y + 12, 40, RL_MAROON); } - else DrawText("Press BACKSPACE to delete chars...", 230, 300, 20, GRAY); + else DrawText("Press BACKSPACE to delete chars...", 230, 300, 20, RL_GRAY); } EndDrawing(); diff --git a/examples/text/text_raylib_fonts.c b/examples/text/text_raylib_fonts.c index 3c930ac2b..19ef94086 100644 --- a/examples/text/text_raylib_fonts.c +++ b/examples/text/text_raylib_fonts.c @@ -61,7 +61,7 @@ int main() positions[4].y += 2; positions[7].y -= 8; - Color colors[MAX_FONTS] = { MAROON, ORANGE, DARKGREEN, DARKBLUE, DARKPURPLE, LIME, GOLD, RED }; + Color colors[MAX_FONTS] = { RL_MAROON, RL_ORANGE, RL_DARKGREEN, RL_DARKBLUE, RL_DARKPURPLE, RL_LIME, RL_GOLD, RL_RED }; //-------------------------------------------------------------------------------------- // Main game loop @@ -76,10 +76,10 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("free fonts included with raylib", 250, 20, 20, DARKGRAY); - DrawLine(220, 50, 590, 50, DARKGRAY); + DrawText("free fonts included with raylib", 250, 20, 20, RL_DARKGRAY); + DrawLine(220, 50, 590, 50, RL_DARKGRAY); for (int i = 0; i < MAX_FONTS; i++) { diff --git a/examples/text/text_sprite_fonts.c b/examples/text/text_sprite_fonts.c index 7ce2fef5f..4e04170c0 100644 --- a/examples/text/text_sprite_fonts.c +++ b/examples/text/text_sprite_fonts.c @@ -54,11 +54,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawTextEx(font1, msg1, fontPosition1, font1.baseSize, -3, WHITE); - DrawTextEx(font2, msg2, fontPosition2, font2.baseSize, -2, WHITE); - DrawTextEx(font3, msg3, fontPosition3, font3.baseSize, 2, WHITE); + DrawTextEx(font1, msg1, fontPosition1, font1.baseSize, -3, RL_WHITE); + DrawTextEx(font2, msg2, fontPosition2, font2.baseSize, -2, RL_WHITE); + DrawTextEx(font3, msg3, fontPosition3, font3.baseSize, 2, RL_WHITE); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/text/text_ttf_loading.c b/examples/text/text_ttf_loading.c index 0e964ebd8..14fbbae46 100644 --- a/examples/text/text_ttf_loading.c +++ b/examples/text/text_ttf_loading.c @@ -97,26 +97,26 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Use mouse wheel to change font size", 20, 20, 10, GRAY); - DrawText("Use KEY_RIGHT and KEY_LEFT to move text", 20, 40, 10, GRAY); - DrawText("Use 1, 2, 3 to change texture filter", 20, 60, 10, GRAY); - DrawText("Drop a new TTF font for dynamic loading", 20, 80, 10, DARKGRAY); + DrawText("Use mouse wheel to change font size", 20, 20, 10, RL_GRAY); + DrawText("Use KEY_RIGHT and KEY_LEFT to move text", 20, 40, 10, RL_GRAY); + DrawText("Use 1, 2, 3 to change texture filter", 20, 60, 10, RL_GRAY); + DrawText("Drop a new TTF font for dynamic loading", 20, 80, 10, RL_DARKGRAY); - DrawTextEx(font, msg, fontPosition, fontSize, 0, BLACK); + DrawTextEx(font, msg, fontPosition, fontSize, 0, RL_BLACK); // TODO: It seems texSize measurement is not accurate due to chars offsets... - //DrawRectangleLines(fontPosition.x, fontPosition.y, textSize.x, textSize.y, RED); + //DrawRectangleLines(fontPosition.x, fontPosition.y, textSize.x, textSize.y, RL_RED); - DrawRectangle(0, screenHeight - 80, screenWidth, 80, LIGHTGRAY); - DrawText(FormatText("Font size: %02.02f", fontSize), 20, screenHeight - 50, 10, DARKGRAY); - DrawText(FormatText("Text size: [%02.02f, %02.02f]", textSize.x, textSize.y), 20, screenHeight - 30, 10, DARKGRAY); - DrawText("CURRENT TEXTURE FILTER:", 250, 400, 20, GRAY); + DrawRectangle(0, screenHeight - 80, screenWidth, 80, RL_LIGHTGRAY); + DrawText(FormatText("Font size: %02.02f", fontSize), 20, screenHeight - 50, 10, RL_DARKGRAY); + DrawText(FormatText("Text size: [%02.02f, %02.02f]", textSize.x, textSize.y), 20, screenHeight - 30, 10, RL_DARKGRAY); + DrawText("CURRENT TEXTURE FILTER:", 250, 400, 20, RL_GRAY); - if (currentFontFilter == 0) DrawText("POINT", 570, 400, 20, BLACK); - else if (currentFontFilter == 1) DrawText("BILINEAR", 570, 400, 20, BLACK); - else if (currentFontFilter == 2) DrawText("TRILINEAR", 570, 400, 20, BLACK); + if (currentFontFilter == 0) DrawText("POINT", 570, 400, 20, RL_BLACK); + else if (currentFontFilter == 1) DrawText("BILINEAR", 570, 400, 20, RL_BLACK); + else if (currentFontFilter == 2) DrawText("TRILINEAR", 570, 400, 20, RL_BLACK); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/text/text_writing_anim.c b/examples/text/text_writing_anim.c index 5563b561c..3bef00745 100644 --- a/examples/text/text_writing_anim.c +++ b/examples/text/text_writing_anim.c @@ -42,12 +42,12 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText(SubText(message, 0, framesCounter/10), 210, 160, 20, MAROON); + DrawText(SubText(message, 0, framesCounter/10), 210, 160, 20, RL_MAROON); - DrawText("PRESS [ENTER] to RESTART!", 240, 260, 20, LIGHTGRAY); - DrawText("PRESS [SPACE] to SPEED UP!", 239, 300, 20, LIGHTGRAY); + DrawText("PRESS [ENTER] to RESTART!", 240, 260, 20, RL_LIGHTGRAY); + DrawText("PRESS [SPACE] to SPEED UP!", 239, 300, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_image_drawing.c b/examples/textures/textures_image_drawing.c index b179612d4..1538aed91 100644 --- a/examples/textures/textures_image_drawing.c +++ b/examples/textures/textures_image_drawing.c @@ -41,7 +41,7 @@ int main() Font font = LoadFont("resources/custom_jupiter_crash.png"); // Draw over image using custom font - ImageDrawTextEx(&parrots, (Vector2){ 300, 230 }, font, "PARROTS & CAT", font.baseSize, -2, WHITE); + ImageDrawTextEx(&parrots, (Vector2){ 300, 230 }, font, "PARROTS & CAT", font.baseSize, -2, RL_WHITE); UnloadFont(font); // Unload custom spritefont (already drawn used on image) @@ -63,13 +63,13 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 40, WHITE); - DrawRectangleLines(screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 40, texture.width, texture.height, DARKGRAY); + DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 40, RL_WHITE); + DrawRectangleLines(screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 40, texture.width, texture.height, RL_DARKGRAY); - DrawText("We are drawing only one texture from various images composed!", 240, 350, 10, DARKGRAY); - DrawText("Source images have been cropped, scaled, flipped and copied one over the other.", 190, 370, 10, DARKGRAY); + DrawText("We are drawing only one texture from various images composed!", 240, 350, 10, RL_DARKGRAY); + DrawText("Source images have been cropped, scaled, flipped and copied one over the other.", 190, 370, 10, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_image_generation.c b/examples/textures/textures_image_generation.c index b9608c89a..bf9a5720e 100644 --- a/examples/textures/textures_image_generation.c +++ b/examples/textures/textures_image_generation.c @@ -22,10 +22,10 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [textures] example - procedural images generation"); - Image verticalGradient = GenImageGradientV(screenWidth, screenHeight, RED, BLUE); - Image horizontalGradient = GenImageGradientH(screenWidth, screenHeight, RED, BLUE); - Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, WHITE, BLACK); - Image checked = GenImageChecked(screenWidth, screenHeight, 32, 32, RED, BLUE); + Image verticalGradient = GenImageGradientV(screenWidth, screenHeight, RL_RED, RL_BLUE); + Image horizontalGradient = GenImageGradientH(screenWidth, screenHeight, RL_RED, RL_BLUE); + Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, RL_WHITE, RL_BLACK); + Image checked = GenImageChecked(screenWidth, screenHeight, 32, 32, RL_RED, RL_BLUE); Image whiteNoise = GenImageWhiteNoise(screenWidth, screenHeight, 0.5f); Image perlinNoise = GenImagePerlinNoise(screenWidth, screenHeight, 50, 50, 4.0f); Image cellular = GenImageCellular(screenWidth, screenHeight, 32); @@ -68,23 +68,23 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawTexture(textures[currentTexture], 0, 0, WHITE); + DrawTexture(textures[currentTexture], 0, 0, RL_WHITE); - DrawRectangle(30, 400, 325, 30, Fade(SKYBLUE, 0.5f)); - DrawRectangleLines(30, 400, 325, 30, Fade(WHITE, 0.5f)); - DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL TEXTURES", 40, 410, 10, WHITE); + DrawRectangle(30, 400, 325, 30, Fade(RL_SKYBLUE, 0.5f)); + DrawRectangleLines(30, 400, 325, 30, Fade(RL_WHITE, 0.5f)); + DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL TEXTURES", 40, 410, 10, RL_WHITE); switch(currentTexture) { - case 0: DrawText("VERTICAL GRADIENT", 560, 10, 20, RAYWHITE); break; - case 1: DrawText("HORIZONTAL GRADIENT", 540, 10, 20, RAYWHITE); break; - case 2: DrawText("RADIAL GRADIENT", 580, 10, 20, LIGHTGRAY); break; - case 3: DrawText("CHECKED", 680, 10, 20, RAYWHITE); break; - case 4: DrawText("WHITE NOISE", 640, 10, 20, RED); break; - case 5: DrawText("PERLIN NOISE", 630, 10, 20, RAYWHITE); break; - case 6: DrawText("CELLULAR", 670, 10, 20, RAYWHITE); break; + case 0: DrawText("VERTICAL GRADIENT", 560, 10, 20, RL_RAYWHITE); break; + case 1: DrawText("HORIZONTAL GRADIENT", 540, 10, 20, RL_RAYWHITE); break; + case 2: DrawText("RADIAL GRADIENT", 580, 10, 20, RL_LIGHTGRAY); break; + case 3: DrawText("CHECKED", 680, 10, 20, RL_RAYWHITE); break; + case 4: DrawText("RL_WHITE NOISE", 640, 10, 20, RL_RED); break; + case 5: DrawText("PERLIN NOISE", 630, 10, 20, RL_RAYWHITE); break; + case 6: DrawText("CELLULAR", 670, 10, 20, RL_RAYWHITE); break; default: break; } diff --git a/examples/textures/textures_image_loading.c b/examples/textures/textures_image_loading.c index 54c735860..95fe87955 100644 --- a/examples/textures/textures_image_loading.c +++ b/examples/textures/textures_image_loading.c @@ -42,11 +42,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, WHITE); + DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, RL_WHITE); - DrawText("this IS a texture loaded from an image!", 300, 370, 10, GRAY); + DrawText("this IS a texture loaded from an image!", 300, 370, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_image_npatch.c b/examples/textures/textures_image_npatch.c index 357b8a98c..bb5c6b015 100644 --- a/examples/textures/textures_image_npatch.c +++ b/examples/textures/textures_image_npatch.c @@ -73,25 +73,25 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Draw the n-patches - DrawTextureNPatch(nPatchTexture, ninePatchInfo2, dstRec2, origin, 0.0f, WHITE); - DrawTextureNPatch(nPatchTexture, ninePatchInfo1, dstRec1, origin, 0.0f, WHITE); - DrawTextureNPatch(nPatchTexture, h3PatchInfo, dstRecH, origin, 0.0f, WHITE); - DrawTextureNPatch(nPatchTexture, v3PatchInfo, dstRecV, origin, 0.0f, WHITE); + DrawTextureNPatch(nPatchTexture, ninePatchInfo2, dstRec2, origin, 0.0f, RL_WHITE); + DrawTextureNPatch(nPatchTexture, ninePatchInfo1, dstRec1, origin, 0.0f, RL_WHITE); + DrawTextureNPatch(nPatchTexture, h3PatchInfo, dstRecH, origin, 0.0f, RL_WHITE); + DrawTextureNPatch(nPatchTexture, v3PatchInfo, dstRecV, origin, 0.0f, RL_WHITE); // Draw the source texture - DrawRectangleLines( 5, 88, 74, 266, BLUE); - DrawTexture(nPatchTexture, 10, 93, WHITE); - DrawText("TEXTURE", 15, 360, 10, DARKGRAY); + DrawRectangleLines( 5, 88, 74, 266, RL_BLUE); + DrawTexture(nPatchTexture, 10, 93, RL_WHITE); + DrawText("TEXTURE", 15, 360, 10, RL_DARKGRAY); - DrawRectangle( 10, 10, 250, 73, Fade(SKYBLUE, 0.5)); - DrawRectangleLines( 10, 10, 250, 73, BLUE); + DrawRectangle( 10, 10, 250, 73, Fade(RL_SKYBLUE, 0.5)); + DrawRectangleLines( 10, 10, 250, 73, RL_BLUE); - DrawText("9-Patch and 3-Patch example", 20, 20, 10, BLACK); - DrawText(" Move the mouse to stretch or", 40, 40, 10, DARKGRAY); - DrawText(" shrink the n-patches.", 40, 60, 10, DARKGRAY); + DrawText("9-Patch and 3-Patch example", 20, 20, 10, RL_BLACK); + DrawText(" Move the mouse to stretch or", 40, 40, 10, RL_DARKGRAY); + DrawText(" shrink the n-patches.", 40, 60, 10, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_image_processing.c b/examples/textures/textures_image_processing.c index 6d33d95bf..a0e71963f 100644 --- a/examples/textures/textures_image_processing.c +++ b/examples/textures/textures_image_processing.c @@ -93,7 +93,7 @@ int main() switch (currentProcess) { case COLOR_GRAYSCALE: ImageColorGrayscale(&image); break; - case COLOR_TINT: ImageColorTint(&image, GREEN); break; + case COLOR_TINT: ImageColorTint(&image, RL_GREEN); break; case COLOR_INVERT: ImageColorInvert(&image); break; case COLOR_CONTRAST: ImageColorContrast(&image, -40); break; case COLOR_BRIGHTNESS: ImageColorBrightness(&image, -80); break; @@ -114,20 +114,20 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("IMAGE PROCESSING:", 40, 30, 10, DARKGRAY); + DrawText("IMAGE PROCESSING:", 40, 30, 10, RL_DARKGRAY); // Draw rectangles for (int i = 0; i < NUM_PROCESSES; i++) { - DrawRectangleRec(selectRecs[i], (i == currentProcess) ? SKYBLUE : LIGHTGRAY); - DrawRectangleLines((int)selectRecs[i].x, (int) selectRecs[i].y, (int) selectRecs[i].width, (int) selectRecs[i].height, (i == currentProcess) ? BLUE : GRAY); - DrawText( processText[i], (int)( selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2), (int) selectRecs[i].y + 11, 10, (i == currentProcess) ? DARKBLUE : DARKGRAY); + DrawRectangleRec(selectRecs[i], (i == currentProcess) ? RL_SKYBLUE : RL_LIGHTGRAY); + DrawRectangleLines((int)selectRecs[i].x, (int) selectRecs[i].y, (int) selectRecs[i].width, (int) selectRecs[i].height, (i == currentProcess) ? RL_BLUE : RL_GRAY); + DrawText( processText[i], (int)( selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2), (int) selectRecs[i].y + 11, 10, (i == currentProcess) ? RL_DARKBLUE : RL_DARKGRAY); } - DrawTexture(texture, screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, WHITE); - DrawRectangleLines(screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, texture.width, texture.height, BLACK); + DrawTexture(texture, screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, RL_WHITE); + DrawRectangleLines(screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, texture.width, texture.height, RL_BLACK); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_image_text.c b/examples/textures/textures_image_text.c index fb99e8277..070f9287a 100644 --- a/examples/textures/textures_image_text.c +++ b/examples/textures/textures_image_text.c @@ -26,7 +26,7 @@ int main() Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM) // Draw over image using custom font - ImageDrawTextEx(&parrots, (Vector2){ 20.0f, 20.0f }, font, "[Parrots font drawing]", (float)font.baseSize, 0.0f, RED); + ImageDrawTextEx(&parrots, (Vector2){ 20.0f, 20.0f }, font, "[Parrots font drawing]", (float)font.baseSize, 0.0f, RL_RED); Texture2D texture = LoadTextureFromImage(parrots); // Image converted to texture, uploaded to GPU memory (VRAM) UnloadImage(parrots); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM @@ -51,20 +51,20 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!showFont) { // Draw texture with text already drawn inside - DrawTextureV(texture, position, WHITE); + DrawTextureV(texture, position, RL_WHITE); // Draw text directly using sprite font DrawTextEx(font, "[Parrots font drawing]", (Vector2){ position.x + 20, - position.y + 20 + 280 }, (float)font.baseSize, 0.0f, WHITE); + position.y + 20 + 280 }, (float)font.baseSize, 0.0f, RL_WHITE); } - else DrawTexture(font.texture, screenWidth/2 - font.texture.width/2, 50, BLACK); + else DrawTexture(font.texture, screenWidth/2 - font.texture.width/2, 50, RL_BLACK); - DrawText("PRESS SPACE to SEE USED SPRITEFONT ", 290, 420, 10, DARKGRAY); + DrawText("PRESS SPACE to SEE USED SPRITEFONT ", 290, 420, 10, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_logo_raylib.c b/examples/textures/textures_logo_raylib.c index f2f931281..ebaa8678e 100644 --- a/examples/textures/textures_logo_raylib.c +++ b/examples/textures/textures_logo_raylib.c @@ -36,11 +36,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, WHITE); + DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, RL_WHITE); - DrawText("this IS a texture!", 360, 370, 10, GRAY); + DrawText("this IS a texture!", 360, 370, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_particles_blending.c b/examples/textures/textures_particles_blending.c index 3b7dcaa38..297dd795d 100644 --- a/examples/textures/textures_particles_blending.c +++ b/examples/textures/textures_particles_blending.c @@ -100,7 +100,7 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(DARKGRAY); + ClearBackground(RL_DARKGRAY); BeginBlendMode(blending); @@ -115,10 +115,10 @@ int main() EndBlendMode(); - DrawText("PRESS SPACE to CHANGE BLENDING MODE", 180, 20, 20, BLACK); + DrawText("PRESS SPACE to CHANGE BLENDING MODE", 180, 20, 20, RL_BLACK); - if (blending == BLEND_ALPHA) DrawText("ALPHA BLENDING", 290, screenHeight - 40, 20, BLACK); - else DrawText("ADDITIVE BLENDING", 280, screenHeight - 40, 20, RAYWHITE); + if (blending == BLEND_ALPHA) DrawText("ALPHA BLENDING", 290, screenHeight - 40, 20, RL_BLACK); + else DrawText("ADDITIVE BLENDING", 280, screenHeight - 40, 20, RL_RAYWHITE); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_raw_data.c b/examples/textures/textures_raw_data.c index b038792ba..0c2ab267a 100644 --- a/examples/textures/textures_raw_data.c +++ b/examples/textures/textures_raw_data.c @@ -42,8 +42,8 @@ int main() { for (int x = 0; x < width; x++) { - if (((x/32+y/32)/1)%2 == 0) pixels[y*height + x] = ORANGE; - else pixels[y*height + x] = GOLD; + if (((x/32+y/32)/1)%2 == 0) pixels[y*height + x] = RL_ORANGE; + else pixels[y*height + x] = RL_GOLD; } } @@ -68,16 +68,16 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawTexture(checked, screenWidth/2 - checked.width/2, screenHeight/2 - checked.height/2, Fade(WHITE, 0.5f)); - DrawTexture(fudesumi, 430, -30, WHITE); + DrawTexture(checked, screenWidth/2 - checked.width/2, screenHeight/2 - checked.height/2, Fade(RL_WHITE, 0.5f)); + DrawTexture(fudesumi, 430, -30, RL_WHITE); - DrawText("CHECKED TEXTURE ", 84, 100, 30, BROWN); - DrawText("GENERATED by CODE", 72, 164, 30, BROWN); - DrawText("and RAW IMAGE LOADING", 46, 226, 30, BROWN); + DrawText("CHECKED TEXTURE ", 84, 100, 30, RL_BROWN); + DrawText("GENERATED by CODE", 72, 164, 30, RL_BROWN); + DrawText("and RAW IMAGE LOADING", 46, 226, 30, RL_BROWN); - DrawText("(c) Fudesumi sprite by Eiden Marsal", 310, screenHeight - 20, 10, BROWN); + DrawText("(c) Fudesumi sprite by Eiden Marsal", 310, screenHeight - 20, 10, RL_BROWN); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_rectangle.c b/examples/textures/textures_rectangle.c index e12477460..cb27b78bb 100644 --- a/examples/textures/textures_rectangle.c +++ b/examples/textures/textures_rectangle.c @@ -64,25 +64,25 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawTexture(scarfy, 15, 40, WHITE); - DrawRectangleLines(15, 40, scarfy.width, scarfy.height, LIME); - DrawRectangleLines(15 + frameRec.x, 40 + frameRec.y, frameRec.width, frameRec.height, RED); + DrawTexture(scarfy, 15, 40, RL_WHITE); + DrawRectangleLines(15, 40, scarfy.width, scarfy.height, RL_LIME); + DrawRectangleLines(15 + frameRec.x, 40 + frameRec.y, frameRec.width, frameRec.height, RL_RED); - DrawText("FRAME SPEED: ", 165, 210, 10, DARKGRAY); - DrawText(FormatText("%02i FPS", framesSpeed), 575, 210, 10, DARKGRAY); - DrawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, DARKGRAY); + DrawText("FRAME SPEED: ", 165, 210, 10, RL_DARKGRAY); + DrawText(FormatText("%02i FPS", framesSpeed), 575, 210, 10, RL_DARKGRAY); + DrawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, RL_DARKGRAY); for (int i = 0; i < MAX_FRAME_SPEED; i++) { - if (i < framesSpeed) DrawRectangle(250 + 21*i, 205, 20, 20, RED); - DrawRectangleLines(250 + 21*i, 205, 20, 20, MAROON); + if (i < framesSpeed) DrawRectangle(250 + 21*i, 205, 20, 20, RL_RED); + DrawRectangleLines(250 + 21*i, 205, 20, 20, RL_MAROON); } - DrawTextureRec(scarfy, frameRec, position, WHITE); // Draw part of the texture + DrawTextureRec(scarfy, frameRec, position, RL_WHITE); // Draw part of the texture - DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, GRAY); + DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_srcrec_dstrec.c b/examples/textures/textures_srcrec_dstrec.c index cc08eb58c..155f7f751 100644 --- a/examples/textures/textures_srcrec_dstrec.c +++ b/examples/textures/textures_srcrec_dstrec.c @@ -52,19 +52,19 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // NOTE: Using DrawTexturePro() we can easily rotate and scale the part of the texture we draw // sourceRec defines the part of the texture we use for drawing // destRec defines the rectangle where our texture part will fit (scaling it to fit) // origin defines the point of the texture used as reference for rotation and scaling // rotation defines the texture rotation (using origin as rotation point) - DrawTexturePro(scarfy, sourceRec, destRec, origin, (float)rotation, WHITE); + DrawTexturePro(scarfy, sourceRec, destRec, origin, (float)rotation, RL_WHITE); - DrawLine((int) destRec.x, 0, (int) destRec.x, screenHeight, GRAY); - DrawLine(0, (int)destRec.y, screenWidth, (int)destRec.y, GRAY); + DrawLine((int) destRec.x, 0, (int) destRec.x, screenHeight, RL_GRAY); + DrawLine(0, (int)destRec.y, screenWidth, (int)destRec.y, RL_GRAY); - DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, GRAY); + DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/examples/textures/textures_to_image.c b/examples/textures/textures_to_image.c index 37c3b5a00..82893a941 100644 --- a/examples/textures/textures_to_image.c +++ b/examples/textures/textures_to_image.c @@ -47,11 +47,11 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, WHITE); + DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, RL_WHITE); - DrawText("this IS a texture loaded from an image!", 300, 370, 10, GRAY); + DrawText("this IS a texture loaded from an image!", 300, 370, 10, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/games/arkanoid.c b/games/arkanoid.c index 2a4a2e536..312ec258e 100644 --- a/games/arkanoid.c +++ b/games/arkanoid.c @@ -281,18 +281,18 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { // Draw player bar - DrawRectangle(player.position.x - player.size.x/2, player.position.y - player.size.y/2, player.size.x, player.size.y, BLACK); + DrawRectangle(player.position.x - player.size.x/2, player.position.y - player.size.y/2, player.size.x, player.size.y, RL_BLACK); // Draw player lives - for (int i = 0; i < player.life; i++) DrawRectangle(20 + 40*i, screenHeight - 30, 35, 10, LIGHTGRAY); + for (int i = 0; i < player.life; i++) DrawRectangle(20 + 40*i, screenHeight - 30, 35, 10, RL_LIGHTGRAY); // Draw ball - DrawCircleV(ball.position, ball.radius, MAROON); + DrawCircleV(ball.position, ball.radius, RL_MAROON); // Draw bricks for (int i = 0; i < LINES_OF_BRICKS; i++) @@ -301,15 +301,15 @@ void DrawGame(void) { if (brick[i][j].active) { - if ((i + j) % 2 == 0) DrawRectangle(brick[i][j].position.x - brickSize.x/2, brick[i][j].position.y - brickSize.y/2, brickSize.x, brickSize.y, GRAY); - else DrawRectangle(brick[i][j].position.x - brickSize.x/2, brick[i][j].position.y - brickSize.y/2, brickSize.x, brickSize.y, DARKGRAY); + if ((i + j) % 2 == 0) DrawRectangle(brick[i][j].position.x - brickSize.x/2, brick[i][j].position.y - brickSize.y/2, brickSize.x, brickSize.y, RL_GRAY); + else DrawRectangle(brick[i][j].position.x - brickSize.x/2, brick[i][j].position.y - brickSize.y/2, brickSize.x, brickSize.y, RL_DARKGRAY); } } } - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); } diff --git a/games/asteroids.c b/games/asteroids.c index 6837cd258..a3d9e3c2b 100644 --- a/games/asteroids.c +++ b/games/asteroids.c @@ -153,7 +153,7 @@ void InitGame(void) player.acceleration = 0; player.rotation = 0; player.collider = (Vector3){player.position.x + sin(player.rotation*RL_DEG2RAD)*(shipHeight/2.5f), player.position.y - cos(player.rotation*RL_DEG2RAD)*(shipHeight/2.5f), 12}; - player.color = LIGHTGRAY; + player.color = RL_LIGHTGRAY; destroyedMeteorsCount = 0; @@ -165,7 +165,7 @@ void InitGame(void) shoot[i].radius = 2; shoot[i].active = false; shoot[i].lifeSpawn = 0; - shoot[i].color = WHITE; + shoot[i].color = RL_WHITE; } for (int i = 0; i < MAX_BIG_METEORS; i++) @@ -207,7 +207,7 @@ void InitGame(void) bigMeteor[i].speed = (Vector2){velx, vely}; bigMeteor[i].radius = 40; bigMeteor[i].active = true; - bigMeteor[i].color = BLUE; + bigMeteor[i].color = RL_BLUE; } for (int i = 0; i < MAX_MEDIUM_METEORS; i++) @@ -216,7 +216,7 @@ void InitGame(void) mediumMeteor[i].speed = (Vector2){0,0}; mediumMeteor[i].radius = 20; mediumMeteor[i].active = false; - mediumMeteor[i].color = BLUE; + mediumMeteor[i].color = RL_BLUE; } for (int i = 0; i < MAX_SMALL_METEORS; i++) @@ -225,7 +225,7 @@ void InitGame(void) smallMeteor[i].speed = (Vector2){0,0}; smallMeteor[i].radius = 10; smallMeteor[i].active = false; - smallMeteor[i].color = BLUE; + smallMeteor[i].color = RL_BLUE; } midMeteorsCount = 0; @@ -440,7 +440,7 @@ void UpdateGame(void) midMeteorsCount ++; } //bigMeteor[a].position = (Vector2){-100, -100}; - bigMeteor[a].color = RED; + bigMeteor[a].color = RL_RED; a = MAX_BIG_METEORS; } } @@ -471,7 +471,7 @@ void UpdateGame(void) smallMeteorsCount ++; } //mediumMeteor[b].position = (Vector2){-100, -100}; - mediumMeteor[b].color = GREEN; + mediumMeteor[b].color = RL_GREEN; b = MAX_MEDIUM_METEORS; } } @@ -484,7 +484,7 @@ void UpdateGame(void) shoot[i].lifeSpawn = 0; smallMeteor[c].active = false; destroyedMeteorsCount++; - smallMeteor[c].color = YELLOW; + smallMeteor[c].color = RL_YELLOW; // smallMeteor[c].position = (Vector2){-100, -100}; c = MAX_SMALL_METEORS; } @@ -510,7 +510,7 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { @@ -518,38 +518,38 @@ void DrawGame(void) Vector2 v1 = { player.position.x + sinf(player.rotation*RL_DEG2RAD)*(shipHeight), player.position.y - cosf(player.rotation*RL_DEG2RAD)*(shipHeight) }; Vector2 v2 = { player.position.x - cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y - sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) }; Vector2 v3 = { player.position.x + cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y + sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) }; - DrawTriangle(v1, v2, v3, MAROON); + DrawTriangle(v1, v2, v3, RL_MAROON); // Draw meteors for (int i = 0; i < MAX_BIG_METEORS; i++) { - if (bigMeteor[i].active) DrawCircleV(bigMeteor[i].position, bigMeteor[i].radius, DARKGRAY); - else DrawCircleV(bigMeteor[i].position, bigMeteor[i].radius, Fade(LIGHTGRAY, 0.3f)); + if (bigMeteor[i].active) DrawCircleV(bigMeteor[i].position, bigMeteor[i].radius, RL_DARKGRAY); + else DrawCircleV(bigMeteor[i].position, bigMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f)); } for (int i = 0; i < MAX_MEDIUM_METEORS; i++) { - if (mediumMeteor[i].active) DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, GRAY); - else DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, Fade(LIGHTGRAY, 0.3f)); + if (mediumMeteor[i].active) DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, RL_GRAY); + else DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f)); } for (int i = 0; i < MAX_SMALL_METEORS; i++) { - if (smallMeteor[i].active) DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, GRAY); - else DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, Fade(LIGHTGRAY, 0.3f)); + if (smallMeteor[i].active) DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, RL_GRAY); + else DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f)); } // Draw shoot for (int i = 0; i < PLAYER_MAX_SHOOTS; i++) { - if (shoot[i].active) DrawCircleV(shoot[i].position, shoot[i].radius, BLACK); + if (shoot[i].active) DrawCircleV(shoot[i].position, shoot[i].radius, RL_BLACK); } - if (victory) DrawText("VICTORY", screenWidth/2 - MeasureText("VICTORY", 20)/2, screenHeight/2, 20, LIGHTGRAY); + if (victory) DrawText("VICTORY", screenWidth/2 - MeasureText("VICTORY", 20)/2, screenHeight/2, 20, RL_LIGHTGRAY); - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); } diff --git a/games/asteroids_survival.c b/games/asteroids_survival.c index dd7b7f6ad..1f76d0254 100644 --- a/games/asteroids_survival.c +++ b/games/asteroids_survival.c @@ -138,7 +138,7 @@ void InitGame(void) player.acceleration = 0; player.rotation = 0; player.collider = (Vector3){player.position.x + sin(player.rotation*RL_DEG2RAD)*(shipHeight/2.5f), player.position.y - cos(player.rotation*RL_DEG2RAD)*(shipHeight/2.5f), 12}; - player.color = LIGHTGRAY; + player.color = RL_LIGHTGRAY; for (int i = 0; i < MAX_MEDIUM_METEORS; i++) { @@ -177,7 +177,7 @@ void InitGame(void) mediumMeteor[i].speed = (Vector2){velx, vely}; mediumMeteor[i].radius = 20; mediumMeteor[i].active = true; - mediumMeteor[i].color = GREEN; + mediumMeteor[i].color = RL_GREEN; } for (int i = 0; i < MAX_SMALL_METEORS; i++) @@ -217,7 +217,7 @@ void InitGame(void) smallMeteor[i].speed = (Vector2){velx, vely}; smallMeteor[i].radius = 10; smallMeteor[i].active = true; - smallMeteor[i].color = YELLOW; + smallMeteor[i].color = RL_YELLOW; } } @@ -331,7 +331,7 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { @@ -339,26 +339,26 @@ void DrawGame(void) Vector2 v1 = { player.position.x + sinf(player.rotation*RL_DEG2RAD)*(shipHeight), player.position.y - cosf(player.rotation*RL_DEG2RAD)*(shipHeight) }; Vector2 v2 = { player.position.x - cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y - sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) }; Vector2 v3 = { player.position.x + cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y + sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) }; - DrawTriangle(v1, v2, v3, MAROON); + DrawTriangle(v1, v2, v3, RL_MAROON); // Draw meteor for (int i = 0;i < MAX_MEDIUM_METEORS; i++) { - if (mediumMeteor[i].active) DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, GRAY); - else DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, Fade(LIGHTGRAY, 0.3f)); + if (mediumMeteor[i].active) DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, RL_GRAY); + else DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f)); } for (int i = 0;i < MAX_SMALL_METEORS; i++) { - if (smallMeteor[i].active) DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, DARKGRAY); - else DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, Fade(LIGHTGRAY, 0.3f)); + if (smallMeteor[i].active) DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, RL_DARKGRAY); + else DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f)); } - DrawText(FormatText("TIME: %.02f", (float)framesCounter/60), 10, 10, 20, BLACK); + DrawText(FormatText("TIME: %.02f", (float)framesCounter/60), 10, 10, 20, RL_BLACK); - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/games/drturtle/00_drturtle_screens.c b/games/drturtle/00_drturtle_screens.c index fd9b3dada..c7838d78d 100644 --- a/games/drturtle/00_drturtle_screens.c +++ b/games/drturtle/00_drturtle_screens.c @@ -85,29 +85,29 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); switch (currentScreen) { case TITLE: { // Draw title screen - DrawRectangle(0, 0, screenWidth, screenHeight, GREEN); - DrawText("TITLE SCREEN", 20, 20, 40, DARKGREEN); + DrawRectangle(0, 0, screenWidth, screenHeight, RL_GREEN); + DrawText("TITLE SCREEN", 20, 20, 40, RL_DARKGREEN); } break; case GAMEPLAY: { // Draw gameplay screen - DrawRectangle(0, 0, screenWidth, screenHeight, RED); - DrawText("GAMEPLAY SCREEN", 20, 20, 40, MAROON); + DrawRectangle(0, 0, screenWidth, screenHeight, RL_RED); + DrawText("GAMEPLAY SCREEN", 20, 20, 40, RL_MAROON); } break; case ENDING: { // Draw ending screen - DrawRectangle(0, 0, screenWidth, screenHeight, BLUE); - DrawText("ENDING SCREEN", 20, 20, 40, DARKBLUE); + DrawRectangle(0, 0, screenWidth, screenHeight, RL_BLUE); + DrawText("ENDING SCREEN", 20, 20, 40, RL_DARKBLUE); } break; default: break; diff --git a/games/drturtle/01_drturtle_scrolling.c b/games/drturtle/01_drturtle_scrolling.c index b8a091de4..a9c305f57 100644 --- a/games/drturtle/01_drturtle_scrolling.c +++ b/games/drturtle/01_drturtle_scrolling.c @@ -106,29 +106,29 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Draw background (common to all screens) - DrawTexture(sky, 0, 0, WHITE); + DrawTexture(sky, 0, 0, RL_WHITE); - DrawTexture(mountains, backScrolling, 0, WHITE); - DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE); + DrawTexture(mountains, backScrolling, 0, RL_WHITE); + DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE); - DrawTexture(sea, seaScrolling, 0, BLUE); - DrawTexture(sea, screenWidth + seaScrolling, 0, BLUE); + DrawTexture(sea, seaScrolling, 0, RL_BLUE); + DrawTexture(sea, screenWidth + seaScrolling, 0, RL_BLUE); switch (currentScreen) { case TITLE: { // Draw title screen - DrawText("PRESS ENTER", 450, 420, 40, BLACK); + DrawText("PRESS ENTER", 450, 420, 40, RL_BLACK); } break; case GAMEPLAY: { // Draw gameplay screen - DrawText("GAMEPLAY SCREEN", 20, 20, 40, MAROON); + DrawText("GAMEPLAY SCREEN", 20, 20, 40, RL_MAROON); } break; case ENDING: @@ -136,9 +136,9 @@ int main() // Draw ending screen // Draw a transparent black rectangle that covers all screen - DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f)); + DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f)); - DrawText("ENDING SCREEN", 20, 20, 40, DARKBLUE); + DrawText("ENDING SCREEN", 20, 20, 40, RL_DARKBLUE); } break; default: break; diff --git a/games/drturtle/02_drturtle_player.c b/games/drturtle/02_drturtle_player.c index bf49abe59..2df5dbf68 100644 --- a/games/drturtle/02_drturtle_player.c +++ b/games/drturtle/02_drturtle_player.c @@ -134,23 +134,23 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Draw background (common to all screens) - DrawTexture(sky, 0, 0, WHITE); + DrawTexture(sky, 0, 0, RL_WHITE); - DrawTexture(mountains, backScrolling, 0, WHITE); - DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE); + DrawTexture(mountains, backScrolling, 0, RL_WHITE); + DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE); if (!gameraMode) { - DrawTexture(sea, seaScrolling, 0, BLUE); - DrawTexture(sea, screenWidth + seaScrolling, 0, BLUE); + DrawTexture(sea, seaScrolling, 0, RL_BLUE); + DrawTexture(sea, screenWidth + seaScrolling, 0, RL_BLUE); } else { - DrawTexture(sea, seaScrolling, 0, RED); - DrawTexture(sea, screenWidth + seaScrolling, 0, RED); + DrawTexture(sea, seaScrolling, 0, RL_RED); + DrawTexture(sea, screenWidth + seaScrolling, 0, RL_RED); } switch (currentScreen) @@ -158,33 +158,33 @@ int main() case TITLE: { // Draw title - //DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE); - DrawRectangle(380, 140, 500, 300, GRAY); + //DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE); + DrawRectangle(380, 140, 500, 300, RL_GRAY); // Draw blinking text - if ((framesCounter/30) % 2) DrawText("PRESS ENTER", 480, 480, 40, BLACK); + if ((framesCounter/30) % 2) DrawText("PRESS ENTER", 480, 480, 40, RL_BLACK); } break; case GAMEPLAY: { // Draw player - //if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE); - //else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE); + //if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE); + //else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE); // Draw player bounding box - if (!gameraMode) DrawRectangleRec(playerBounds, GREEN); - else DrawRectangleRec(playerBounds, ORANGE); + if (!gameraMode) DrawRectangleRec(playerBounds, RL_GREEN); + else DrawRectangleRec(playerBounds, RL_ORANGE); } break; case ENDING: { // Draw a transparent black rectangle that covers all screen - DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f)); + DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f)); - DrawText("GAME OVER", 300, 200, 100, MAROON); + DrawText("GAME OVER", 300, 200, 100, RL_MAROON); // Draw blinking text - if ((framesCounter/30) % 2) DrawText("PRESS ENTER to REPLAY", 400, 420, 30, LIGHTGRAY); + if ((framesCounter/30) % 2) DrawText("PRESS ENTER to REPLAY", 400, 420, 30, RL_LIGHTGRAY); } break; default: break; diff --git a/games/drturtle/03_drturtle_enemies.c b/games/drturtle/03_drturtle_enemies.c index f659a19a3..4e6f03eae 100644 --- a/games/drturtle/03_drturtle_enemies.c +++ b/games/drturtle/03_drturtle_enemies.c @@ -268,23 +268,23 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Draw background (common to all screens) - DrawTexture(sky, 0, 0, WHITE); + DrawTexture(sky, 0, 0, RL_WHITE); - DrawTexture(mountains, backScrolling, 0, WHITE); - DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE); + DrawTexture(mountains, backScrolling, 0, RL_WHITE); + DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE); if (!gameraMode) { - DrawTexture(sea, seaScrolling, 0, BLUE); - DrawTexture(sea, screenWidth + seaScrolling, 0, BLUE); + DrawTexture(sea, seaScrolling, 0, RL_BLUE); + DrawTexture(sea, screenWidth + seaScrolling, 0, RL_BLUE); } else { - DrawTexture(sea, seaScrolling, 0, RED); - DrawTexture(sea, screenWidth + seaScrolling, 0, RED); + DrawTexture(sea, seaScrolling, 0, RL_RED); + DrawTexture(sea, screenWidth + seaScrolling, 0, RL_RED); } switch (currentScreen) @@ -292,24 +292,24 @@ int main() case TITLE: { // Draw title - DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE); + DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE); // Draw blinking text - if ((framesCounter/30) % 2) DrawText("PRESS ENTER", 480, 480, 40, BLACK); + if ((framesCounter/30) % 2) DrawText("PRESS ENTER", 480, 480, 40, RL_BLACK); } break; case GAMEPLAY: { // Draw water lines - for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f)); + for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f)); // Draw player - if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE); - else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE); + if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE); + else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE); // Draw player bounding box - //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f)); - //else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f)); + //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f)); + //else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f)); // Draw enemies for (int i = 0; i < MAX_ENEMIES; i++) @@ -320,10 +320,10 @@ int main() /* switch(enemyType[i]) { - case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; + case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; default: break; } */ @@ -331,10 +331,10 @@ int main() // Draw enemies bounding boxes switch(enemyType[i]) { - case 0: DrawRectangleRec(enemyBounds[i], RED); break; - case 1: DrawRectangleRec(enemyBounds[i], RED); break; - case 2: DrawRectangleRec(enemyBounds[i], RED); break; - case 3: DrawRectangleRec(enemyBounds[i], GREEN); break; + case 0: DrawRectangleRec(enemyBounds[i], RL_RED); break; + case 1: DrawRectangleRec(enemyBounds[i], RL_RED); break; + case 2: DrawRectangleRec(enemyBounds[i], RL_RED); break; + case 3: DrawRectangleRec(enemyBounds[i], RL_GREEN); break; default: break; } } @@ -343,25 +343,25 @@ int main() // Draw gameplay interface // Draw food bar - DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f)); - DrawRectangle(20, 20, foodBar, 40, ORANGE); - DrawRectangleLines(20, 20, 400, 40, BLACK); + DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f)); + DrawRectangle(20, 20, foodBar, 40, RL_ORANGE); + DrawRectangleLines(20, 20, 400, 40, RL_BLACK); if (gameraMode) { - DrawText("GAMERA MODE", 60, 22, 40, GRAY); + DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY); } } break; case ENDING: { // Draw a transparent black rectangle that covers all screen - DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f)); + DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f)); - DrawText("GAME OVER", 300, 200, 100, MAROON); + DrawText("GAME OVER", 300, 200, 100, RL_MAROON); // Draw blinking text - if ((framesCounter/30) % 2) DrawText("PRESS ENTER to REPLAY", 400, 420, 30, LIGHTGRAY); + if ((framesCounter/30) % 2) DrawText("PRESS ENTER to REPLAY", 400, 420, 30, RL_LIGHTGRAY); } break; default: break; diff --git a/games/drturtle/04_drturtle_gui.c b/games/drturtle/04_drturtle_gui.c index 0ec06fb68..59d5cd3a0 100644 --- a/games/drturtle/04_drturtle_gui.c +++ b/games/drturtle/04_drturtle_gui.c @@ -311,13 +311,13 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Draw background (common to all screens) - DrawTexture(sky, 0, 0, WHITE); + DrawTexture(sky, 0, 0, RL_WHITE); - DrawTexture(mountains, backScrolling, 0, WHITE); - DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE); + DrawTexture(mountains, backScrolling, 0, RL_WHITE); + DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE); if (!gameraMode) { @@ -335,24 +335,24 @@ int main() case TITLE: { // Draw title - DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE); + DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE); // Draw blinking text - if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, WHITE); + if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, RL_WHITE); } break; case GAMEPLAY: { // Draw water lines - for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f)); + for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f)); // Draw player - if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE); - else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE); + if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE); + else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE); // Draw player bounding box - //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f)); - //else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f)); + //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f)); + //else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f)); // Draw enemies for (int i = 0; i < MAX_ENEMIES; i++) @@ -362,10 +362,10 @@ int main() // Draw enemies switch(enemyType[i]) { - case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; + case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; default: break; } @@ -373,10 +373,10 @@ int main() /* switch(enemyType[i]) { - case 0: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 1: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 2: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 3: DrawRectangleRec(enemyBounds[i], Fade(GREEN, 0.5f)); break; + case 0: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 1: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 2: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 3: DrawRectangleRec(enemyBounds[i], Fade(RL_GREEN, 0.5f)); break; default: break; } */ @@ -384,34 +384,34 @@ int main() } // Draw gameplay interface - DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f)); - DrawRectangle(20, 20, foodBar, 40, ORANGE); - DrawRectangleLines(20, 20, 400, 40, BLACK); + DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f)); + DrawRectangle(20, 20, foodBar, 40, RL_ORANGE); + DrawRectangleLines(20, 20, 400, 40, RL_BLACK); - DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, ORANGE); - DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, ORANGE); + DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, RL_ORANGE); + DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, RL_ORANGE); if (gameraMode) { - DrawText("GAMERA MODE", 60, 22, 40, GRAY); - DrawTexture(gframe, 0, 0, Fade(WHITE, 0.5f)); + DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY); + DrawTexture(gframe, 0, 0, Fade(RL_WHITE, 0.5f)); } } break; case ENDING: { // Draw a transparent black rectangle that covers all screen - DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f)); + DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f)); - DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, MAROON); + DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, RL_MAROON); - DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, GOLD); - DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, GOLD); - DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, ORANGE); - DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, ORANGE); + DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, RL_GOLD); + DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, RL_GOLD); + DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, RL_ORANGE); + DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, RL_ORANGE); // Draw blinking text - if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, LIGHTGRAY); + if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, RL_LIGHTGRAY); } break; default: break; diff --git a/games/drturtle/05_drturtle_audio.c b/games/drturtle/05_drturtle_audio.c index 4c3ce4add..7c737f14f 100644 --- a/games/drturtle/05_drturtle_audio.c +++ b/games/drturtle/05_drturtle_audio.c @@ -327,13 +327,13 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Draw background (common to all screens) - DrawTexture(sky, 0, 0, WHITE); + DrawTexture(sky, 0, 0, RL_WHITE); - DrawTexture(mountains, backScrolling, 0, WHITE); - DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE); + DrawTexture(mountains, backScrolling, 0, RL_WHITE); + DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE); if (!gameraMode) { @@ -351,24 +351,24 @@ int main() case TITLE: { // Draw title - DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE); + DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE); // Draw blinking text - if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, WHITE); + if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, RL_WHITE); } break; case GAMEPLAY: { // Draw water lines - for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f)); + for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f)); // Draw player - if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE); - else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE); + if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE); + else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE); // Draw player bounding box - //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f)); - //else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f)); + //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f)); + //else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f)); // Draw enemies for (int i = 0; i < MAX_ENEMIES; i++) @@ -378,10 +378,10 @@ int main() // Draw enemies switch(enemyType[i]) { - case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; + case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; default: break; } @@ -389,10 +389,10 @@ int main() /* switch(enemyType[i]) { - case 0: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 1: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 2: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 3: DrawRectangleRec(enemyBounds[i], Fade(GREEN, 0.5f)); break; + case 0: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 1: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 2: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 3: DrawRectangleRec(enemyBounds[i], Fade(RL_GREEN, 0.5f)); break; default: break; } */ @@ -400,34 +400,34 @@ int main() } // Draw gameplay interface - DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f)); - DrawRectangle(20, 20, foodBar, 40, ORANGE); - DrawRectangleLines(20, 20, 400, 40, BLACK); + DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f)); + DrawRectangle(20, 20, foodBar, 40, RL_ORANGE); + DrawRectangleLines(20, 20, 400, 40, RL_BLACK); - DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, ORANGE); - DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, ORANGE); + DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, RL_ORANGE); + DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, RL_ORANGE); if (gameraMode) { - DrawText("GAMERA MODE", 60, 22, 40, GRAY); - DrawTexture(gframe, 0, 0, Fade(WHITE, 0.5f)); + DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY); + DrawTexture(gframe, 0, 0, Fade(RL_WHITE, 0.5f)); } } break; case ENDING: { // Draw a transparent black rectangle that covers all screen - DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f)); + DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f)); - DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, MAROON); + DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, RL_MAROON); - DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, GOLD); - DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, GOLD); - DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, ORANGE); - DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, ORANGE); + DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, RL_GOLD); + DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, RL_GOLD); + DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, RL_ORANGE); + DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, RL_ORANGE); // Draw blinking text - if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, LIGHTGRAY); + if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, RL_LIGHTGRAY); } break; default: break; diff --git a/games/drturtle/06_drturtle_final.c b/games/drturtle/06_drturtle_final.c index a74d4f7e3..84b34c0de 100644 --- a/games/drturtle/06_drturtle_final.c +++ b/games/drturtle/06_drturtle_final.c @@ -352,13 +352,13 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Draw background (common to all screens) - DrawTexture(sky, 0, 0, WHITE); + DrawTexture(sky, 0, 0, RL_WHITE); - DrawTexture(mountains, backScrolling, 0, WHITE); - DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE); + DrawTexture(mountains, backScrolling, 0, RL_WHITE); + DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE); if (!gameraMode) { @@ -376,24 +376,24 @@ int main() case TITLE: { // Draw title - DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE); + DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE); // Draw blinking text - if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, WHITE); + if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, RL_WHITE); } break; case GAMEPLAY: { // Draw water lines - for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f)); + for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f)); // Draw player - if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE); - else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE); + if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE); + else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE); // Draw player bounding box - //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f)); - //else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f)); + //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f)); + //else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f)); // Draw enemies for (int i = 0; i < MAX_ENEMIES; i++) @@ -403,10 +403,10 @@ int main() // Draw enemies switch(enemyType[i]) { - case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; + case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; default: break; } @@ -414,10 +414,10 @@ int main() /* switch(enemyType[i]) { - case 0: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 1: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 2: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 3: DrawRectangleRec(enemyBounds[i], Fade(GREEN, 0.5f)); break; + case 0: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 1: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 2: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 3: DrawRectangleRec(enemyBounds[i], Fade(RL_GREEN, 0.5f)); break; default: break; } */ @@ -425,34 +425,34 @@ int main() } // Draw gameplay interface - DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f)); - DrawRectangle(20, 20, foodBar, 40, ORANGE); - DrawRectangleLines(20, 20, 400, 40, BLACK); + DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f)); + DrawRectangle(20, 20, foodBar, 40, RL_ORANGE); + DrawRectangleLines(20, 20, 400, 40, RL_BLACK); - DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, ORANGE); - DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, ORANGE); + DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, RL_ORANGE); + DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, RL_ORANGE); if (gameraMode) { - DrawText("GAMERA MODE", 60, 22, 40, GRAY); - DrawTexture(gframe, 0, 0, Fade(WHITE, 0.5f)); + DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY); + DrawTexture(gframe, 0, 0, Fade(RL_WHITE, 0.5f)); } } break; case ENDING: { // Draw a transparent black rectangle that covers all screen - DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f)); + DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f)); - DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, MAROON); + DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, RL_MAROON); - DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, GOLD); - DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, GOLD); - DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, ORANGE); - DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, ORANGE); + DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, RL_GOLD); + DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, RL_GOLD); + DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, RL_ORANGE); + DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, RL_ORANGE); // Draw blinking text - if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, LIGHTGRAY); + if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, RL_LIGHTGRAY); } break; default: break; diff --git a/games/drturtle/drturtle_final_web.c b/games/drturtle/drturtle_final_web.c index 0b639e38b..86502cdf6 100644 --- a/games/drturtle/drturtle_final_web.c +++ b/games/drturtle/drturtle_final_web.c @@ -433,13 +433,13 @@ void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); // Draw background (common to all screens) - DrawTexture(sky, 0, 0, WHITE); + DrawTexture(sky, 0, 0, RL_WHITE); - DrawTexture(mountains, backScrolling, 0, WHITE); - DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE); + DrawTexture(mountains, backScrolling, 0, RL_WHITE); + DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE); if (!gameraMode) { @@ -457,24 +457,24 @@ void UpdateDrawFrame(void) case TITLE: { // Draw title - DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE); + DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE); // Draw blinking text - if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 1, WHITE); + if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 1, RL_WHITE); } break; case GAMEPLAY: { // Draw water lines - for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f)); + for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f)); // Draw player - if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE); - else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE); + if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE); + else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE); // Draw player bounding box - //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f)); - //else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f)); + //if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f)); + //else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f)); // Draw enemies for (int i = 0; i < MAX_ENEMIES; i++) @@ -484,10 +484,10 @@ void UpdateDrawFrame(void) // Draw enemies switch(enemyType[i]) { - case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; - case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break; + case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; + case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break; default: break; } @@ -495,10 +495,10 @@ void UpdateDrawFrame(void) /* switch(enemyType[i]) { - case 0: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 1: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 2: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break; - case 3: DrawRectangleRec(enemyBounds[i], Fade(GREEN, 0.5f)); break; + case 0: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 1: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 2: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break; + case 3: DrawRectangleRec(enemyBounds[i], Fade(RL_GREEN, 0.5f)); break; default: break; } */ @@ -506,34 +506,34 @@ void UpdateDrawFrame(void) } // Draw gameplay interface - DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f)); - DrawRectangle(20, 20, foodBar, 40, ORANGE); - DrawRectangleLines(20, 20, 400, 40, BLACK); + DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f)); + DrawRectangle(20, 20, foodBar, 40, RL_ORANGE); + DrawRectangleLines(20, 20, 400, 40, RL_BLACK); - DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, ORANGE); - DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, ORANGE); + DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, RL_ORANGE); + DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, RL_ORANGE); if (gameraMode) { - DrawText("GAMERA MODE", 60, 22, 40, GRAY); - DrawTexture(gframe, 0, 0, Fade(WHITE, 0.5f)); + DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY); + DrawTexture(gframe, 0, 0, Fade(RL_WHITE, 0.5f)); } } break; case ENDING: { // Draw a transparent black rectangle that covers all screen - DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f)); + DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f)); - DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, MAROON); + DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, RL_MAROON); - DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, GOLD); - DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, GOLD); - DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, ORANGE); - DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, ORANGE); + DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, RL_GOLD); + DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, RL_GOLD); + DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, RL_ORANGE); + DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, RL_ORANGE); // Draw blinking text - if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, LIGHTGRAY); + if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, RL_LIGHTGRAY); } break; default: break; diff --git a/games/floppy.c b/games/floppy.c index 2ca91a141..e61bc421f 100644 --- a/games/floppy.c +++ b/games/floppy.c @@ -196,32 +196,32 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { - DrawCircle(floppy.position.x, floppy.position.y, floppy.radius, DARKGRAY); + DrawCircle(floppy.position.x, floppy.position.y, floppy.radius, RL_DARKGRAY); // Draw tubes for (int i = 0; i < MAX_TUBES; i++) { - DrawRectangle(tubes[i*2].rec.x, tubes[i*2].rec.y, tubes[i*2].rec.width, tubes[i*2].rec.height, GRAY); - DrawRectangle(tubes[i*2 + 1].rec.x, tubes[i*2 + 1].rec.y, tubes[i*2 + 1].rec.width, tubes[i*2 + 1].rec.height, GRAY); + DrawRectangle(tubes[i*2].rec.x, tubes[i*2].rec.y, tubes[i*2].rec.width, tubes[i*2].rec.height, RL_GRAY); + DrawRectangle(tubes[i*2 + 1].rec.x, tubes[i*2 + 1].rec.y, tubes[i*2 + 1].rec.width, tubes[i*2 + 1].rec.height, RL_GRAY); } // Draw flashing fx (one frame only) if (superfx) { - DrawRectangle(0, 0, screenWidth, screenHeight, WHITE); + DrawRectangle(0, 0, screenWidth, screenHeight, RL_WHITE); superfx = false; } - DrawText(FormatText("%04i", score), 20, 20, 40, GRAY); - DrawText(FormatText("HI-SCORE: %04i", hiScore), 20, 70, 20, LIGHTGRAY); + DrawText(FormatText("%04i", score), 20, 20, 40, RL_GRAY); + DrawText(FormatText("HI-SCORE: %04i", hiScore), 20, 70, 20, RL_LIGHTGRAY); - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); } diff --git a/games/gold_fever.c b/games/gold_fever.c index c5f36efa5..d140f6bb5 100644 --- a/games/gold_fever.c +++ b/games/gold_fever.c @@ -239,30 +239,30 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { if (follow) { - DrawRectangle(0, 0, screenWidth, screenHeight, RED); - DrawRectangle(10, 10, screenWidth - 20, screenHeight - 20, RAYWHITE); + DrawRectangle(0, 0, screenWidth, screenHeight, RL_RED); + DrawRectangle(10, 10, screenWidth - 20, screenHeight - 20, RL_RAYWHITE); } - DrawRectangleLines(home.rec.x, home.rec.y, home.rec.width, home.rec.height, BLUE); + DrawRectangleLines(home.rec.x, home.rec.y, home.rec.width, home.rec.height, RL_BLUE); - DrawCircleLines(enemy.position.x, enemy.position.y, enemy.radiusBounds, RED); - DrawCircleV(enemy.position, enemy.radius, MAROON); + DrawCircleLines(enemy.position.x, enemy.position.y, enemy.radiusBounds, RL_RED); + DrawCircleV(enemy.position, enemy.radius, RL_MAROON); - DrawCircleV(player.position, player.radius, GRAY); - if (points.active) DrawCircleV(points.position, points.radius, GOLD); + DrawCircleV(player.position, player.radius, RL_GRAY); + if (points.active) DrawCircleV(points.position, points.radius, RL_GOLD); - DrawText(FormatText("SCORE: %04i", score), 20, 15, 20, GRAY); - DrawText(FormatText("HI-SCORE: %04i", hiScore), 300, 15, 20, GRAY); + DrawText(FormatText("SCORE: %04i", score), 20, 15, 20, RL_GRAY); + DrawText(FormatText("HI-SCORE: %04i", hiScore), 300, 15, 20, RL_GRAY); - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); } diff --git a/games/gorilas.c b/games/gorilas.c index 11bdaf871..7107d3441 100644 --- a/games/gorilas.c +++ b/games/gorilas.c @@ -237,7 +237,7 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { @@ -247,7 +247,7 @@ void DrawGame(void) // Draw explosions for (int i = 0; i < MAX_EXPLOSIONS; i++) { - if (explosion[i].active) DrawCircle(explosion[i].position.x, explosion[i].position.y, explosion[i].radius, RAYWHITE); + if (explosion[i].active) DrawCircle(explosion[i].position.x, explosion[i].position.y, explosion[i].radius, RL_RAYWHITE); } // Draw players @@ -256,14 +256,14 @@ void DrawGame(void) if (player[i].isAlive) { if (player[i].isLeftTeam) DrawRectangle(player[i].position.x - player[i].size.x/2, player[i].position.y - player[i].size.y/2, - player[i].size.x, player[i].size.y, BLUE); + player[i].size.x, player[i].size.y, RL_BLUE); else DrawRectangle(player[i].position.x - player[i].size.x/2, player[i].position.y - player[i].size.y/2, - player[i].size.x, player[i].size.y, RED); + player[i].size.x, player[i].size.y, RL_RED); } } // Draw ball - if (ball.active) DrawCircle(ball.position.x, ball.position.y, ball.radius, MAROON); + if (ball.active) DrawCircle(ball.position.x, ball.position.y, ball.radius, RL_MAROON); // Draw the angle and the power of the aim, and the previous ones if (!ballOnAir) @@ -272,21 +272,21 @@ void DrawGame(void) /* if (player[playerTurn].isLeftTeam) { - DrawText(FormatText("Previous Point %i, %i", (int)player[playerTurn].previousPoint.x, (int)player[playerTurn].previousPoint.y), 20, 20, 20, DARKBLUE); - DrawText(FormatText("Previous Angle %i", player[playerTurn].previousAngle), 20, 50, 20, DARKBLUE); - DrawText(FormatText("Previous Power %i", player[playerTurn].previousPower), 20, 80, 20, DARKBLUE); - DrawText(FormatText("Aiming Point %i, %i", (int)player[playerTurn].aimingPoint.x, (int)player[playerTurn].aimingPoint.y), 20, 110, 20, DARKBLUE); - DrawText(FormatText("Aiming Angle %i", player[playerTurn].aimingAngle), 20, 140, 20, DARKBLUE); - DrawText(FormatText("Aiming Power %i", player[playerTurn].aimingPower), 20, 170, 20, DARKBLUE); + DrawText(FormatText("Previous Point %i, %i", (int)player[playerTurn].previousPoint.x, (int)player[playerTurn].previousPoint.y), 20, 20, 20, RL_DARKBLUE); + DrawText(FormatText("Previous Angle %i", player[playerTurn].previousAngle), 20, 50, 20, RL_DARKBLUE); + DrawText(FormatText("Previous Power %i", player[playerTurn].previousPower), 20, 80, 20, RL_DARKBLUE); + DrawText(FormatText("Aiming Point %i, %i", (int)player[playerTurn].aimingPoint.x, (int)player[playerTurn].aimingPoint.y), 20, 110, 20, RL_DARKBLUE); + DrawText(FormatText("Aiming Angle %i", player[playerTurn].aimingAngle), 20, 140, 20, RL_DARKBLUE); + DrawText(FormatText("Aiming Power %i", player[playerTurn].aimingPower), 20, 170, 20, RL_DARKBLUE); } else { - DrawText(FormatText("Previous Point %i, %i", (int)player[playerTurn].previousPoint.x, (int)player[playerTurn].previousPoint.y), screenWidth*3/4, 20, 20, DARKBLUE); - DrawText(FormatText("Previous Angle %i", player[playerTurn].previousAngle), screenWidth*3/4, 50, 20, DARKBLUE); - DrawText(FormatText("Previous Power %i", player[playerTurn].previousPower), screenWidth*3/4, 80, 20, DARKBLUE); - DrawText(FormatText("Aiming Point %i, %i", (int)player[playerTurn].aimingPoint.x, (int)player[playerTurn].aimingPoint.y), screenWidth*3/4, 110, 20, DARKBLUE); - DrawText(FormatText("Aiming Angle %i", player[playerTurn].aimingAngle), screenWidth*3/4, 140, 20, DARKBLUE); - DrawText(FormatText("Aiming Power %i", player[playerTurn].aimingPower), screenWidth*3/4, 170, 20, DARKBLUE); + DrawText(FormatText("Previous Point %i, %i", (int)player[playerTurn].previousPoint.x, (int)player[playerTurn].previousPoint.y), screenWidth*3/4, 20, 20, RL_DARKBLUE); + DrawText(FormatText("Previous Angle %i", player[playerTurn].previousAngle), screenWidth*3/4, 50, 20, RL_DARKBLUE); + DrawText(FormatText("Previous Power %i", player[playerTurn].previousPower), screenWidth*3/4, 80, 20, RL_DARKBLUE); + DrawText(FormatText("Aiming Point %i, %i", (int)player[playerTurn].aimingPoint.x, (int)player[playerTurn].aimingPoint.y), screenWidth*3/4, 110, 20, RL_DARKBLUE); + DrawText(FormatText("Aiming Angle %i", player[playerTurn].aimingAngle), screenWidth*3/4, 140, 20, RL_DARKBLUE); + DrawText(FormatText("Aiming Power %i", player[playerTurn].aimingPower), screenWidth*3/4, 170, 20, RL_DARKBLUE); } */ @@ -296,30 +296,30 @@ void DrawGame(void) // Previous aiming DrawTriangle((Vector2){ player[playerTurn].position.x - player[playerTurn].size.x/4, player[playerTurn].position.y - player[playerTurn].size.y/4 }, (Vector2){ player[playerTurn].position.x + player[playerTurn].size.x/4, player[playerTurn].position.y + player[playerTurn].size.y/4 }, - player[playerTurn].previousPoint, GRAY); + player[playerTurn].previousPoint, RL_GRAY); // Actual aiming DrawTriangle((Vector2){ player[playerTurn].position.x - player[playerTurn].size.x/4, player[playerTurn].position.y - player[playerTurn].size.y/4 }, (Vector2){ player[playerTurn].position.x + player[playerTurn].size.x/4, player[playerTurn].position.y + player[playerTurn].size.y/4 }, - player[playerTurn].aimingPoint, DARKBLUE); + player[playerTurn].aimingPoint, RL_DARKBLUE); } else { // Previous aiming DrawTriangle((Vector2){ player[playerTurn].position.x - player[playerTurn].size.x/4, player[playerTurn].position.y + player[playerTurn].size.y/4 }, (Vector2){ player[playerTurn].position.x + player[playerTurn].size.x/4, player[playerTurn].position.y - player[playerTurn].size.y/4 }, - player[playerTurn].previousPoint, GRAY); + player[playerTurn].previousPoint, RL_GRAY); // Actual aiming DrawTriangle((Vector2){ player[playerTurn].position.x - player[playerTurn].size.x/4, player[playerTurn].position.y + player[playerTurn].size.y/4 }, (Vector2){ player[playerTurn].position.x + player[playerTurn].size.x/4, player[playerTurn].position.y - player[playerTurn].size.y/4 }, - player[playerTurn].aimingPoint, MAROON); + player[playerTurn].aimingPoint, RL_MAROON); } } - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); } diff --git a/games/just_do/just_do.c b/games/just_do/just_do.c index c7c76af96..b31cf5da4 100644 --- a/games/just_do/just_do.c +++ b/games/just_do/just_do.c @@ -137,7 +137,7 @@ void UpdateTransition(void) void DrawTransition(void) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, transAlpha)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_RAYWHITE, transAlpha)); } void UpdateDrawFrame(void) @@ -335,7 +335,7 @@ void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); switch(currentScreen) { diff --git a/games/just_do/screens/screen_level00.c b/games/just_do/screens/screen_level00.c index e72e3812b..76b31e334 100644 --- a/games/just_do/screens/screen_level00.c +++ b/games/just_do/screens/screen_level00.c @@ -124,26 +124,26 @@ void UpdateLevel00Screen(void) void DrawLevel00Screen(void) { // Draw Level00 screen - DrawText("U", boundsU.x, boundsU.y + 10, 160, GRAY); - DrawText("J", GetScreenWidth()/2 - MeasureText("JUST DO", 160)/2, GetScreenHeight()/2 - 80, 160, GRAY); - DrawText("ST D", GetScreenWidth()/2 - MeasureText("JUST DO", 160)/2 + 210, GetScreenHeight()/2 - 80, 160, GRAY); - DrawText("O", boundsO.x, boundsO.y + 10, 160, GRAY); + DrawText("U", boundsU.x, boundsU.y + 10, 160, RL_GRAY); + DrawText("J", GetScreenWidth()/2 - MeasureText("JUST DO", 160)/2, GetScreenHeight()/2 - 80, 160, RL_GRAY); + DrawText("ST D", GetScreenWidth()/2 - MeasureText("JUST DO", 160)/2 + 210, GetScreenHeight()/2 - 80, 160, RL_GRAY); + DrawText("O", boundsO.x, boundsO.y + 10, 160, RL_GRAY); - DrawText("by RAMON SANTAMARIA (@raysan5)", 370, GetScreenHeight()/2 + 100, 30, Fade(LIGHTGRAY, 0.4f)); + DrawText("by RAMON SANTAMARIA (@raysan5)", 370, GetScreenHeight()/2 + 100, 30, Fade(RL_LIGHTGRAY, 0.4f)); - if (mouseOverU && !placedU) DrawRectangleLines(boundsU.x - 20, boundsU.y, boundsU.width, boundsU.height, Fade(LIGHTGRAY, 0.8f)); - //DrawRectangleBordersRec(boundsU, -20, 0, 20, Fade(RED, 0.3f)); + if (mouseOverU && !placedU) DrawRectangleLines(boundsU.x - 20, boundsU.y, boundsU.width, boundsU.height, Fade(RL_LIGHTGRAY, 0.8f)); + //DrawRectangleBordersRec(boundsU, -20, 0, 20, Fade(RL_RED, 0.3f)); - if (mouseOverO && !placedO) DrawRectangleLines(boundsO.x - 20, boundsO.y, boundsO.width, boundsO.height, Fade(LIGHTGRAY, 0.8f)); - //DrawRectangleBordersRec(boundsO, -20, 0, 20, Fade(RED, 0.3f)); + if (mouseOverO && !placedO) DrawRectangleLines(boundsO.x - 20, boundsO.y, boundsO.width, boundsO.height, Fade(RL_LIGHTGRAY, 0.8f)); + //DrawRectangleBordersRec(boundsO, -20, 0, 20, Fade(RL_RED, 0.3f)); if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 00", GetScreenWidth()/2 - MeasureText("LEVEL 00", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 00", GetScreenWidth()/2 - MeasureText("LEVEL 00", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 00", GetScreenWidth()/2 - MeasureText("LEVEL 00", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 00", GetScreenWidth()/2 - MeasureText("LEVEL 00", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level00 Screen Unload logic diff --git a/games/just_do/screens/screen_level01.c b/games/just_do/screens/screen_level01.c index 8cb76bf1d..16c9c6877 100644 --- a/games/just_do/screens/screen_level01.c +++ b/games/just_do/screens/screen_level01.c @@ -133,21 +133,21 @@ void UpdateLevel01Screen(void) void DrawLevel01Screen(void) { // Draw Level01 screen - if (!levelFinished) DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), LIGHTGRAY); - else DrawRectangle(60, 60, GetScreenWidth() - 120, GetScreenHeight() - 120, LIGHTGRAY); + if (!levelFinished) DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_LIGHTGRAY); + else DrawRectangle(60, 60, GetScreenWidth() - 120, GetScreenHeight() - 120, RL_LIGHTGRAY); - DrawRectangleRec(outerLeftRec, GRAY); - DrawRectangleRec(innerLeftRec, RAYWHITE); - DrawRectangleRec(outerRightRec, RAYWHITE); - DrawRectangleRec(innerRightRec, GRAY); + DrawRectangleRec(outerLeftRec, RL_GRAY); + DrawRectangleRec(innerLeftRec, RL_RAYWHITE); + DrawRectangleRec(outerRightRec, RL_RAYWHITE); + DrawRectangleRec(innerRightRec, RL_GRAY); if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 01", GetScreenWidth()/2 - MeasureText("LEVEL 01", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 01", GetScreenWidth()/2 - MeasureText("LEVEL 01", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 01", GetScreenWidth()/2 - MeasureText("LEVEL 01", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 01", GetScreenWidth()/2 - MeasureText("LEVEL 01", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level01 Screen Unload logic diff --git a/games/just_do/screens/screen_level02.c b/games/just_do/screens/screen_level02.c index 584edcef4..37bd0f831 100644 --- a/games/just_do/screens/screen_level02.c +++ b/games/just_do/screens/screen_level02.c @@ -128,20 +128,20 @@ void DrawLevel02Screen(void) { // Draw Level02 screen - DrawCircleV(holeCirclePos, holeCircleRadius, LIGHTGRAY); - DrawCircleV(bouncingBallPos, bouncingBallRadius, DARKGRAY); + DrawCircleV(holeCirclePos, holeCircleRadius, RL_LIGHTGRAY); + DrawCircleV(bouncingBallPos, bouncingBallRadius, RL_DARKGRAY); - DrawCircleLines(bouncingBallPos.x, bouncingBallPos.y, 120, Fade(LIGHTGRAY, 0.8f)); + DrawCircleLines(bouncingBallPos.x, bouncingBallPos.y, 120, Fade(RL_LIGHTGRAY, 0.8f)); if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 02", GetScreenWidth()/2 - MeasureText("LEVEL 02", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 02", GetScreenWidth()/2 - MeasureText("LEVEL 02", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 02", GetScreenWidth()/2 - MeasureText("LEVEL 02", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 02", GetScreenWidth()/2 - MeasureText("LEVEL 02", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level02 Screen Unload logic diff --git a/games/just_do/screens/screen_level03.c b/games/just_do/screens/screen_level03.c index 7c3aa2863..6d1c19218 100644 --- a/games/just_do/screens/screen_level03.c +++ b/games/just_do/screens/screen_level03.c @@ -107,18 +107,18 @@ void UpdateLevel03Screen(void) void DrawLevel03Screen(void) { // Draw Level03 screen - DrawRectangleRec(holeRec, GRAY); - DrawRectangleRec(pieceRec, RAYWHITE); + DrawRectangleRec(holeRec, RL_GRAY); + DrawRectangleRec(pieceRec, RL_RAYWHITE); - if (showPiece) DrawRectangleLines(pieceRec.x, pieceRec.y, pieceRec.width, pieceRec.height, Fade(LIGHTGRAY, 0.8f)); + if (showPiece) DrawRectangleLines(pieceRec.x, pieceRec.y, pieceRec.width, pieceRec.height, Fade(RL_LIGHTGRAY, 0.8f)); if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 03", GetScreenWidth()/2 - MeasureText("LEVEL 03", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 03", GetScreenWidth()/2 - MeasureText("LEVEL 03", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 03", GetScreenWidth()/2 - MeasureText("LEVEL 03", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 03", GetScreenWidth()/2 - MeasureText("LEVEL 03", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level03 Screen Unload logic diff --git a/games/just_do/screens/screen_level04.c b/games/just_do/screens/screen_level04.c index 7a8a21f12..695060e8e 100644 --- a/games/just_do/screens/screen_level04.c +++ b/games/just_do/screens/screen_level04.c @@ -121,17 +121,17 @@ void UpdateLevel04Screen(void) void DrawLevel04Screen(void) { // Draw Level04 screen here! - //DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), GRAY); - DrawCircleV(circlesCenter, outerCircleRadius, GRAY); - DrawCircleV(circlesCenter, innerCircleRadius, RAYWHITE); + //DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_GRAY); + DrawCircleV(circlesCenter, outerCircleRadius, RL_GRAY); + DrawCircleV(circlesCenter, innerCircleRadius, RL_RAYWHITE); if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 04", GetScreenWidth()/2 - MeasureText("LEVEL 04", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 04", GetScreenWidth()/2 - MeasureText("LEVEL 04", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 04", GetScreenWidth()/2 - MeasureText("LEVEL 04", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 04", GetScreenWidth()/2 - MeasureText("LEVEL 04", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level04 Screen Unload logic diff --git a/games/just_do/screens/screen_level05.c b/games/just_do/screens/screen_level05.c index 5d5d23d61..a788756f8 100644 --- a/games/just_do/screens/screen_level05.c +++ b/games/just_do/screens/screen_level05.c @@ -66,16 +66,16 @@ void InitLevel05Screen(void) } // That's a dirty hack to give sonme coherence to this puzzle... - circleColor[9] = GRAY; - circleColor[8] = RAYWHITE; - circleColor[7] = RAYWHITE; - circleColor[6] = GRAY; - circleColor[5] = RAYWHITE; - circleColor[4] = GRAY; - circleColor[3] = GRAY; - circleColor[2] = GRAY; - circleColor[1] = RAYWHITE; - circleColor[0] = GRAY; + circleColor[9] = RL_GRAY; + circleColor[8] = RL_RAYWHITE; + circleColor[7] = RL_RAYWHITE; + circleColor[6] = RL_GRAY; + circleColor[5] = RL_RAYWHITE; + circleColor[4] = RL_GRAY; + circleColor[3] = RL_GRAY; + circleColor[2] = RL_GRAY; + circleColor[1] = RL_RAYWHITE; + circleColor[0] = RL_GRAY; } // Level05 Screen Update logic @@ -94,23 +94,23 @@ void UpdateLevel05Screen(void) { if (i == 0) { - if (CheckColor(circleColor[8], GRAY)) circleColor[8] = RAYWHITE; - else circleColor[8] = GRAY; + if (CheckColor(circleColor[8], RL_GRAY)) circleColor[8] = RL_RAYWHITE; + else circleColor[8] = RL_GRAY; } else if (i == 2) { - if (CheckColor(circleColor[5], GRAY)) circleColor[5] = RAYWHITE; - else circleColor[5] = GRAY; + if (CheckColor(circleColor[5], RL_GRAY)) circleColor[5] = RL_RAYWHITE; + else circleColor[5] = RL_GRAY; } else if (i == 3) { - if (CheckColor(circleColor[6], GRAY)) circleColor[6] = RAYWHITE; - else circleColor[6] = GRAY; + if (CheckColor(circleColor[6], RL_GRAY)) circleColor[6] = RL_RAYWHITE; + else circleColor[6] = RL_GRAY; } else { - if (CheckColor(circleColor[i], GRAY)) circleColor[i] = RAYWHITE; - else circleColor[i] = GRAY; + if (CheckColor(circleColor[i], RL_GRAY)) circleColor[i] = RL_RAYWHITE; + else circleColor[i] = RL_GRAY; } return; } @@ -122,7 +122,7 @@ void UpdateLevel05Screen(void) { done = true; - if (CheckColor(circleColor[i], RAYWHITE)) + if (CheckColor(circleColor[i], RL_RAYWHITE)) { done = false; return; @@ -160,11 +160,11 @@ void DrawLevel05Screen(void) if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 05", GetScreenWidth()/2 - MeasureText("LEVEL 05", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 05", GetScreenWidth()/2 - MeasureText("LEVEL 05", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 05", GetScreenWidth()/2 - MeasureText("LEVEL 05", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 05", GetScreenWidth()/2 - MeasureText("LEVEL 05", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level05 Screen Unload logic diff --git a/games/just_do/screens/screen_level06.c b/games/just_do/screens/screen_level06.c index ec72d70c1..066330121 100644 --- a/games/just_do/screens/screen_level06.c +++ b/games/just_do/screens/screen_level06.c @@ -125,22 +125,22 @@ void UpdateLevel06Screen(void) void DrawLevel06Screen(void) { // Draw Level06 screen - DrawRectangleRec(centerRec, LIGHTGRAY); + DrawRectangleRec(centerRec, RL_LIGHTGRAY); for (int i = 0; i < 4; i++) { - DrawRectangleRec(movingRecs[i], GRAY); + DrawRectangleRec(movingRecs[i], RL_GRAY); } - if (!done && (mouseOverNum >= 0)) DrawRectangleLines(movingRecs[mouseOverNum].x - 5, movingRecs[mouseOverNum].y - 5, movingRecs[mouseOverNum].width + 10, movingRecs[mouseOverNum].height + 10, Fade(LIGHTGRAY, 0.8f)); + if (!done && (mouseOverNum >= 0)) DrawRectangleLines(movingRecs[mouseOverNum].x - 5, movingRecs[mouseOverNum].y - 5, movingRecs[mouseOverNum].width + 10, movingRecs[mouseOverNum].height + 10, Fade(RL_LIGHTGRAY, 0.8f)); if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 06", GetScreenWidth()/2 - MeasureText("LEVEL 06", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 06", GetScreenWidth()/2 - MeasureText("LEVEL 06", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 06", GetScreenWidth()/2 - MeasureText("LEVEL 06", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 06", GetScreenWidth()/2 - MeasureText("LEVEL 06", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level06 Screen Unload logic diff --git a/games/just_do/screens/screen_level07.c b/games/just_do/screens/screen_level07.c index 2ed4f9440..aad67d30e 100644 --- a/games/just_do/screens/screen_level07.c +++ b/games/just_do/screens/screen_level07.c @@ -70,9 +70,9 @@ void InitLevel07Screen(void) middleCircleActive = true; rightCircleActive = false; - leftCircleColor = GRAY; - middleCircleColor = GRAY; - rightCircleColor = GRAY; + leftCircleColor = RL_GRAY; + middleCircleColor = RL_GRAY; + rightCircleColor = RL_GRAY; } // Level07 Screen Update logic @@ -91,25 +91,25 @@ void UpdateLevel07Screen(void) if (rightCircleActive && CheckCollisionPointCircle(GetMousePosition(), leftCirclePos, circleRadius)) { - if (CheckColor(leftCircleColor, GRAY)) leftCircleColor = LIGHTGRAY; - else leftCircleColor = GRAY; + if (CheckColor(leftCircleColor, RL_GRAY)) leftCircleColor = RL_LIGHTGRAY; + else leftCircleColor = RL_GRAY; } if (middleCircleActive && CheckCollisionPointCircle(GetMousePosition(), middleCirclePos, circleRadius)) { - if (CheckColor(middleCircleColor, GRAY)) middleCircleColor = LIGHTGRAY; - else middleCircleColor = GRAY; + if (CheckColor(middleCircleColor, RL_GRAY)) middleCircleColor = RL_LIGHTGRAY; + else middleCircleColor = RL_GRAY; } if (rightCircleActive && leftCircleActive && CheckCollisionPointCircle(GetMousePosition(), rightCirclePos, circleRadius)) { - if (CheckColor(rightCircleColor, GRAY)) rightCircleColor = LIGHTGRAY; - else rightCircleColor = GRAY; + if (CheckColor(rightCircleColor, RL_GRAY)) rightCircleColor = RL_LIGHTGRAY; + else rightCircleColor = RL_GRAY; } } // Check all cicles done - if (CheckColor(leftCircleColor, LIGHTGRAY) && CheckColor(middleCircleColor, LIGHTGRAY) && CheckColor(rightCircleColor, LIGHTGRAY) && + if (CheckColor(leftCircleColor, RL_LIGHTGRAY) && CheckColor(middleCircleColor, RL_LIGHTGRAY) && CheckColor(rightCircleColor, RL_LIGHTGRAY) && !leftCircleActive && !middleCircleActive && !rightCircleActive) { done = true; @@ -140,24 +140,24 @@ void DrawLevel07Screen(void) DrawCircleV(middleCirclePos, circleRadius, middleCircleColor); DrawCircleV(rightCirclePos, circleRadius, rightCircleColor); - if (leftCircleActive) DrawCircleV(leftBtnPos, btnRadius, GRAY); - else DrawCircleV(leftBtnPos, btnRadius, LIGHTGRAY); + if (leftCircleActive) DrawCircleV(leftBtnPos, btnRadius, RL_GRAY); + else DrawCircleV(leftBtnPos, btnRadius, RL_LIGHTGRAY); - if (middleCircleActive) DrawCircleV(middleBtnPos, btnRadius, GRAY); - else DrawCircleV(middleBtnPos, btnRadius, LIGHTGRAY); + if (middleCircleActive) DrawCircleV(middleBtnPos, btnRadius, RL_GRAY); + else DrawCircleV(middleBtnPos, btnRadius, RL_LIGHTGRAY); - if (rightCircleActive) DrawCircleV(rightBtnPos, btnRadius, GRAY); - else DrawCircleV(rightBtnPos, btnRadius, LIGHTGRAY); + if (rightCircleActive) DrawCircleV(rightBtnPos, btnRadius, RL_GRAY); + else DrawCircleV(rightBtnPos, btnRadius, RL_LIGHTGRAY); if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 07", GetScreenWidth()/2 - MeasureText("LEVEL 07", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 07", GetScreenWidth()/2 - MeasureText("LEVEL 07", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 07", GetScreenWidth()/2 - MeasureText("LEVEL 07", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 07", GetScreenWidth()/2 - MeasureText("LEVEL 07", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level07 Screen Unload logic diff --git a/games/just_do/screens/screen_level08.c b/games/just_do/screens/screen_level08.c index 1caced496..67ce2e218 100644 --- a/games/just_do/screens/screen_level08.c +++ b/games/just_do/screens/screen_level08.c @@ -127,21 +127,21 @@ void UpdateLevel08Screen(void) void DrawLevel08Screen(void) { // Draw Level08 screen - DrawRectangle(1100, GetScreenHeight()/2 - 20, 40, 40, GRAY); + DrawRectangle(1100, GetScreenHeight()/2 - 20, 40, 40, RL_GRAY); - DrawRectangleRec(movingBox, LIGHTGRAY); + DrawRectangleRec(movingBox, RL_LIGHTGRAY); - if (leftColumnActive) DrawRectangleRec(leftColumnRec, GRAY); - if (middleColumnActive) DrawRectangleRec(middleColumnRec, GRAY); - if (rightColumnActive) DrawRectangleRec(rightColumnRec, GRAY); + if (leftColumnActive) DrawRectangleRec(leftColumnRec, RL_GRAY); + if (middleColumnActive) DrawRectangleRec(middleColumnRec, RL_GRAY); + if (rightColumnActive) DrawRectangleRec(rightColumnRec, RL_GRAY); if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 08", GetScreenWidth()/2 - MeasureText("LEVEL 08", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 08", GetScreenWidth()/2 - MeasureText("LEVEL 08", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 08", GetScreenWidth()/2 - MeasureText("LEVEL 08", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 08", GetScreenWidth()/2 - MeasureText("LEVEL 08", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level08 Screen Unload logic diff --git a/games/just_do/screens/screen_level09.c b/games/just_do/screens/screen_level09.c index 91b0a6f73..9e2d8453b 100644 --- a/games/just_do/screens/screen_level09.c +++ b/games/just_do/screens/screen_level09.c @@ -67,11 +67,11 @@ void InitLevel09Screen(void) activated[i] = false; - if (i%2 == 0) bwColors[i] = LIGHTGRAY; - else bwColors[i] = GRAY; + if (i%2 == 0) bwColors[i] = RL_LIGHTGRAY; + else bwColors[i] = RL_GRAY; } - bwColors[10] = RAYWHITE; + bwColors[10] = RL_RAYWHITE; } // Level09 Screen Update logic @@ -91,16 +91,16 @@ void UpdateLevel09Screen(void) { if (i == 10) { - if (CheckColor(bwColors[i], RAYWHITE)) + if (CheckColor(bwColors[i], RL_RAYWHITE)) { - bwColors[i] = LIGHTGRAY; + bwColors[i] = RL_LIGHTGRAY; enableCounter = true; resetCounter = 0; activated[1] = true; } else { - bwColors[i] = RAYWHITE; + bwColors[i] = RL_RAYWHITE; enableCounter = false; resetCounter = 5*60; @@ -111,7 +111,7 @@ void UpdateLevel09Screen(void) { if (activated[i]) { - bwColors[i] = LIGHTGRAY; + bwColors[i] = RL_LIGHTGRAY; if (i != 19) activated[i + 2] = true; } } @@ -123,13 +123,13 @@ void UpdateLevel09Screen(void) { for (int i = 0; i < NUM_BOXES; i++) { - if (i%2 == 0) bwColors[i] = LIGHTGRAY; - else bwColors[i] = GRAY; + if (i%2 == 0) bwColors[i] = RL_LIGHTGRAY; + else bwColors[i] = RL_GRAY; activated[i] = false; } - bwColors[10] = RAYWHITE; + bwColors[10] = RL_RAYWHITE; enableCounter = false; resetCounter = 0; } @@ -138,7 +138,7 @@ void UpdateLevel09Screen(void) { done = true; - if (!CheckColor(bwColors[i], LIGHTGRAY)) + if (!CheckColor(bwColors[i], RL_LIGHTGRAY)) { done = false; return; @@ -174,11 +174,11 @@ void DrawLevel09Screen(void) if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RAYWHITE, 0.6f)); - DrawText("LEVEL 09", GetScreenWidth()/2 - MeasureText("LEVEL 09", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_RAYWHITE, 0.6f)); + DrawText("LEVEL 09", GetScreenWidth()/2 - MeasureText("LEVEL 09", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 09", GetScreenWidth()/2 - MeasureText("LEVEL 09", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 09", GetScreenWidth()/2 - MeasureText("LEVEL 09", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level09 Screen Unload logic diff --git a/games/just_do/screens/screen_level10.c b/games/just_do/screens/screen_level10.c index f42b1e666..57b33ffe5 100644 --- a/games/just_do/screens/screen_level10.c +++ b/games/just_do/screens/screen_level10.c @@ -123,21 +123,21 @@ void UpdateLevel10Screen(void) void DrawLevel10Screen(void) { // Draw Level10 screen - DrawRectangle(1100, GetScreenHeight()/2 - 20, 40, 40, GRAY); + DrawRectangle(1100, GetScreenHeight()/2 - 20, 40, 40, RL_GRAY); - DrawRectangleRec(movingBox, LIGHTGRAY); + DrawRectangleRec(movingBox, RL_LIGHTGRAY); - if (leftColumnActive) DrawRectangleRec(leftColumnRec, GRAY); - if (middleColumnActive) DrawRectangleRec(middleColumnRec, GRAY); - if (rightColumnActive) DrawRectangleRec(rightColumnRec, GRAY); + if (leftColumnActive) DrawRectangleRec(leftColumnRec, RL_GRAY); + if (middleColumnActive) DrawRectangleRec(middleColumnRec, RL_GRAY); + if (rightColumnActive) DrawRectangleRec(rightColumnRec, RL_GRAY); if (levelFinished) { - DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f)); - DrawText("LEVEL 08", GetScreenWidth()/2 - MeasureText("LEVEL 08", 30)/2, 20, 30, GRAY); - DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY); + DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f)); + DrawText("LEVEL 08", GetScreenWidth()/2 - MeasureText("LEVEL 08", 30)/2, 20, 30, RL_GRAY); + DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY); } - else DrawText("LEVEL 08", GetScreenWidth()/2 - MeasureText("LEVEL 08", 30)/2, 20, 30, LIGHTGRAY); + else DrawText("LEVEL 08", GetScreenWidth()/2 - MeasureText("LEVEL 08", 30)/2, 20, 30, RL_LIGHTGRAY); } // Level10 Screen Unload logic diff --git a/games/just_do/screens/screen_logo.c b/games/just_do/screens/screen_logo.c index 1c9a9b49d..dbb1a77b2 100644 --- a/games/just_do/screens/screen_logo.c +++ b/games/just_do/screens/screen_logo.c @@ -173,42 +173,42 @@ void DrawLogoScreen(void) // Draw LOGO screen if (logoScreenState == 0) { - if ((framesCounter/15)%2) DrawRectangle(logoPositionX, logoPositionY - 60, 16, 16, BLACK); + if ((framesCounter/15)%2) DrawRectangle(logoPositionX, logoPositionY - 60, 16, 16, RL_BLACK); } else if (logoScreenState == 1) { - DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, RL_BLACK); } else if (logoScreenState == 2) { - DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, RL_BLACK); - DrawRectangle(logoPositionX + 240, logoPositionY - 60, 16, rightSideRecHeight, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, BLACK); + DrawRectangle(logoPositionX + 240, logoPositionY - 60, 16, rightSideRecHeight, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, RL_BLACK); } else if (logoScreenState == 3) { - DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 16 - 60, 16, leftSideRecHeight - 32, BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 16 - 60, 16, leftSideRecHeight - 32, RL_BLACK); - DrawRectangle(logoPositionX + 240, logoPositionY + 16 - 60, 16, rightSideRecHeight - 32, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, BLACK); + DrawRectangle(logoPositionX + 240, logoPositionY + 16 - 60, 16, rightSideRecHeight - 32, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, RL_BLACK); - DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112 - 60, 224, 224, RAYWHITE); + DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112 - 60, 224, 224, RL_RAYWHITE); - DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48 - 60, 50, BLACK); + DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48 - 60, 50, RL_BLACK); - if (!msgLogoADone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, GRAY); + if (!msgLogoADone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, RL_GRAY); else { - DrawText(msgLogoA, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, GRAY); + DrawText(msgLogoA, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, RL_GRAY); - if (!msgLogoBDone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoB, 30)/2, logoPositionY + 280, 30, GRAY); + if (!msgLogoBDone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoB, 30)/2, logoPositionY + 280, 30, RL_GRAY); else { - DrawText(msgLogoB, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 280, 30, GRAY); + DrawText(msgLogoB, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 280, 30, RL_GRAY); } } } diff --git a/games/koala_seasons/koala_seasons.c b/games/koala_seasons/koala_seasons.c index 479fab854..0ebbfc3bf 100644 --- a/games/koala_seasons/koala_seasons.c +++ b/games/koala_seasons/koala_seasons.c @@ -175,7 +175,7 @@ void UpdateTransition(void) void DrawTransition(void) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, transAlpha)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_BLACK, transAlpha)); } // Update and Draw one frame @@ -249,7 +249,7 @@ void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(WHITE); + ClearBackground(RL_WHITE); switch (currentScreen) { @@ -264,8 +264,8 @@ void UpdateDrawFrame(void) DrawFPS(20, GetScreenHeight() - 30); - DrawRectangle(GetScreenWidth() - 200, GetScreenHeight() - 50, 200, 40, Fade(WHITE, 0.6f)); - DrawText("ALPHA VERSION", GetScreenWidth() - 180, GetScreenHeight() - 40, 20, DARKGRAY); + DrawRectangle(GetScreenWidth() - 200, GetScreenHeight() - 50, 200, 40, Fade(RL_WHITE, 0.6f)); + DrawText("ALPHA VERSION", GetScreenWidth() - 180, GetScreenHeight() - 40, 20, RL_DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/games/koala_seasons/screens/screen_ending.c b/games/koala_seasons/screens/screen_ending.c index b345a3b20..82280b9f7 100644 --- a/games/koala_seasons/screens/screen_ending.c +++ b/games/koala_seasons/screens/screen_ending.c @@ -120,10 +120,10 @@ void InitEndingScreen(void) trophyButton = (Rectangle){ GetScreenWidth()*0.871, GetScreenHeight()*0.513, 123, 123}; shareButton = (Rectangle){ GetScreenWidth()*0.871, GetScreenHeight()*0.719, 123, 123}; - buttonPlayColor = WHITE; - buttonShopColor = WHITE; - buttonTrophyColor = WHITE; - buttonShareColor = WHITE; + buttonPlayColor = RL_WHITE; + buttonShopColor = RL_WHITE; + buttonTrophyColor = RL_WHITE; + buttonShareColor = RL_WHITE; currentScore = 0; seasonsCounter = 0; @@ -140,7 +140,7 @@ void InitEndingScreen(void) leafParticles[j].speed = (Vector2){ (float)GetRandomValue(-500, 500)/100, (float)GetRandomValue(-500, 500)/100 }; leafParticles[j].size = (float)GetRandomValue(3, 10)/5; leafParticles[j].rotation = GetRandomValue(0, 360); - leafParticles[j].color = WHITE; + leafParticles[j].color = RL_WHITE; leafParticles[j].alpha = 1; } @@ -352,7 +352,7 @@ void UpdateEndingScreen(void) initSeason = GetRandomValue(0, 3); } - buttonPlayColor = GOLD; + buttonPlayColor = RL_GOLD; } } break; } @@ -388,23 +388,23 @@ void UpdateEndingScreen(void) #elif (defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)) if (CheckCollisionPointRec(GetMousePosition(), playButton)) { - buttonPlayColor = GOLD; + buttonPlayColor = RL_GOLD; if (IsMouseButtonPressed(0)) { endingCounter = REPLAY; replaying = true; } } - else buttonPlayColor = WHITE; + else buttonPlayColor = RL_WHITE; - if (CheckCollisionPointRec(GetMousePosition(), shopButton)) buttonShopColor = GOLD; - else buttonShopColor = WHITE; + if (CheckCollisionPointRec(GetMousePosition(), shopButton)) buttonShopColor = RL_GOLD; + else buttonShopColor = RL_WHITE; - if (CheckCollisionPointRec(GetMousePosition(), trophyButton)) buttonTrophyColor = GOLD; - else buttonTrophyColor = WHITE; + if (CheckCollisionPointRec(GetMousePosition(), trophyButton)) buttonTrophyColor = RL_GOLD; + else buttonTrophyColor = RL_WHITE; - if (CheckCollisionPointRec(GetMousePosition(), shareButton)) buttonShareColor = GOLD; - else buttonShareColor = WHITE; + if (CheckCollisionPointRec(GetMousePosition(), shareButton)) buttonShareColor = RL_GOLD; + else buttonShareColor = RL_WHITE; #endif } @@ -417,31 +417,31 @@ void DrawEndingScreen(void) } // Frames and backgrounds - DrawTexturePro(atlas01, ending_plate_frame, (Rectangle){GetScreenWidth()*0.042, GetScreenHeight()*0.606, ending_plate_frame.width, ending_plate_frame.height}, (Vector2){ 0, 0}, 0, WHITE); - DrawTexturePro(atlas01, ending_paint_back, (Rectangle){GetScreenWidth()*0.133, GetScreenHeight()*0.097, ending_paint_back.width, ending_paint_back.height}, (Vector2){ 0, 0}, 0, WHITE); + DrawTexturePro(atlas01, ending_plate_frame, (Rectangle){GetScreenWidth()*0.042, GetScreenHeight()*0.606, ending_plate_frame.width, ending_plate_frame.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + DrawTexturePro(atlas01, ending_paint_back, (Rectangle){GetScreenWidth()*0.133, GetScreenHeight()*0.097, ending_paint_back.width, ending_paint_back.height}, (Vector2){ 0, 0}, 0, RL_WHITE); - if (killer == 0) DrawTexturePro(atlas01, ending_paint_koalafire, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalafire.width, ending_paint_koalafire.height}, (Vector2){ 0, 0}, 0, WHITE); - else if (killer == 1) DrawTexturePro(atlas01, ending_paint_koalasnake, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalasnake.width, ending_paint_koalasnake.height}, (Vector2){ 0, 0}, 0, WHITE); - else if (killer == 2) DrawTexturePro(atlas01, ending_paint_koaladingo, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koaladingo.width, ending_paint_koaladingo.height}, (Vector2){ 0, 0}, 0, WHITE); - else if (killer == 3) DrawTexturePro(atlas01, ending_paint_koalaowl, (Rectangle){GetScreenWidth()*0.2, GetScreenHeight()*0.3, ending_paint_koalaowl.width, ending_paint_koalaowl.height}, (Vector2){ 0, 0}, 0, WHITE); - else if (killer == 4) DrawTexturePro(atlas01, ending_paint_koalageneric, (Rectangle){GetScreenWidth()*0.133, GetScreenHeight()*0.171, ending_paint_koalageneric.width, ending_paint_koalageneric.height}, (Vector2){ 0, 0}, 0, WHITE); - else if (killer == 5) DrawTexturePro(atlas01, ending_paint_koalabee, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalabee.width, ending_paint_koalabee.height}, (Vector2){ 0, 0}, 0, WHITE); - else if (killer == 6) DrawTexturePro(atlas01, ending_paint_koalaeagle, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalaeagle.width, ending_paint_koalaeagle.height}, (Vector2){ 0, 0}, 0, WHITE); + if (killer == 0) DrawTexturePro(atlas01, ending_paint_koalafire, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalafire.width, ending_paint_koalafire.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + else if (killer == 1) DrawTexturePro(atlas01, ending_paint_koalasnake, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalasnake.width, ending_paint_koalasnake.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + else if (killer == 2) DrawTexturePro(atlas01, ending_paint_koaladingo, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koaladingo.width, ending_paint_koaladingo.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + else if (killer == 3) DrawTexturePro(atlas01, ending_paint_koalaowl, (Rectangle){GetScreenWidth()*0.2, GetScreenHeight()*0.3, ending_paint_koalaowl.width, ending_paint_koalaowl.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + else if (killer == 4) DrawTexturePro(atlas01, ending_paint_koalageneric, (Rectangle){GetScreenWidth()*0.133, GetScreenHeight()*0.171, ending_paint_koalageneric.width, ending_paint_koalageneric.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + else if (killer == 5) DrawTexturePro(atlas01, ending_paint_koalabee, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalabee.width, ending_paint_koalabee.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + else if (killer == 6) DrawTexturePro(atlas01, ending_paint_koalaeagle, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalaeagle.width, ending_paint_koalaeagle.height}, (Vector2){ 0, 0}, 0, RL_WHITE); - DrawTexturePro(atlas01, ending_paint_frame, (Rectangle){GetScreenWidth()*0.102, GetScreenHeight()*0.035, ending_paint_frame.width, ending_paint_frame.height}, (Vector2){ 0, 0}, 0, WHITE); + DrawTexturePro(atlas01, ending_paint_frame, (Rectangle){GetScreenWidth()*0.102, GetScreenHeight()*0.035, ending_paint_frame.width, ending_paint_frame.height}, (Vector2){ 0, 0}, 0, RL_WHITE); // UI Score planks - DrawTexturePro(atlas01, ending_score_planksmall, (Rectangle){GetScreenWidth()*0.521, GetScreenHeight()*0.163, ending_score_planksmall.width, ending_score_planksmall.height}, (Vector2){ 0, 0}, 0, WHITE); - DrawTexturePro(atlas01, ending_score_planklarge, (Rectangle){GetScreenWidth()*0.415, GetScreenHeight()*0.303, ending_score_planklarge.width, ending_score_planklarge.height}, (Vector2){ 0, 0}, 0, WHITE); - DrawTexturePro(atlas01, ending_score_planksmall, (Rectangle){GetScreenWidth()*0.521, GetScreenHeight()*0.440, ending_score_planksmall.width, ending_score_planksmall.height}, (Vector2){ 0, 0}, 0, WHITE); + DrawTexturePro(atlas01, ending_score_planksmall, (Rectangle){GetScreenWidth()*0.521, GetScreenHeight()*0.163, ending_score_planksmall.width, ending_score_planksmall.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + DrawTexturePro(atlas01, ending_score_planklarge, (Rectangle){GetScreenWidth()*0.415, GetScreenHeight()*0.303, ending_score_planklarge.width, ending_score_planklarge.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + DrawTexturePro(atlas01, ending_score_planksmall, (Rectangle){GetScreenWidth()*0.521, GetScreenHeight()*0.440, ending_score_planksmall.width, ending_score_planksmall.height}, (Vector2){ 0, 0}, 0, RL_WHITE); // UI Score icons and frames - DrawTexturePro(atlas01, ending_score_seasonicon, (Rectangle){GetScreenWidth()*0.529, GetScreenHeight()*0.096, ending_score_seasonicon.width, ending_score_seasonicon.height}, (Vector2){ 0, 0}, 0, WHITE); - DrawTexturePro(atlas01, ending_score_seasonneedle, (Rectangle){GetScreenWidth()*0.579, GetScreenHeight()*0.189, ending_score_seasonneedle.width, ending_score_seasonneedle.height}, (Vector2){ending_score_seasonneedle.width/2, ending_score_seasonneedle.height*0.9}, clockRotation, WHITE); - DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.535, GetScreenHeight()*0.11, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, WHITE); + DrawTexturePro(atlas01, ending_score_seasonicon, (Rectangle){GetScreenWidth()*0.529, GetScreenHeight()*0.096, ending_score_seasonicon.width, ending_score_seasonicon.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + DrawTexturePro(atlas01, ending_score_seasonneedle, (Rectangle){GetScreenWidth()*0.579, GetScreenHeight()*0.189, ending_score_seasonneedle.width, ending_score_seasonneedle.height}, (Vector2){ending_score_seasonneedle.width/2, ending_score_seasonneedle.height*0.9}, clockRotation, RL_WHITE); + DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.535, GetScreenHeight()*0.11, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, RL_WHITE); - DrawTexturePro(atlas01, ending_score_frameback, (Rectangle){GetScreenWidth()*0.430, GetScreenHeight()*0.246, ending_score_frameback.width, ending_score_frameback.height}, (Vector2){ 0, 0}, 0, WHITE); - DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.429, GetScreenHeight()*0.244, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, WHITE); + DrawTexturePro(atlas01, ending_score_frameback, (Rectangle){GetScreenWidth()*0.430, GetScreenHeight()*0.246, ending_score_frameback.width, ending_score_frameback.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.429, GetScreenHeight()*0.244, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, RL_WHITE); for (int i = 0; i < 20; i++) { @@ -449,15 +449,15 @@ void DrawEndingScreen(void) { DrawTexturePro(atlas01, particle_ecualyptusleaf, (Rectangle){ leafParticles[i].position.x, leafParticles[i].position.y, particle_ecualyptusleaf.width*leafParticles[i].size, particle_ecualyptusleaf.height*leafParticles[i].size }, - (Vector2){ particle_ecualyptusleaf.width/2*leafParticles[i].size, particle_ecualyptusleaf.height/2*leafParticles[i].size }, leafParticles[i].rotation, Fade(WHITE,leafParticles[i].alpha)); + (Vector2){ particle_ecualyptusleaf.width/2*leafParticles[i].size, particle_ecualyptusleaf.height/2*leafParticles[i].size }, leafParticles[i].rotation, Fade(RL_WHITE,leafParticles[i].alpha)); } } - DrawTexturePro(atlas01, ending_score_leavesicon, (Rectangle){GetScreenWidth()*0.421, GetScreenHeight()*0.228, ending_score_leavesicon.width, ending_score_leavesicon.height}, (Vector2){ 0, 0}, 0, WHITE); + DrawTexturePro(atlas01, ending_score_leavesicon, (Rectangle){GetScreenWidth()*0.421, GetScreenHeight()*0.228, ending_score_leavesicon.width, ending_score_leavesicon.height}, (Vector2){ 0, 0}, 0, RL_WHITE); - DrawTexturePro(atlas01, ending_score_frameback, (Rectangle){GetScreenWidth()*0.536, GetScreenHeight()*0.383, ending_score_frameback.width, ending_score_frameback.height}, (Vector2){ 0, 0}, 0, WHITE); - DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.535, GetScreenHeight()*0.383, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, WHITE); - DrawTexturePro(atlas01, ending_score_enemyicon, (Rectangle){GetScreenWidth()*0.538, GetScreenHeight()*0.414, ending_score_enemyicon.width, ending_score_enemyicon.height}, (Vector2){ 0, 0}, 0, WHITE); + DrawTexturePro(atlas01, ending_score_frameback, (Rectangle){GetScreenWidth()*0.536, GetScreenHeight()*0.383, ending_score_frameback.width, ending_score_frameback.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.535, GetScreenHeight()*0.383, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, RL_WHITE); + DrawTexturePro(atlas01, ending_score_enemyicon, (Rectangle){GetScreenWidth()*0.538, GetScreenHeight()*0.414, ending_score_enemyicon.width, ending_score_enemyicon.height}, (Vector2){ 0, 0}, 0, RL_WHITE); // UI Buttons DrawTexturePro(atlas01, ending_button_replay, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.096, ending_button_replay.width, ending_button_replay.height}, (Vector2){ 0, 0}, 0, buttonPlayColor); @@ -465,11 +465,11 @@ void DrawEndingScreen(void) DrawTexturePro(atlas01, ending_button_trophy, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.513, ending_button_trophy.width, ending_button_trophy.height}, (Vector2){ 0, 0}, 0, buttonTrophyColor); DrawTexturePro(atlas01, ending_button_share, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.719, ending_button_share.width, ending_button_share.height}, (Vector2){ 0, 0}, 0, buttonShareColor); - DrawTextEx(font, FormatText("%03i", seasonsCounter), (Vector2){ GetScreenWidth()*0.73f, GetScreenHeight()*0.14f }, font.baseSize, 1, WHITE); - DrawTextEx(font, FormatText("%03i", currentLeavesEnding), (Vector2){ GetScreenWidth()*0.73f, GetScreenHeight()*0.29f }, font.baseSize, 1, WHITE); - DrawTextEx(font, FormatText("%04i", currentScore), (Vector2){ GetScreenWidth()*0.715f, GetScreenHeight()*0.426f }, font.baseSize, 1, WHITE); + DrawTextEx(font, FormatText("%03i", seasonsCounter), (Vector2){ GetScreenWidth()*0.73f, GetScreenHeight()*0.14f }, font.baseSize, 1, RL_WHITE); + DrawTextEx(font, FormatText("%03i", currentLeavesEnding), (Vector2){ GetScreenWidth()*0.73f, GetScreenHeight()*0.29f }, font.baseSize, 1, RL_WHITE); + DrawTextEx(font, FormatText("%04i", currentScore), (Vector2){ GetScreenWidth()*0.715f, GetScreenHeight()*0.426f }, font.baseSize, 1, RL_WHITE); - DrawTextEx(font, FormatText("%s %i - %s %i", initMonthText, initYears, finalMonthText, finalYears), (Vector2){ GetScreenWidth()*0.1f, GetScreenHeight()*0.7f }, font.baseSize/2.0f, 1, WHITE); + DrawTextEx(font, FormatText("%s %i - %s %i", initMonthText, initYears, finalMonthText, finalYears), (Vector2){ GetScreenWidth()*0.1f, GetScreenHeight()*0.7f }, font.baseSize/2.0f, 1, RL_WHITE); for (int i = 0; i < MAX_KILLS; i++) { @@ -477,44 +477,44 @@ void DrawEndingScreen(void) { switch (killHistory[i]) { - case 1: DrawTextureRec(atlas01, ending_plate_headsnake, (Vector2){GetScreenWidth()*0.448 + ending_plate_headsnake.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break; - case 2: DrawTextureRec(atlas01, ending_plate_headdingo, (Vector2){GetScreenWidth()*0.448 + ending_plate_headdingo.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break; - case 3: DrawTextureRec(atlas01, ending_plate_headowl, (Vector2){GetScreenWidth()*0.448 + ending_plate_headowl.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break; - case 4: DrawTextureRec(atlas01, ending_plate_headbee, (Vector2){GetScreenWidth()*0.448 + ending_plate_headbee.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break; - case 5: DrawTextureRec(atlas01, ending_plate_headeagle, (Vector2){GetScreenWidth()*0.448 + ending_plate_headeagle.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break; + case 1: DrawTextureRec(atlas01, ending_plate_headsnake, (Vector2){GetScreenWidth()*0.448 + ending_plate_headsnake.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, RL_WHITE); break; + case 2: DrawTextureRec(atlas01, ending_plate_headdingo, (Vector2){GetScreenWidth()*0.448 + ending_plate_headdingo.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, RL_WHITE); break; + case 3: DrawTextureRec(atlas01, ending_plate_headowl, (Vector2){GetScreenWidth()*0.448 + ending_plate_headowl.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, RL_WHITE); break; + case 4: DrawTextureRec(atlas01, ending_plate_headbee, (Vector2){GetScreenWidth()*0.448 + ending_plate_headbee.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, RL_WHITE); break; + case 5: DrawTextureRec(atlas01, ending_plate_headeagle, (Vector2){GetScreenWidth()*0.448 + ending_plate_headeagle.width*(i%10), GetScreenHeight()*0.682 + (GetScreenHeight()*0.055)*(i/10)}, RL_WHITE); break; default: break; } } } /* - DrawText(FormatText("KOALA IS DEAD :("), GetScreenWidth()/2 - MeasureText("YOU'RE DEAD ", 60)/2, GetScreenHeight()/3, 60, RED); - DrawText(FormatText("Score: %02i - HiScore: %02i", score, hiscore),GetScreenWidth()/2 - MeasureText("Score: 00 - HiScore: 00", 60)/2, GetScreenHeight()/3 +100, 60, RED); - DrawText(FormatText("You lived: %02i years", years),GetScreenWidth()/2 - MeasureText("You lived: 00", 60)/2 + 60, GetScreenHeight()/3 +200, 30, RED); - DrawText(FormatText("%02s killed you", killer),GetScreenWidth()/2 - MeasureText("killer killed you", 60)/2 + 90, GetScreenHeight()/3 +270, 30, RED); - //DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, 0.5)); + DrawText(FormatText("KOALA IS DEAD :("), GetScreenWidth()/2 - MeasureText("YOU'RE DEAD ", 60)/2, GetScreenHeight()/3, 60, RL_RED); + DrawText(FormatText("Score: %02i - HiScore: %02i", score, hiscore),GetScreenWidth()/2 - MeasureText("Score: 00 - HiScore: 00", 60)/2, GetScreenHeight()/3 +100, 60, RL_RED); + DrawText(FormatText("You lived: %02i years", years),GetScreenWidth()/2 - MeasureText("You lived: 00", 60)/2 + 60, GetScreenHeight()/3 +200, 30, RL_RED); + DrawText(FormatText("%02s killed you", killer),GetScreenWidth()/2 - MeasureText("killer killed you", 60)/2 + 90, GetScreenHeight()/3 +270, 30, RL_RED); + //DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_BLACK, 0.5)); */ - //DrawTextEx(font, FormatText("%02s", killer), (Vector2){ GetScreenWidth()*0.08, GetScreenHeight()*0.78 }, font.baseSize/2, 1, WHITE); - if (killer == 0) DrawTextEx(font, textFire01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE); - else if (killer == 2) DrawTextEx(font, textDingo01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE); + //DrawTextEx(font, FormatText("%02s", killer), (Vector2){ GetScreenWidth()*0.08, GetScreenHeight()*0.78 }, font.baseSize/2, 1, RL_WHITE); + if (killer == 0) DrawTextEx(font, textFire01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, RL_WHITE); + else if (killer == 2) DrawTextEx(font, textDingo01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, RL_WHITE); else if (killer == 1) { - DrawTextEx(font, textSnake01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE); - DrawTextEx(font, textSnake02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, WHITE); + DrawTextEx(font, textSnake01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, RL_WHITE); + DrawTextEx(font, textSnake02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, RL_WHITE); } else if (killer == 3) { - DrawTextEx(font, textOwl01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE); - DrawTextEx(font, textOwl02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, WHITE); + DrawTextEx(font, textOwl01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, RL_WHITE); + DrawTextEx(font, textOwl02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, RL_WHITE); } - else if (killer == 4) DrawTextEx(font, textNaturalDeath01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE); + else if (killer == 4) DrawTextEx(font, textNaturalDeath01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, RL_WHITE); else if (killer == 5) { - DrawTextEx(font, textBee01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE); - DrawTextEx(font, textBee02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, WHITE); + DrawTextEx(font, textBee01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, RL_WHITE); + DrawTextEx(font, textBee02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, RL_WHITE); } - else if (killer == 6) DrawTextEx(font, textEagle, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE); + else if (killer == 6) DrawTextEx(font, textEagle, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, RL_WHITE); } // Ending Screen Unload logic diff --git a/games/koala_seasons/screens/screen_gameplay.c b/games/koala_seasons/screens/screen_gameplay.c index 383510bbd..bfe0d3734 100644 --- a/games/koala_seasons/screens/screen_gameplay.c +++ b/games/koala_seasons/screens/screen_gameplay.c @@ -995,7 +995,7 @@ void UpdateGameplayScreen(void) if (currentLeaves >= LEAVESTOTRANSFORM && !coolDown) { - flyColor = ORANGE; + flyColor = RL_ORANGE; if (leafGUIglow) { @@ -1198,7 +1198,7 @@ void UpdateGameplayScreen(void) scrollSpeed = 1.6f; speedMod = 1.2f; coolDown = true; - flyColor = GRAY; + flyColor = RL_GRAY; speedFX.active = false; } } @@ -2404,14 +2404,14 @@ void UpdateGameplayScreen(void) if (transBackAnim) { - finalColor = RED; - finalColor2 = WHITE; + finalColor = RL_RED; + finalColor2 = RL_WHITE; } if (!transBackAnim) { - finalColor = WHITE; - finalColor2 = RED; + finalColor = RL_WHITE; + finalColor2 = RL_RED; } if (transCount >= 120) @@ -2456,15 +2456,15 @@ void UpdateGameplayScreen(void) if (transBackAnim) { - finalColor = RED; + finalColor = RL_RED; } if (!transBackAnim) { - finalColor = WHITE; + finalColor = RL_WHITE; } } - else finalColor = WHITE; + else finalColor = RL_WHITE; #if (defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB)) if ((IsGestureDetected(GESTURE_HOLD) || (GetGestureDetected() == GESTURE_DRAG)) && CheckCollisionPointRec(GetTouchPosition(0), leftButton)) player.y += FLYINGMOV; @@ -2637,8 +2637,8 @@ void DrawGameplayScreen(void) for (int i = 0; i < MAX_FIRE; i++) { DrawTexturePro(atlas01, (Rectangle){gameplay_props_burnttree.x, gameplay_props_burnttree.y + fire[i].y + gameplay_props_burnttree.height/14, gameplay_props_burnttree.width, gameplay_props_burnttree.height}, - (Rectangle){fire[i].x + 5, fire[i].y + gameplay_props_burnttree.height/14, gameplay_props_burnttree.width, gameplay_props_burnttree.height}, (Vector2){0, 0}, 0, WHITE); - DrawTextureRec(atlas01, fireAnimation, (Vector2){fire[i].x, GetScreenHeight() - gameplay_props_burnttree.height/7}, WHITE); + (Rectangle){fire[i].x + 5, fire[i].y + gameplay_props_burnttree.height/14, gameplay_props_burnttree.width, gameplay_props_burnttree.height}, (Vector2){0, 0}, 0, RL_WHITE); + DrawTextureRec(atlas01, fireAnimation, (Vector2){fire[i].x, GetScreenHeight() - gameplay_props_burnttree.height/7}, RL_WHITE); for(int j = MAX_FIRE_FLAMES; j > -2; j--) { @@ -2646,17 +2646,17 @@ void DrawGameplayScreen(void) { if (j%2 > 0) { - DrawTextureRec(atlas01, fireAnimation, (Vector2){fire[i].x + fireOffset - 10, 40*j}, WHITE); + DrawTextureRec(atlas01, fireAnimation, (Vector2){fire[i].x + fireOffset - 10, 40*j}, RL_WHITE); fireAnimation.x = gameplay_props_fire_spritesheet.x + fireAnimation.width*curFrame1; } else if (j%2 + 1 == 1) { - DrawTextureRec(atlas01, fireAnimation, (Vector2){fire[i].x - fireOffset , 40*j}, WHITE); + DrawTextureRec(atlas01, fireAnimation, (Vector2){fire[i].x - fireOffset , 40*j}, RL_WHITE); fireAnimation.x = gameplay_props_fire_spritesheet.x + fireAnimation.width*curFrame2; } else { - DrawTextureRec(atlas01, fireAnimation, (Vector2){fire[i].x - fireOffset , 40*j}, WHITE); + DrawTextureRec(atlas01, fireAnimation, (Vector2){fire[i].x - fireOffset , 40*j}, RL_WHITE); fireAnimation.x = gameplay_props_fire_spritesheet.x + fireAnimation.width*curFrame3; } } @@ -2665,7 +2665,7 @@ void DrawGameplayScreen(void) for (int i = 0; i < MAX_ICE; i++) { - if (iceActive[i]) for (int k = 0; k < GetScreenHeight(); k += (GetScreenHeight()/6)) DrawTexturePro(atlas01, gameplay_props_ice_sprite, (Rectangle){ice[i].x - 5, ice[i].y+k, gameplay_props_ice_sprite.width, gameplay_props_ice_sprite.height}, (Vector2){0,0}, 0, WHITE); + if (iceActive[i]) for (int k = 0; k < GetScreenHeight(); k += (GetScreenHeight()/6)) DrawTexturePro(atlas01, gameplay_props_ice_sprite, (Rectangle){ice[i].x - 5, ice[i].y+k, gameplay_props_ice_sprite.width, gameplay_props_ice_sprite.height}, (Vector2){0,0}, 0, RL_WHITE); } BeginShaderMode(colorBlend); @@ -2677,27 +2677,27 @@ void DrawGameplayScreen(void) for (int i = 0; i < MAX_RESIN; i++) { - if (resinActive[i]) DrawTextureRec(atlas01, gameplay_props_resin_sprite,(Vector2){ resin[i].x - resin[i].width/3, resin[i].y - resin[i].height/5}, WHITE); + if (resinActive[i]) DrawTextureRec(atlas01, gameplay_props_resin_sprite,(Vector2){ resin[i].x - resin[i].width/3, resin[i].y - resin[i].height/5}, RL_WHITE); } for (int i = 0; i < MAX_ENEMIES; i++) { if (snakeActive[i]) { - if (!isHitSnake[i])DrawTextureRec(atlas01, snakeAnimation, (Vector2){snake[i].x - snake[i].width, snake[i].y - snake[i].height/2}, WHITE); - else DrawTextureRec(atlas01, (Rectangle){gameplay_enemy_snake.x + snakeAnimation.width*2, gameplay_enemy_snake.y, snakeAnimation.width, snakeAnimation.height}, (Vector2){snake[i].x - snake[i].width/2, snake[i].y - snake[i].height/2}, WHITE); + if (!isHitSnake[i])DrawTextureRec(atlas01, snakeAnimation, (Vector2){snake[i].x - snake[i].width, snake[i].y - snake[i].height/2}, RL_WHITE); + else DrawTextureRec(atlas01, (Rectangle){gameplay_enemy_snake.x + snakeAnimation.width*2, gameplay_enemy_snake.y, snakeAnimation.width, snakeAnimation.height}, (Vector2){snake[i].x - snake[i].width/2, snake[i].y - snake[i].height/2}, RL_WHITE); } if (dingoActive[i]) { - if (!isHitDingo[i]) DrawTextureRec(atlas01, dingoAnimation, (Vector2){dingo[i].x - dingo[i].width/2, dingo[i].y - dingo[i].height/4}, WHITE); - else DrawTextureRec(atlas01, (Rectangle){gameplay_enemy_dingo.x + dingoAnimation.width*2, gameplay_enemy_dingo.y, dingoAnimation.width, dingoAnimation.height}, (Vector2){dingo[i].x - dingo[i].width/2, dingo[i].y - dingo[i].height/4}, WHITE); + if (!isHitDingo[i]) DrawTextureRec(atlas01, dingoAnimation, (Vector2){dingo[i].x - dingo[i].width/2, dingo[i].y - dingo[i].height/4}, RL_WHITE); + else DrawTextureRec(atlas01, (Rectangle){gameplay_enemy_dingo.x + dingoAnimation.width*2, gameplay_enemy_dingo.y, dingoAnimation.width, dingoAnimation.height}, (Vector2){dingo[i].x - dingo[i].width/2, dingo[i].y - dingo[i].height/4}, RL_WHITE); } if (owlActive[i]) { - if (!isHitOwl[i])DrawTextureRec(atlas01, owlAnimation, (Vector2){owl[i].x - owl[i].width*0.7, owl[i].y - owl[i].height*0.1}, WHITE); - else DrawTextureRec(atlas01, (Rectangle){gameplay_enemy_owl.x + owlAnimation.width*2, gameplay_enemy_owl.y, owlAnimation.width, owlAnimation.height}, (Vector2){owl[i].x - owl[i].width/2, owl[i].y - owl[i].height/6}, WHITE); + if (!isHitOwl[i])DrawTextureRec(atlas01, owlAnimation, (Vector2){owl[i].x - owl[i].width*0.7, owl[i].y - owl[i].height*0.1}, RL_WHITE); + else DrawTextureRec(atlas01, (Rectangle){gameplay_enemy_owl.x + owlAnimation.width*2, gameplay_enemy_owl.y, owlAnimation.width, owlAnimation.height}, (Vector2){owl[i].x - owl[i].width/2, owl[i].y - owl[i].height/6}, RL_WHITE); } if (enemyHit[i].active) @@ -2717,20 +2717,20 @@ void DrawGameplayScreen(void) { if (leafSide[i]) { - if (leafType[i] == 0) DrawTextureRec(atlas01, (Rectangle){ gameplay_props_leaf_lil.x, gameplay_props_leaf_lil.y, -gameplay_props_leaf_lil.width, gameplay_props_leaf_lil.height }, (Vector2){ leaf[i].x, leaf[i].y - 15 }, WHITE); - else if (leafType[i] == 1) DrawTextureRec(atlas01, (Rectangle){ gameplay_props_leaf_lil.x, gameplay_props_leaf_lil.y, -gameplay_props_leaf_lil.width, gameplay_props_leaf_lil.height }, (Vector2){leaf[i].x, leaf[i].y + 10 }, WHITE); - else if (leafType[i] == 2) DrawTextureRec(atlas01, (Rectangle){ gameplay_props_leaf_mid.x, gameplay_props_leaf_mid.y, -gameplay_props_leaf_mid.width, gameplay_props_leaf_mid.height }, (Vector2){leaf[i].x, leaf[i].y - 15 }, WHITE); - else if (leafType[i] == 3) DrawTextureRec(atlas01, (Rectangle){ gameplay_props_leaf_big.x, gameplay_props_leaf_big.y, -gameplay_props_leaf_big.width, gameplay_props_leaf_big.height }, (Vector2){leaf[i].x, leaf[i].y - 15 }, WHITE); + if (leafType[i] == 0) DrawTextureRec(atlas01, (Rectangle){ gameplay_props_leaf_lil.x, gameplay_props_leaf_lil.y, -gameplay_props_leaf_lil.width, gameplay_props_leaf_lil.height }, (Vector2){ leaf[i].x, leaf[i].y - 15 }, RL_WHITE); + else if (leafType[i] == 1) DrawTextureRec(atlas01, (Rectangle){ gameplay_props_leaf_lil.x, gameplay_props_leaf_lil.y, -gameplay_props_leaf_lil.width, gameplay_props_leaf_lil.height }, (Vector2){leaf[i].x, leaf[i].y + 10 }, RL_WHITE); + else if (leafType[i] == 2) DrawTextureRec(atlas01, (Rectangle){ gameplay_props_leaf_mid.x, gameplay_props_leaf_mid.y, -gameplay_props_leaf_mid.width, gameplay_props_leaf_mid.height }, (Vector2){leaf[i].x, leaf[i].y - 15 }, RL_WHITE); + else if (leafType[i] == 3) DrawTextureRec(atlas01, (Rectangle){ gameplay_props_leaf_big.x, gameplay_props_leaf_big.y, -gameplay_props_leaf_big.width, gameplay_props_leaf_big.height }, (Vector2){leaf[i].x, leaf[i].y - 15 }, RL_WHITE); } else { - if (leafType[i] == 0) DrawTextureRec(atlas01, gameplay_props_leaf_lil, (Vector2){ leaf[i].x - 25, leaf[i].y - 15 }, WHITE); - else if (leafType[i] == 1) DrawTextureRec(atlas01, gameplay_props_leaf_lil, (Vector2){leaf[i].x - 25, leaf[i].y + 10 }, WHITE); - else if (leafType[i] == 2) DrawTextureRec(atlas01, gameplay_props_leaf_mid, (Vector2){leaf[i].x - 25, leaf[i].y - 15 }, WHITE); - else if (leafType[i] == 3) DrawTextureRec(atlas01, gameplay_props_leaf_big, (Vector2){leaf[i].x - 25, leaf[i].y - 15 }, WHITE); + if (leafType[i] == 0) DrawTextureRec(atlas01, gameplay_props_leaf_lil, (Vector2){ leaf[i].x - 25, leaf[i].y - 15 }, RL_WHITE); + else if (leafType[i] == 1) DrawTextureRec(atlas01, gameplay_props_leaf_lil, (Vector2){leaf[i].x - 25, leaf[i].y + 10 }, RL_WHITE); + else if (leafType[i] == 2) DrawTextureRec(atlas01, gameplay_props_leaf_mid, (Vector2){leaf[i].x - 25, leaf[i].y - 15 }, RL_WHITE); + else if (leafType[i] == 3) DrawTextureRec(atlas01, gameplay_props_leaf_big, (Vector2){leaf[i].x - 25, leaf[i].y - 15 }, RL_WHITE); } #if defined(DEBUG) - DrawRectangle(leaf[i].x, leaf[i].y, 64, 64, Fade(GREEN, 0.5f)); + DrawRectangle(leaf[i].x, leaf[i].y, 64, 64, Fade(RL_GREEN, 0.5f)); #endif } @@ -2740,20 +2740,20 @@ void DrawGameplayScreen(void) { DrawTexturePro(atlas01, particle_ecualyptusleaf, (Rectangle){ leafParticles[i].particles[j].position.x, leafParticles[i].particles[j].position.y, particle_ecualyptusleaf.width*leafParticles[i].particles[j].size, particle_ecualyptusleaf.height*leafParticles[i].particles[j].size }, - (Vector2){ particle_ecualyptusleaf.width/2*leafParticles[i].particles[j].size, particle_ecualyptusleaf.height/2*leafParticles[i].particles[j].size }, leafParticles[i].particles[j].rotation, Fade(WHITE,leafParticles[i].particles[j].alpha)); + (Vector2){ particle_ecualyptusleaf.width/2*leafParticles[i].particles[j].size, particle_ecualyptusleaf.height/2*leafParticles[i].particles[j].size }, leafParticles[i].particles[j].rotation, Fade(RL_WHITE,leafParticles[i].particles[j].alpha)); } } } - if (beeActive && !isHitBee) DrawTextureRec(atlas01, beeAnimation, (Vector2){bee.x, bee.y - gameplay_enemy_bee.height/2}, WHITE); + if (beeActive && !isHitBee) DrawTextureRec(atlas01, beeAnimation, (Vector2){bee.x, bee.y - gameplay_enemy_bee.height/2}, RL_WHITE); else if (beeActive && isHitBee) DrawTexturePro(atlas01, (Rectangle){gameplay_enemy_bee.x + beeAnimation.width*4, gameplay_enemy_bee.y, beeAnimation.width, gameplay_enemy_bee.height}, - (Rectangle){bee.x, bee.y, beeAnimation.width, gameplay_enemy_bee.height}, (Vector2){0, 0}, 0, WHITE); + (Rectangle){bee.x, bee.y, beeAnimation.width, gameplay_enemy_bee.height}, (Vector2){0, 0}, 0, RL_WHITE); - if (eagleActive && !isHitEagle) DrawTextureRec(atlas01, eagleAnimation, (Vector2){eagle.x, eagle.y}, WHITE); - else if (eagleActive && isHitEagle) DrawTextureRec(atlas01, gameplay_enemy_eagle_death, (Vector2){eagle.x, eagle.y}, WHITE); + if (eagleActive && !isHitEagle) DrawTextureRec(atlas01, eagleAnimation, (Vector2){eagle.x, eagle.y}, RL_WHITE); + else if (eagleActive && isHitEagle) DrawTextureRec(atlas01, gameplay_enemy_eagle_death, (Vector2){eagle.x, eagle.y}, RL_WHITE); - if (alertActive) DrawTexturePro(atlas01, gameplay_fx_eaglealert, alertRectangle, (Vector2){0, 0}, 0, Fade(RED, 0.7f)); - if (alertBeeActive) DrawTexturePro(atlas01, gameplay_fx_eaglealert, beeAlertRectangle, (Vector2){0, 0}, 0, Fade(ORANGE, 0.7f)); + if (alertActive) DrawTexturePro(atlas01, gameplay_fx_eaglealert, alertRectangle, (Vector2){0, 0}, 0, Fade(RL_RED, 0.7f)); + if (alertBeeActive) DrawTexturePro(atlas01, gameplay_fx_eaglealert, beeAlertRectangle, (Vector2){0, 0}, 0, Fade(RL_ORANGE, 0.7f)); if (transforming) { @@ -2776,25 +2776,25 @@ void DrawGameplayScreen(void) { switch(state) { - case GRABED: DrawTextureRec(atlas01, koalaAnimationIddle, (Vector2){player.x - player.width, player.y - gameplay_koala_idle.height/4}, WHITE); break; - case JUMPING: DrawTexturePro(atlas01, gameplay_koala_jump, (Rectangle){player.x - player.width, player.y - gameplay_koala_jump.height/4, gameplay_koala_jump.width, gameplay_koala_jump.height}, (Vector2){0, 0}, 0, WHITE); break; - case KICK:DrawTexturePro(atlas01, gameplay_koala_dash, (Rectangle){player.x - player.width, player.y - gameplay_koala_jump.height/4, gameplay_koala_dash.width, gameplay_koala_dash.height}, (Vector2){0, 0}, 0, WHITE); break; + case GRABED: DrawTextureRec(atlas01, koalaAnimationIddle, (Vector2){player.x - player.width, player.y - gameplay_koala_idle.height/4}, RL_WHITE); break; + case JUMPING: DrawTexturePro(atlas01, gameplay_koala_jump, (Rectangle){player.x - player.width, player.y - gameplay_koala_jump.height/4, gameplay_koala_jump.width, gameplay_koala_jump.height}, (Vector2){0, 0}, 0, RL_WHITE); break; + case KICK:DrawTexturePro(atlas01, gameplay_koala_dash, (Rectangle){player.x - player.width, player.y - gameplay_koala_jump.height/4, gameplay_koala_dash.width, gameplay_koala_dash.height}, (Vector2){0, 0}, 0, RL_WHITE); break; case FINALFORM: { if(transforming)DrawTexturePro(atlas01, koalaAnimationTransform, (Rectangle){player.x - player.width, player.y - gameplay_koala_transform.height/4, gameplay_koala_transform.width/2, gameplay_koala_transform.height}, (Vector2){0, 0}, 0, finalColor); - else DrawTexturePro(atlas01, koalaAnimationFly, (Rectangle){player.x - gameplay_koala_fly.width/3, player.y - gameplay_koala_fly.height/4, gameplay_koala_fly.width/2, gameplay_koala_fly.height}, (Vector2){0, 0}, 0, finalColor);//DrawTextureRec((koalaFly), (Rectangle){0, 0, 128, 128}, (Vector2){player.x - 50, player.y - 40}, WHITE); + else DrawTexturePro(atlas01, koalaAnimationFly, (Rectangle){player.x - gameplay_koala_fly.width/3, player.y - gameplay_koala_fly.height/4, gameplay_koala_fly.width/2, gameplay_koala_fly.height}, (Vector2){0, 0}, 0, finalColor);//DrawTextureRec((koalaFly), (Rectangle){0, 0, 128, 128}, (Vector2){player.x - 50, player.y - 40}, RL_WHITE); } break; - case ONWIND: DrawTexturePro(atlas01, gameplay_koala_jump, (Rectangle){player.x - player.width, player.y - gameplay_koala_jump.height/4, gameplay_koala_jump.width, gameplay_koala_jump.height}, (Vector2) { 0, 0}, 0, WHITE); break; + case ONWIND: DrawTexturePro(atlas01, gameplay_koala_jump, (Rectangle){player.x - player.width, player.y - gameplay_koala_jump.height/4, gameplay_koala_jump.width, gameplay_koala_jump.height}, (Vector2) { 0, 0}, 0, RL_WHITE); break; default: break; } } - else if (play == false && playerActive) DrawTextureRec(atlas01, (Rectangle){gameplay_koala_idle.x, gameplay_koala_idle.y, gameplay_koala_idle.width/3, gameplay_koala_idle.height}, (Vector2){player.x - player.width, player.y - gameplay_koala_idle.height/4}, WHITE); - else DrawTexturePro(atlas01, gameplay_koala_die, (Rectangle){player.x - player.width, player.y - gameplay_koala_die.height/4, gameplay_koala_die.width, gameplay_koala_die.height}, (Vector2) { 0, 0}, 0, WHITE); + else if (play == false && playerActive) DrawTextureRec(atlas01, (Rectangle){gameplay_koala_idle.x, gameplay_koala_idle.y, gameplay_koala_idle.width/3, gameplay_koala_idle.height}, (Vector2){player.x - player.width, player.y - gameplay_koala_idle.height/4}, RL_WHITE); + else DrawTexturePro(atlas01, gameplay_koala_die, (Rectangle){player.x - player.width, player.y - gameplay_koala_die.height/4, gameplay_koala_die.width, gameplay_koala_die.height}, (Vector2) { 0, 0}, 0, RL_WHITE); for (int i = 0; i < MAX_WIND; i++) { - if (windActive[i]) DrawTextureRec(atlas01, windAnimation, (Vector2){wind[i].x - 14, wind[i].y - 14}, WHITE); + if (windActive[i]) DrawTextureRec(atlas01, windAnimation, (Vector2){wind[i].x - 14, wind[i].y - 14}, RL_WHITE); } if (playerActive && !play) @@ -2836,7 +2836,7 @@ void DrawGameplayScreen(void) // Draw Speed Particles for (int i = 0; i < MAX_PARTICLES_SPEED; i++) { - if (speedFX.particle[i].active) DrawRectangle(speedFX.particle[i].position.x, speedFX.particle[i].position.y, speedFX.particle[i].size.x, speedFX.particle[i].size.y , Fade(WHITE, speedFX.particle[i].alpha)); + if (speedFX.particle[i].active) DrawRectangle(speedFX.particle[i].position.x, speedFX.particle[i].position.y, speedFX.particle[i].size.x, speedFX.particle[i].size.y , Fade(RL_WHITE, speedFX.particle[i].alpha)); } for (int i = 0; i < MAX_PARTICLES_STORM; i++) @@ -2865,23 +2865,23 @@ void DrawGameplayScreen(void) if (fogAlpha != 0) { - DrawTexturePro(atlas02, background_fog02, (Rectangle){ fogPosition, GetScreenHeight()*0.6, GetScreenWidth(), background_fog02.height}, (Vector2){ 0 , 0 }, 0, Fade(WHITE, fogAlpha)); - DrawTexturePro(atlas02, background_fog02, (Rectangle){ fogPosition+GetScreenWidth(), GetScreenHeight()*0.6, GetScreenWidth(), background_fog02.height}, (Vector2){ 0 , 0 }, 0, Fade(WHITE, fogAlpha)); + DrawTexturePro(atlas02, background_fog02, (Rectangle){ fogPosition, GetScreenHeight()*0.6, GetScreenWidth(), background_fog02.height}, (Vector2){ 0 , 0 }, 0, Fade(RL_WHITE, fogAlpha)); + DrawTexturePro(atlas02, background_fog02, (Rectangle){ fogPosition+GetScreenWidth(), GetScreenHeight()*0.6, GetScreenWidth(), background_fog02.height}, (Vector2){ 0 , 0 }, 0, Fade(RL_WHITE, fogAlpha)); } - if (filterAlpha != 0 && state != FINALFORM) DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(SKYBLUE, filterAlpha)); + if (filterAlpha != 0 && state != FINALFORM) DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_SKYBLUE, filterAlpha)); - DrawTexturePro(atlas01, gameplay_gui_leafcounter_base, (Rectangle){ 0, 0, gameplay_gui_leafcounter_base.width, gameplay_gui_leafcounter_base.height}, (Vector2){ 0 , 0 }, 0, WHITE); + DrawTexturePro(atlas01, gameplay_gui_leafcounter_base, (Rectangle){ 0, 0, gameplay_gui_leafcounter_base.width, gameplay_gui_leafcounter_base.height}, (Vector2){ 0 , 0 }, 0, RL_WHITE); DrawTexturePro(atlas01, gameplay_gui_seasonsclock_disc, (Rectangle) {GetScreenWidth(), 0, gameplay_gui_seasonsclock_disc.width, gameplay_gui_seasonsclock_disc.height}, (Vector2) {gameplay_gui_seasonsclock_disc.width/2, gameplay_gui_seasonsclock_disc.height/2}, // Draw a part of a texture defined by a rectangle with 'pro' parameters - clockRotation, Fade(WHITE, UIfade)); + clockRotation, Fade(RL_WHITE, UIfade)); - DrawTexturePro(atlas01, gameplay_gui_seasonsclock_base, (Rectangle){ (GetScreenWidth() - gameplay_gui_seasonsclock_base.width ), 0, gameplay_gui_seasonsclock_base.width, gameplay_gui_seasonsclock_base.height}, (Vector2){ 0 , 0 }, 0, Fade(WHITE, UIfade)); + DrawTexturePro(atlas01, gameplay_gui_seasonsclock_base, (Rectangle){ (GetScreenWidth() - gameplay_gui_seasonsclock_base.width ), 0, gameplay_gui_seasonsclock_base.width, gameplay_gui_seasonsclock_base.height}, (Vector2){ 0 , 0 }, 0, Fade(RL_WHITE, UIfade)); for (int i = 0; i < 20; i++) { - if (((currentLeaves/5) > i) && (state != FINALFORM)) DrawTexturePro(atlas01, gameplay_gui_leafcounter_cell, (Rectangle) {87, 83, gameplay_gui_leafcounter_cell.width, gameplay_gui_leafcounter_cell.height}, (Vector2) {gameplay_gui_leafcounter_cell.width/4, 69}, i*(-18), WHITE); - else if ((power/18 >= i) && (state == FINALFORM)) DrawTexturePro(atlas01, gameplay_gui_leafcounter_cell, (Rectangle) {87, 83, gameplay_gui_leafcounter_cell.width, gameplay_gui_leafcounter_cell.height}, (Vector2) {gameplay_gui_leafcounter_cell.width/4, 69}, i*(-18), WHITE); + if (((currentLeaves/5) > i) && (state != FINALFORM)) DrawTexturePro(atlas01, gameplay_gui_leafcounter_cell, (Rectangle) {87, 83, gameplay_gui_leafcounter_cell.width, gameplay_gui_leafcounter_cell.height}, (Vector2) {gameplay_gui_leafcounter_cell.width/4, 69}, i*(-18), RL_WHITE); + else if ((power/18 >= i) && (state == FINALFORM)) DrawTexturePro(atlas01, gameplay_gui_leafcounter_cell, (Rectangle) {87, 83, gameplay_gui_leafcounter_cell.width, gameplay_gui_leafcounter_cell.height}, (Vector2) {gameplay_gui_leafcounter_cell.width/4, 69}, i*(-18), RL_WHITE); } if ((currentLeaves >= LEAVESTOTRANSFORM) && (state != FINALFORM)) @@ -2892,20 +2892,20 @@ void DrawGameplayScreen(void) DrawTexturePro(atlas01, gameplay_gui_leafcounter_glow, (Rectangle){ 84, 83, gameplay_gui_leafcounter_glow.width, gameplay_gui_leafcounter_glow.height}, - (Vector2){ gameplay_gui_leafcounter_glow.width/2 , gameplay_gui_leafcounter_glow.height/2 }, 0, Fade(WHITE, leafGUIglowFade)); + (Vector2){ gameplay_gui_leafcounter_glow.width/2 , gameplay_gui_leafcounter_glow.height/2 }, 0, Fade(RL_WHITE, leafGUIglowFade)); } if ((play == false) && playerActive) { if (startNum == 3) DrawTexturePro(atlas01, gameplay_countdown_3, (Rectangle){ GetScreenWidth()/2, GetScreenHeight()/2, gameplay_countdown_3.width*numberScale, gameplay_countdown_3.height*numberScale}, - (Vector2){ gameplay_countdown_3.width*numberScale/2 , gameplay_countdown_3.height*numberScale/2 }, 0, Fade(RED, numberAlpha)); + (Vector2){ gameplay_countdown_3.width*numberScale/2 , gameplay_countdown_3.height*numberScale/2 }, 0, Fade(RL_RED, numberAlpha)); else if (startNum == 2) DrawTexturePro(atlas01, gameplay_countdown_2, (Rectangle){ GetScreenWidth()/2, GetScreenHeight()/2, gameplay_countdown_2.width*numberScale, gameplay_countdown_2.height*numberScale}, - (Vector2){ gameplay_countdown_2.width*numberScale/2 , gameplay_countdown_2.height*numberScale/2 }, 0, Fade(RED, leafGUIpulseFade)); + (Vector2){ gameplay_countdown_2.width*numberScale/2 , gameplay_countdown_2.height*numberScale/2 }, 0, Fade(RL_RED, leafGUIpulseFade)); else if (startNum == 1) DrawTexturePro(atlas01, gameplay_countdown_1, (Rectangle){ GetScreenWidth()/2, GetScreenHeight()/2, gameplay_countdown_1.width*numberScale, gameplay_countdown_1.height*numberScale}, - (Vector2){ gameplay_countdown_1.width*numberScale/2 , gameplay_countdown_1.height*numberScale/2 }, 0, Fade(RED, leafGUIpulseFade)); + (Vector2){ gameplay_countdown_1.width*numberScale/2 , gameplay_countdown_1.height*numberScale/2 }, 0, Fade(RL_RED, leafGUIpulseFade)); } // Draw text elements @@ -2953,60 +2953,60 @@ void DrawGameplayScreen(void) } #if defined(DEBUG) - DrawRectangle(player.x, player.y, player.width, player.height, Fade(WHITE, 0.5)); + DrawRectangle(player.x, player.y, player.width, player.height, Fade(RL_WHITE, 0.5)); for (int i = 0; i < MAX_WIND; i++) { - if (windActive[i]) DrawRectangleRec(wind[i], Fade (GRAY, 0.4)); + if (windActive[i]) DrawRectangleRec(wind[i], Fade (RL_GRAY, 0.4)); } for (int i = 0; i < MAX_ENEMIES; i++) { - if (owlActive[i]) DrawRectangleRec(owl[i], Fade(BLACK, 0.5f)); - if (dingoActive[i]) DrawRectangleRec(dingo[i], Fade(BLACK, 0.5f)); - if (snakeActive[i]) DrawRectangleRec(snake[i], BLACK); + if (owlActive[i]) DrawRectangleRec(owl[i], Fade(RL_BLACK, 0.5f)); + if (dingoActive[i]) DrawRectangleRec(dingo[i], Fade(RL_BLACK, 0.5f)); + if (snakeActive[i]) DrawRectangleRec(snake[i], RL_BLACK); } - if (beeActive) DrawRectangleRec(bee, Fade(BLACK, 0.5f)); - if (eagleActive) DrawRectangleRec(eagle, Fade(BLACK, 0.5f)); + if (beeActive) DrawRectangleRec(bee, Fade(RL_BLACK, 0.5f)); + if (eagleActive) DrawRectangleRec(eagle, Fade(RL_BLACK, 0.5f)); switch (season) { case WINTER: { - if (currentMonth == 5) DrawText("June", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RED); - if (currentMonth == 6) DrawText("July", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RED); + if (currentMonth == 5) DrawText("June", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RL_RED); + if (currentMonth == 6) DrawText("July", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RL_RED); } break; case SPRING: { - if (currentMonth == 8) DrawText("September", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RED); - if (currentMonth == 9) DrawText("October", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RED); + if (currentMonth == 8) DrawText("September", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RL_RED); + if (currentMonth == 9) DrawText("October", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RL_RED); } break; case SUMMER: { - if (currentMonth == 11) DrawText("December", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RED); - if (currentMonth == 0) DrawText("January", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RED); + if (currentMonth == 11) DrawText("December", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RL_RED); + if (currentMonth == 0) DrawText("January", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RL_RED); } break; case FALL: { - if (currentMonth == 2) DrawText("March", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RED); - if (currentMonth == 3) DrawText("April", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RED); + if (currentMonth == 2) DrawText("March", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RL_RED); + if (currentMonth == 3) DrawText("April", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RL_RED); } break; case TRANSITION: { - if (currentMonth == 4) DrawText("May", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RED); + if (currentMonth == 4) DrawText("May", GetScreenWidth() - 140, GetScreenHeight() - 20, 20, RL_RED); } break; default: break; } - DrawText(FormatText("Score: %02i", score), 140, GetScreenHeight() - 20, 20, RED); - DrawText(FormatText("HighScore: %02i", hiscore), 600, GetScreenHeight() - 20, 20, RED); - DrawText(FormatText("SeasonChange: %03i", seasonTimer), 300, GetScreenHeight() - 20, 20, RED); + DrawText(FormatText("Score: %02i", score), 140, GetScreenHeight() - 20, 20, RL_RED); + DrawText(FormatText("HighScore: %02i", hiscore), 600, GetScreenHeight() - 20, 20, RL_RED); + DrawText(FormatText("SeasonChange: %03i", seasonTimer), 300, GetScreenHeight() - 20, 20, RL_RED); #endif } @@ -3449,7 +3449,7 @@ static void Reset(void) killCounter = 0; currentLeaves = 0; clockRotation = 0; - flyColor = GRAY; + flyColor = RL_GRAY; globalFrameCounter = 0; startCounter = 0; numberAlpha = 1; @@ -3646,35 +3646,35 @@ static void Reset(void) snowParticle.particles[j].position = (Vector2){ 0, 0 }; snowParticle.particles[j].size = (float)GetRandomValue(3, 9)/10; snowParticle.particles[j].rotation = GetRandomValue(0, 360); - snowParticle.particles[j].color = WHITE; + snowParticle.particles[j].color = RL_WHITE; snowParticle.particles[j].alpha = 1.0f; backSnowParticle.particles[j].active = false; backSnowParticle.particles[j].position = (Vector2){ 0, 0 }; backSnowParticle.particles[j].size = (float)GetRandomValue(2, 8)/10; backSnowParticle.particles[j].rotation = GetRandomValue(0, 360); - backSnowParticle.particles[j].color = WHITE; + backSnowParticle.particles[j].color = RL_WHITE; backSnowParticle.particles[j].alpha = 0.7f; planetreeParticle.particles[j].active = false; planetreeParticle.particles[j].position = (Vector2){ 0, 0 }; planetreeParticle.particles[j].size = (float)GetRandomValue(3, 9)/10; planetreeParticle.particles[j].rotation = GetRandomValue(0, 360); - planetreeParticle.particles[j].color = WHITE; + planetreeParticle.particles[j].color = RL_WHITE; planetreeParticle.particles[j].alpha = 1.0f; backPlanetreeParticle.particles[j].active = false; backPlanetreeParticle.particles[j].position = (Vector2){ 0, 0 }; backPlanetreeParticle.particles[j].size = (float)GetRandomValue(2, 8)/10; backPlanetreeParticle.particles[j].rotation = GetRandomValue(0, 360); - backPlanetreeParticle.particles[j].color = WHITE; + backPlanetreeParticle.particles[j].color = RL_WHITE; backPlanetreeParticle.particles[j].alpha = 0.7f; dandelionParticle.particles[j].active = false; dandelionParticle.particles[j].position = (Vector2){ 0, 0 }; dandelionParticle.particles[j].size = (float)GetRandomValue(3, 9)/10; dandelionParticle.particles[j].rotation = 0; - dandelionParticle.particles[j].color = WHITE; + dandelionParticle.particles[j].color = RL_WHITE; dandelionParticle.particles[j].alpha = 1; dandelionParticle.particles[j].rotPhy = GetRandomValue(0 , 180); @@ -3682,7 +3682,7 @@ static void Reset(void) dandelionBackParticle.particles[j].position = (Vector2){ 0, 0 }; dandelionBackParticle.particles[j].size = (float)GetRandomValue(2, 8)/10; dandelionBackParticle.particles[j].rotation = 0; - dandelionBackParticle.particles[j].color = WHITE; + dandelionBackParticle.particles[j].color = RL_WHITE; dandelionBackParticle.particles[j].alpha = 0.7f; dandelionBackParticle.particles[j].rotPhy = GetRandomValue(0 , 180); @@ -3690,28 +3690,28 @@ static void Reset(void) flowerParticle.particles[j].position = (Vector2){ 0, 0 }; flowerParticle.particles[j].size = (float)GetRandomValue(3, 9)/10; flowerParticle.particles[j].rotation = GetRandomValue(0, 360); - flowerParticle.particles[j].color = WHITE; + flowerParticle.particles[j].color = RL_WHITE; flowerParticle.particles[j].alpha = 1.0f; backFlowerParticle.particles[j].active = false; backFlowerParticle.particles[j].position = (Vector2){ 0, 0 }; backFlowerParticle.particles[j].size = (float)GetRandomValue(2, 8)/10; backFlowerParticle.particles[j].rotation = GetRandomValue(0, 360); - backFlowerParticle.particles[j].color = WHITE; + backFlowerParticle.particles[j].color = RL_WHITE; backFlowerParticle.particles[j].alpha = 0.7f; rainParticle.particles[j].active = false; rainParticle.particles[j].position = (Vector2){ 0, 0 }; rainParticle.particles[j].size = (float)GetRandomValue(3, 9)/10; rainParticle.particles[j].rotation = -20; - rainParticle.particles[j].color = WHITE; + rainParticle.particles[j].color = RL_WHITE; rainParticle.particles[j].alpha = 1.0f; backRainParticle.particles[j].active = false; backRainParticle.particles[j].position = (Vector2){ 0, 0 }; backRainParticle.particles[j].size = (float)GetRandomValue(2, 8)/10; backRainParticle.particles[j].rotation = -20; - backRainParticle.particles[j].color = WHITE; + backRainParticle.particles[j].color = RL_WHITE; backRainParticle.particles[j].alpha = 0.7f; } @@ -3719,7 +3719,7 @@ static void Reset(void) for (int j = 0; j < MAX_PARTICLES_SPEED; j++) { speedFX.particle[j].position = (Vector2){ 0, 0 }; - speedFX.particle[j].color = WHITE; + speedFX.particle[j].color = RL_WHITE; speedFX.particle[j].alpha = 1.0f; speedFX.particle[j].size = (Vector2){GetScreenWidth(), GetRandomValue(10, 50)/10}; speedFX.particle[j].rotation = 0.0f; @@ -3732,7 +3732,7 @@ static void Reset(void) rainStormParticle.particles[j].position = (Vector2){ 0, 0 }; rainStormParticle.particles[j].size = (float)GetRandomValue(3, 9)/10; rainStormParticle.particles[j].rotation = -40; - rainStormParticle.particles[j].color = WHITE; + rainStormParticle.particles[j].color = RL_WHITE; rainStormParticle.particles[j].alpha = 1.0f; } @@ -3742,7 +3742,7 @@ static void Reset(void) snowStormParticle.particles[j].position = (Vector2){ 0, 0 }; snowStormParticle.particles[j].size = (float)GetRandomValue(2, 8)/10; snowStormParticle.particles[j].rotation = 40; - snowStormParticle.particles[j].color = WHITE; + snowStormParticle.particles[j].color = RL_WHITE; snowStormParticle.particles[j].alpha = 1.0f; } @@ -3854,7 +3854,7 @@ static void Reset(void) enemyHit[i].speed = (Vector2){ (float)GetRandomValue(-500, 500)/100, (float)GetRandomValue(-500, 500)/100 }; enemyHit[i].size = (float)GetRandomValue(1, 45)/30; enemyHit[i].rotation = GetRandomValue(0, 360); - enemyHit[i].color = RED; + enemyHit[i].color = RL_RED; enemyHit[i].alpha = 1.0f; enemyHit[i].active = false; @@ -3890,7 +3890,7 @@ static void Reset(void) leafParticles[i].particles[j].speed = (Vector2){ (float)GetRandomValue(-500, 500)/100, (float)GetRandomValue(-500, 500)/100 }; leafParticles[i].particles[j].size = (float)GetRandomValue(3, 10)/5; leafParticles[i].particles[j].rotation = GetRandomValue(0, 360); - leafParticles[i].particles[j].color = WHITE; + leafParticles[i].particles[j].color = RL_WHITE; leafParticles[i].particles[j].alpha = 1.0f; } } diff --git a/games/koala_seasons/screens/screen_logo.c b/games/koala_seasons/screens/screen_logo.c index 55785c3a5..89a07a37d 100644 --- a/games/koala_seasons/screens/screen_logo.c +++ b/games/koala_seasons/screens/screen_logo.c @@ -173,42 +173,42 @@ void DrawLogoScreen(void) // Draw LOGO screen if (logoScreenState == 0) { - if ((framesCounter/15)%2) DrawRectangle(logoPositionX, logoPositionY - 60, 16, 16, BLACK); + if ((framesCounter/15)%2) DrawRectangle(logoPositionX, logoPositionY - 60, 16, 16, RL_BLACK); } else if (logoScreenState == 1) { - DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, RL_BLACK); } else if (logoScreenState == 2) { - DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, RL_BLACK); - DrawRectangle(logoPositionX + 240, logoPositionY - 60, 16, rightSideRecHeight, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, BLACK); + DrawRectangle(logoPositionX + 240, logoPositionY - 60, 16, rightSideRecHeight, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, RL_BLACK); } else if (logoScreenState == 3) { - DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 16 - 60, 16, leftSideRecHeight - 32, BLACK); + DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 16 - 60, 16, leftSideRecHeight - 32, RL_BLACK); - DrawRectangle(logoPositionX + 240, logoPositionY + 16 - 60, 16, rightSideRecHeight - 32, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, BLACK); + DrawRectangle(logoPositionX + 240, logoPositionY + 16 - 60, 16, rightSideRecHeight - 32, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, RL_BLACK); - DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112 - 60, 224, 224, RAYWHITE); + DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112 - 60, 224, 224, RL_RAYWHITE); - DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48 - 60, 50, BLACK); + DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48 - 60, 50, RL_BLACK); - if (!msgLogoADone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, GRAY); + if (!msgLogoADone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, RL_GRAY); else { - DrawText(msgLogoA, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, GRAY); + DrawText(msgLogoA, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 230, 30, RL_GRAY); - if (!msgLogoBDone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoB, 30)/2, logoPositionY + 280, 30, GRAY); + if (!msgLogoBDone) DrawText(msgBuffer, GetScreenWidth()/2 - MeasureText(msgLogoB, 30)/2, logoPositionY + 280, 30, RL_GRAY); else { - DrawText(msgLogoB, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 280, 30, GRAY); + DrawText(msgLogoB, GetScreenWidth()/2 - MeasureText(msgLogoA, 30)/2, logoPositionY + 280, 30, RL_GRAY); } } } diff --git a/games/koala_seasons/screens/screen_title.c b/games/koala_seasons/screens/screen_title.c index c6c871b85..f72c2eadc 100644 --- a/games/koala_seasons/screens/screen_title.c +++ b/games/koala_seasons/screens/screen_title.c @@ -192,35 +192,35 @@ void InitTitleScreen(void) snowParticle.particle[j].position = (Vector2){ 0, 0 }; snowParticle.particle[j].size = (float)GetRandomValue(3, 9)/10; snowParticle.particle[j].rotation = GetRandomValue(0, 360); - snowParticle.particle[j].color = WHITE; + snowParticle.particle[j].color = RL_WHITE; snowParticle.particle[j].alpha = 1.0f; backSnowParticle.particle[j].active = false; backSnowParticle.particle[j].position = (Vector2){ 0, 0 }; backSnowParticle.particle[j].size = (float)GetRandomValue(2, 8)/10; backSnowParticle.particle[j].rotation = GetRandomValue(0, 360); - backSnowParticle.particle[j].color = WHITE; + backSnowParticle.particle[j].color = RL_WHITE; backSnowParticle.particle[j].alpha = 0.7f; planetreeParticle.particle[j].active = false; planetreeParticle.particle[j].position = (Vector2){ 0, 0 }; planetreeParticle.particle[j].size = (float)GetRandomValue(3, 9)/10; planetreeParticle.particle[j].rotation = GetRandomValue(0, 360); - planetreeParticle.particle[j].color = WHITE; + planetreeParticle.particle[j].color = RL_WHITE; planetreeParticle.particle[j].alpha = 1.0f; backPlanetreeParticle.particle[j].active = false; backPlanetreeParticle.particle[j].position = (Vector2){ 0, 0 }; backPlanetreeParticle.particle[j].size = (float)GetRandomValue(2, 8)/10; backPlanetreeParticle.particle[j].rotation = GetRandomValue(0, 360); - backPlanetreeParticle.particle[j].color = WHITE; + backPlanetreeParticle.particle[j].color = RL_WHITE; backPlanetreeParticle.particle[j].alpha = 0.7f; dandelionParticle.particle[j].active = false; dandelionParticle.particle[j].position = (Vector2){ 0, 0 }; dandelionParticle.particle[j].size = (float)GetRandomValue(3, 9)/10; dandelionParticle.particle[j].rotation = 0; - dandelionParticle.particle[j].color = WHITE; + dandelionParticle.particle[j].color = RL_WHITE; dandelionParticle.particle[j].alpha = 1; dandelionParticle.particle[j].rotPhy = GetRandomValue(0 , 180); @@ -228,7 +228,7 @@ void InitTitleScreen(void) dandelionBackParticle.particle[j].position = (Vector2){ 0, 0 }; dandelionBackParticle.particle[j].size = (float)GetRandomValue(2, 8)/10; dandelionBackParticle.particle[j].rotation = 0; - dandelionBackParticle.particle[j].color = WHITE; + dandelionBackParticle.particle[j].color = RL_WHITE; dandelionBackParticle.particle[j].alpha = 0.7f; dandelionBackParticle.particle[j].rotPhy = GetRandomValue(0 , 180); @@ -236,28 +236,28 @@ void InitTitleScreen(void) flowerParticle.particle[j].position = (Vector2){ 0, 0 }; flowerParticle.particle[j].size = (float)GetRandomValue(3, 9)/10; flowerParticle.particle[j].rotation = GetRandomValue(0, 360); - flowerParticle.particle[j].color = WHITE; + flowerParticle.particle[j].color = RL_WHITE; flowerParticle.particle[j].alpha = 1.0f; backFlowerParticle.particle[j].active = false; backFlowerParticle.particle[j].position = (Vector2){ 0, 0 }; backFlowerParticle.particle[j].size = (float)GetRandomValue(2, 8)/10; backFlowerParticle.particle[j].rotation = GetRandomValue(0, 360); - backFlowerParticle.particle[j].color = WHITE; + backFlowerParticle.particle[j].color = RL_WHITE; backFlowerParticle.particle[j].alpha = 0.7f; rainParticle.particle[j].active = false; rainParticle.particle[j].position = (Vector2){ 0, 0 }; rainParticle.particle[j].size = (float)GetRandomValue(3, 9)/10; rainParticle.particle[j].rotation = -20; - rainParticle.particle[j].color = WHITE; + rainParticle.particle[j].color = RL_WHITE; rainParticle.particle[j].alpha = 1.0f; backRainParticle.particle[j].active = false; backRainParticle.particle[j].position = (Vector2){ 0, 0 }; backRainParticle.particle[j].size = (float)GetRandomValue(2, 8)/10; backRainParticle.particle[j].rotation = -20; - backRainParticle.particle[j].color = WHITE; + backRainParticle.particle[j].color = RL_WHITE; backRainParticle.particle[j].alpha = 0.7f; } @@ -267,7 +267,7 @@ void InitTitleScreen(void) rainStormParticle.particle[j].position = (Vector2){ 0, 0 }; rainStormParticle.particle[j].size = (float)GetRandomValue(3, 9)/10; rainStormParticle.particle[j].rotation = -40; - rainStormParticle.particle[j].color = WHITE; + rainStormParticle.particle[j].color = RL_WHITE; rainStormParticle.particle[j].alpha = 1.0f; } @@ -277,7 +277,7 @@ void InitTitleScreen(void) snowStormParticle.particle[j].position = (Vector2){ 0, 0 }; snowStormParticle.particle[j].size = (float)GetRandomValue(4, 8)/10; snowStormParticle.particle[j].rotation = 40; - snowStormParticle.particle[j].color = WHITE; + snowStormParticle.particle[j].color = RL_WHITE; snowStormParticle.particle[j].alpha = 1.0f; } @@ -894,7 +894,7 @@ void DrawTitleScreen(void) if (backRayparticle.particle[i].active) DrawTexturePro(atlas02, gameplay_back_fx_lightraymid, (Rectangle){ backRayparticle.particle[i].position.x, backRayparticle.particle[i].position.y, gameplay_back_fx_lightraymid.width*backRayparticle.particle[i].size, gameplay_back_fx_lightraymid.height*backRayparticle.particle[i].size }, (Vector2){ gameplay_back_fx_lightraymid.width*backRayparticle.particle[i].size/2, gameplay_back_fx_lightraymid.height*backRayparticle.particle[i].size/2 }, backRayparticle.particle[i].rotation, - Fade(GOLD, backRayparticle.particle[i].alpha)); + Fade(RL_GOLD, backRayparticle.particle[i].alpha)); } DrawParallaxFront(); @@ -902,12 +902,12 @@ void DrawTitleScreen(void) for (int i = 0; i < 5; i++) { DrawTexturePro(atlas02, gameplay_props_tree, (Rectangle){bamboo[i].x, bamboo[i].y, 43, 720}, (Vector2){0, 0}, 0, color03); - //DrawRectangleRec(bamboo[i], Fade(LIME, 0.5)); + //DrawRectangleRec(bamboo[i], Fade(RL_LIME, 0.5)); } EndShaderMode(); - DrawTextureRec(atlas01, koalaMenu, (Vector2){player.x - player.width, player.y - 40}, WHITE); + DrawTextureRec(atlas01, koalaMenu, (Vector2){player.x - player.width, player.y - 40}, RL_WHITE); BeginShaderMode(colorBlend); @@ -915,8 +915,8 @@ void DrawTitleScreen(void) EndShaderMode(); - DrawTexturePro(atlas01, (Rectangle){title_titletext.x, title_titletext.y, title_titletext.width, 230}, (Rectangle){GetScreenWidth()*0.49F - title_titletext.width/2, currentValue1, title_titletext.width, 235}, (Vector2){0, 0}, 0, WHITE); - DrawTexturePro(atlas01, (Rectangle){title_titletext.x, title_titletext.y + 232, title_titletext.width, 116}, (Rectangle){GetScreenWidth()*0.49F - title_titletext.width/2, currentValue2, title_titletext.width, 116}, (Vector2){0, 0}, 0, WHITE); + DrawTexturePro(atlas01, (Rectangle){title_titletext.x, title_titletext.y, title_titletext.width, 230}, (Rectangle){GetScreenWidth()*0.49F - title_titletext.width/2, currentValue1, title_titletext.width, 235}, (Vector2){0, 0}, 0, RL_WHITE); + DrawTexturePro(atlas01, (Rectangle){title_titletext.x, title_titletext.y + 232, title_titletext.width, 116}, (Rectangle){GetScreenWidth()*0.49F - title_titletext.width/2, currentValue2, title_titletext.width, 116}, (Vector2){0, 0}, 0, RL_WHITE); if ((framesCounter/60)%2 && framesCounter >= duration) DrawTextEx(font, pressToPlay, (Vector2){ GetScreenWidth()/2 - fontSize.x/2, GetScreenHeight()/2 + fontSize.y*2 }, font.baseSize, 2, (Color){247, 239, 209, 255}); @@ -974,15 +974,15 @@ void DrawTitleScreen(void) } /* - DrawTexturePro(atlas01, title_twitter, (Rectangle){ GetScreenWidth()*0.85, GetScreenHeight()*0.1, title_twitter.width, title_twitter.height}, (Vector2){0,0}, 0, WHITE); - DrawTexturePro(atlas01, title_facebook, (Rectangle){ GetScreenWidth()*0.85, GetScreenHeight()*0.3, title_facebook.width, title_facebook.height}, (Vector2){0,0}, 0, WHITE); - DrawTexturePro(atlas01, title_googleplay, (Rectangle){ GetScreenWidth()*0.85, GetScreenHeight()*0.5, title_googleplay.width, title_googleplay.height}, (Vector2){0,0}, 0, WHITE); + DrawTexturePro(atlas01, title_twitter, (Rectangle){ GetScreenWidth()*0.85, GetScreenHeight()*0.1, title_twitter.width, title_twitter.height}, (Vector2){0,0}, 0, RL_WHITE); + DrawTexturePro(atlas01, title_facebook, (Rectangle){ GetScreenWidth()*0.85, GetScreenHeight()*0.3, title_facebook.width, title_facebook.height}, (Vector2){0,0}, 0, RL_WHITE); + DrawTexturePro(atlas01, title_googleplay, (Rectangle){ GetScreenWidth()*0.85, GetScreenHeight()*0.5, title_googleplay.width, title_googleplay.height}, (Vector2){0,0}, 0, RL_WHITE); - if (soundActive)DrawTexturePro(atlas01, title_music_on, (Rectangle){soundButton.x, soundButton.y, title_music_on.width, title_music_on.height}, (Vector2){0,0}, 0, WHITE); - else DrawTexturePro(atlas01, title_music_off, (Rectangle){soundButton.x, soundButton.y, title_music_off.width, title_music_off.height}, (Vector2){0,0}, 0, WHITE); + if (soundActive)DrawTexturePro(atlas01, title_music_on, (Rectangle){soundButton.x, soundButton.y, title_music_on.width, title_music_on.height}, (Vector2){0,0}, 0, RL_WHITE); + else DrawTexturePro(atlas01, title_music_off, (Rectangle){soundButton.x, soundButton.y, title_music_off.width, title_music_off.height}, (Vector2){0,0}, 0, RL_WHITE); - if (musicActive)DrawTexturePro(atlas01, title_speaker_on, (Rectangle){speakerButton.x, speakerButton.y, title_speaker_on.width, title_speaker_on.height}, (Vector2){0,0}, 0, WHITE); - else DrawTexturePro(atlas01, title_speaker_off, (Rectangle){speakerButton.x, speakerButton.y, title_speaker_off.width, title_speaker_off.height}, (Vector2){0,0}, 0, WHITE); + if (musicActive)DrawTexturePro(atlas01, title_speaker_on, (Rectangle){speakerButton.x, speakerButton.y, title_speaker_on.width, title_speaker_on.height}, (Vector2){0,0}, 0, RL_WHITE); + else DrawTexturePro(atlas01, title_speaker_off, (Rectangle){speakerButton.x, speakerButton.y, title_speaker_off.width, title_speaker_off.height}, (Vector2){0,0}, 0, RL_WHITE); */ } diff --git a/games/light_my_ritual/light_my_ritual.c b/games/light_my_ritual/light_my_ritual.c index ece51997b..37e4d61a7 100644 --- a/games/light_my_ritual/light_my_ritual.c +++ b/games/light_my_ritual/light_my_ritual.c @@ -207,7 +207,7 @@ void UpdateTransition(void) void DrawTransition(void) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, transAlpha)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_BLACK, transAlpha)); } // Update and draw game frame @@ -261,7 +261,7 @@ void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); switch(currentScreen) { diff --git a/games/light_my_ritual/screens/screen_gameplay.c b/games/light_my_ritual/screens/screen_gameplay.c index 09124402e..d5bc73af3 100644 --- a/games/light_my_ritual/screens/screen_gameplay.c +++ b/games/light_my_ritual/screens/screen_gameplay.c @@ -188,7 +188,7 @@ void InitGameplayScreen(void) player.position = (Vector2){ GetScreenWidth()/2, GetScreenHeight()/2 - 40 }; player.radius = 20; player.speed = (Vector2){5, 5}; - player.color = WHITE; + player.color = RL_WHITE; // Initialize lights positions based on lights map image data int kI = 0, kII = 0, kIII = 0; @@ -228,7 +228,7 @@ void InitGameplayScreen(void) lightsI[i].radius = 12; lightsI[i].requiredEnergy = GetRandomValue(3, 9); lightsI[i].active = false; - lightsI[i].color = GOLD; + lightsI[i].color = RL_GOLD; lightsI[i].framesCounter = 0; lightsI[i].currentFrame = 0; @@ -241,7 +241,7 @@ void InitGameplayScreen(void) lightsII[i].radius = 8; lightsII[i].requiredEnergy = GetRandomValue(3, 8); lightsII[i].active = false; - lightsII[i].color = GOLD; + lightsII[i].color = RL_GOLD; lightsII[i].framesCounter = 0; lightsII[i].currentFrame = 0; @@ -254,7 +254,7 @@ void InitGameplayScreen(void) lightsIII[i].radius = 8; lightsIII[i].requiredEnergy = GetRandomValue(4, 10); lightsIII[i].active = false; - lightsIII[i].color = GOLD; + lightsIII[i].color = RL_GOLD; lightsIII[i].framesCounter = 0; lightsIII[i].currentFrame = 0; @@ -327,7 +327,7 @@ void UpdateGameplayScreen(void) player.lightEnergy += ENERGY_REFILL_RATIO; player.color = (Color){ 255, 255, 100, 255 }; } - else player.color = WHITE; + else player.color = RL_WHITE; if (player.lightEnergy > MAX_PLAYER_ENERGY) player.lightEnergy = MAX_PLAYER_ENERGY; @@ -563,38 +563,38 @@ void UpdateGameplayScreen(void) // Gameplay Screen Draw logic void DrawGameplayScreen(void) { - DrawTexture(background, 0, 0, WHITE); + DrawTexture(background, 0, 0, RL_WHITE); // DrawText("STARS ARE ALIGNED! NO TIME TO LOOSE! LIGHT MY RITUAL!", // Draw foreground and circles - if ((currentLightedLevel == LEVEL_FINISHED) || (currentLightedLevel == LEVEL_III)) DrawTexture(foregroundIII, 0, 0, WHITE); - else if (currentLightedLevel == LEVEL_II) DrawTexture(foregroundII, 0, 0, WHITE); - else if (currentLightedLevel == LEVEL_I) DrawTexture(foregroundI, 0, 0, WHITE); + if ((currentLightedLevel == LEVEL_FINISHED) || (currentLightedLevel == LEVEL_III)) DrawTexture(foregroundIII, 0, 0, RL_WHITE); + else if (currentLightedLevel == LEVEL_II) DrawTexture(foregroundII, 0, 0, RL_WHITE); + else if (currentLightedLevel == LEVEL_I) DrawTexture(foregroundI, 0, 0, RL_WHITE); // Draw lighted circles (depends on current lighted level) switch (currentLightedLevel) { case LEVEL_FINISHED: { - DrawTexture(circleIIIon, GetScreenWidth()/2 - circleIIIon.width/2, GetScreenHeight()/2 - circleIIIon.height/2, WHITE); - DrawTexture(circleIIon, GetScreenWidth()/2 - circleIIon.width/2, GetScreenHeight()/2 - circleIIon.height/2, WHITE); - DrawTexture(circleIon, GetScreenWidth()/2 - circleIon.width/2, GetScreenHeight()/2 - circleIon.height/2, WHITE); + DrawTexture(circleIIIon, GetScreenWidth()/2 - circleIIIon.width/2, GetScreenHeight()/2 - circleIIIon.height/2, RL_WHITE); + DrawTexture(circleIIon, GetScreenWidth()/2 - circleIIon.width/2, GetScreenHeight()/2 - circleIIon.height/2, RL_WHITE); + DrawTexture(circleIon, GetScreenWidth()/2 - circleIon.width/2, GetScreenHeight()/2 - circleIon.height/2, RL_WHITE); } break; case LEVEL_III: { - DrawTexture(circleIIIoff, GetScreenWidth()/2 - circleIIIoff.width/2, GetScreenHeight()/2 - circleIIIoff.height/2, WHITE); - DrawTexture(circleIIon, GetScreenWidth()/2 - circleIIon.width/2, GetScreenHeight()/2 - circleIIon.height/2, WHITE); - DrawTexture(circleIon, GetScreenWidth()/2 - circleIon.width/2, GetScreenHeight()/2 - circleIon.height/2, WHITE); + DrawTexture(circleIIIoff, GetScreenWidth()/2 - circleIIIoff.width/2, GetScreenHeight()/2 - circleIIIoff.height/2, RL_WHITE); + DrawTexture(circleIIon, GetScreenWidth()/2 - circleIIon.width/2, GetScreenHeight()/2 - circleIIon.height/2, RL_WHITE); + DrawTexture(circleIon, GetScreenWidth()/2 - circleIon.width/2, GetScreenHeight()/2 - circleIon.height/2, RL_WHITE); } break; case LEVEL_II: { - DrawTexture(circleIIoff, GetScreenWidth()/2 - circleIIoff.width/2, GetScreenHeight()/2 - circleIIoff.height/2, WHITE); - DrawTexture(circleIon, GetScreenWidth()/2 - circleIon.width/2, GetScreenHeight()/2 - circleIon.height/2, WHITE); + DrawTexture(circleIIoff, GetScreenWidth()/2 - circleIIoff.width/2, GetScreenHeight()/2 - circleIIoff.height/2, RL_WHITE); + DrawTexture(circleIon, GetScreenWidth()/2 - circleIon.width/2, GetScreenHeight()/2 - circleIon.height/2, RL_WHITE); } break; case LEVEL_I: { - DrawTexture(circleIoff, GetScreenWidth()/2 - circleIoff.width/2, GetScreenHeight()/2 - circleIoff.height/2, WHITE); + DrawTexture(circleIoff, GetScreenWidth()/2 - circleIoff.width/2, GetScreenHeight()/2 - circleIoff.height/2, RL_WHITE); } break; default: break; } @@ -607,44 +607,44 @@ void DrawGameplayScreen(void) { for (int i = 0; i < MAX_LIGHTS_III; i++) { - //if (lightsIII[i].active) DrawCircleV(lightsIII[i].position, lightsIII[i].radius, GOLD); - //else DrawCircleLines(lightsIII[i].position.x, lightsIII[i].position.y, lightsIII[i].radius, GRAY); - DrawTextureRec(texLight, lightsIII[i].frameRec, (Vector2){ lightsIII[i].position.x - 32, lightsIII[i].position.y - 32 }, WHITE); + //if (lightsIII[i].active) DrawCircleV(lightsIII[i].position, lightsIII[i].radius, RL_GOLD); + //else DrawCircleLines(lightsIII[i].position.x, lightsIII[i].position.y, lightsIII[i].radius, RL_GRAY); + DrawTextureRec(texLight, lightsIII[i].frameRec, (Vector2){ lightsIII[i].position.x - 32, lightsIII[i].position.y - 32 }, RL_WHITE); } - for (int i = 0; i < MAX_LIGHTS_III; i++) if (lightsIII[i].active) DrawTexture(lightGlow, lightsIII[i].position.x - lightGlow.width/2, lightsIII[i].position.y - lightGlow.height/2, Fade(WHITE, 0.3f)); - for (int i = 0; i < MAX_LIGHTS_III; i++) DrawText(FormatText("%02i", lightsIII[i].requiredEnergy), lightsIII[i].position.x - 10, lightsIII[i].position.y + 14, 20, lightsIII[i].active ? GRAY : YELLOW); + for (int i = 0; i < MAX_LIGHTS_III; i++) if (lightsIII[i].active) DrawTexture(lightGlow, lightsIII[i].position.x - lightGlow.width/2, lightsIII[i].position.y - lightGlow.height/2, Fade(RL_WHITE, 0.3f)); + for (int i = 0; i < MAX_LIGHTS_III; i++) DrawText(FormatText("%02i", lightsIII[i].requiredEnergy), lightsIII[i].position.x - 10, lightsIII[i].position.y + 14, 20, lightsIII[i].active ? RL_GRAY : RL_YELLOW); } case LEVEL_II: { for (int i = 0; i < MAX_LIGHTS_II; i++) { - //if (lightsII[i].active) DrawCircleV(lightsII[i].position, lightsII[i].radius, GOLD); - //else DrawCircleLines(lightsI[i].position.x, lightsI[i].position.y, lightsI[i].radius, GRAY); - DrawTextureRec(texLight, lightsII[i].frameRec, (Vector2){ lightsII[i].position.x - 32, lightsII[i].position.y - 32 }, WHITE); + //if (lightsII[i].active) DrawCircleV(lightsII[i].position, lightsII[i].radius, RL_GOLD); + //else DrawCircleLines(lightsI[i].position.x, lightsI[i].position.y, lightsI[i].radius, RL_GRAY); + DrawTextureRec(texLight, lightsII[i].frameRec, (Vector2){ lightsII[i].position.x - 32, lightsII[i].position.y - 32 }, RL_WHITE); } - for (int i = 0; i < MAX_LIGHTS_II; i++) if (lightsII[i].active) DrawTexture(lightGlow, lightsII[i].position.x - lightGlow.width/2, lightsII[i].position.y - lightGlow.height/2, Fade(WHITE, 0.3f)); - for (int i = 0; i < MAX_LIGHTS_II; i++) DrawText(FormatText("%02i", lightsII[i].requiredEnergy), lightsII[i].position.x - 10, lightsII[i].position.y + 14, 20, lightsII[i].active ? GRAY : YELLOW); + for (int i = 0; i < MAX_LIGHTS_II; i++) if (lightsII[i].active) DrawTexture(lightGlow, lightsII[i].position.x - lightGlow.width/2, lightsII[i].position.y - lightGlow.height/2, Fade(RL_WHITE, 0.3f)); + for (int i = 0; i < MAX_LIGHTS_II; i++) DrawText(FormatText("%02i", lightsII[i].requiredEnergy), lightsII[i].position.x - 10, lightsII[i].position.y + 14, 20, lightsII[i].active ? RL_GRAY : RL_YELLOW); } case LEVEL_I: { for (int i = 0; i < MAX_LIGHTS_I; i++) { - //if (lightsI[i].active) DrawCircleV(lightsI[i].position, lightsI[i].radius, GOLD); - //else DrawCircleLines(lightsI[i].position.x, lightsI[i].position.y, lightsI[i].radius, GRAY); - DrawTextureRec(texLight, lightsI[i].frameRec, (Vector2){ lightsI[i].position.x - 32, lightsI[i].position.y - 32 }, WHITE); + //if (lightsI[i].active) DrawCircleV(lightsI[i].position, lightsI[i].radius, RL_GOLD); + //else DrawCircleLines(lightsI[i].position.x, lightsI[i].position.y, lightsI[i].radius, RL_GRAY); + DrawTextureRec(texLight, lightsI[i].frameRec, (Vector2){ lightsI[i].position.x - 32, lightsI[i].position.y - 32 }, RL_WHITE); } - for (int i = 0; i < MAX_LIGHTS_I; i++) if (lightsI[i].active) DrawTexture(lightGlow, lightsI[i].position.x - lightGlow.width/2, lightsI[i].position.y - lightGlow.height/2, Fade(WHITE, 0.3f)); - for (int i = 0; i < MAX_LIGHTS_I; i++) DrawText(FormatText("%02i", lightsI[i].requiredEnergy), lightsI[i].position.x - 10, lightsI[i].position.y + 14, 20, lightsI[i].active ? GRAY : YELLOW); + for (int i = 0; i < MAX_LIGHTS_I; i++) if (lightsI[i].active) DrawTexture(lightGlow, lightsI[i].position.x - lightGlow.width/2, lightsI[i].position.y - lightGlow.height/2, Fade(RL_WHITE, 0.3f)); + for (int i = 0; i < MAX_LIGHTS_I; i++) DrawText(FormatText("%02i", lightsI[i].requiredEnergy), lightsI[i].position.x - 10, lightsI[i].position.y + 14, 20, lightsI[i].active ? RL_GRAY : RL_YELLOW); } default: break; } // Draw main lighter - DrawTexture(book, GetScreenWidth()/2 - book.width/2, GetScreenHeight()/2, WHITE); - DrawTexture(lightRay, GetScreenWidth()/2 - lightRay.width/2, 0, Fade(WHITE, 0.5f)); + DrawTexture(book, GetScreenWidth()/2 - book.width/2, GetScreenHeight()/2, RL_WHITE); + DrawTexture(lightRay, GetScreenWidth()/2 - lightRay.width/2, 0, Fade(RL_WHITE, 0.5f)); // Draw player //DrawCircleV(player.position, player.radius, player.color); @@ -658,56 +658,56 @@ void DrawGameplayScreen(void) if (enemies[i].active) { //DrawCircleV(enemies[i].position, enemies[i].radius, enemies[i].color); - DrawTextureRec(texEnemy, (Rectangle){ 0, 0, 64, 64 }, (Vector2){ enemies[i].position.x - 32, enemies[i].position.y - 32 }, WHITE); + DrawTextureRec(texEnemy, (Rectangle){ 0, 0, 64, 64 }, (Vector2){ enemies[i].position.x - 32, enemies[i].position.y - 32 }, RL_WHITE); } } // Draw time left for ritual - DrawTextEx(font, FormatText("%02.2f", (99.0f - ritualTime)), (Vector2){ 560, 20 }, font.baseSize, 0, WHITE); + DrawTextEx(font, FormatText("%02.2f", (99.0f - ritualTime)), (Vector2){ 560, 20 }, font.baseSize, 0, RL_WHITE); // Draw light energy bar - DrawRectangle(20, 30, 400, 20, GRAY); - DrawRectangle(20, 30, (400*player.lightEnergy)/MAX_PLAYER_ENERGY, 20, GOLD); - DrawRectangleLines(20, 30, 400, 20, LIGHTGRAY); - DrawText(FormatText("%03.0f", player.lightEnergy), 430, 30, 20, WHITE); + DrawRectangle(20, 30, 400, 20, RL_GRAY); + DrawRectangle(20, 30, (400*player.lightEnergy)/MAX_PLAYER_ENERGY, 20, RL_GOLD); + DrawRectangleLines(20, 30, 400, 20, RL_LIGHTGRAY); + DrawText(FormatText("%03.0f", player.lightEnergy), 430, 30, 20, RL_WHITE); // Draw level lighted bar (for completion) - DrawRectangle(GetScreenWidth() - 40, 30, 20, 660, GRAY); - DrawRectangle(GetScreenWidth() - 40, 30 + 660 - 660*currentLightEnergy/maxLightEnergy, 20, 660*currentLightEnergy/maxLightEnergy, YELLOW); - DrawRectangleLines(GetScreenWidth() - 40, 30, 20, 660, LIGHTGRAY); + DrawRectangle(GetScreenWidth() - 40, 30, 20, 660, RL_GRAY); + DrawRectangle(GetScreenWidth() - 40, 30 + 660 - 660*currentLightEnergy/maxLightEnergy, 20, 660*currentLightEnergy/maxLightEnergy, RL_YELLOW); + DrawRectangleLines(GetScreenWidth() - 40, 30, 20, 660, RL_LIGHTGRAY); // Show message: "You run out of light!!!" if player.lightEnergy <= 0 if (player.lightEnergy < 2) { - if ((framesCounter/20)%2) DrawTextEx(font, "YOU'RE RUNNING OUT OF LIGHT!", (Vector2){ 20, 60 }, font.baseSize/2, 0, WHITE); + if ((framesCounter/20)%2) DrawTextEx(font, "YOU'RE RUNNING OUT OF LIGHT!", (Vector2){ 20, 60 }, font.baseSize/2, 0, RL_WHITE); } } else if (!timeOver) // LEVEL_FINISHED { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, 0.4f)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_BLACK, 0.4f)); // Wait some time before jumping to ending: raylib - DrawTexture(texRitual, GetScreenWidth()/2 - texRitual.width/2, 100, WHITE); - DrawTextEx(font, FormatText("BEST LIGHTING TIME: %02.2f", ritualTime), (Vector2){ 320, 340 }, 50, 0, WHITE); - DrawTextEx(font, "PRESS ENTER to START the RITUAL", (Vector2){ 160, 480 }, 60, 0, WHITE); + DrawTexture(texRitual, GetScreenWidth()/2 - texRitual.width/2, 100, RL_WHITE); + DrawTextEx(font, FormatText("BEST LIGHTING TIME: %02.2f", ritualTime), (Vector2){ 320, 340 }, 50, 0, RL_WHITE); + DrawTextEx(font, "PRESS ENTER to START the RITUAL", (Vector2){ 160, 480 }, 60, 0, RL_WHITE); if (IsKeyPressed(KEY_ENTER)) startRitual = true; } if (timeOver) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, 0.4f)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_BLACK, 0.4f)); - DrawTexture(texTimeOver, GetScreenWidth()/2 - texTimeOver.width/2, 140, WHITE); - DrawTextEx(font, FormatText("NEXT STARS ALIGNMENT IN %i YEARS", nextStarsAlignment), (Vector2){ 200, 360 }, 50, 0, WHITE); - DrawTextEx(font, "PRESS ENTER to GO HOME...", (Vector2){ 260, 480 }, 60, 0, WHITE); + DrawTexture(texTimeOver, GetScreenWidth()/2 - texTimeOver.width/2, 140, RL_WHITE); + DrawTextEx(font, FormatText("NEXT STARS ALIGNMENT IN %i YEARS", nextStarsAlignment), (Vector2){ 200, 360 }, 50, 0, RL_WHITE); + DrawTextEx(font, "PRESS ENTER to GO HOME...", (Vector2){ 260, 480 }, 60, 0, RL_WHITE); if (IsKeyPressed(KEY_ENTER)) finishScreen = 2; } - if (startRitual) DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, alphaRitual)); + if (startRitual) DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_RAYWHITE, alphaRitual)); - if (pause) DrawTextEx(font, "RITUAL PAUSED", (Vector2){ GetScreenWidth()/2 - MeasureText("RITUAL PAUSED", 40)/2, 110 }, 50, 0, WHITE); + if (pause) DrawTextEx(font, "RITUAL PAUSED", (Vector2){ GetScreenWidth()/2 - MeasureText("RITUAL PAUSED", 40)/2, 110 }, 50, 0, RL_WHITE); } // Gameplay Screen Unload logic @@ -790,7 +790,7 @@ static void EnemyReset(Enemy *enemy) { enemy->active = false; enemy->framesCounter = 0; - enemy->color = RED; + enemy->color = RL_RED; enemy->radius = 10; int side = GetRandomValue(0, 1); diff --git a/games/light_my_ritual/screens/screen_logo_raylib.c b/games/light_my_ritual/screens/screen_logo_raylib.c index 87a2282e4..ec93356c6 100644 --- a/games/light_my_ritual/screens/screen_logo_raylib.c +++ b/games/light_my_ritual/screens/screen_logo_raylib.c @@ -155,46 +155,46 @@ void rlDrawLogoScreen(void) { if (state == 0) { - if ((framesCounter/10)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, BLACK); + if ((framesCounter/10)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, RL_BLACK); } else if (state == 1) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); } else if (state == 2) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); - DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, BLACK); + DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, RL_BLACK); } else if (state == 3) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(RL_BLACK, alpha)); - DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(RL_BLACK, alpha)); - DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha)); + DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RL_RAYWHITE, alpha)); - DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha)); + DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(RL_BLACK, alpha)); } else if (state == 4) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(RL_BLACK, alpha)); - DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(RL_BLACK, alpha)); - DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha)); + DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RL_RAYWHITE, alpha)); - DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha)); + DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(RL_BLACK, alpha)); - if (framesCounter > 20) DrawText("powered by", logoPositionX, logoPositionY - 27, 20, Fade(DARKGRAY, alpha)); + if (framesCounter > 20) DrawText("powered by", logoPositionX, logoPositionY - 27, 20, Fade(RL_DARKGRAY, alpha)); } } diff --git a/games/light_my_ritual/screens/screen_title.c b/games/light_my_ritual/screens/screen_title.c index bcf53f518..8d7af0800 100644 --- a/games/light_my_ritual/screens/screen_title.c +++ b/games/light_my_ritual/screens/screen_title.c @@ -80,12 +80,12 @@ void DrawTitleScreen(void) { DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), (Color){ 26, 26, 26, 255 }); - DrawTexture(background, GetScreenWidth()/2 - background.width/2, 0, WHITE); - DrawTexture(title, GetScreenWidth()/2 - title.width/2, 30, Fade(WHITE, titleAlpha)); + DrawTexture(background, GetScreenWidth()/2 - background.width/2, 0, RL_WHITE); + DrawTexture(title, GetScreenWidth()/2 - title.width/2, 30, Fade(RL_WHITE, titleAlpha)); - DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 20, GetScreenHeight() - 40, 20, LIGHTGRAY); + DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 20, GetScreenHeight() - 40, 20, RL_LIGHTGRAY); - if ((framesCounter > 180) && ((framesCounter/40)%2)) DrawTextEx(font, "PRESS ENTER to START LIGHTING", (Vector2){ 230, 450 }, font.baseSize, -2, WHITE); + if ((framesCounter > 180) && ((framesCounter/40)%2)) DrawTextEx(font, "PRESS ENTER to START LIGHTING", (Vector2){ 230, 450 }, font.baseSize, -2, RL_WHITE); } // Title Screen Unload logic diff --git a/games/missile_commander.c b/games/missile_commander.c index 15e06f6d5..2c0d57545 100644 --- a/games/missile_commander.c +++ b/games/missile_commander.c @@ -392,7 +392,7 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { @@ -401,9 +401,9 @@ void DrawGame(void) { if (missile[i].active) { - DrawLine(missile[i].origin.x, missile[i].origin.y, missile[i].position.x, missile[i].position.y, RED); + DrawLine(missile[i].origin.x, missile[i].origin.y, missile[i].position.x, missile[i].position.y, RL_RED); - if (framesCounter % 16 < 8) DrawCircle(missile[i].position.x, missile[i].position.y, 3, YELLOW); + if (framesCounter % 16 < 8) DrawCircle(missile[i].position.x, missile[i].position.y, 3, RL_YELLOW); } } @@ -412,9 +412,9 @@ void DrawGame(void) { if (interceptor[i].active) { - DrawLine(interceptor[i].origin.x, interceptor[i].origin.y, interceptor[i].position.x, interceptor[i].position.y, GREEN); + DrawLine(interceptor[i].origin.x, interceptor[i].origin.y, interceptor[i].position.x, interceptor[i].position.y, RL_GREEN); - if (framesCounter % 16 < 8) DrawCircle(interceptor[i].position.x, interceptor[i].position.y, 3, BLUE); + if (framesCounter % 16 < 8) DrawCircle(interceptor[i].position.x, interceptor[i].position.y, 3, RL_BLUE); } } @@ -427,20 +427,20 @@ void DrawGame(void) // Draw buildings and launchers for (int i = 0; i < LAUNCHERS_AMOUNT; i++) { - if (launcher[i].active) DrawRectangle(launcher[i].position.x - LAUNCHER_SIZE/2, launcher[i].position.y - LAUNCHER_SIZE/2, LAUNCHER_SIZE, LAUNCHER_SIZE, GRAY); + if (launcher[i].active) DrawRectangle(launcher[i].position.x - LAUNCHER_SIZE/2, launcher[i].position.y - LAUNCHER_SIZE/2, LAUNCHER_SIZE, LAUNCHER_SIZE, RL_GRAY); } for (int i = 0; i < BUILDINGS_AMOUNT; i++) { - if (building[i].active) DrawRectangle(building[i].position.x - BUILDING_SIZE/2, building[i].position.y - BUILDING_SIZE/2, BUILDING_SIZE, BUILDING_SIZE, LIGHTGRAY); + if (building[i].active) DrawRectangle(building[i].position.x - BUILDING_SIZE/2, building[i].position.y - BUILDING_SIZE/2, BUILDING_SIZE, BUILDING_SIZE, RL_LIGHTGRAY); } // Draw score - DrawText(FormatText("SCORE %4i", score), 20, 20, 40, LIGHTGRAY); + DrawText(FormatText("SCORE %4i", score), 20, 20, 40, RL_LIGHTGRAY); - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); } diff --git a/games/pang.c b/games/pang.c index dbf3bf7bb..1f42d64a3 100644 --- a/games/pang.c +++ b/games/pang.c @@ -551,7 +551,7 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { @@ -559,33 +559,33 @@ void DrawGame(void) Vector2 v1 = { player.position.x + sinf(player.rotation*RL_DEG2RAD)*(shipHeight), player.position.y - cosf(player.rotation*RL_DEG2RAD)*(shipHeight) }; Vector2 v2 = { player.position.x - cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y - sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) }; Vector2 v3 = { player.position.x + cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y + sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) }; - DrawTriangle(v1, v2, v3, MAROON); + DrawTriangle(v1, v2, v3, RL_MAROON); // Draw meteors (big) for (int i = 0;i < MAX_BIG_BALLS; i++) { - if (bigBalls[i].active) DrawCircleV(bigBalls[i].position, bigBalls[i].radius, DARKGRAY); - else DrawCircleV(bigBalls[i].position, bigBalls[i].radius, Fade(LIGHTGRAY, 0.3f)); + if (bigBalls[i].active) DrawCircleV(bigBalls[i].position, bigBalls[i].radius, RL_DARKGRAY); + else DrawCircleV(bigBalls[i].position, bigBalls[i].radius, Fade(RL_LIGHTGRAY, 0.3f)); } // Draw meteors (medium) for (int i = 0;i < MAX_BIG_BALLS*2; i++) { - if (mediumBalls[i].active) DrawCircleV(mediumBalls[i].position, mediumBalls[i].radius, GRAY); - else DrawCircleV(mediumBalls[i].position, mediumBalls[i].radius, Fade(LIGHTGRAY, 0.3f)); + if (mediumBalls[i].active) DrawCircleV(mediumBalls[i].position, mediumBalls[i].radius, RL_GRAY); + else DrawCircleV(mediumBalls[i].position, mediumBalls[i].radius, Fade(RL_LIGHTGRAY, 0.3f)); } // Draw meteors (small) for (int i = 0;i < MAX_BIG_BALLS*4; i++) { - if (smallBalls[i].active) DrawCircleV(smallBalls[i].position, smallBalls[i].radius, GRAY); - else DrawCircleV(smallBalls[i].position, smallBalls[i].radius, Fade(LIGHTGRAY, 0.3f)); + if (smallBalls[i].active) DrawCircleV(smallBalls[i].position, smallBalls[i].radius, RL_GRAY); + else DrawCircleV(smallBalls[i].position, smallBalls[i].radius, Fade(RL_LIGHTGRAY, 0.3f)); } // Draw shoot for (int i = 0; i < PLAYER_MAX_SHOOTS; i++) { - if (shoot[i].active) DrawLine(linePosition.x, linePosition.y, shoot[i].position.x, shoot[i].position.y, RED); + if (shoot[i].active) DrawLine(linePosition.x, linePosition.y, shoot[i].position.x, shoot[i].position.y, RL_RED); } // Draw score points @@ -593,22 +593,22 @@ void DrawGame(void) { if (points[z].alpha > 0.0f) { - DrawText(FormatText("+%02i", points[z].value), points[z].position.x, points[z].position.y, 20, Fade(BLUE, points[z].alpha)); + DrawText(FormatText("+%02i", points[z].value), points[z].position.x, points[z].position.y, 20, Fade(RL_BLUE, points[z].alpha)); } } // Draw score (UI) - DrawText(FormatText("SCORE: %i", score), 10, 10, 20, LIGHTGRAY); + DrawText(FormatText("SCORE: %i", score), 10, 10, 20, RL_LIGHTGRAY); if (victory) { - DrawText("YOU WIN!", screenWidth/2 - MeasureText("YOU WIN!", 60)/2, 100, 60, LIGHTGRAY); - DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, LIGHTGRAY); + DrawText("YOU WIN!", screenWidth/2 - MeasureText("YOU WIN!", 60)/2, 100, 60, RL_LIGHTGRAY); + DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_LIGHTGRAY); } - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, LIGHTGRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_LIGHTGRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, LIGHTGRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_LIGHTGRAY); EndDrawing(); } diff --git a/games/skully_escape/monster.c b/games/skully_escape/monster.c index 469cd9ca6..1efc04ed4 100644 --- a/games/skully_escape/monster.c +++ b/games/skully_escape/monster.c @@ -1,6 +1,6 @@ /*********************************************************************************** * -* KING GAME JAM - GRAY TEAM +* KING GAME JAM - RL_GRAY TEAM * * * @@ -44,8 +44,8 @@ void DrawMonster(Monster monster, int scroll) { Vector2 scrollPos = { monster.position.x - scroll, monster.position.y }; - if (monster.selected) DrawTextureRec(monster.texture, monster.frameRec, scrollPos, RED); - else DrawTextureRec(monster.texture, monster.frameRec, scrollPos, WHITE); + if (monster.selected) DrawTextureRec(monster.texture, monster.frameRec, scrollPos, RL_RED); + else DrawTextureRec(monster.texture, monster.frameRec, scrollPos, RL_WHITE); } void UnloadMonster(Monster monster) diff --git a/games/skully_escape/player.c b/games/skully_escape/player.c index 857ff5388..363cad113 100644 --- a/games/skully_escape/player.c +++ b/games/skully_escape/player.c @@ -1,6 +1,6 @@ /*********************************************************************************** * -* KING GAME JAM - GRAY TEAM +* KING GAME JAM - RL_GRAY TEAM * * * @@ -191,10 +191,10 @@ void UpdatePlayer(void) // void DrawPlayer(void) { - DrawTextureRec(player.texture, player.frameRec, player.position, WHITE); + DrawTextureRec(player.texture, player.frameRec, player.position, RL_WHITE); // Draw mouse pointer on click - if (pointerAnim) DrawCircleV(pointerPosition, 20, Fade(RED, pointerAlpha)); + if (pointerAnim) DrawCircleV(pointerPosition, 20, Fade(RL_RED, pointerAlpha)); DrawLifes(); } @@ -275,7 +275,7 @@ static void DrawLifes(void) for(int i = 0; i < player.numLifes; i++) { - DrawTexture(texLife, position.x + i*texLife.width, position.y, Fade(RAYWHITE, 0.7f)); + DrawTexture(texLife, position.x + i*texLife.width, position.y, Fade(RL_RAYWHITE, 0.7f)); } } } \ No newline at end of file diff --git a/games/skully_escape/screens/screen_aisle01.c b/games/skully_escape/screens/screen_aisle01.c index 78bb20c48..165def40d 100644 --- a/games/skully_escape/screens/screen_aisle01.c +++ b/games/skully_escape/screens/screen_aisle01.c @@ -337,7 +337,7 @@ void UpdateAisle01Screen(void) // Gameplay Screen Draw logic void DrawAisle01Screen(void) { - DrawTexture(background, -scroll, 0, WHITE); + DrawTexture(background, -scroll, 0, RL_WHITE); // Draw monsters DrawMonster(lamp, scroll); @@ -345,47 +345,47 @@ void DrawAisle01Screen(void) // Draw door Vector2 doorScrollPos = { doorCenter.position.x - scroll, doorCenter.position.y }; - if (doorCenter.selected) DrawTextureRec(doors, doorCenter.frameRec, doorScrollPos, GREEN); - else DrawTextureRec(doors, doorCenter.frameRec, doorScrollPos, WHITE); + if (doorCenter.selected) DrawTextureRec(doors, doorCenter.frameRec, doorScrollPos, RL_GREEN); + else DrawTextureRec(doors, doorCenter.frameRec, doorScrollPos, RL_WHITE); doorScrollPos = (Vector2){ doorLeft.position.x - scroll, doorLeft.position.y }; - if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, GREEN); - else DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, WHITE); + if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, RL_GREEN); + else DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, RL_WHITE); doorScrollPos = (Vector2){ doorRight.position.x - scroll, doorRight.position.y }; - if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorScrollPos, GREEN); - else DrawTextureRec(doors, doorRight.frameRec, doorScrollPos, WHITE); + if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorScrollPos, RL_GREEN); + else DrawTextureRec(doors, doorRight.frameRec, doorScrollPos, RL_WHITE); // Draw messsages - if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(LIGHTGRAY, 0.5f)); - else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(LIGHTGRAY, 0.5f)); + if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(RL_LIGHTGRAY, 0.5f)); + else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(RL_LIGHTGRAY, 0.5f)); if (msgState == 0) { - DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); } else if (msgState == 1) { - DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); - if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, BLACK); + if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, RL_BLACK); } else if (msgState == 2) { if ((msgCounter/30)%2) { - DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, WHITE); + DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, RL_WHITE); - DrawRectangleRec(lamp.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(picture.bounds, Fade(RED, 0.6f)); + DrawRectangleRec(lamp.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(picture.bounds, Fade(RL_RED, 0.6f)); } } else { if ((monsterHover) && ((msgCounter/30)%2)) { - DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(LIGHTGRAY, 0.5f)); - DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, BLACK); + DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(RL_LIGHTGRAY, 0.5f)); + DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, RL_BLACK); } } diff --git a/games/skully_escape/screens/screen_aisle02.c b/games/skully_escape/screens/screen_aisle02.c index 9dc02d377..de772d599 100644 --- a/games/skully_escape/screens/screen_aisle02.c +++ b/games/skully_escape/screens/screen_aisle02.c @@ -373,7 +373,7 @@ void UpdateAisle02Screen(void) // Gameplay Screen Draw logic void DrawAisle02Screen(void) { - DrawTexture(background, -scroll, 0, WHITE); + DrawTexture(background, -scroll, 0, RL_WHITE); // Draw monsters DrawMonster(lamp, scroll); @@ -384,41 +384,41 @@ void DrawAisle02Screen(void) // Draw door Vector2 doorScrollPos = { doorLeft.position.x - scroll, doorLeft.position.y }; - if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, GREEN); - else DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, WHITE); + if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, RL_GREEN); + else DrawTextureRec(doors, doorLeft.frameRec, doorScrollPos, RL_WHITE); // Draw messsages - if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(LIGHTGRAY, 0.5f)); - else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(LIGHTGRAY, 0.5f)); + if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(RL_LIGHTGRAY, 0.5f)); + else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(RL_LIGHTGRAY, 0.5f)); if (msgState == 0) { - DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); } else if (msgState == 1) { - DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); - if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, BLACK); + if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, RL_BLACK); } else if (msgState == 2) { if ((msgCounter/30)%2) { - DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, WHITE); + DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, RL_WHITE); - DrawRectangleRec(lamp.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(arc.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(chair.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(picture.bounds, Fade(RED, 0.6f)); + DrawRectangleRec(lamp.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(arc.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(chair.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(picture.bounds, Fade(RL_RED, 0.6f)); } } else { if ((monsterHover) && ((msgCounter/30)%2)) { - DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(LIGHTGRAY, 0.5f)); - DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, BLACK); + DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(RL_LIGHTGRAY, 0.5f)); + DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, RL_BLACK); } } diff --git a/games/skully_escape/screens/screen_armory.c b/games/skully_escape/screens/screen_armory.c index e05ca4e7f..f2fe879ae 100644 --- a/games/skully_escape/screens/screen_armory.c +++ b/games/skully_escape/screens/screen_armory.c @@ -335,7 +335,7 @@ void UpdateArmoryScreen(void) // Gameplay Screen Draw logic void DrawArmoryScreen(void) { - DrawTexture(background, 0, 0, WHITE); + DrawTexture(background, 0, 0, RL_WHITE); // Draw monsters DrawMonster(blazon01, 0); @@ -343,43 +343,43 @@ void DrawArmoryScreen(void) DrawMonster(blazon03, 0); // Draw door - if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, GREEN); - else DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, WHITE); + if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, RL_GREEN); + else DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, RL_WHITE); - if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorRight.position, GREEN); - else DrawTextureRec(doors, doorRight.frameRec, doorRight.position, WHITE); + if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorRight.position, RL_GREEN); + else DrawTextureRec(doors, doorRight.frameRec, doorRight.position, RL_WHITE); // Draw messsages - if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(LIGHTGRAY, 0.5f)); - else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(LIGHTGRAY, 0.5f)); + if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(RL_LIGHTGRAY, 0.5f)); + else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(RL_LIGHTGRAY, 0.5f)); if (msgState == 0) { - DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); } else if (msgState == 1) { - DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); - if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, BLACK); + if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, RL_BLACK); } else if (msgState == 2) { if ((msgCounter/30)%2) { - DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, WHITE); + DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, RL_WHITE); - DrawRectangleRec(blazon01.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(blazon02.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(blazon03.bounds, Fade(RED, 0.6f)); + DrawRectangleRec(blazon01.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(blazon02.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(blazon03.bounds, Fade(RL_RED, 0.6f)); } } else { if ((monsterHover) && ((msgCounter/30)%2)) { - DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(LIGHTGRAY, 0.5f)); - DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, BLACK); + DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(RL_LIGHTGRAY, 0.5f)); + DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, RL_BLACK); } } diff --git a/games/skully_escape/screens/screen_attic.c b/games/skully_escape/screens/screen_attic.c index 87bffaa22..ecb91e2d8 100644 --- a/games/skully_escape/screens/screen_attic.c +++ b/games/skully_escape/screens/screen_attic.c @@ -269,46 +269,46 @@ void UpdateAtticScreen(void) // Gameplay Screen Draw logic void DrawAtticScreen(void) { - DrawTexture(background, 0, 0, WHITE); + DrawTexture(background, 0, 0, RL_WHITE); // Draw monsters DrawMonster(lamp, 0); DrawMonster(arc, 0); // Draw door - if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorRight.position, GREEN); - else DrawTextureRec(doors, doorRight.frameRec, doorRight.position, WHITE); + if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorRight.position, RL_GREEN); + else DrawTextureRec(doors, doorRight.frameRec, doorRight.position, RL_WHITE); // Draw messsages - if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(LIGHTGRAY, 0.5f)); - else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(LIGHTGRAY, 0.5f)); + if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(RL_LIGHTGRAY, 0.5f)); + else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(RL_LIGHTGRAY, 0.5f)); if (msgState == 0) { - DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); } else if (msgState == 1) { - DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); - if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, BLACK); + if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, RL_BLACK); } else if (msgState == 2) { if ((msgCounter/30)%2) { - DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, WHITE); + DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, RL_WHITE); - DrawRectangleRec(lamp.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(arc.bounds, Fade(RED, 0.6f)); + DrawRectangleRec(lamp.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(arc.bounds, Fade(RL_RED, 0.6f)); } } else { if ((monsterHover) && ((msgCounter/30)%2)) { - DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(LIGHTGRAY, 0.5f)); - DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, BLACK); + DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(RL_LIGHTGRAY, 0.5f)); + DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, RL_BLACK); } } diff --git a/games/skully_escape/screens/screen_bathroom.c b/games/skully_escape/screens/screen_bathroom.c index 1f228803d..2aacbf0f9 100644 --- a/games/skully_escape/screens/screen_bathroom.c +++ b/games/skully_escape/screens/screen_bathroom.c @@ -317,7 +317,7 @@ void UpdateBathroomScreen(void) // Gameplay Screen Draw logic void DrawBathroomScreen(void) { - DrawTexture(background, 0, 0, WHITE); + DrawTexture(background, 0, 0, RL_WHITE); // Draw monsters DrawMonster(lamp, 0); @@ -325,40 +325,40 @@ void DrawBathroomScreen(void) DrawMonster(chair, 0); // Draw door - if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorRight.position, GREEN); - else DrawTextureRec(doors, doorRight.frameRec, doorRight.position, WHITE); + if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorRight.position, RL_GREEN); + else DrawTextureRec(doors, doorRight.frameRec, doorRight.position, RL_WHITE); // Draw messsages - if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(LIGHTGRAY, 0.5f)); - else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(LIGHTGRAY, 0.5f)); + if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(RL_LIGHTGRAY, 0.5f)); + else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(RL_LIGHTGRAY, 0.5f)); if (msgState == 0) { - DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); } else if (msgState == 1) { - DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); - if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, BLACK); + if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, RL_BLACK); } else if (msgState == 2) { if ((msgCounter/30)%2) { - DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, WHITE); + DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, RL_WHITE); - DrawRectangleRec(lamp.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(mirror.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(chair.bounds, Fade(RED, 0.6f)); + DrawRectangleRec(lamp.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(mirror.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(chair.bounds, Fade(RL_RED, 0.6f)); } } else { if ((monsterHover) && ((msgCounter/30)%2)) { - DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(LIGHTGRAY, 0.5f)); - DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, BLACK); + DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(RL_LIGHTGRAY, 0.5f)); + DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, RL_BLACK); } } diff --git a/games/skully_escape/screens/screen_ending.c b/games/skully_escape/screens/screen_ending.c index deffbb82c..963c80198 100644 --- a/games/skully_escape/screens/screen_ending.c +++ b/games/skully_escape/screens/screen_ending.c @@ -69,12 +69,12 @@ void UpdateEndingScreen(void) // Ending Screen Draw logic void DrawEndingScreen(void) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), DARKGRAY); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_DARKGRAY); - DrawTextEx(font, "CONGRATULATIONS!", (Vector2){ 50, 160 }, font.baseSize*3, 2, Fade(WHITE, alpha)); - DrawTextEx(font, "SKULLY ESCAPED!", (Vector2){ 100, 300 }, font.baseSize*3, 2, Fade(WHITE, alpha)); + DrawTextEx(font, "CONGRATULATIONS!", (Vector2){ 50, 160 }, font.baseSize*3, 2, Fade(RL_WHITE, alpha)); + DrawTextEx(font, "SKULLY ESCAPED!", (Vector2){ 100, 300 }, font.baseSize*3, 2, Fade(RL_WHITE, alpha)); - if ((framesCounter > 180) && ((framesCounter/40)%2)) DrawText("PRESS ENTER or CLICK", 380, 545, 40, BLACK); + if ((framesCounter > 180) && ((framesCounter/40)%2)) DrawText("PRESS ENTER or CLICK", 380, 545, 40, RL_BLACK); } // Ending Screen Unload logic diff --git a/games/skully_escape/screens/screen_kitchen.c b/games/skully_escape/screens/screen_kitchen.c index 01ce326ab..dd470672c 100644 --- a/games/skully_escape/screens/screen_kitchen.c +++ b/games/skully_escape/screens/screen_kitchen.c @@ -334,7 +334,7 @@ void UpdateKitchenScreen(void) // Gameplay Screen Draw logic void DrawKitchenScreen(void) { - DrawTexture(background, 0, 0, WHITE); + DrawTexture(background, 0, 0, RL_WHITE); // Draw monsters DrawMonster(closet, 0); @@ -342,43 +342,43 @@ void DrawKitchenScreen(void) DrawMonster(window, 0); // Draw door - if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorRight.position, GREEN); - else DrawTextureRec(doors, doorRight.frameRec, doorRight.position, WHITE); + if (doorRight.selected) DrawTextureRec(doors, doorRight.frameRec, doorRight.position, RL_GREEN); + else DrawTextureRec(doors, doorRight.frameRec, doorRight.position, RL_WHITE); - if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, GREEN); - else DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, WHITE); + if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, RL_GREEN); + else DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, RL_WHITE); // Draw messsages - if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(LIGHTGRAY, 0.5f)); - else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(LIGHTGRAY, 0.5f)); + if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(RL_LIGHTGRAY, 0.5f)); + else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(RL_LIGHTGRAY, 0.5f)); if (msgState == 0) { - DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); } else if (msgState == 1) { - DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); - if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, BLACK); + if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, RL_BLACK); } else if (msgState == 2) { if ((msgCounter/30)%2) { - DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, WHITE); + DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, RL_WHITE); - DrawRectangleRec(closet.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(window.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(chair.bounds, Fade(RED, 0.6f)); + DrawRectangleRec(closet.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(window.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(chair.bounds, Fade(RL_RED, 0.6f)); } } else { if ((monsterHover) && ((msgCounter/30)%2)) { - DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(LIGHTGRAY, 0.5f)); - DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, BLACK); + DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(RL_LIGHTGRAY, 0.5f)); + DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, RL_BLACK); } } diff --git a/games/skully_escape/screens/screen_livingroom.c b/games/skully_escape/screens/screen_livingroom.c index fa465bfa2..3114747ee 100644 --- a/games/skully_escape/screens/screen_livingroom.c +++ b/games/skully_escape/screens/screen_livingroom.c @@ -335,7 +335,7 @@ void UpdateLivingroomScreen(void) // Gameplay Screen Draw logic void DrawLivingroomScreen(void) { - DrawTexture(background, 0, 0, WHITE); + DrawTexture(background, 0, 0, RL_WHITE); // Draw monsters DrawMonster(picture, 0); @@ -343,42 +343,42 @@ void DrawLivingroomScreen(void) DrawMonster(phone, 0); // Draw door - if (doorCenter.selected) DrawTextureRec(doors, doorCenter.frameRec, doorCenter.position, GREEN); - else DrawTextureRec(doors, doorCenter.frameRec, doorCenter.position, WHITE); - if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, GREEN); - else DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, WHITE); + if (doorCenter.selected) DrawTextureRec(doors, doorCenter.frameRec, doorCenter.position, RL_GREEN); + else DrawTextureRec(doors, doorCenter.frameRec, doorCenter.position, RL_WHITE); + if (doorLeft.selected) DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, RL_GREEN); + else DrawTextureRec(doors, doorLeft.frameRec, doorLeft.position, RL_WHITE); // Draw messsages - if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(LIGHTGRAY, 0.5f)); - else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(LIGHTGRAY, 0.5f)); + if (msgState < 2) DrawRectangle(0, 40, GetScreenWidth(), 200, Fade(RL_LIGHTGRAY, 0.5f)); + else if (msgState == 2) DrawRectangle(0, 80, GetScreenWidth(), 100, Fade(RL_LIGHTGRAY, 0.5f)); if (msgState == 0) { - DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, msgBuffer, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); } else if (msgState == 1) { - DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, WHITE); + DrawTextEx(font, message, (Vector2){ msgPosX, 80 }, font.baseSize, 2, RL_WHITE); - if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, BLACK); + if ((msgCounter/30)%2) DrawText("PRESS ENTER or CLICK", GetScreenWidth() - 280, 200, 20, RL_BLACK); } else if (msgState == 2) { if ((msgCounter/30)%2) { - DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, WHITE); + DrawTextEx(font, "CHOOSE WISELY!", (Vector2){ 300, 95 }, font.baseSize*2, 2, RL_WHITE); - DrawRectangleRec(candle.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(phone.bounds, Fade(RED, 0.6f)); - DrawRectangleRec(picture.bounds, Fade(RED, 0.6f)); + DrawRectangleRec(candle.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(phone.bounds, Fade(RL_RED, 0.6f)); + DrawRectangleRec(picture.bounds, Fade(RL_RED, 0.6f)); } } else { if ((monsterHover) && ((msgCounter/30)%2)) { - DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(LIGHTGRAY, 0.5f)); - DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, BLACK); + DrawRectangle(0, 0, GetScreenWidth(), 50, Fade(RL_LIGHTGRAY, 0.5f)); + DrawText("PRESS SPACE or CLICK to INTERACT", 420, 15, 20, RL_BLACK); } } diff --git a/games/skully_escape/screens/screen_logo.c b/games/skully_escape/screens/screen_logo.c index 3e5e311d3..5b5cc67e2 100644 --- a/games/skully_escape/screens/screen_logo.c +++ b/games/skully_escape/screens/screen_logo.c @@ -87,11 +87,11 @@ void UpdateLogoScreen(void) // Logo Screen Draw logic void DrawLogoScreen(void) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RAYWHITE); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_RAYWHITE); - DrawTexture(logo, GetScreenWidth()/2 - logo.width/2, 130, Fade(WHITE, logoAlpha)); + DrawTexture(logo, GetScreenWidth()/2 - logo.width/2, 130, Fade(RL_WHITE, logoAlpha)); - DrawText("GRAY TEAM", 340, 450, 100, Fade(DARKGRAY, logoAlpha)); + DrawText("RL_GRAY TEAM", 340, 450, 100, Fade(RL_DARKGRAY, logoAlpha)); } // Logo Screen Unload logic diff --git a/games/skully_escape/screens/screen_logo_raylib.c b/games/skully_escape/screens/screen_logo_raylib.c index 1eb6cca40..b54d26729 100644 --- a/games/skully_escape/screens/screen_logo_raylib.c +++ b/games/skully_escape/screens/screen_logo_raylib.c @@ -145,46 +145,46 @@ void rlDrawLogoScreen(void) { if (state == 0) { - if ((framesCounter/10)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, BLACK); + if ((framesCounter/10)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, RL_BLACK); } else if (state == 1) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); } else if (state == 2) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); - DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, BLACK); + DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, RL_BLACK); } else if (state == 3) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(RL_BLACK, alpha)); - DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(RL_BLACK, alpha)); - DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha)); + DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RL_RAYWHITE, alpha)); - DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha)); + DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(RL_BLACK, alpha)); } else if (state == 4) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(RL_BLACK, alpha)); - DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(RL_BLACK, alpha)); - DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha)); + DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RL_RAYWHITE, alpha)); - DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha)); + DrawText(raylib, GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(RL_BLACK, alpha)); - if (framesCounter > 20) DrawText("powered by", logoPositionX, logoPositionY - 27, 20, Fade(DARKGRAY, alpha)); + if (framesCounter > 20) DrawText("powered by", logoPositionX, logoPositionY - 27, 20, Fade(RL_DARKGRAY, alpha)); } } diff --git a/games/skully_escape/screens/screen_title.c b/games/skully_escape/screens/screen_title.c index ad231dcdb..3e53c40d3 100644 --- a/games/skully_escape/screens/screen_title.c +++ b/games/skully_escape/screens/screen_title.c @@ -71,11 +71,11 @@ void UpdateTitleScreen(void) // Title Screen Draw logic void DrawTitleScreen(void) { - //DrawText("TITLE SCREEN", 100, 100, 140, Fade(BLACK, titleAlpha)); - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), DARKGRAY); - DrawTexture(title, GetScreenWidth()/2 - title.width/2, 20, Fade(WHITE, titleAlpha)); + //DrawText("TITLE SCREEN", 100, 100, 140, Fade(RL_BLACK, titleAlpha)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_DARKGRAY); + DrawTexture(title, GetScreenWidth()/2 - title.width/2, 20, Fade(RL_WHITE, titleAlpha)); - if ((framesCounter > 180) && ((framesCounter/40)%2)) DrawText("PRESS ENTER to START", 380, 545, 40, BLACK); + if ((framesCounter > 180) && ((framesCounter/40)%2)) DrawText("PRESS ENTER to START", 380, 545, 40, RL_BLACK); } // Title Screen Unload logic diff --git a/games/skully_escape/skully_escape.c b/games/skully_escape/skully_escape.c index e2e7007bb..7ca6c93d5 100644 --- a/games/skully_escape/skully_escape.c +++ b/games/skully_escape/skully_escape.c @@ -254,7 +254,7 @@ void UpdateTransition(void) void DrawTransition(void) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, transAlpha)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_BLACK, transAlpha)); } // Update and draw game frame @@ -378,7 +378,7 @@ void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); switch(currentScreen) { diff --git a/games/snake.c b/games/snake.c index 23d1bd1d0..3da806e1d 100644 --- a/games/snake.c +++ b/games/snake.c @@ -127,8 +127,8 @@ void InitGame(void) snake[i].size = (Vector2){ SQUARE_SIZE, SQUARE_SIZE }; snake[i].speed = (Vector2){ SQUARE_SIZE, 0 }; - if (i == 0) snake[i].color = DARKBLUE; - else snake[i].color = BLUE; + if (i == 0) snake[i].color = RL_DARKBLUE; + else snake[i].color = RL_BLUE; } for (int i = 0; i < SNAKE_LENGTH; i++) @@ -137,7 +137,7 @@ void InitGame(void) } fruit.size = (Vector2){ SQUARE_SIZE, SQUARE_SIZE }; - fruit.color = SKYBLUE; + fruit.color = RL_SKYBLUE; fruit.active = false; } @@ -246,19 +246,19 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { // Draw grid lines for (int i = 0; i < screenWidth/SQUARE_SIZE + 1; i++) { - DrawLineV((Vector2){SQUARE_SIZE*i + offset.x/2, offset.y/2}, (Vector2){SQUARE_SIZE*i + offset.x/2, screenHeight - offset.y/2}, LIGHTGRAY); + DrawLineV((Vector2){SQUARE_SIZE*i + offset.x/2, offset.y/2}, (Vector2){SQUARE_SIZE*i + offset.x/2, screenHeight - offset.y/2}, RL_LIGHTGRAY); } for (int i = 0; i < screenHeight/SQUARE_SIZE + 1; i++) { - DrawLineV((Vector2){offset.x/2, SQUARE_SIZE*i + offset.y/2}, (Vector2){screenWidth - offset.x/2, SQUARE_SIZE*i + offset.y/2}, LIGHTGRAY); + DrawLineV((Vector2){offset.x/2, SQUARE_SIZE*i + offset.y/2}, (Vector2){screenWidth - offset.x/2, SQUARE_SIZE*i + offset.y/2}, RL_LIGHTGRAY); } // Draw snake @@ -267,9 +267,9 @@ void DrawGame(void) // Draw fruit to pick DrawRectangleV(fruit.position, fruit.size, fruit.color); - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); } diff --git a/games/space_invaders.c b/games/space_invaders.c index 97f145473..4aab6ebf9 100644 --- a/games/space_invaders.c +++ b/games/space_invaders.c @@ -147,7 +147,7 @@ void InitGame(void) player.rec.height = 20; player.speed.x = 5; player.speed.y = 5; - player.color = BLACK; + player.color = RL_BLACK; // Initialize enemies for (int i = 0; i < NUM_MAX_ENEMIES; i++) @@ -159,7 +159,7 @@ void InitGame(void) enemy[i].speed.x = 5; enemy[i].speed.y = 5; enemy[i].active = true; - enemy[i].color = GRAY; + enemy[i].color = RL_GRAY; } // Initialize shoots @@ -172,7 +172,7 @@ void InitGame(void) shoot[i].speed.x = 7; shoot[i].speed.y = 0; shoot[i].active = false; - shoot[i].color = MAROON; + shoot[i].color = RL_MAROON; } } @@ -355,15 +355,15 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { DrawRectangleRec(player.rec, player.color); - if (wave == FIRST) DrawText("FIRST WAVE", screenWidth/2 - MeasureText("FIRST WAVE", 40)/2, screenHeight/2 - 40, 40, Fade(BLACK, alpha)); - else if (wave == SECOND) DrawText("SECOND WAVE", screenWidth/2 - MeasureText("SECOND WAVE", 40)/2, screenHeight/2 - 40, 40, Fade(BLACK, alpha)); - else if (wave == THIRD) DrawText("THIRD WAVE", screenWidth/2 - MeasureText("THIRD WAVE", 40)/2, screenHeight/2 - 40, 40, Fade(BLACK, alpha)); + if (wave == FIRST) DrawText("FIRST WAVE", screenWidth/2 - MeasureText("FIRST WAVE", 40)/2, screenHeight/2 - 40, 40, Fade(RL_BLACK, alpha)); + else if (wave == SECOND) DrawText("SECOND WAVE", screenWidth/2 - MeasureText("SECOND WAVE", 40)/2, screenHeight/2 - 40, 40, Fade(RL_BLACK, alpha)); + else if (wave == THIRD) DrawText("THIRD WAVE", screenWidth/2 - MeasureText("THIRD WAVE", 40)/2, screenHeight/2 - 40, 40, Fade(RL_BLACK, alpha)); for (int i = 0; i < activeEnemies; i++) { @@ -375,13 +375,13 @@ void DrawGame(void) if (shoot[i].active) DrawRectangleRec(shoot[i].rec, shoot[i].color); } - DrawText(FormatText("%04i", score), 20, 20, 40, GRAY); + DrawText(FormatText("%04i", score), 20, 20, 40, RL_GRAY); - if (victory) DrawText("YOU WIN", screenWidth/2 - MeasureText("YOU WIN", 40)/2, screenHeight/2 - 40, 40, BLACK); + if (victory) DrawText("YOU WIN", screenWidth/2 - MeasureText("YOU WIN", 40)/2, screenHeight/2 - 40, 40, RL_BLACK); - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); } diff --git a/games/tetris.c b/games/tetris.c index 3c9d5c5c6..aafd5a65d 100644 --- a/games/tetris.c +++ b/games/tetris.c @@ -151,7 +151,7 @@ void InitGame(void) level = 1; lines = 0; - fadingColor = GRAY; + fadingColor = RL_GRAY; piecePositionX = 0; piecePositionY = 0; @@ -276,8 +276,8 @@ void UpdateGame(void) // Animation when deleting lines fadeLineCounter++; - if (fadeLineCounter%8 < 4) fadingColor = MAROON; - else fadingColor = GRAY; + if (fadeLineCounter%8 < 4) fadingColor = RL_MAROON; + else fadingColor = RL_GRAY; if (fadeLineCounter >= FADING_TIME) { @@ -305,7 +305,7 @@ void DrawGame(void) { BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (!gameOver) { @@ -325,25 +325,25 @@ void DrawGame(void) // Draw each square of the grid if (grid[i][j] == EMPTY) { - DrawLine(offset.x, offset.y, offset.x + SQUARE_SIZE, offset.y, LIGHTGRAY ); - DrawLine(offset.x, offset.y, offset.x, offset.y + SQUARE_SIZE, LIGHTGRAY ); - DrawLine(offset.x + SQUARE_SIZE, offset.y, offset.x + SQUARE_SIZE, offset.y + SQUARE_SIZE, LIGHTGRAY ); - DrawLine(offset.x, offset.y + SQUARE_SIZE, offset.x + SQUARE_SIZE, offset.y + SQUARE_SIZE, LIGHTGRAY ); + DrawLine(offset.x, offset.y, offset.x + SQUARE_SIZE, offset.y, RL_LIGHTGRAY ); + DrawLine(offset.x, offset.y, offset.x, offset.y + SQUARE_SIZE, RL_LIGHTGRAY ); + DrawLine(offset.x + SQUARE_SIZE, offset.y, offset.x + SQUARE_SIZE, offset.y + SQUARE_SIZE, RL_LIGHTGRAY ); + DrawLine(offset.x, offset.y + SQUARE_SIZE, offset.x + SQUARE_SIZE, offset.y + SQUARE_SIZE, RL_LIGHTGRAY ); offset.x += SQUARE_SIZE; } else if (grid[i][j] == FULL) { - DrawRectangle(offset.x, offset.y, SQUARE_SIZE, SQUARE_SIZE, GRAY); + DrawRectangle(offset.x, offset.y, SQUARE_SIZE, SQUARE_SIZE, RL_GRAY); offset.x += SQUARE_SIZE; } else if (grid[i][j] == MOVING) { - DrawRectangle(offset.x, offset.y, SQUARE_SIZE, SQUARE_SIZE, DARKGRAY); + DrawRectangle(offset.x, offset.y, SQUARE_SIZE, SQUARE_SIZE, RL_DARKGRAY); offset.x += SQUARE_SIZE; } else if (grid[i][j] == BLOCK) { - DrawRectangle(offset.x, offset.y, SQUARE_SIZE, SQUARE_SIZE, LIGHTGRAY); + DrawRectangle(offset.x, offset.y, SQUARE_SIZE, SQUARE_SIZE, RL_LIGHTGRAY); offset.x += SQUARE_SIZE; } else if (grid[i][j] == FADING) @@ -369,15 +369,15 @@ void DrawGame(void) { if (incomingPiece[i][j] == EMPTY) { - DrawLine(offset.x, offset.y, offset.x + SQUARE_SIZE, offset.y, LIGHTGRAY ); - DrawLine(offset.x, offset.y, offset.x, offset.y + SQUARE_SIZE, LIGHTGRAY ); - DrawLine(offset.x + SQUARE_SIZE, offset.y, offset.x + SQUARE_SIZE, offset.y + SQUARE_SIZE, LIGHTGRAY ); - DrawLine(offset.x, offset.y + SQUARE_SIZE, offset.x + SQUARE_SIZE, offset.y + SQUARE_SIZE, LIGHTGRAY ); + DrawLine(offset.x, offset.y, offset.x + SQUARE_SIZE, offset.y, RL_LIGHTGRAY ); + DrawLine(offset.x, offset.y, offset.x, offset.y + SQUARE_SIZE, RL_LIGHTGRAY ); + DrawLine(offset.x + SQUARE_SIZE, offset.y, offset.x + SQUARE_SIZE, offset.y + SQUARE_SIZE, RL_LIGHTGRAY ); + DrawLine(offset.x, offset.y + SQUARE_SIZE, offset.x + SQUARE_SIZE, offset.y + SQUARE_SIZE, RL_LIGHTGRAY ); offset.x += SQUARE_SIZE; } else if (incomingPiece[i][j] == MOVING) { - DrawRectangle(offset.x, offset.y, SQUARE_SIZE, SQUARE_SIZE, GRAY); + DrawRectangle(offset.x, offset.y, SQUARE_SIZE, SQUARE_SIZE, RL_GRAY); offset.x += SQUARE_SIZE; } } @@ -386,12 +386,12 @@ void DrawGame(void) offset.y += SQUARE_SIZE; } - DrawText("INCOMING:", offset.x, offset.y - 100, 10, GRAY); - DrawText(FormatText("LINES: %04i", lines), offset.x, offset.y + 20, 10, GRAY); + DrawText("INCOMING:", offset.x, offset.y - 100, 10, RL_GRAY); + DrawText(FormatText("LINES: %04i", lines), offset.x, offset.y + 20, 10, RL_GRAY); - if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY); + if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY); } - else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY); + else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY); EndDrawing(); } diff --git a/games/transmission/screens/screen_ending.c b/games/transmission/screens/screen_ending.c index d0cf7d899..3aadd1652 100644 --- a/games/transmission/screens/screen_ending.c +++ b/games/transmission/screens/screen_ending.c @@ -124,7 +124,7 @@ void InitEndingScreen(void) // Generate newspaper with title and subtitle Image imNewspaper = LoadImage("resources/textures/ending_newspaper.png"); fontNews = LoadFontEx("resources/fonts/Lora-Bold.ttf", 32, 250, 0); - ImageDrawTextEx(&imNewspaper, (Vector2){ 50, 220 }, fontNews, headline, fontNews.baseSize, 0, DARKGRAY); + ImageDrawTextEx(&imNewspaper, (Vector2){ 50, 220 }, fontNews, headline, fontNews.baseSize, 0, RL_DARKGRAY); texNewspaper = LoadTextureFromImage(imNewspaper); //UnloadFont(fontNews); @@ -162,20 +162,20 @@ void UpdateEndingScreen(void) // Ending Screen Draw logic void DrawEndingScreen(void) { - DrawTexture(texBackground, 0, 0, WHITE); + DrawTexture(texBackground, 0, 0, RL_WHITE); DrawTexturePro(texNewspaper, (Rectangle){ 0, 0, texNewspaper.width, texNewspaper.height }, (Rectangle){ GetScreenWidth()/2, GetScreenHeight()/2, texNewspaper.width*scale, texNewspaper.height*scale }, - (Vector2){ (float)texNewspaper.width*scale/2, (float)texNewspaper.height*scale/2 }, rotation, WHITE); + (Vector2){ (float)texNewspaper.width*scale/2, (float)texNewspaper.height*scale/2 }, rotation, RL_WHITE); - DrawTextureEx(texVignette, (Vector2){ 0, 0 }, 0.0f, 2.0f, WHITE); + DrawTextureEx(texVignette, (Vector2){ 0, 0 }, 0.0f, 2.0f, RL_WHITE); // Draw debug information - DrawTextEx(fontNews, headline, (Vector2){ 10, 10 }, fontNews.baseSize, 0, RAYWHITE); + DrawTextEx(fontNews, headline, (Vector2){ 10, 10 }, fontNews.baseSize, 0, RL_RAYWHITE); for (int i = 0; i < missions[currentMission].wordsCount; i++) { - DrawText(codingWords[messageWords[i].id], 10, 60 + 30*i, 20, (messageWords[i].id == missions[currentMission].sols[i]) ? GREEN : RED); + DrawText(codingWords[messageWords[i].id], 10, 60 + 30*i, 20, (messageWords[i].id == missions[currentMission].sols[i]) ? RL_GREEN : RL_RED); } if (state == 1) DrawButton("continuar"); diff --git a/games/transmission/screens/screen_gameplay.c b/games/transmission/screens/screen_gameplay.c index 0594e10fc..590867950 100644 --- a/games/transmission/screens/screen_gameplay.c +++ b/games/transmission/screens/screen_gameplay.c @@ -146,7 +146,7 @@ void InitGameplayScreen(void) #else // Generate coding words atlas directly from text Image imWordsBase = LoadImage("resources/textures/words_base.png"); - Image imWords = GenImageColor(imWordsBase.width, imWordsBase.height*MAX_CODING_WORDS, WHITE); + Image imWords = GenImageColor(imWordsBase.width, imWordsBase.height*MAX_CODING_WORDS, RL_WHITE); for (int i = 0; i < MAX_CODING_WORDS; i++) { @@ -156,7 +156,7 @@ void InitGameplayScreen(void) ImageDrawTextEx(&imWords,(Vector2){ imWordsBase.width/2 - MeasureTextEx(fontMessage, codingWords[i], fontMessage.baseSize, 0).x/2, imWordsBase.height*i }, fontMessage, codingWords[i], - fontMessage.baseSize, 0, BLACK); + fontMessage.baseSize, 0, RL_BLACK); } texWordsAtlas = LoadTextureFromImage(imWords); @@ -377,25 +377,25 @@ void UpdateGameplayScreen(void) // Gameplay Screen Draw logic void DrawGameplayScreen(void) { - DrawTexture(texBackground, 0, 0, WHITE); + DrawTexture(texBackground, 0, 0, RL_WHITE); - DrawTextEx(fontMessage, missions[currentMission].msg, msgOffset, fontMessage.baseSize, 0, BLACK); + DrawTextEx(fontMessage, missions[currentMission].msg, msgOffset, fontMessage.baseSize, 0, RL_BLACK); for (int i = 0; i < missions[currentMission].wordsCount; i++) { Rectangle recLines = messageWords[i].rec; - DrawRectangleLines(recLines.x, recLines.y, recLines.width, recLines.height, Fade(RED, 0.35f)); - if(messageWords[i].hover) DrawRectangleRec(messageWords[i].rec, Fade(RED, 0.30f)); - DrawText(FormatText("%i", messageWords[i].id), i*25, 0, 30, RED); + DrawRectangleLines(recLines.x, recLines.y, recLines.width, recLines.height, Fade(RL_RED, 0.35f)); + if(messageWords[i].hover) DrawRectangleRec(messageWords[i].rec, Fade(RL_RED, 0.30f)); + DrawText(FormatText("%i", messageWords[i].id), i*25, 0, 30, RL_RED); } for (int i = 0; i < MAX_CODING_WORDS; i++) { - if (words[i].picked) DrawTextureRec(texWordsAtlas, (Rectangle){ 0, i*35, 140, 35 }, (Vector2){ words[i].rec.x, words[i].rec.y }, MAROON); - else if (words[i].hover) DrawTextureRec(texWordsAtlas, (Rectangle){ 0, i*35, 140, 35 }, (Vector2){ words[i].rec.x, words[i].rec.y }, RED); - else DrawTextureRec(texWordsAtlas, (Rectangle){ 0, i*35, 140, 35 }, (Vector2){ words[i].rec.x, words[i].rec.y }, WHITE); + if (words[i].picked) DrawTextureRec(texWordsAtlas, (Rectangle){ 0, i*35, 140, 35 }, (Vector2){ words[i].rec.x, words[i].rec.y }, RL_MAROON); + else if (words[i].hover) DrawTextureRec(texWordsAtlas, (Rectangle){ 0, i*35, 140, 35 }, (Vector2){ words[i].rec.x, words[i].rec.y }, RL_RED); + else DrawTextureRec(texWordsAtlas, (Rectangle){ 0, i*35, 140, 35 }, (Vector2){ words[i].rec.x, words[i].rec.y }, RL_WHITE); } - DrawTexturePro(texVignette, (Rectangle){0,0,texVignette.width, texVignette.height}, (Rectangle){0,0,GetScreenWidth(), GetScreenHeight()}, (Vector2){0,0}, 0, WHITE); + DrawTexturePro(texVignette, (Rectangle){0,0,texVignette.width, texVignette.height}, (Rectangle){0,0,GetScreenWidth(), GetScreenHeight()}, (Vector2){0,0}, 0, RL_WHITE); if (canSend) DrawButton("enviar"); } diff --git a/games/transmission/screens/screen_logo.c b/games/transmission/screens/screen_logo.c index 30271ba6d..a219e2eef 100644 --- a/games/transmission/screens/screen_logo.c +++ b/games/transmission/screens/screen_logo.c @@ -86,7 +86,7 @@ void UpdateLogoScreen(void) // Logo Screen Draw logic void DrawLogoScreen(void) { - DrawTexture(logoCW, GetScreenWidth()/2 - logoCW.width/2, GetScreenHeight()/2 - logoCW.height/2, Fade(WHITE, fadeValue)); + DrawTexture(logoCW, GetScreenWidth()/2 - logoCW.width/2, GetScreenHeight()/2 - logoCW.height/2, Fade(RL_WHITE, fadeValue)); } // Logo Screen Unload logic diff --git a/games/transmission/screens/screen_mission.c b/games/transmission/screens/screen_mission.c index 0f996502f..c9321a1ee 100644 --- a/games/transmission/screens/screen_mission.c +++ b/games/transmission/screens/screen_mission.c @@ -135,9 +135,9 @@ void InitMissionScreen(void) missionLenght = 0; missionSpeed = 1; - numberColor = RAYWHITE; - missionColor = LIGHTGRAY; - keywordColor = (Color){198, 49, 60, 255}; //RED + numberColor = RL_RAYWHITE; + missionColor = RL_LIGHTGRAY; + keywordColor = (Color){198, 49, 60, 255}; //RL_RED numberPosition = (Vector2){150, 185}; missionPosition = (Vector2){numberPosition.x, numberPosition.y + 60}; @@ -187,8 +187,8 @@ void UpdateMissionScreen(void) void DrawMissionScreen(void) { // TODO: Draw MISSION screen here! - DrawTexture(texBackground, 0,0, WHITE); - DrawTexturePro(texBackline, sourceRecBackLine, destRecBackLine, (Vector2){0,0},0, Fade(WHITE, fadeBackLine)); + DrawTexture(texBackground, 0,0, RL_WHITE); + DrawTexturePro(texBackline, sourceRecBackLine, destRecBackLine, (Vector2){0,0},0, Fade(RL_WHITE, fadeBackLine)); if (writeNumber) DrawTextEx(fontMission, FormatText("Filtración #%02i ", currentMission + 1), numberPosition, missionSize + 10, 0, numberColor); DrawTextEx(fontMission, SubText(missions[currentMission].brief, 0, missionLenght), missionPosition, missionSize, 0, missionColor); diff --git a/games/transmission/screens/screen_title.c b/games/transmission/screens/screen_title.c index 22efadb1a..de7505108 100644 --- a/games/transmission/screens/screen_title.c +++ b/games/transmission/screens/screen_title.c @@ -77,7 +77,7 @@ void InitTitleScreen(void) transmissionPosition = (Vector2){519, 221}; missionPositon = (Vector2){580, 261}; - titleColor = BLACK; + titleColor = RL_BLACK; speedText = 15; missionLenght = 0; @@ -136,7 +136,7 @@ void UpdateTitleScreen(void) // Title Screen Draw logic void DrawTitleScreen(void) { - DrawTexture(texBackground, 0,0, WHITE); + DrawTexture(texBackground, 0,0, RL_WHITE); DrawTextEx(fontTitle, SubText(textTitle, 0, transmissionLenght), transmissionPosition, titleSize, 0, titleColor); DrawTextEx(fontTitle, SubText(textTitle, 12, missionLenght), missionPositon, titleSize, 0, titleColor); diff --git a/games/transmission/transmission.c b/games/transmission/transmission.c index d4298e346..dcd312d11 100644 --- a/games/transmission/transmission.c +++ b/games/transmission/transmission.c @@ -79,10 +79,10 @@ int main(void) recButton.x = screenWidth - recButton.width; recButton.y = screenHeight - recButton.height - 50; fadeButton = 0.8f; - colorButton = RED; + colorButton = RL_RED; textPositionButton = (Vector2){recButton.x + recButton.width/2, recButton.y + recButton.height/2}; fontSizeButton = 30; - textColorButton = WHITE; + textColorButton = RL_WHITE; currentMission = 0; totalMissions = 4; @@ -234,7 +234,7 @@ static void UpdateTransition(void) // Draw transition effect (full-screen rectangle) static void DrawTransition(void) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, transAlpha)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_BLACK, transAlpha)); } // Update and draw game frame @@ -310,7 +310,7 @@ static void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); switch(currentScreen) { @@ -448,7 +448,7 @@ bool IsButtonPressed() void DrawButton(const char *text) { //DrawRectangleRec(recButton, Fade(colorButton, fadeButton)); - DrawTexturePro(texButton, (Rectangle){0,0,texButton.width, texButton.height}, recButton, (Vector2){0,0},0, Fade(WHITE, fadeButton)); + DrawTexturePro(texButton, (Rectangle){0,0,texButton.width, texButton.height}, recButton, (Vector2){0,0},0, Fade(RL_WHITE, fadeButton)); Vector2 measure = MeasureTextEx(fontMission, text, fontSizeButton, 0); Vector2 textPos = {textPositionButton.x - measure.x/2 + 10, textPositionButton.y - measure.y/2 - 10}; DrawTextEx(fontMission, text, textPos , fontSizeButton, 0, textColorButton); diff --git a/games/wave_collector/screens/screen_ending.c b/games/wave_collector/screens/screen_ending.c index 7dc21965a..ee3c0c239 100644 --- a/games/wave_collector/screens/screen_ending.c +++ b/games/wave_collector/screens/screen_ending.c @@ -72,26 +72,26 @@ void UpdateEndingScreen(void) // Ending Screen Draw logic void DrawEndingScreen(void) { - DrawTexture(texBackground, 0, 0, WHITE); + DrawTexture(texBackground, 0, 0, RL_WHITE); if (endingStatus == 1) // Win { - DrawTexture(texWin, GetScreenWidth()/2 - texWin.width/2, 90, WHITE); - DrawTextEx(font, "congrats, you got the wave!", (Vector2){ 200, 335 }, font.baseSize, 0, WHITE); + DrawTexture(texWin, GetScreenWidth()/2 - texWin.width/2, 90, RL_WHITE); + DrawTextEx(font, "congrats, you got the wave!", (Vector2){ 200, 335 }, font.baseSize, 0, RL_WHITE); } else if (endingStatus == 2) // Lose { - DrawTexture(texLose, GetScreenWidth()/2 - texWin.width/2, 90, WHITE); - DrawTextEx(font, "it seems you lose the wave...", (Vector2){ 205, 335 }, font.baseSize, 0, WHITE); + DrawTexture(texLose, GetScreenWidth()/2 - texWin.width/2, 90, RL_WHITE); + DrawTextEx(font, "it seems you lose the wave...", (Vector2){ 205, 335 }, font.baseSize, 0, RL_WHITE); } - DrawRectangle(0, GetScreenHeight() - 70, 560, 40, Fade(RAYWHITE, 0.8f)); - DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 36, GetScreenHeight() - 60, 20, DARKBLUE); + DrawRectangle(0, GetScreenHeight() - 70, 560, 40, Fade(RL_RAYWHITE, 0.8f)); + DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 36, GetScreenHeight() - 60, 20, RL_DARKBLUE); - DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, DARKGRAY); - DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, WHITE); + DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, RL_DARKGRAY); + DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, RL_WHITE); - if ((framesCounter > 80) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to return", (Vector2){ 300, 464 }, font.baseSize, 0, SKYBLUE); + if ((framesCounter > 80) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to return", (Vector2){ 300, 464 }, font.baseSize, 0, RL_SKYBLUE); } // Ending Screen Unload logic diff --git a/games/wave_collector/screens/screen_gameplay.c b/games/wave_collector/screens/screen_gameplay.c index 1835c2229..15b43caa5 100644 --- a/games/wave_collector/screens/screen_gameplay.c +++ b/games/wave_collector/screens/screen_gameplay.c @@ -142,7 +142,7 @@ void InitGameplayScreen(void) player.width = 20; player.height = 60; player.speed = (Vector2){ 15, 15 }; - player.color = GOLD; + player.color = RL_GOLD; player.position = (Vector2){ playerArea.x + playerArea.width/2 - texPlayer.width/2, playerArea.y + playerArea.height/2 - texPlayer.height/2 }; @@ -199,7 +199,7 @@ void InitGameplayScreen(void) samples[i].radius = 6; samples[i].active = true; samples[i].collected = false; - samples[i].color = RED; + samples[i].color = RL_RED; samples[i].renderable = false; } @@ -351,12 +351,12 @@ void UpdateGameplayScreen(void) void DrawGameplayScreen(void) { // Draw background - DrawTexture(texBackground, 0, 0, WHITE); + DrawTexture(texBackground, 0, 0, RL_WHITE); // Screen elements drawing - //DrawRectangleLines(playerArea.x, playerArea.y, playerArea.width, playerArea.height, BLUE); - DrawRectangle(0, GetScreenHeight()/2 - 1, GetScreenWidth(), 2, Fade(BLUE, 0.3f)); - //DrawRectangleLines(0, GetScreenHeight()/2 - MAX_GAME_HEIGHT/2, GetScreenWidth(), MAX_GAME_HEIGHT, GRAY); + //DrawRectangleLines(playerArea.x, playerArea.y, playerArea.width, playerArea.height, RL_BLUE); + DrawRectangle(0, GetScreenHeight()/2 - 1, GetScreenWidth(), 2, Fade(RL_BLUE, 0.3f)); + //DrawRectangleLines(0, GetScreenHeight()/2 - MAX_GAME_HEIGHT/2, GetScreenWidth(), MAX_GAME_HEIGHT, RL_GRAY); // Draw samples for (int i = 0; i < totalSamples - 1; i++) @@ -365,8 +365,8 @@ void DrawGameplayScreen(void) { Color col = samples[i].color; - if (i < (currentSample + 1)) col = Fade(DARKGRAY, 0.5f); - else col = WHITE; + if (i < (currentSample + 1)) col = Fade(RL_DARKGRAY, 0.5f); + else col = RL_WHITE; if (!samples[i].collected) { @@ -377,8 +377,8 @@ void DrawGameplayScreen(void) else DrawTexture(texSampleBig, samples[i].position.x - texSampleBig.width/2, samples[i].position.y - texSampleBig.height/2, col); } - if (i < (currentSample + 1)) col = Fade(GRAY, 0.3f); - else col = Fade(RED, 0.5f); + if (i < (currentSample + 1)) col = Fade(RL_GRAY, 0.3f); + else col = Fade(RL_RED, 0.5f); // Draw line between samples DrawLineEx(samples[i].position, samples[i + 1].position, 3.0f, col); @@ -387,58 +387,58 @@ void DrawGameplayScreen(void) // Draw player //DrawRectangle((int)player.position.x, (int)player.position.y, player.width, player.height, player.color); - DrawTexture(texPlayer, player.position.x - 32, player.position.y - 24, WHITE); + DrawTexture(texPlayer, player.position.x - 32, player.position.y - 24, RL_WHITE); // Draw pause message - if (pause) DrawTextEx(font, "WAVE PAUSED", (Vector2){ 235, 400 }, font.baseSize*2, 0, WHITE); + if (pause) DrawTextEx(font, "WAVE PAUSED", (Vector2){ 235, 400 }, font.baseSize*2, 0, RL_WHITE); // Draw number of samples - //DrawText(FormatText("%05i", collectedSamples), 900, 200, 40, GRAY); - //DrawText(FormatText("%05i", totalSamples), 900, 250, 40, GRAY); - DrawTextEx(font, FormatText("%05i / %05i", collectedSamples, totalSamples), (Vector2){810, 170}, font.baseSize, -2, SKYBLUE); + //DrawText(FormatText("%05i", collectedSamples), 900, 200, 40, RL_GRAY); + //DrawText(FormatText("%05i", totalSamples), 900, 250, 40, RL_GRAY); + DrawTextEx(font, FormatText("%05i / %05i", collectedSamples, totalSamples), (Vector2){810, 170}, font.baseSize, -2, RL_SKYBLUE); // Draw combo - DrawTextEx(font, FormatText("Combo: %02i [max: %02i]", combo, maxCombo), (Vector2){200, 170}, font.baseSize/2, -2, SKYBLUE); + DrawTextEx(font, FormatText("Combo: %02i [max: %02i]", combo, maxCombo), (Vector2){200, 170}, font.baseSize/2, -2, RL_SKYBLUE); // Draw synchonicity level - DrawRectangle(99, 622, 395, 32, Fade(RAYWHITE, 0.8f)); + DrawRectangle(99, 622, 395, 32, Fade(RL_RAYWHITE, 0.8f)); - if (synchro <= 0.3f) DrawRectangle(99, 622, synchro*395, 32, Fade(RED, 0.8f)); - else if (synchro <= 0.8f) DrawRectangle(99, 622, synchro*395, 32, Fade(ORANGE,0.8f)); - else if (synchro < 1.0f) DrawRectangle(99, 622, synchro*395, 32, Fade(LIME,0.8f)); - else DrawRectangle(99, 622, synchro*395, 32, Fade(GREEN, 0.9f)); + if (synchro <= 0.3f) DrawRectangle(99, 622, synchro*395, 32, Fade(RL_RED, 0.8f)); + else if (synchro <= 0.8f) DrawRectangle(99, 622, synchro*395, 32, Fade(RL_ORANGE,0.8f)); + else if (synchro < 1.0f) DrawRectangle(99, 622, synchro*395, 32, Fade(RL_LIME,0.8f)); + else DrawRectangle(99, 622, synchro*395, 32, Fade(RL_GREEN, 0.9f)); - DrawRectangleLines(99, 622, 395, 32, MAROON); + DrawRectangleLines(99, 622, 395, 32, RL_MAROON); - if (synchro == 1.0f) DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, GREEN); - else DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, SKYBLUE); + if (synchro == 1.0f) DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, RL_GREEN); + else DrawTextEx(font, FormatText("%02i%%", (int)(synchro*100)), (Vector2){99 + 390, 600}, font.baseSize, -2, RL_SKYBLUE); // Draw time warp coool-down bar - DrawRectangle(754, 622, 395, 32, Fade(RAYWHITE, 0.8f)); - DrawRectangle(754, 622, warpCounter, 32, Fade(SKYBLUE, 0.8f)); - DrawRectangleLines(754, 622, 395, 32, DARKGRAY); - //DrawText(FormatText("%02i%%", (int)(synchro*100)), 754 + 410, 628, 20, DARKGRAY); - DrawTextEx(font, FormatText("%02i%%", (int)((float)warpCounter/395.0f*100.0f)), (Vector2){754 + 390, 600}, font.baseSize, -2, SKYBLUE); + DrawRectangle(754, 622, 395, 32, Fade(RL_RAYWHITE, 0.8f)); + DrawRectangle(754, 622, warpCounter, 32, Fade(RL_SKYBLUE, 0.8f)); + DrawRectangleLines(754, 622, 395, 32, RL_DARKGRAY); + //DrawText(FormatText("%02i%%", (int)(synchro*100)), 754 + 410, 628, 20, RL_DARKGRAY); + DrawTextEx(font, FormatText("%02i%%", (int)((float)warpCounter/395.0f*100.0f)), (Vector2){754 + 390, 600}, font.baseSize, -2, RL_SKYBLUE); // Draw wave if (waveTarget.texture.id <= 0) // Render target could not be loaded (OpenGL 1.1) { // Draw wave directly on screen - DrawSamplesMap(samples, totalSamples, currentSample, waveRec, MAROON); - DrawRectangle(waveRec.x + (int)currentSample*1215/totalSamples, waveRec.y, 2, 99, DARKGRAY); + DrawSamplesMap(samples, totalSamples, currentSample, waveRec, RL_MAROON); + DrawRectangle(waveRec.x + (int)currentSample*1215/totalSamples, waveRec.y, 2, 99, RL_DARKGRAY); } else { // Draw wave using render target BeginTextureMode(waveTarget); - ClearBackground(BLANK); - DrawSamplesMap(samples, totalSamples, currentSample, (Rectangle){ 0, 0, waveTarget.texture.width, waveTarget.texture.height }, MAROON); + ClearBackground(RL_BLANK); + DrawSamplesMap(samples, totalSamples, currentSample, (Rectangle){ 0, 0, waveTarget.texture.width, waveTarget.texture.height }, RL_MAROON); EndTextureMode(); // TODO: Apply antialiasing shader - DrawTextureEx(waveTarget.texture, (Vector2){ waveRec.x, waveRec.y }, 0.0f, 1.0f, WHITE); - DrawRectangle(waveRec.x + (int)currentSample*1215/totalSamples, waveRec.y, 2, 99, DARKGRAY); + DrawTextureEx(waveTarget.texture, (Vector2){ waveRec.x, waveRec.y }, 0.0f, 1.0f, RL_WHITE); + DrawRectangle(waveRec.x + (int)currentSample*1215/totalSamples, waveRec.y, 2, 99, RL_DARKGRAY); } } @@ -487,7 +487,7 @@ static void DrawSamplesMap(Sample *samples, int sampleCount, int playedSamples, for (int i = 0; i < sampleCount - 1; i++) { - if (i < playedSamples) col = GRAY; + if (i < playedSamples) col = RL_GRAY; else col = color; DrawLineV((Vector2){ (float)bounds.x + (float)i*sampleIncrementX, (float)(bounds.y + bounds.height/2) + samples[i].value*bounds.height }, diff --git a/games/wave_collector/screens/screen_logo.c b/games/wave_collector/screens/screen_logo.c index 5f18a3210..ee940f393 100644 --- a/games/wave_collector/screens/screen_logo.c +++ b/games/wave_collector/screens/screen_logo.c @@ -137,34 +137,34 @@ void DrawLogoScreen(void) { if (state == 0) { - if ((framesCounter/10)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, BLACK); + if ((framesCounter/10)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, RL_BLACK); } else if (state == 1) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); } else if (state == 2) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); - DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, BLACK); + DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, RL_BLACK); } else if (state == 3) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(RL_BLACK, alpha)); - DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(RL_BLACK, alpha)); - DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RAYWHITE, alpha)); + DrawRectangle(GetScreenWidth()/2 - 112, GetScreenHeight()/2 - 112, 224, 224, Fade(RL_RAYWHITE, alpha)); - DrawText(SubText("raylib", 0, lettersCount), GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(BLACK, alpha)); + DrawText(SubText("raylib", 0, lettersCount), GetScreenWidth()/2 - 44, GetScreenHeight()/2 + 48, 50, Fade(RL_BLACK, alpha)); - if (framesCounter > 20) DrawText("powered by", logoPositionX, logoPositionY - 27, 20, Fade(DARKGRAY, alpha)); + if (framesCounter > 20) DrawText("powered by", logoPositionX, logoPositionY - 27, 20, Fade(RL_DARKGRAY, alpha)); } } diff --git a/games/wave_collector/screens/screen_title.c b/games/wave_collector/screens/screen_title.c index 5c414f4f3..af59aecb0 100644 --- a/games/wave_collector/screens/screen_title.c +++ b/games/wave_collector/screens/screen_title.c @@ -82,16 +82,16 @@ void UpdateTitleScreen(void) // Title Screen Draw logic void DrawTitleScreen(void) { - DrawTexture(texBackground, 0, 0, WHITE); - DrawTexture(texTitle, GetScreenWidth()/2 - texTitle.width/2, -25, Fade(WHITE, titleAlpha)); + DrawTexture(texBackground, 0, 0, RL_WHITE); + DrawTexture(texTitle, GetScreenWidth()/2 - texTitle.width/2, -25, Fade(RL_WHITE, titleAlpha)); - DrawRectangle(0, GetScreenHeight() - 70, 560, 40, Fade(RAYWHITE, 0.8f)); - DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 36, GetScreenHeight() - 60, 20, DARKBLUE); + DrawRectangle(0, GetScreenHeight() - 70, 560, 40, Fade(RL_RAYWHITE, 0.8f)); + DrawText("(c) Developed by Ramon Santamaria (@raysan5)", 36, GetScreenHeight() - 60, 20, RL_DARKBLUE); - DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, DARKGRAY); - DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, WHITE); + DrawText("powered by", GetScreenWidth() - 162, GetScreenHeight() - 190, 20, RL_DARKGRAY); + DrawTexture(texLogo, GetScreenWidth() - 128 - 34, GetScreenHeight() - 128 - 36, RL_WHITE); - if ((framesCounter > 160) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to start", (Vector2){ 325, 500 }, font.baseSize, 0, SKYBLUE); + if ((framesCounter > 160) && ((framesCounter/40)%2)) DrawTextEx(font, "mouse click to start", (Vector2){ 325, 500 }, font.baseSize, 0, RL_SKYBLUE); } // Title Screen Unload logic diff --git a/games/wave_collector/wave_collector.c b/games/wave_collector/wave_collector.c index 0a04310d4..da0943809 100644 --- a/games/wave_collector/wave_collector.c +++ b/games/wave_collector/wave_collector.c @@ -235,7 +235,7 @@ static void UpdateTransition(void) // Draw transition effect (full-screen rectangle) static void DrawTransition(void) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, transAlpha)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_RAYWHITE, transAlpha)); } // Update and draw game frame @@ -289,7 +289,7 @@ static void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); switch(currentScreen) { diff --git a/projects/CMake/core_basic_window.c b/projects/CMake/core_basic_window.c index 176f46c91..c53d48cf5 100644 --- a/projects/CMake/core_basic_window.c +++ b/projects/CMake/core_basic_window.c @@ -45,9 +45,9 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); + DrawText("Congrats! You created your first window!", 190, 200, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/projects/CodeBlocks/core_basic_window.c b/projects/CodeBlocks/core_basic_window.c index 588f80c23..6c7aebe5d 100644 --- a/projects/CodeBlocks/core_basic_window.c +++ b/projects/CodeBlocks/core_basic_window.c @@ -45,9 +45,9 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); + DrawText("Congrats! You created your first window!", 190, 200, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/projects/Geany/core_basic_window.c b/projects/Geany/core_basic_window.c index 96d0f1398..37b3d7781 100644 --- a/projects/Geany/core_basic_window.c +++ b/projects/Geany/core_basic_window.c @@ -35,9 +35,9 @@ int main() //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); - DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); + DrawText("Congrats! You created your first window!", 190, 200, 20, RL_LIGHTGRAY); EndDrawing(); //---------------------------------------------------------------------------------- diff --git a/projects/VS2015.UWP/raylib.App.UWP/App.cpp b/projects/VS2015.UWP/raylib.App.UWP/App.cpp index 6ce6915c1..627be400b 100644 --- a/projects/VS2015.UWP/raylib.App.UWP/App.cpp +++ b/projects/VS2015.UWP/raylib.App.UWP/App.cpp @@ -451,17 +451,17 @@ void App::Run() // Draw BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); posX += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_X] * 5; posY += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_Y] * -5; - DrawRectangle(posX, posY, 400, 100, RED); + DrawRectangle(posX, posY, 400, 100, RL_RED); - DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE); + DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), RL_BLUE); - DrawCircle(mousePosition.x, mousePosition.y, 40, BLUE); + DrawCircle(mousePosition.x, mousePosition.y, 40, RL_BLUE); - if (UWPIsKeyDown(KEY_S)) DrawCircle(100, 100, 100, BLUE); + if (UWPIsKeyDown(KEY_S)) DrawCircle(100, 100, 100, RL_BLUE); if (UWPIsKeyPressed(KEY_A)) { @@ -475,15 +475,15 @@ void App::Run() UWPDisableCursor(); } - if (currentKeyState[KEY_LEFT_ALT]) DrawRectangle(250, 250, 20, 20, BLACK); - if (currentKeyState[KEY_BACKSPACE]) DrawRectangle(280, 250, 20, 20, BLACK); - if (currentMouseState[MOUSE_LEFT_BUTTON]) DrawRectangle(280, 250, 20, 20, BLACK); + if (currentKeyState[KEY_LEFT_ALT]) DrawRectangle(250, 250, 20, 20, RL_BLACK); + if (currentKeyState[KEY_BACKSPACE]) DrawRectangle(280, 250, 20, 20, RL_BLACK); + if (currentMouseState[MOUSE_LEFT_BUTTON]) DrawRectangle(280, 250, 20, 20, RL_BLACK); static int pos = 0; pos -= currentMouseWheelY; - DrawRectangle(280, pos + 50, 20, 20, BLACK); - DrawRectangle(250, 280 + (time++ % 60), 10, 10, PURPLE); + DrawRectangle(280, pos + 50, 20, 20, RL_BLACK); + DrawRectangle(250, 280 + (time++ % 60), 10, 10, RL_PURPLE); EndDrawing(); diff --git a/projects/VSCode/main.c b/projects/VSCode/main.c index e79184226..bdf25f2d7 100644 --- a/projects/VSCode/main.c +++ b/projects/VSCode/main.c @@ -23,13 +23,13 @@ int main() { cam.position.z = cos(GetTime()) * 10.f; BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); BeginMode3D(cam); - DrawCube(cubePos, 2.f, 2.f, 2.f, RED); - DrawCubeWires(cubePos, 2.f, 2.f, 2.f, MAROON); + DrawCube(cubePos, 2.f, 2.f, 2.f, RL_RED); + DrawCubeWires(cubePos, 2.f, 2.f, 2.f, RL_MAROON); DrawGrid(10, 1.f); EndMode3D(); - DrawText("This is a raylib example", 10, 40, 20, DARKGRAY); + DrawText("This is a raylib example", 10, 40, 20, RL_DARKGRAY); DrawFPS(10, 10); EndDrawing(); } diff --git a/src/core.c b/src/core.c index fe50ce173..9bf6149fd 100644 --- a/src/core.c +++ b/src/core.c @@ -1056,8 +1056,8 @@ void EndDrawing(void) if (((gifFramesCounter/15)%2) == 1) { - DrawCircle(30, screenHeight - 20, 10, RED); - DrawText("RECORDING", 50, screenHeight - 25, 10, MAROON); + DrawCircle(30, screenHeight - 20, 10, RL_RED); + DrawText("RECORDING", 50, screenHeight - 25, 10, RL_MAROON); } rlglDraw(); // Draw RECORDING message @@ -2423,9 +2423,9 @@ static bool InitGraphicsDevice(int width, int height) { EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, // Type of context support -> Required on RPI? //EGL_SURFACE_TYPE, EGL_WINDOW_BIT, // Don't use it on Android! - EGL_RED_SIZE, 8, // RED color bit depth (alternative: 5) - EGL_GREEN_SIZE, 8, // GREEN color bit depth (alternative: 6) - EGL_BLUE_SIZE, 8, // BLUE color bit depth (alternative: 5) + EGL_RED_SIZE, 8, // RL_RED color bit depth (alternative: 5) + EGL_GREEN_SIZE, 8, // RL_GREEN color bit depth (alternative: 6) + EGL_BLUE_SIZE, 8, // RL_BLUE color bit depth (alternative: 5) //EGL_ALPHA_SIZE, 8, // ALPHA bit depth (required for transparent framebuffer) //EGL_TRANSPARENT_TYPE, EGL_NONE, // Request transparent framebuffer (EGL_TRANSPARENT_RGB does not work on RPI) EGL_DEPTH_SIZE, 16, // Depth buffer size (Required to use Depth testing!) @@ -2740,7 +2740,7 @@ static bool InitGraphicsDevice(int width, int height) rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix rlLoadIdentity(); // Reset current matrix (MODELVIEW) - ClearBackground(RAYWHITE); // Default background color for raylib games :P + ClearBackground(RL_RAYWHITE); // Default background color for raylib games :P #if defined(PLATFORM_ANDROID) windowReady = true; // IMPORTANT! @@ -4418,36 +4418,36 @@ static void LogoAnimation(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); if (state == 0) { - if ((framesCounter/12)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, BLACK); + if ((framesCounter/12)%2) DrawRectangle(logoPositionX, logoPositionY, 16, 16, RL_BLACK); } else if (state == 1) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); } else if (state == 2) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, BLACK); - DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, BLACK); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY, 16, leftSideRecHeight, RL_BLACK); - DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, BLACK); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, BLACK); + DrawRectangle(logoPositionX + 240, logoPositionY, 16, rightSideRecHeight, RL_BLACK); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, RL_BLACK); } else if (state == 3) { - DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY, topSideRecWidth, 16, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 16, 16, leftSideRecHeight - 32, Fade(RL_BLACK, alpha)); - DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(BLACK, alpha)); - DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(BLACK, alpha)); + DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, Fade(RL_BLACK, alpha)); + DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, Fade(RL_BLACK, alpha)); - DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, Fade(RAYWHITE, alpha)); + DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, Fade(RL_RAYWHITE, alpha)); - DrawText(SubText("raylib", 0, lettersCount), screenWidth/2 - 44, screenHeight/2 + 48, 50, Fade(BLACK, alpha)); + DrawText(SubText("raylib", 0, lettersCount), screenWidth/2 - 44, screenHeight/2 + 48, 50, Fade(RL_BLACK, alpha)); } EndDrawing(); diff --git a/src/external/glfw/src/mappings.h b/src/external/glfw/src/mappings.h index 97073db50..ee6a0b390 100644 --- a/src/external/glfw/src/mappings.h +++ b/src/external/glfw/src/mappings.h @@ -105,7 +105,7 @@ const char* _glfwDefaultMappings[] = "03000000d81d00000f00000000000000,iBUFFALO BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", "03000000d81d00001000000000000000,iBUFFALO BSGP1204P Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,", "03000000830500006020000000000000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Windows,", -"03000000b50700001403000000000000,IMPACT BLACK,a:b2,b:b3,back:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,", +"03000000b50700001403000000000000,IMPACT RL_BLACK,a:b2,b:b3,back:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,", "030000006f0e00002401000000000000,INJUSTICE FightStick for PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,", "03000000491900000204000000000000,Ipega PG-9023,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,", "030000006d04000011c2000000000000,Logitech Cordless Wingman,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b5,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b2,righttrigger:b7,rightx:a3,righty:a4,x:b4,platform:Windows,", diff --git a/src/models.c b/src/models.c index 03998d18c..38e7cdd6e 100644 --- a/src/models.c +++ b/src/models.c @@ -1465,7 +1465,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) Vector3 v7 = { w*(x - 0.5f), 0, h*(z + 0.5f) }; Vector3 v8 = { w*(x + 0.5f), 0, h*(z + 0.5f) }; - // We check pixel color to be WHITE, we will full cubes + // We check pixel color to be RL_WHITE, we will full cubes if ((cubicmapPixels[z*cubicmap.width + x].r == 255) && (cubicmapPixels[z*cubicmap.width + x].g == 255) && (cubicmapPixels[z*cubicmap.width + x].b == 255)) @@ -1651,7 +1651,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) tcCounter += 6; } } - // We check pixel color to be BLACK, we will only draw floor and roof + // We check pixel color to be RL_BLACK, we will only draw floor and roof else if ((cubicmapPixels[z*cubicmap.width + x].r == 0) && (cubicmapPixels[z*cubicmap.width + x].g == 0) && (cubicmapPixels[z*cubicmap.width + x].b == 0)) @@ -1790,8 +1790,8 @@ Material LoadMaterialDefault(void) //material.maps[MAP_NORMAL].texture; // NOTE: By default, not set //material.maps[MAP_SPECULAR].texture; // NOTE: By default, not set - material.maps[MAP_DIFFUSE].color = WHITE; // Diffuse color - material.maps[MAP_SPECULAR].color = WHITE; // Specular color + material.maps[MAP_DIFFUSE].color = RL_WHITE; // Diffuse color + material.maps[MAP_SPECULAR].color = RL_WHITE; // Specular color return material; } @@ -1803,7 +1803,7 @@ void UnloadMaterial(Material material) if (material.shader.id != GetShaderDefault().id) UnloadShader(material.shader); // Unload loaded texture maps (avoid unloading default texture, managed by raylib) - for (int i = 0; i < MAX_MATERIAL_MAPS; i++) + for (int i = 0; i < RL_MAX_MATERIAL_MAPS; i++) { if (material.maps[i].texture.id != GetTextureDefault().id) rlDeleteTextures(material.maps[i].texture.id); } diff --git a/src/raylib.h b/src/raylib.h index 8b7ca4893..ceef92d22 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -91,49 +91,49 @@ #define RL_DEG2RAD (RL_PI/180.0f) #define RL_RAD2DEG (180.0f/RL_PI) -#define RL_MAX_TOUCH_POINTS 10 // Maximum number of touch points supported +#define RL_MAX_TOUCH_POINTS 10 // Maximum number of touch points supported // Shader and material limits -#define MAX_SHADER_LOCATIONS 32 // Maximum number of predefined locations stored in shader struct -#define MAX_MATERIAL_MAPS 12 // Maximum number of texture maps stored in shader struct +#define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of predefined locations stored in shader struct +#define RL_MAX_MATERIAL_MAPS 12 // Maximum number of texture maps stored in shader struct // NOTE: MSC C++ compiler does not support compound literals (C99 feature) // Plain structures in C++ (without constructors) can be initialized from { } initializers. #if defined(__cplusplus) - #define CLITERAL + #define RL_CLITERAL #else - #define CLITERAL (Color) + #define RL_CLITERAL (Color) #endif // Some Basic Colors -// NOTE: Custom raylib color palette for amazing visuals on WHITE background -#define LIGHTGRAY CLITERAL{ 200, 200, 200, 255 } // Light Gray -#define GRAY CLITERAL{ 130, 130, 130, 255 } // Gray -#define DARKGRAY CLITERAL{ 80, 80, 80, 255 } // Dark Gray -#define YELLOW CLITERAL{ 253, 249, 0, 255 } // Yellow -#define GOLD CLITERAL{ 255, 203, 0, 255 } // Gold -#define ORANGE CLITERAL{ 255, 161, 0, 255 } // Orange -#define PINK CLITERAL{ 255, 109, 194, 255 } // Pink -#define RED CLITERAL{ 230, 41, 55, 255 } // Red -#define MAROON CLITERAL{ 190, 33, 55, 255 } // Maroon -#define GREEN CLITERAL{ 0, 228, 48, 255 } // Green -#define LIME CLITERAL{ 0, 158, 47, 255 } // Lime -#define DARKGREEN CLITERAL{ 0, 117, 44, 255 } // Dark Green -#define SKYBLUE CLITERAL{ 102, 191, 255, 255 } // Sky Blue -#define BLUE CLITERAL{ 0, 121, 241, 255 } // Blue -#define DARKBLUE CLITERAL{ 0, 82, 172, 255 } // Dark Blue -#define PURPLE CLITERAL{ 200, 122, 255, 255 } // Purple -#define VIOLET CLITERAL{ 135, 60, 190, 255 } // Violet -#define DARKPURPLE CLITERAL{ 112, 31, 126, 255 } // Dark Purple -#define BEIGE CLITERAL{ 211, 176, 131, 255 } // Beige -#define BROWN CLITERAL{ 127, 106, 79, 255 } // Brown -#define DARKBROWN CLITERAL{ 76, 63, 47, 255 } // Dark Brown +// NOTE: Custom raylib color palette for amazing visuals on RL_WHITE background +#define RL_LIGHTGRAY RL_CLITERAL{ 200, 200, 200, 255 } // Light Gray +#define RL_GRAY RL_CLITERAL{ 130, 130, 130, 255 } // Gray +#define RL_DARKGRAY RL_CLITERAL{ 80, 80, 80, 255 } // Dark Gray +#define RL_YELLOW RL_CLITERAL{ 253, 249, 0, 255 } // Yellow +#define RL_GOLD RL_CLITERAL{ 255, 203, 0, 255 } // Gold +#define RL_ORANGE RL_CLITERAL{ 255, 161, 0, 255 } // Orange +#define RL_PINK RL_CLITERAL{ 255, 109, 194, 255 } // Pink +#define RL_RED RL_CLITERAL{ 230, 41, 55, 255 } // Red +#define RL_MAROON RL_CLITERAL{ 190, 33, 55, 255 } // Maroon +#define RL_GREEN RL_CLITERAL{ 0, 228, 48, 255 } // Green +#define RL_LIME RL_CLITERAL{ 0, 158, 47, 255 } // Lime +#define RL_DARKGREEN RL_CLITERAL{ 0, 117, 44, 255 } // Dark Green +#define RL_SKYBLUE RL_CLITERAL{ 102, 191, 255, 255 } // Sky Blue +#define RL_BLUE RL_CLITERAL{ 0, 121, 241, 255 } // Blue +#define RL_DARKBLUE RL_CLITERAL{ 0, 82, 172, 255 } // Dark Blue +#define RL_PURPLE RL_CLITERAL{ 200, 122, 255, 255 } // Purple +#define RL_VIOLET RL_CLITERAL{ 135, 60, 190, 255 } // Violet +#define RL_DARKPURPLE RL_CLITERAL{ 112, 31, 126, 255 } // Dark Purple +#define RL_BEIGE RL_CLITERAL{ 211, 176, 131, 255 } // Beige +#define RL_BROWN RL_CLITERAL{ 127, 106, 79, 255 } // Brown +#define RL_DARKBROWN RL_CLITERAL{ 76, 63, 47, 255 } // Dark Brown -#define WHITE CLITERAL{ 255, 255, 255, 255 } // White -#define BLACK CLITERAL{ 0, 0, 0, 255 } // Black -#define BLANK CLITERAL{ 0, 0, 0, 0 } // Blank (Transparent) -#define MAGENTA CLITERAL{ 255, 0, 255, 255 } // Magenta -#define RAYWHITE CLITERAL{ 245, 245, 245, 255 } // My own White (raylib logo) +#define RL_WHITE RL_CLITERAL{ 255, 255, 255, 255 } // White +#define RL_BLACK RL_CLITERAL{ 0, 0, 0, 255 } // Black +#define RL_BLANK RL_CLITERAL{ 0, 0, 0, 0 } // Blank (Transparent) +#define RL_MAGENTA RL_CLITERAL{ 255, 0, 255, 255 } // Magenta +#define RL_RAYWHITE RL_CLITERAL{ 245, 245, 245, 255 } // My own White (raylib logo) //---------------------------------------------------------------------------------- // Structures Definition @@ -310,7 +310,7 @@ typedef struct Mesh { // Shader type (generic) typedef struct Shader { unsigned int id; // Shader program id - int locs[MAX_SHADER_LOCATIONS]; // Shader locations array + int locs[RL_MAX_SHADER_LOCATIONS]; // Shader locations array } Shader; // Material texture map @@ -323,7 +323,7 @@ typedef struct MaterialMap { // Material type (generic) typedef struct Material { Shader shader; // Material shader - MaterialMap maps[MAX_MATERIAL_MAPS]; // Material maps + MaterialMap maps[RL_MAX_MATERIAL_MAPS]; // Material maps float *params; // Material generic parameters (if required) } Material; diff --git a/src/rlgl.h b/src/rlgl.h index 717fb1b8c..39d61b751 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -214,13 +214,13 @@ typedef unsigned char byte; } Mesh; // Shader and material limits - #define MAX_SHADER_LOCATIONS 32 - #define MAX_MATERIAL_MAPS 12 + #define RL_MAX_SHADER_LOCATIONS 32 + #define RL_MAX_MATERIAL_MAPS 12 // Shader type (generic) typedef struct Shader { unsigned int id; // Shader program id - int locs[MAX_SHADER_LOCATIONS]; // Shader locations array + int locs[RL_MAX_SHADER_LOCATIONS]; // Shader locations array } Shader; // Material texture map @@ -233,7 +233,7 @@ typedef unsigned char byte; // Material type (generic) typedef struct Material { Shader shader; // Material shader - MaterialMap maps[MAX_MATERIAL_MAPS]; // Material maps + MaterialMap maps[RL_MAX_MATERIAL_MAPS]; // Material maps float *params; // Material generic parameters (if required) } Material; @@ -2253,7 +2253,7 @@ void rlLoadMesh(Mesh *mesh, bool dynamic) } else { - // Default color vertex attribute set to WHITE + // Default color vertex attribute set to RL_WHITE glVertexAttrib3f(2, 1.0f, 1.0f, 1.0f); glDisableVertexAttribArray(2); } @@ -2269,7 +2269,7 @@ void rlLoadMesh(Mesh *mesh, bool dynamic) } else { - // Default color vertex attribute set to WHITE + // Default color vertex attribute set to RL_WHITE glVertexAttrib4f(3, 1.0f, 1.0f, 1.0f, 1.0f); glDisableVertexAttribArray(3); } @@ -2458,7 +2458,7 @@ void rlDrawMesh(Mesh mesh, Material material, Matrix transform) //----------------------------------------------------- // Bind active texture maps (if available) - for (int i = 0; i < MAX_MATERIAL_MAPS; i++) + for (int i = 0; i < RL_MAX_MATERIAL_MAPS; i++) { if (material.maps[i].texture.id > 0) { @@ -2555,7 +2555,7 @@ void rlDrawMesh(Mesh mesh, Material material, Matrix transform) } // Unbind all binded texture maps - for (int i = 0; i < MAX_MATERIAL_MAPS; i++) + for (int i = 0; i < RL_MAX_MATERIAL_MAPS; i++) { glActiveTexture(GL_TEXTURE0 + i); // Set shader active texture if ((i == MAP_IRRADIANCE) || (i == MAP_PREFILTER) || (i == MAP_CUBEMAP)) glBindTexture(GL_TEXTURE_CUBE_MAP, 0); @@ -2799,7 +2799,7 @@ Shader LoadShaderCode(char *vsCode, char *fsCode) Shader shader = { 0 }; // NOTE: All locations must be reseted to -1 (no location) - for (int i = 0; i < MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1; + for (int i = 0; i < RL_MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) unsigned int vertexShaderId = defaultVShaderId; @@ -3670,7 +3670,7 @@ static Shader LoadShaderDefault(void) Shader shader = { 0 }; // NOTE: All locations must be reseted to -1 (no location) - for (int i = 0; i < MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1; + for (int i = 0; i < RL_MAX_SHADER_LOCATIONS; i++) shader.locs[i] = -1; // Vertex shader directly defined, no external file required char defaultVShaderStr[] = diff --git a/src/text.c b/src/text.c index 80b75f106..5fcbd13d4 100644 --- a/src/text.c +++ b/src/text.c @@ -176,7 +176,7 @@ extern void LoadDefaultFont(void) Color *imagePixels = (Color *)malloc(imWidth*imHeight*sizeof(Color)); - for (int i = 0; i < imWidth*imHeight; i++) imagePixels[i] = BLANK; // Initialize array + for (int i = 0; i < imWidth*imHeight; i++) imagePixels[i] = RL_BLANK; // Initialize array int counter = 0; // Font data elements counter @@ -185,7 +185,7 @@ extern void LoadDefaultFont(void) { for (int j = 31; j >= 0; j--) { - if (BIT_CHECK(defaultFontData[counter], j)) imagePixels[i+j] = WHITE; + if (BIT_CHECK(defaultFontData[counter], j)) imagePixels[i+j] = RL_WHITE; } counter++; @@ -284,7 +284,7 @@ Font LoadFont(const char *fileName) #endif { Image image = LoadImage(fileName); - if (image.data != NULL) font = LoadFontFromImage(image, MAGENTA, DEFAULT_FIRST_CHAR); + if (image.data != NULL) font = LoadFontFromImage(image, RL_MAGENTA, DEFAULT_FIRST_CHAR); UnloadImage(image); } @@ -398,9 +398,9 @@ Font LoadFontFromImage(Image image, Color key, int firstChar) // NOTE: We need to remove key color borders from image to avoid weird // artifacts on texture scaling when using FILTER_BILINEAR or FILTER_TRILINEAR - for (int i = 0; i < image.height*image.width; i++) if (COLOR_EQUAL(pixels[i], key)) pixels[i] = BLANK; + for (int i = 0; i < image.height*image.width; i++) if (COLOR_EQUAL(pixels[i], key)) pixels[i] = RL_BLANK; - // Create a new image with the processed color data (key color replaced by BLANK) + // Create a new image with the processed color data (key color replaced by RL_BLANK) Image fontClear = LoadImageEx(pixels, image.width, image.height); free(pixels); // Free pixels array memory @@ -700,7 +700,7 @@ void DrawFPS(int posX, int posY) } // NOTE: We have rounding errors every frame, so it oscillates a lot - DrawText(FormatText("%2i FPS", fps), posX, posY, 20, LIME); + DrawText(FormatText("%2i FPS", fps), posX, posY, 20, RL_LIME); } // Draw text (using default font) diff --git a/src/textures.c b/src/textures.c index fa1d7f0ef..ffa0189b4 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1418,8 +1418,8 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) // NOTE: We will store the dithered data as unsigned short (16bpp) image->data = (unsigned short *)malloc(image->width*image->height*sizeof(unsigned short)); - Color oldPixel = WHITE; - Color newPixel = WHITE; + Color oldPixel = RL_WHITE; + Color newPixel = RL_WHITE; int rError, gError, bError; unsigned short rPixel, gPixel, bPixel, aPixel; // Used for 16bit pixel composition @@ -1498,7 +1498,7 @@ Color *ImageExtractPalette(Image image, int maxPaletteSize, int *extractCount) Color *palette = (Color *)malloc(maxPaletteSize*sizeof(Color)); int palCount = 0; - for (int i = 0; i < maxPaletteSize; i++) palette[i] = BLANK; // Set all colors to BLANK + for (int i = 0; i < maxPaletteSize; i++) palette[i] = RL_BLANK; // Set all colors to RL_BLANK for (int i = 0; i < image.width*image.height; i++) { @@ -1681,7 +1681,7 @@ Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Co ImageColorTint(&imFont, tint); // Apply color tint to font // Create image to store text - Image imText = GenImageColor((int)imSize.x, (int)imSize.y, BLANK); + Image imText = GenImageColor((int)imSize.x, (int)imSize.y, RL_BLANK); for (int i = 0; i < length; i++) { @@ -2182,8 +2182,8 @@ Image GenImageWhiteNoise(int width, int height, float factor) for (int i = 0; i < width*height; i++) { - if (GetRandomValue(0, 99) < (int)(factor*100.0f)) pixels[i] = WHITE; - else pixels[i] = BLACK; + if (GetRandomValue(0, 99) < (int)(factor*100.0f)) pixels[i] = RL_WHITE; + else pixels[i] = RL_BLACK; } Image image = LoadImageEx(pixels, width, height); diff --git a/templates/advance_game/advance_game.c b/templates/advance_game/advance_game.c index 48a34f6d7..1ab165e7c 100644 --- a/templates/advance_game/advance_game.c +++ b/templates/advance_game/advance_game.c @@ -206,7 +206,7 @@ static void UpdateTransition(void) // Draw transition effect (full-screen rectangle) static void DrawTransition(void) { - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, transAlpha)); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_BLACK, transAlpha)); } // Update and draw game frame @@ -267,7 +267,7 @@ static void UpdateDrawFrame(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); switch(currentScreen) { diff --git a/templates/advance_game/screens/screen_ending.c b/templates/advance_game/screens/screen_ending.c index 66b5ddf9f..5d433fbbb 100644 --- a/templates/advance_game/screens/screen_ending.c +++ b/templates/advance_game/screens/screen_ending.c @@ -63,9 +63,9 @@ void UpdateEndingScreen(void) void DrawEndingScreen(void) { // TODO: Draw ENDING screen here! - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE); - DrawTextEx(font, "ENDING SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, DARKBLUE); - DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, DARKBLUE); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_BLUE); + DrawTextEx(font, "ENDING SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, RL_DARKBLUE); + DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, RL_DARKBLUE); } // Ending Screen Unload logic diff --git a/templates/advance_game/screens/screen_gameplay.c b/templates/advance_game/screens/screen_gameplay.c index 8943adb5a..c19a12917 100644 --- a/templates/advance_game/screens/screen_gameplay.c +++ b/templates/advance_game/screens/screen_gameplay.c @@ -63,9 +63,9 @@ void UpdateGameplayScreen(void) void DrawGameplayScreen(void) { // TODO: Draw GAMEPLAY screen here! - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), PURPLE); - DrawTextEx(font, "GAMEPLAY SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, MAROON); - DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, MAROON); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_PURPLE); + DrawTextEx(font, "GAMEPLAY SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, RL_MAROON); + DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, RL_MAROON); } // Gameplay Screen Unload logic diff --git a/templates/advance_game/screens/screen_logo.c b/templates/advance_game/screens/screen_logo.c index 6282e83ed..ebb455c45 100644 --- a/templates/advance_game/screens/screen_logo.c +++ b/templates/advance_game/screens/screen_logo.c @@ -68,10 +68,10 @@ void UpdateLogoScreen(void) void DrawLogoScreen(void) { // TODO: Draw LOGO screen here! - DrawTextEx(font, "LOGO SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, GRAY); - DrawText("WAIT for 2 SECONDS...", 290, 400, 20, GRAY); + DrawTextEx(font, "LOGO SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, RL_GRAY); + DrawText("WAIT for 2 SECONDS...", 290, 400, 20, RL_GRAY); - DrawTexture(logo, GetScreenWidth()/2 - logo.width/2, 100, WHITE); + DrawTexture(logo, GetScreenWidth()/2 - logo.width/2, 100, RL_WHITE); } // Logo Screen Unload logic diff --git a/templates/advance_game/screens/screen_title.c b/templates/advance_game/screens/screen_title.c index 5727546a3..7549c267f 100644 --- a/templates/advance_game/screens/screen_title.c +++ b/templates/advance_game/screens/screen_title.c @@ -64,9 +64,9 @@ void UpdateTitleScreen(void) void DrawTitleScreen(void) { // TODO: Draw TITLE screen here! - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), GREEN); - DrawTextEx(font, "TITLE SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, DARKGREEN); - DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, DARKGREEN); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_GREEN); + DrawTextEx(font, "TITLE SCREEN", (Vector2){ 20, 10 }, font.baseSize*3, 4, RL_DARKGREEN); + DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, RL_DARKGREEN); } // Title Screen Unload logic diff --git a/templates/simple_game/simple_game.c b/templates/simple_game/simple_game.c index 028b1da89..9854efd6d 100644 --- a/templates/simple_game/simple_game.c +++ b/templates/simple_game/simple_game.c @@ -97,39 +97,39 @@ int main(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); switch(currentScreen) { case LOGO: { // TODO: Draw LOGO screen here! - DrawText("LOGO SCREEN", 20, 20, 40, LIGHTGRAY); - DrawText("WAIT for 2 SECONDS...", 290, 220, 20, GRAY); + DrawText("LOGO SCREEN", 20, 20, 40, RL_LIGHTGRAY); + DrawText("WAIT for 2 SECONDS...", 290, 220, 20, RL_GRAY); } break; 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); + DrawRectangle(0, 0, screenWidth, screenHeight, RL_GREEN); + DrawText("TITLE SCREEN", 20, 20, 40, RL_DARKGREEN); + DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, RL_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); + DrawRectangle(0, 0, screenWidth, screenHeight, RL_PURPLE); + DrawText("GAMEPLAY SCREEN", 20, 20, 40, RL_MAROON); + DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, RL_MAROON); } break; 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); + DrawRectangle(0, 0, screenWidth, screenHeight, RL_BLUE); + DrawText("ENDING SCREEN", 20, 20, 40, RL_DARKBLUE); + DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, RL_DARKBLUE); } break; default: break; diff --git a/templates/standard_game/screens/screen_ending.c b/templates/standard_game/screens/screen_ending.c index 871969779..cde02cf09 100644 --- a/templates/standard_game/screens/screen_ending.c +++ b/templates/standard_game/screens/screen_ending.c @@ -62,9 +62,9 @@ void UpdateEndingScreen(void) void DrawEndingScreen(void) { // TODO: Draw ENDING screen here! - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE); - DrawText("ENDING SCREEN", 20, 20, 40, DARKBLUE); - DrawText("PRESS ENTER to RETURN to TITLE SCREEN", 120, 220, 20, DARKBLUE); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_BLUE); + DrawText("ENDING SCREEN", 20, 20, 40, RL_DARKBLUE); + DrawText("PRESS ENTER to RETURN to TITLE SCREEN", 120, 220, 20, RL_DARKBLUE); } // Ending Screen Unload logic diff --git a/templates/standard_game/screens/screen_gameplay.c b/templates/standard_game/screens/screen_gameplay.c index 7f108265a..805add8eb 100644 --- a/templates/standard_game/screens/screen_gameplay.c +++ b/templates/standard_game/screens/screen_gameplay.c @@ -62,9 +62,9 @@ void UpdateGameplayScreen(void) void DrawGameplayScreen(void) { // TODO: Draw GAMEPLAY screen here! - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), PURPLE); - DrawText("GAMEPLAY SCREEN", 20, 20, 40, MAROON); - DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, MAROON); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_PURPLE); + DrawText("GAMEPLAY SCREEN", 20, 20, 40, RL_MAROON); + DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, RL_MAROON); } // Gameplay Screen Unload logic diff --git a/templates/standard_game/screens/screen_logo.c b/templates/standard_game/screens/screen_logo.c index c0b60571a..88b5bbd22 100644 --- a/templates/standard_game/screens/screen_logo.c +++ b/templates/standard_game/screens/screen_logo.c @@ -64,8 +64,8 @@ void UpdateLogoScreen(void) void DrawLogoScreen(void) { // TODO: Draw LOGO screen here! - DrawText("LOGO SCREEN", 20, 20, 40, LIGHTGRAY); - DrawText("WAIT for 2 SECONDS...", 290, 220, 20, GRAY); + DrawText("LOGO SCREEN", 20, 20, 40, RL_LIGHTGRAY); + DrawText("WAIT for 2 SECONDS...", 290, 220, 20, RL_GRAY); } // Logo Screen Unload logic diff --git a/templates/standard_game/screens/screen_title.c b/templates/standard_game/screens/screen_title.c index 328448bac..126a7bb06 100644 --- a/templates/standard_game/screens/screen_title.c +++ b/templates/standard_game/screens/screen_title.c @@ -63,9 +63,9 @@ void UpdateTitleScreen(void) void DrawTitleScreen(void) { // TODO: Draw TITLE screen here! - DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), GREEN); - DrawText("TITLE SCREEN", 20, 20, 40, DARKGREEN); - DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, DARKGREEN); + DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_GREEN); + DrawText("TITLE SCREEN", 20, 20, 40, RL_DARKGREEN); + DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, RL_DARKGREEN); } // Title Screen Unload logic diff --git a/templates/standard_game/standard_game.c b/templates/standard_game/standard_game.c index 8871484e2..f60821b15 100644 --- a/templates/standard_game/standard_game.c +++ b/templates/standard_game/standard_game.c @@ -113,7 +113,7 @@ int main(void) //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RL_RAYWHITE); switch(currentScreen) {