mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(world): initialize map allocation heaps
This commit is contained in:
parent
aa62781560
commit
ba6f00d96c
@ -88,6 +88,10 @@ void CWorld::Initialize() {
|
||||
|
||||
// TODO
|
||||
|
||||
CMap::Initialize();
|
||||
|
||||
// TODO
|
||||
|
||||
CWorld::s_weather = STORM_NEW(Weather);
|
||||
|
||||
// TODO
|
||||
|
||||
9
src/world/map/CChunkLiquid.hpp
Normal file
9
src/world/map/CChunkLiquid.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef WORLD_MAP_C_CHUNK_LIQUID_HPP
|
||||
#define WORLD_MAP_C_CHUNK_LIQUID_HPP
|
||||
|
||||
class CChunkLiquid {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -1,11 +1,45 @@
|
||||
#include "world/map/CMap.hpp"
|
||||
#include "world/map/CChunkLiquid.hpp"
|
||||
#include "world/map/CMapArea.hpp"
|
||||
#include "world/map/CMapAreaLow.hpp"
|
||||
#include "world/map/CMapCacheLight.hpp"
|
||||
#include "world/map/CMapChunk.hpp"
|
||||
#include "world/map/CMapDoodadDef.hpp"
|
||||
#include "world/map/CMapEntity.hpp"
|
||||
#include "world/map/CMapLight.hpp"
|
||||
#include "world/map/CMapObj.hpp"
|
||||
#include "world/map/CMapObjDef.hpp"
|
||||
#include "world/map/CMapObjDefGroup.hpp"
|
||||
#include "world/map/CMapObjGroup.hpp"
|
||||
#include <common/ObjectAlloc.hpp>
|
||||
#include <storm/String.hpp>
|
||||
|
||||
uint32_t* CMap::s_areaHeap;
|
||||
uint32_t* CMap::s_areaLowHeap;
|
||||
uint32_t* CMap::s_baseObjLinkHeap;
|
||||
uint32_t* CMap::s_cacheLightHeap;
|
||||
uint32_t* CMap::s_chunkHeap;
|
||||
uint32_t* CMap::s_chunkLiquidHeap;
|
||||
uint32_t* CMap::s_doodadDefHeap;
|
||||
uint32_t* CMap::s_entityHeap;
|
||||
STORM_EXPLICIT_LIST(CMapBaseObj, m_lameAssLink) CMap::s_entityList;
|
||||
uint32_t* CMap::s_lightHeap;
|
||||
uint32_t* CMap::s_mapObjDefGroupHeap;
|
||||
uint32_t* CMap::s_mapObjDefHeap;
|
||||
uint32_t* CMap::s_mapObjGroupHeap;
|
||||
uint32_t* CMap::s_mapObjHeap;
|
||||
char CMap::s_mapName[256];
|
||||
char CMap::s_mapPath[256];
|
||||
char CMap::s_wdtFilename[256];
|
||||
|
||||
void CMap::Initialize() {
|
||||
// TODO
|
||||
|
||||
CMap::MapMemInitialize();
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CMap::Load(const char* mapName, int32_t zoneID) {
|
||||
// TODO
|
||||
|
||||
@ -18,3 +52,20 @@ void CMap::Load(const char* mapName, int32_t zoneID) {
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CMap::MapMemInitialize() {
|
||||
CMap::s_lightHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapLight), 128, "WLIGHT", true));
|
||||
CMap::s_cacheLightHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapCacheLight), 256, "WCACHELIGHT", true));
|
||||
CMap::s_mapObjGroupHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapObjGroup), 128, "WMAPOBJGROUP", true));
|
||||
CMap::s_mapObjHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapObj), 32, "WMAPOBJ", true));
|
||||
CMap::s_baseObjLinkHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapBaseObjLink), 10000, "WBASEOBJLINK", true));
|
||||
CMap::s_areaHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapArea), 16, "WAREA", true));
|
||||
// CMap::s_areaMedHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapAreaMed), 16, "WAREAMED", true)); ??
|
||||
CMap::s_areaLowHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapAreaLow), 16, "WAREALOW", true));
|
||||
CMap::s_chunkHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapChunk), 256, "WCHUNK", true));
|
||||
CMap::s_doodadDefHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapDoodadDef), 5000, "WDOODADDEF", true));
|
||||
CMap::s_entityHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapEntity), 128, "WENTITY", true));
|
||||
CMap::s_mapObjDefGroupHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapObjDefGroup), 128, "WMAPOBJDEFGROUP", true));
|
||||
CMap::s_mapObjDefHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CMapObjDef), 64, "WMAPOBJDEF", true));
|
||||
CMap::s_chunkLiquidHeap = STORM_NEW(uint32_t)(ObjectAllocAddHeap(sizeof(CChunkLiquid), 64, "WCHUNKLIQUID", true));
|
||||
}
|
||||
|
||||
@ -8,13 +8,28 @@
|
||||
class CMap {
|
||||
public:
|
||||
// Static variables
|
||||
static uint32_t* s_areaHeap;
|
||||
static uint32_t* s_areaLowHeap;
|
||||
static uint32_t* s_baseObjLinkHeap;
|
||||
static uint32_t* s_cacheLightHeap;
|
||||
static uint32_t* s_chunkHeap;
|
||||
static uint32_t* s_chunkLiquidHeap;
|
||||
static uint32_t* s_doodadDefHeap;
|
||||
static uint32_t* s_entityHeap;
|
||||
static STORM_EXPLICIT_LIST(CMapBaseObj, m_lameAssLink) s_entityList;
|
||||
static uint32_t* s_lightHeap;
|
||||
static uint32_t* s_mapObjDefGroupHeap;
|
||||
static uint32_t* s_mapObjDefHeap;
|
||||
static uint32_t* s_mapObjGroupHeap;
|
||||
static uint32_t* s_mapObjHeap;
|
||||
static char s_mapName[];
|
||||
static char s_mapPath[];
|
||||
static char s_wdtFilename[];
|
||||
|
||||
// Static functions
|
||||
static void Initialize();
|
||||
static void Load(const char* mapName, int32_t zoneID);
|
||||
static void MapMemInitialize();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
11
src/world/map/CMapArea.hpp
Normal file
11
src/world/map/CMapArea.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef WORLD_MAP_C_MAP_AREA_HPP
|
||||
#define WORLD_MAP_C_MAP_AREA_HPP
|
||||
|
||||
#include "world/map/CMapBaseObj.hpp"
|
||||
|
||||
class CMapArea : public CMapBaseObj {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
9
src/world/map/CMapAreaLow.hpp
Normal file
9
src/world/map/CMapAreaLow.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef WORLD_MAP_C_MAP_AREA_LOW_HPP
|
||||
#define WORLD_MAP_C_MAP_AREA_LOW_HPP
|
||||
|
||||
class CMapAreaLow {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
9
src/world/map/CMapCacheLight.hpp
Normal file
9
src/world/map/CMapCacheLight.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef WORLD_MAP_C_MAP_CACHE_LIGHT_HPP
|
||||
#define WORLD_MAP_C_MAP_CACHE_LIGHT_HPP
|
||||
|
||||
class CMapCacheLight {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
11
src/world/map/CMapChunk.hpp
Normal file
11
src/world/map/CMapChunk.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef WORLD_MAP_C_MAP_CHUNK_HPP
|
||||
#define WORLD_MAP_C_MAP_CHUNK_HPP
|
||||
|
||||
#include "world/map/CMapBaseObj.hpp"
|
||||
|
||||
class CMapChunk : public CMapBaseObj {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
11
src/world/map/CMapDoodadDef.hpp
Normal file
11
src/world/map/CMapDoodadDef.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef WORLD_MAP_C_MAP_DOODAD_DEF_HPP
|
||||
#define WORLD_MAP_C_MAP_DOODAD_DEF_HPP
|
||||
|
||||
#include "world/map/CMapStaticEntity.hpp"
|
||||
|
||||
class CMapDoodadDef : public CMapStaticEntity {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
11
src/world/map/CMapLight.hpp
Normal file
11
src/world/map/CMapLight.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef WORLD_MAP_C_MAP_LIGHT_HPP
|
||||
#define WORLD_MAP_C_MAP_LIGHT_HPP
|
||||
|
||||
#include "world/map/CMapBaseObj.hpp"
|
||||
|
||||
class CMapLight : public CMapBaseObj {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
9
src/world/map/CMapObj.hpp
Normal file
9
src/world/map/CMapObj.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef WORLD_MAP_C_MAP_OBJ_HPP
|
||||
#define WORLD_MAP_C_MAP_OBJ_HPP
|
||||
|
||||
class CMapObj {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
11
src/world/map/CMapObjDef.hpp
Normal file
11
src/world/map/CMapObjDef.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef WORLD_MAP_C_MAP_OBJ_DEF_HPP
|
||||
#define WORLD_MAP_C_MAP_OBJ_DEF_HPP
|
||||
|
||||
#include "world/map/CMapBaseObj.hpp"
|
||||
|
||||
class CMapObjDef : public CMapBaseObj {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
9
src/world/map/CMapObjDefGroup.hpp
Normal file
9
src/world/map/CMapObjDefGroup.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef WORLD_MAP_C_MAP_OBJ_DEF_GROUP_HPP
|
||||
#define WORLD_MAP_C_MAP_OBJ_DEF_GROUP_HPP
|
||||
|
||||
class CMapObjDefGroup : public CMapBaseObj {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
9
src/world/map/CMapObjGroup.hpp
Normal file
9
src/world/map/CMapObjGroup.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef WORLD_MAP_C_MAP_OBJ_GROUP_HPP
|
||||
#define WORLD_MAP_C_MAP_OBJ_GROUP_HPP
|
||||
|
||||
class CMapObjGroup {
|
||||
public:
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user