From: Randy McShandy Date: Wed, 22 May 2024 20:49:40 +0000 (-0500) Subject: Updates for mingw windows build X-Git-Url: http://git.mcshandy.xyz/gitweb.cgi?a=commitdiff_plain;h=4d084b147d87d4639f34f9f9a00b0935e788b822;p=barrow_crawler Updates for mingw windows build --- diff --git a/src/render_raylib.c b/src/render_raylib.c index 89242cb..d0b8d09 100644 --- a/src/render_raylib.c +++ b/src/render_raylib.c @@ -1,7 +1,10 @@ #include #include #include + +#if POSIX_BC==1 #define RAYMATH_IMPLEMENTATION +#endif #include #include "structs.h" @@ -73,6 +76,8 @@ Vector4 orb_normal_color; float orb_intensity = 1.0f; /* TODO: normalized distance from center, but lighting shader already has this. */ Vector3 orb_directionality = {1.0f, 1.0f, 1.0f}; +int map_visible = 0; + typedef void(*renderfunc)(); typedef void(*controlfunc)(); #define MAX_RENDERFUNCS 2U @@ -109,13 +114,18 @@ void drawing_game_mode() DrawTextureEx(hand_01_texture, hand_position, hand_rotation, hand_scale, orb_color); -#define DEBUG_GAME_INFO 0 -#if DEBUG_GAME_INFO==1 Rectangle minimap_dest = {.width = 64.0f*img_export_scale.x, .height = 64.0f*img_export_scale.y, .x = 0.0f, .y = 0.0f}; Rectangle minimap_src = {.width = barrow_texture.width, .height = barrow_texture.height, .x = 0.0f, .y = 0.0f}; + if(map_visible) + { + DrawTexturePro(floor_texture, minimap_src, minimap_dest, (Vector2){0.0f, 0.0f}, 0.0f, RAYWHITE); + } + +#define DEBUG_GAME_INFO 0 +#if DEBUG_GAME_INFO==1 - DrawTexturePro(floor_texture, minimap_src, minimap_dest, (Vector2){0.0f, 0.0f}, 0.0f, RAYWHITE); DrawFPS(fscreen_dims.x - 80, 10); + DrawTexturePro(floor_texture, minimap_src, minimap_dest, (Vector2){0.0f, 0.0f}, 0.0f, RAYWHITE); DrawText(TextFormat("cam x %f\ncam y %f\ncam z %f", cam.position.x, cam.position.y, cam.position.z), 0, 128, 16, GREEN); DrawText(TextFormat("tgt x %f\ntgt y %f\ntgt z %f", cam.target.x, cam.target.y, cam.target.z), 0, 128+64, 16, GREEN); DrawText(TextFormat("rot x %f\nrot y %f\nrot z %f", player_angles.x, player_angles.y, player_angles.z), 0, 128+(64*2), 16, GREEN); @@ -130,6 +140,7 @@ void drawing_resource_wait_mode() { static int status_phase = 0; const char format_string[] = "%s\n\n%3.2f%%"; + const char tribute_string[] = "This game is dedicated to the North American Muskrat, Ondatra Zibethicus"; const char wait_string[] = "Generating resources..."; const int sector_speed = 2U; const int sector_segments = 16; @@ -153,6 +164,9 @@ void drawing_resource_wait_mode() (status_phase % 360), ((status_phase % 360)*2), sector_segments, LIGHTGRAY); + + DrawText(tribute_string, + (fscreen_dims.x/2.0f) - (MeasureText(tribute_string, font_size)/2.0f), 3.0f * (fscreen_dims.y/4.0f), font_size, BLACK); } void control_game_mode() @@ -190,6 +204,15 @@ void control_game_mode() cam.target.y -= DEG2RAD * 20.0; } + if (IsKeyDown(KEY_M)) + { + map_visible = 1; + } + else + { + map_visible = 0; + } + if (IsKeyReleased(KEY_ONE)) orb_color = RED; if (IsKeyReleased(KEY_TWO)) diff --git a/src/utils.c b/src/utils.c index 7dcff1d..89bdd4e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -10,9 +10,12 @@ #include "structs.h" #include "platform.h" +#if POSIX_BC == 1 #define STB_IMAGE_WRITE_IMPLEMENTATION -#include "external/stb_image_write.h" #define STB_IMAGE_RESIZE_IMPLEMENTATION +#endif + +#include "external/stb_image_write.h" #include "external/stb_image_resize2.h" #define SHADOW 1