mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-07 23:29:54 +03:00
feat(world): add CMap::AllocEntity
This commit is contained in:
2 files changed
+23
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user