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
This commit is contained in:
badblocks 2023-05-18 11:49:10 -07:00
parent d689902de7
commit 8ddd30bbb4
No known key found for this signature in database
2 changed files with 50 additions and 0 deletions

28
source/map_basic.c Normal file
View file

@ -0,0 +1,28 @@
#include <stdio.h>
#include <math.h>
#include <switch.h>
#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");
}

22
source/map_basic.h Normal file
View file

@ -0,0 +1,22 @@
#ifndef MAP_H
#define MAP_H
#include <stdlib.h>
#include <switch.h>
#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