From e3d80fbb561d43e53d8fd7bac49f46dbadfd291e Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 24 Nov 2025 02:49:11 -0700 Subject: Working on things and broke something This reverts commit fc72bf3d757340382ad8e422eb31e701577544f8. --- src/map.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/map.c (limited to 'src/map.c') diff --git a/src/map.c b/src/map.c new file mode 100644 index 0000000..ebcb077 --- /dev/null +++ b/src/map.c @@ -0,0 +1,35 @@ +#include "map.h" +#include "game.h" + +void repositionMap(Map* map) +{ + map->rect.x = GetRenderWidth() - map->rect.width; +} + +void initMap(Map* map, const Settings* settings) +{ + *map = (Map){ + .rect = (Rectangle){0.0, 0.0, settings->mapPreviewSize, + settings->mapPreviewSize}, + .isEnabled = settings->isMapPreviewEnabledDefault, + .isFullSize = false + }; + + repositionMap(map); +} + +void updateMap(Map* map, Game* game) +{ + // Handle window resize. + if (IsWindowResized()) + { + repositionMap(map); + } + + if (!map->isEnabled) + { + return; + } + + DrawRectangleLinesEx(map->rect, 3.0, BLUE); +} -- cgit v1.2.3