From aa62781560a0bbeeacb94c54abd10e95c931b127 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Wed, 21 Jan 2026 16:06:21 -0600 Subject: [PATCH] feat(world): populate CMapBaseObj --- src/world/map/CMap.cpp | 1 + src/world/map/CMap.hpp | 3 +++ src/world/map/CMapBaseObj.cpp | 5 ++++ src/world/map/CMapBaseObj.hpp | 45 +++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 src/world/map/CMapBaseObj.cpp diff --git a/src/world/map/CMap.cpp b/src/world/map/CMap.cpp index 32b9dd4..32c0234 100644 --- a/src/world/map/CMap.cpp +++ b/src/world/map/CMap.cpp @@ -1,6 +1,7 @@ #include "world/map/CMap.hpp" #include +STORM_EXPLICIT_LIST(CMapBaseObj, m_lameAssLink) CMap::s_entityList; char CMap::s_mapName[256]; char CMap::s_mapPath[256]; char CMap::s_wdtFilename[256]; diff --git a/src/world/map/CMap.hpp b/src/world/map/CMap.hpp index a1a14a0..3407f37 100644 --- a/src/world/map/CMap.hpp +++ b/src/world/map/CMap.hpp @@ -1,11 +1,14 @@ #ifndef WORLD_MAP_C_MAP_HPP #define WORLD_MAP_C_MAP_HPP +#include "world/map/CMapBaseObj.hpp" +#include #include class CMap { public: // Static variables + static STORM_EXPLICIT_LIST(CMapBaseObj, m_lameAssLink) s_entityList; static char s_mapName[]; static char s_mapPath[]; static char s_wdtFilename[]; diff --git a/src/world/map/CMapBaseObj.cpp b/src/world/map/CMapBaseObj.cpp new file mode 100644 index 0000000..620f598 --- /dev/null +++ b/src/world/map/CMapBaseObj.cpp @@ -0,0 +1,5 @@ +#include "world/map/CMapBaseObj.hpp" + +uint32_t CMapBaseObj::GetType() { + return this->m_type; +} diff --git a/src/world/map/CMapBaseObj.hpp b/src/world/map/CMapBaseObj.hpp index c3f43e3..d9693c8 100644 --- a/src/world/map/CMapBaseObj.hpp +++ b/src/world/map/CMapBaseObj.hpp @@ -1,9 +1,54 @@ #ifndef WORLD_MAP_C_MAP_BASE_OBJ_HPP #define WORLD_MAP_C_MAP_BASE_OBJ_HPP +#include +#include + +class CM2Lighting; +class CMapBaseObj; + +class CMapBaseObjLink { + public: + // Member variables + uint32_t memHandle; + CMapBaseObj* owner; + CMapBaseObj* ref; + TSLink refLink; + TSLink ownerLink; +}; + class CMapBaseObj { public: + // Enums + enum { + Type_BaseObj = 0x1, + Type_Area = 0x2, + Type_Chunk = 0x4, + Type_MapObjDef = 0x8, + Type_MapObjDefGroup = 0x10, + Type_Entity = 0x20, + Type_DoodadDef = 0x40, + Type_Light = 0x80, + }; + + // Public member variables + uint32_t m_memHandle; + TSLink m_lameAssLink; + STORM_EXPLICIT_LIST(CMapBaseObjLink, ownerLink) m_parentLinkList; + // TODO + + // Public virtual member functions + virtual ~CMapBaseObj() = default; + virtual void SelectLights(CM2Lighting* lighting) {}; + virtual void SelectUnderwater(CM2Lighting* lighting) {}; + + // Public member functions + uint32_t GetType(); + + protected: + // Protected member variables + uint16_t m_type = Type_BaseObj; }; #endif