mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(world): add CMap::AllocEntity
This commit is contained in:
parent
ba6f00d96c
commit
fe06d5e820
@ -32,6 +32,26 @@ char CMap::s_mapName[256];
|
||||
char CMap::s_mapPath[256];
|
||||
char CMap::s_wdtFilename[256];
|
||||
|
||||
CMapEntity* CMap::AllocEntity(int32_t a1) {
|
||||
CMapEntity* entity;
|
||||
uint32_t memHandle;
|
||||
void* mem = nullptr;
|
||||
|
||||
if (ObjectAlloc(*CMap::s_entityHeap, &memHandle, &mem, false)) {
|
||||
entity = new (mem) CMapEntity();
|
||||
} else {
|
||||
entity = nullptr;
|
||||
}
|
||||
|
||||
if (a1) {
|
||||
CMap::s_entityList.LinkToHead(entity);
|
||||
} else {
|
||||
CMap::s_entityList.LinkToTail(entity);
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
void CMap::Initialize() {
|
||||
// TODO
|
||||
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
#include <storm/List.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
class CMapEntity;
|
||||
|
||||
class CMap {
|
||||
public:
|
||||
// Static variables
|
||||
@ -27,6 +29,7 @@ class CMap {
|
||||
static char s_wdtFilename[];
|
||||
|
||||
// Static functions
|
||||
static CMapEntity* AllocEntity(int32_t a1);
|
||||
static void Initialize();
|
||||
static void Load(const char* mapName, int32_t zoneID);
|
||||
static void MapMemInitialize();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user