feat(world): add CMap::Load

This commit is contained in:
fallenoak 2025-10-08 16:47:13 -05:00
parent 9a48558429
commit 1e362b0c6e
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
4 changed files with 46 additions and 1 deletions

View File

@ -1,4 +1,7 @@
file(GLOB PRIVATE_SOURCES "*.cpp") file(GLOB PRIVATE_SOURCES
"*.cpp"
"map/*.cpp"
)
add_library(world STATIC add_library(world STATIC
${PRIVATE_SOURCES} ${PRIVATE_SOURCES}

6
src/world/Map.hpp Normal file
View File

@ -0,0 +1,6 @@
#ifndef WORLD_MAP_HPP
#define WORLD_MAP_HPP
#include "world/map/CMap.hpp"
#endif

19
src/world/map/CMap.cpp Normal file
View File

@ -0,0 +1,19 @@
#include "world/map/CMap.hpp"
#include <storm/String.hpp>
char CMap::s_mapName[256];
char CMap::s_mapPath[256];
char CMap::s_wdtFilename[256];
void CMap::Load(const char* mapName, int32_t zoneID) {
// TODO
auto nameOfs = SStrCopy(CMap::s_mapPath, "World\\Maps\\");
SStrCopy(&CMap::s_mapPath[nameOfs], mapName);
SStrCopy(CMap::s_mapName, mapName);
SStrPrintf(CMap::s_wdtFilename, sizeof(CMap::s_wdtFilename), "%s\\%s.wdt", CMap::s_mapPath, CMap::s_mapName);
// TODO
}

17
src/world/map/CMap.hpp Normal file
View File

@ -0,0 +1,17 @@
#ifndef WORLD_MAP_C_MAP_HPP
#define WORLD_MAP_C_MAP_HPP
#include <cstdint>
class CMap {
public:
// Static variables
static char s_mapName[];
static char s_mapPath[];
static char s_wdtFilename[];
// Static functions
static void Load(const char* mapName, int32_t zoneID);
};
#endif