diff options
| author | nathan <nathansmith@disroot.org> | 2025-11-24 09:49:11 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-11-24 09:49:11 +0000 |
| commit | e3d80fbb561d43e53d8fd7bac49f46dbadfd291e (patch) | |
| tree | 920c21c727da1c9488cc2f023e7317c5a93b5fc8 /src/map.c | |
| parent | fc72bf3d757340382ad8e422eb31e701577544f8 (diff) | |
| download | FindThings-e3d80fbb561d43e53d8fd7bac49f46dbadfd291e.tar.gz FindThings-e3d80fbb561d43e53d8fd7bac49f46dbadfd291e.tar.bz2 FindThings-e3d80fbb561d43e53d8fd7bac49f46dbadfd291e.zip | |
Working on things and broke something
This reverts commit fc72bf3d757340382ad8e422eb31e701577544f8.
Diffstat (limited to 'src/map.c')
| -rw-r--r-- | src/map.c | 35 |
1 files changed, 35 insertions, 0 deletions
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); +} |
