mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-26 13:56:05 +03:00
feat(map): add CMap static members
This commit is contained in:
parent
c4e56fd99d
commit
1326c896df
@ -189,6 +189,11 @@ void ClientServices::SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler
|
|||||||
s_currentConnection->SetMessageHandler(msgId, handler, param);
|
s_currentConnection->SetMessageHandler(msgId, handler, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientServices::ClearMessageHandler(NETMESSAGE msgId) {
|
||||||
|
STORM_ASSERT(ClientServices::s_currentConnection);
|
||||||
|
s_currentConnection->ClearMessageHandler(msgId);
|
||||||
|
}
|
||||||
|
|
||||||
void ClientServices::GetRealmList() {
|
void ClientServices::GetRealmList() {
|
||||||
STORM_ASSERT(ClientServices::s_currentConnection);
|
STORM_ASSERT(ClientServices::s_currentConnection);
|
||||||
ClientServices::s_currentConnection->Initiate(COP_GET_REALMS, 35, nullptr);
|
ClientServices::s_currentConnection->Initiate(COP_GET_REALMS, 35, nullptr);
|
||||||
|
|||||||
@ -38,6 +38,7 @@ class ClientServices : public LoginResponse {
|
|||||||
static ClientConnection* Connection();
|
static ClientConnection* Connection();
|
||||||
static ClientServices* GetInstance();
|
static ClientServices* GetInstance();
|
||||||
static void SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, void* param);
|
static void SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, void* param);
|
||||||
|
static void ClearMessageHandler(NETMESSAGE msgId);
|
||||||
static void GetRealmList();
|
static void GetRealmList();
|
||||||
static void GetCharacterList();
|
static void GetCharacterList();
|
||||||
static void EnumerateCharacters(ENUMERATE_CHARACTERS_CALLBACK fcn, void* param);
|
static void EnumerateCharacters(ENUMERATE_CHARACTERS_CALLBACK fcn, void* param);
|
||||||
|
|||||||
@ -1062,8 +1062,12 @@ void CGlueMgr::Suspend() {
|
|||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
FrameXML_FreeHashNodes();
|
FrameXML_FreeHashNodes();
|
||||||
|
ClientServices::ClearMessageHandler(SMSG_CHARACTER_RENAME_RESULT);
|
||||||
// TODO
|
ClientServices::ClearMessageHandler(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT);
|
||||||
|
ClientServices::ClearMessageHandler(SMSG_CHAR_CUSTOMIZE);
|
||||||
|
ClientServices::ClearMessageHandler(SMSG_REALM_SPLIT);
|
||||||
|
ClientServices::ClearMessageHandler(SMSG_KICK_REASON);
|
||||||
|
// TODO: ClientServices::ClearMessageHandler(1242);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGlueMgr::UpdateCurrentScreen(const char* screen) {
|
void CGlueMgr::UpdateCurrentScreen(const char* screen) {
|
||||||
@ -1121,9 +1125,9 @@ void CGlueMgr::PollEnterWorld() {
|
|||||||
|
|
||||||
auto info = CGlueMgr::m_characterInfo;
|
auto info = CGlueMgr::m_characterInfo;
|
||||||
|
|
||||||
//if (*(_BYTE*)(info + 385))
|
if (info->firstLogin) {
|
||||||
// sub_4D9660(*(_BYTE*)(info + 377), (int)v51, *(_BYTE*)(info + 376), (int)&v68);
|
// sub_4D9660(info->classID, mapID, info->raceID, info->position);
|
||||||
|
}
|
||||||
|
|
||||||
CGlueMgr::Suspend();
|
CGlueMgr::Suspend();
|
||||||
ClientInitializeGame(info->mapID, info->position);
|
ClientInitializeGame(info->mapID, info->position);
|
||||||
|
|||||||
@ -554,6 +554,11 @@ void NetClient::SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, voi
|
|||||||
this->m_handlerParams[msgId] = param;
|
this->m_handlerParams[msgId] = param;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NetClient::ClearMessageHandler(NETMESSAGE msgId) {
|
||||||
|
this->m_handlers[msgId] = nullptr;
|
||||||
|
this->m_handlerParams[msgId] = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void NetClient::WCCantConnect(WowConnection* conn, uint32_t timeStamp, NETCONNADDR* addr) {
|
void NetClient::WCCantConnect(WowConnection* conn, uint32_t timeStamp, NETCONNADDR* addr) {
|
||||||
if (conn == this->m_redirectConnection) {
|
if (conn == this->m_redirectConnection) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -85,6 +85,7 @@ class NetClient : public WowConnectionResponse {
|
|||||||
void SetDelete();
|
void SetDelete();
|
||||||
void SetLoginData(LoginData* loginData);
|
void SetLoginData(LoginData* loginData);
|
||||||
void SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, void* param);
|
void SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler, void* param);
|
||||||
|
void ClearMessageHandler(NETMESSAGE msgId);
|
||||||
void DisplayNetworkStats();
|
void DisplayNetworkStats();
|
||||||
void GetNetStats(float& bandwidthIn, float& bandwidthOut, uint32_t& latency);
|
void GetNetStats(float& bandwidthIn, float& bandwidthOut, uint32_t& latency);
|
||||||
void PushObjMgr();
|
void PushObjMgr();
|
||||||
|
|||||||
@ -50,6 +50,8 @@ void CWorld::Initialize() {
|
|||||||
(CWorld::s_enables2 & Enables2::Enable_HwPcf) != 0
|
(CWorld::s_enables2 & Enables2::Enable_HwPcf) != 0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CMap::Initialize();
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,10 @@
|
|||||||
#include "world/daynight/DayNight.hpp"
|
#include "world/daynight/DayNight.hpp"
|
||||||
#include "util/SFile.hpp"
|
#include "util/SFile.hpp"
|
||||||
#include <storm/Error.hpp>
|
#include <storm/Error.hpp>
|
||||||
|
#include <common/ObjectAlloc.hpp>
|
||||||
|
#include <common/Processor.hpp>
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -11,9 +15,95 @@ char CMap::wdtFilename[STORM_MAX_PATH];
|
|||||||
uint32_t CMap::version;
|
uint32_t CMap::version;
|
||||||
SMMapHeader CMap::header;
|
SMMapHeader CMap::header;
|
||||||
SMAreaInfo CMap::areaInfo[64 * 64];
|
SMAreaInfo CMap::areaInfo[64 * 64];
|
||||||
uint32_t CMap::uniqueId;
|
int32_t CMap::uniqueId;
|
||||||
int32_t CMap::bDungeon;
|
int32_t CMap::bDungeon;
|
||||||
|
int32_t CMap::counts[11];
|
||||||
|
int32_t CMap::freeCounts[11];
|
||||||
|
TSGrowableArray<uint32_t> CMap::scCollideList;
|
||||||
|
uint32_t CMap::scCollideCnt;
|
||||||
|
uint32_t CMap::cCount;
|
||||||
|
|
||||||
|
uint32_t* CMap::lightHeap;
|
||||||
|
uint32_t* CMap::cacheLightHeap;
|
||||||
|
uint32_t* CMap::mapObjGroupHeap;
|
||||||
|
uint32_t* CMap::mapObjHeap;
|
||||||
|
uint32_t* CMap::baseObjLinkHeap;
|
||||||
|
uint32_t* CMap::areaHeap;
|
||||||
|
uint32_t* CMap::areaMedHeap;
|
||||||
|
uint32_t* CMap::areaLowHeap;
|
||||||
|
uint32_t* CMap::chunkHeap;
|
||||||
|
uint32_t* CMap::doodadDefHeap;
|
||||||
|
uint32_t* CMap::entityHeap;
|
||||||
|
uint32_t* CMap::mapObjDefGroupHeap;
|
||||||
|
uint32_t* CMap::mapObjDefHeap;
|
||||||
|
uint32_t* CMap::chunkLiquidHeap;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CMap::Initialize() {
|
||||||
|
// TODO
|
||||||
|
memset(&CMap::counts, 0, sizeof(CMap::counts));
|
||||||
|
memset(&CMap::freeCounts, 0, sizeof(CMap::freeCounts));
|
||||||
|
memset(&CMap::areaInfo, 0, sizeof(CMap::areaInfo));
|
||||||
|
CMap::scCollideList.SetCount(2048);
|
||||||
|
CMap::scCollideCnt = 0;
|
||||||
|
CMap::cCount = 0;
|
||||||
|
CMap::uniqueId = -2;
|
||||||
|
CMap::bDungeon = 0;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
CMap::MapMemInitialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMap::MapMemInitialize() {
|
||||||
|
CMap::lightHeap = NEW(uint32_t);
|
||||||
|
*CMap::lightHeap = ObjectAllocAddHeap(212, 128, "WLIGHT", true);
|
||||||
|
|
||||||
|
CMap::cacheLightHeap = NEW(uint32_t);
|
||||||
|
*CMap::cacheLightHeap = ObjectAllocAddHeap(132, 256, "WCACHELIGHT", true);
|
||||||
|
|
||||||
|
CMap::mapObjGroupHeap = NEW(uint32_t);
|
||||||
|
*CMap::mapObjGroupHeap = ObjectAllocAddHeap(444, 128, "WMAPOBJGROUP", true);
|
||||||
|
|
||||||
|
CMap::mapObjHeap = NEW(uint32_t);
|
||||||
|
*CMap::mapObjHeap = ObjectAllocAddHeap(2552, 32, "WMAPOBJ", true);
|
||||||
|
|
||||||
|
CMap::baseObjLinkHeap = NEW(uint32_t);
|
||||||
|
*CMap::baseObjLinkHeap = ObjectAllocAddHeap(28, 10000, "WBASEOBJLINK", true);
|
||||||
|
|
||||||
|
CMap::areaHeap = NEW(uint32_t);
|
||||||
|
*CMap::areaHeap = ObjectAllocAddHeap(1212, 16, "WAREA", true);
|
||||||
|
|
||||||
|
CMap::areaMedHeap = NEW(uint32_t);
|
||||||
|
*CMap::areaMedHeap = ObjectAllocAddHeap(33404, 16, "WAREAMED", true);
|
||||||
|
|
||||||
|
CMap::areaLowHeap = NEW(uint32_t);
|
||||||
|
*CMap::areaLowHeap = ObjectAllocAddHeap(92, 16, "WAREALOW", true);
|
||||||
|
|
||||||
|
CMap::chunkHeap = NEW(uint32_t);
|
||||||
|
*CMap::chunkHeap = ObjectAllocAddHeap(344, 256, "WCHUNK", true);
|
||||||
|
|
||||||
|
CMap::doodadDefHeap = NEW(uint32_t);
|
||||||
|
*CMap::doodadDefHeap = ObjectAllocAddHeap(368, 5000, "WDOODADDEF", true);
|
||||||
|
|
||||||
|
CMap::entityHeap = NEW(uint32_t);
|
||||||
|
*CMap::entityHeap = ObjectAllocAddHeap(208, 128, "WENTITY", true);
|
||||||
|
|
||||||
|
CMap::mapObjDefGroupHeap = NEW(uint32_t);
|
||||||
|
*CMap::mapObjDefGroupHeap = ObjectAllocAddHeap(192, 128, "WMAPOBJDEFGROUP", true);
|
||||||
|
|
||||||
|
CMap::mapObjDefHeap = NEW(uint32_t);
|
||||||
|
*CMap::mapObjDefHeap = ObjectAllocAddHeap(344, 64, "WMAPOBJDEF", true);
|
||||||
|
|
||||||
|
CMap::chunkLiquidHeap = NEW(uint32_t);
|
||||||
|
*CMap::chunkLiquidHeap = ObjectAllocAddHeap(1092, 64, "WCHUNKLIQUID", true);
|
||||||
|
|
||||||
|
int32_t vendor;
|
||||||
|
if (OsGetProcessorFeaturesEx(vendor) & 4) {
|
||||||
|
// TODO: dword_CF08F8 = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CMap::Load(const char* mapName, int32_t zoneID) {
|
void CMap::Load(const char* mapName, int32_t zoneID) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "world/map/Types.hpp"
|
#include "world/map/Types.hpp"
|
||||||
#include <storm/String.hpp>
|
#include <storm/String.hpp>
|
||||||
|
#include <storm/Array.hpp>
|
||||||
|
|
||||||
class CMap {
|
class CMap {
|
||||||
public:
|
public:
|
||||||
@ -12,10 +13,32 @@ class CMap {
|
|||||||
static uint32_t version;
|
static uint32_t version;
|
||||||
static SMMapHeader header;
|
static SMMapHeader header;
|
||||||
static SMAreaInfo areaInfo[64 * 64];
|
static SMAreaInfo areaInfo[64 * 64];
|
||||||
static uint32_t uniqueId;
|
static int32_t uniqueId;
|
||||||
static int32_t bDungeon;
|
static int32_t bDungeon;
|
||||||
|
static int32_t counts[11];
|
||||||
|
static int32_t freeCounts[11];
|
||||||
|
static TSGrowableArray<uint32_t> scCollideList;
|
||||||
|
static uint32_t scCollideCnt;
|
||||||
|
static uint32_t cCount;
|
||||||
|
|
||||||
|
static uint32_t* lightHeap;
|
||||||
|
static uint32_t* cacheLightHeap;
|
||||||
|
static uint32_t* mapObjGroupHeap;
|
||||||
|
static uint32_t* mapObjHeap;
|
||||||
|
static uint32_t* baseObjLinkHeap;
|
||||||
|
static uint32_t* areaHeap;
|
||||||
|
static uint32_t* areaMedHeap;
|
||||||
|
static uint32_t* areaLowHeap;
|
||||||
|
static uint32_t* chunkHeap;
|
||||||
|
static uint32_t* doodadDefHeap;
|
||||||
|
static uint32_t* entityHeap;
|
||||||
|
static uint32_t* mapObjDefGroupHeap;
|
||||||
|
static uint32_t* mapObjDefHeap;
|
||||||
|
static uint32_t* chunkLiquidHeap;
|
||||||
|
|
||||||
|
|
||||||
|
static void Initialize();
|
||||||
|
static void MapMemInitialize();
|
||||||
static void Load(const char* mapName, int32_t zoneID);
|
static void Load(const char* mapName, int32_t zoneID);
|
||||||
static void LoadWdt();
|
static void LoadWdt();
|
||||||
static void LoadTextureBlob();
|
static void LoadTextureBlob();
|
||||||
|
|||||||
@ -23,7 +23,7 @@ struct SMAreaInfo {
|
|||||||
|
|
||||||
struct SMMapObjDef {
|
struct SMMapObjDef {
|
||||||
uint32_t nameId;
|
uint32_t nameId;
|
||||||
uint32_t uniqueId;
|
int32_t uniqueId;
|
||||||
C3Vector pos;
|
C3Vector pos;
|
||||||
C3Vector rot;
|
C3Vector rot;
|
||||||
CAaBox extents;
|
CAaBox extents;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user