]> git.mcshandy.xyz Git - barrow_crawler/commitdiff
Updates for mingw windows build
authorRandy McShandy <randy@mcshandy.xyz>
Wed, 22 May 2024 20:49:40 +0000 (15:49 -0500)
committerRandy McShandy <randy@mcshandy.xyz>
Wed, 22 May 2024 20:49:40 +0000 (15:49 -0500)
src/render_raylib.c
src/utils.c

index 89242cbb236269965b5f8cc4822350cc9bcbfd57..d0b8d09b7db41d8d20aeea0dacc815f5fd0b1d8d 100644 (file)
@@ -1,7 +1,10 @@
 #include <stddef.h>
 #include <raylib.h>
 #include <stdlib.h>
+
+#if POSIX_BC==1
 #define RAYMATH_IMPLEMENTATION
+#endif
 #include <raymath.h>
 
 #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))
index 7dcff1da0420b3784eb5083e84a1c873e4027c50..89bdd4e7f36a0da8c6354c6d418a936f7850cf9b 100644 (file)
 #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