From 8ddd30bbb47d4abbf8542f7822dcce8c334458a2 Mon Sep 17 00:00:00 2001 From: badbl0cks <4161747+badbl0cks@users.noreply.github.com> Date: Thu, 18 May 2023 11:49:10 -0700 Subject: [PATCH] Add basic map pin functionality - Define Point structure for 3D coordinates - Add map pin type constants - Implement placeholder functions for: * Player location loading * Map pin addition * Pin counting - Foundation for Korok seed tracking --- source/map_basic.c | 28 ++++++++++++++++++++++++++++ source/map_basic.h | 22 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 source/map_basic.c create mode 100644 source/map_basic.h diff --git a/source/map_basic.c b/source/map_basic.c new file mode 100644 index 0000000..7a7e4b3 --- /dev/null +++ b/source/map_basic.c @@ -0,0 +1,28 @@ +#include +#include +#include +#include "map_basic.h" + +static Point player_location = {0}; + +void loadPlayerLocation() { + printf("Loading player location...\n"); + // TODO: Read player position from save data + player_location.x = 0.0f; + player_location.y = 0.0f; + player_location.z = 0.0f; + printf("Player at: (%.1f, %.1f, %.1f)\n", + player_location.x, player_location.y, player_location.z); +} + +void addMapPin(u32 icon, Point location) { + printf("Adding map pin at (%.1f, %.1f, %.1f)\n", + location.x, location.y, location.z); + // TODO: Implement map pin addition to save data +} + +void countMapPins() { + printf("Counting map pins...\n"); + // TODO: Count existing pins in save data + printf("Found 0 map pins\n"); +} \ No newline at end of file diff --git a/source/map_basic.h b/source/map_basic.h new file mode 100644 index 0000000..99996f0 --- /dev/null +++ b/source/map_basic.h @@ -0,0 +1,22 @@ +#ifndef MAP_H +#define MAP_H + +#include +#include + +#define MAP_PIN_STAR 0x1F +#define MAP_PIN_LEAF 0x22 +#define MAP_PIN_EMPTY 0xFFFFFFFF + +typedef struct { + u32 hash; + float x; + float y; + float z; +} Point; + +void loadPlayerLocation(); +void addMapPin(u32 icon, Point location); +void countMapPins(); + +#endif \ No newline at end of file