mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 16:52:45 +03:00
Compare commits
1 Commits
47597cd2ff
...
fb4266aafd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb4266aafd |
@ -520,9 +520,8 @@ void WowClientDestroy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WowClientInit() {
|
void WowClientInit() {
|
||||||
EventRegister(EVENT_ID_TICK, reinterpret_cast<EVENTHANDLERFUNC>(&CWorld::OnTick));
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
// EventRegister(EVENT_ID_5, (int)sub_4020E0);
|
||||||
// _cfltcvt_init_0();
|
// _cfltcvt_init_0();
|
||||||
|
|
||||||
ClientRegisterConsoleCommands();
|
ClientRegisterConsoleCommands();
|
||||||
|
|||||||
@ -286,10 +286,12 @@ int32_t SchedulerThreadProcProcess(uint32_t a1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float elapsedSec = (currTime - context->m_schedLastIdle) * 0.001;
|
uint32_t v9 = (currTime - context->m_schedLastIdle);
|
||||||
context->m_schedLastIdle = currTime;
|
context->m_schedLastIdle = currTime;
|
||||||
|
double elapsedSec = v9 * 0.001;
|
||||||
|
|
||||||
SynthesizeTick(context, currTime, elapsedSec);
|
// TODO
|
||||||
|
// FrameTime::Update(currTime, elapsedSec);
|
||||||
|
|
||||||
IEvtTimerDispatch(context);
|
IEvtTimerDispatch(context);
|
||||||
|
|
||||||
|
|||||||
@ -91,17 +91,3 @@ void SynthesizePoll(EvtContext* context) {
|
|||||||
|
|
||||||
IEvtQueueDispatch(context, EVENT_ID_POLL, nullptr);
|
IEvtQueueDispatch(context, EVENT_ID_POLL, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SynthesizeTick(EvtContext* context, uint32_t currTime, float elapsedSec) {
|
|
||||||
context->m_critsect.Enter();
|
|
||||||
bool closed = context->m_schedState == EvtContext::SCHEDSTATE_CLOSED;
|
|
||||||
context->m_critsect.Leave();
|
|
||||||
|
|
||||||
if (closed) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EVENT_DATA_TICK data = { elapsedSec, currTime };
|
|
||||||
|
|
||||||
IEvtQueueDispatch(context, EVENT_ID_TICK, &data);
|
|
||||||
}
|
|
||||||
|
|||||||
@ -15,6 +15,4 @@ void SynthesizePaint(EvtContext* context);
|
|||||||
|
|
||||||
void SynthesizePoll(EvtContext* context);
|
void SynthesizePoll(EvtContext* context);
|
||||||
|
|
||||||
void SynthesizeTick(EvtContext* context, uint32_t currTime, float elapsedSec);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -12,7 +12,7 @@ enum EVENTID {
|
|||||||
EVENT_ID_FOCUS = 2,
|
EVENT_ID_FOCUS = 2,
|
||||||
EVENT_ID_CLOSE = 3,
|
EVENT_ID_CLOSE = 3,
|
||||||
EVENT_ID_DESTROY = 4,
|
EVENT_ID_DESTROY = 4,
|
||||||
EVENT_ID_TICK = 5,
|
EVENT_ID_5 = 5,
|
||||||
EVENT_ID_IDLE = 6,
|
EVENT_ID_IDLE = 6,
|
||||||
EVENT_ID_POLL = 7,
|
EVENT_ID_POLL = 7,
|
||||||
EVENT_ID_INITIALIZE = 8,
|
EVENT_ID_INITIALIZE = 8,
|
||||||
@ -259,9 +259,4 @@ struct EVENT_DATA_SIZE {
|
|||||||
int32_t h;
|
int32_t h;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EVENT_DATA_TICK {
|
|
||||||
float tickTimeSec;
|
|
||||||
uint32_t curTimeMs;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -72,12 +72,6 @@ enum OBJECT_TYPE_ID {
|
|||||||
// TODO
|
// TODO
|
||||||
};
|
};
|
||||||
|
|
||||||
enum OUT_OF_RANGE_TYPE {
|
|
||||||
OUT_OF_RANGE_0 = 0,
|
|
||||||
OUT_OF_RANGE_1 = 1,
|
|
||||||
OUT_OF_RANGE_2 = 2,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum SHEATHE_TYPE {
|
enum SHEATHE_TYPE {
|
||||||
SHEATHE_0 = 0,
|
SHEATHE_0 = 0,
|
||||||
SHEATHE_1 = 1,
|
SHEATHE_1 = 1,
|
||||||
|
|||||||
@ -4,10 +4,6 @@ CGContainer_C::CGContainer_C(uint32_t time, CClientObjCreate& objCreate) : CGIte
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGContainer_C::~CGContainer_C() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGContainer_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
void CGContainer_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
||||||
this->CGItem_C::SetStorage(storage, saved);
|
this->CGItem_C::SetStorage(storage, saved);
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
class CGContainer_C : public CGItem_C, public CGContainer {
|
class CGContainer_C : public CGItem_C, public CGContainer {
|
||||||
public:
|
public:
|
||||||
// Virtual public member functions
|
|
||||||
virtual ~CGContainer_C();
|
|
||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGContainer_C(uint32_t time, CClientObjCreate& objCreate);
|
CGContainer_C(uint32_t time, CClientObjCreate& objCreate);
|
||||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||||
|
|||||||
@ -4,10 +4,6 @@ CGCorpse_C::CGCorpse_C(uint32_t time, CClientObjCreate& objCreate) : CGObject_C(
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGCorpse_C::~CGCorpse_C() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGCorpse_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
void CGCorpse_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
||||||
this->CGObject_C::SetStorage(storage, saved);
|
this->CGObject_C::SetStorage(storage, saved);
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
class CGCorpse_C : public CGObject_C, public CGCorpse {
|
class CGCorpse_C : public CGObject_C, public CGCorpse {
|
||||||
public:
|
public:
|
||||||
// Virtual public member functions
|
|
||||||
virtual ~CGCorpse_C();
|
|
||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGCorpse_C(uint32_t time, CClientObjCreate& objCreate);
|
CGCorpse_C(uint32_t time, CClientObjCreate& objCreate);
|
||||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||||
|
|||||||
@ -4,10 +4,6 @@ CGDynamicObject_C::CGDynamicObject_C(uint32_t time, CClientObjCreate& objCreate)
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGDynamicObject_C::~CGDynamicObject_C() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGDynamicObject_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
void CGDynamicObject_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
||||||
this->CGObject_C::SetStorage(storage, saved);
|
this->CGObject_C::SetStorage(storage, saved);
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
class CGDynamicObject_C : public CGObject_C, public CGDynamicObject {
|
class CGDynamicObject_C : public CGObject_C, public CGDynamicObject {
|
||||||
public:
|
public:
|
||||||
// Virtual public member functions
|
|
||||||
virtual ~CGDynamicObject_C();
|
|
||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGDynamicObject_C(uint32_t time, CClientObjCreate& objCreate);
|
CGDynamicObject_C(uint32_t time, CClientObjCreate& objCreate);
|
||||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||||
|
|||||||
@ -4,10 +4,6 @@ CGGameObject_C::CGGameObject_C(uint32_t time, CClientObjCreate& objCreate) : CGO
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGGameObject_C::~CGGameObject_C() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGGameObject_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
void CGGameObject_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
||||||
this->CGObject_C::SetStorage(storage, saved);
|
this->CGObject_C::SetStorage(storage, saved);
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
class CGGameObject_C : public CGObject_C, public CGGameObject {
|
class CGGameObject_C : public CGObject_C, public CGGameObject {
|
||||||
public:
|
public:
|
||||||
// Virtual public member functions
|
|
||||||
virtual ~CGGameObject_C();
|
|
||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGGameObject_C(uint32_t time, CClientObjCreate& objCreate);
|
CGGameObject_C(uint32_t time, CClientObjCreate& objCreate);
|
||||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||||
|
|||||||
@ -4,10 +4,6 @@ CGItem_C::CGItem_C(uint32_t time, CClientObjCreate& objCreate) : CGObject_C(time
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGItem_C::~CGItem_C() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGItem_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
void CGItem_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
||||||
this->CGObject_C::SetStorage(storage, saved);
|
this->CGObject_C::SetStorage(storage, saved);
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
class CGItem_C : public CGObject_C, public CGItem {
|
class CGItem_C : public CGObject_C, public CGItem {
|
||||||
public:
|
public:
|
||||||
// Virtual public member functions
|
|
||||||
virtual ~CGItem_C();
|
|
||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGItem_C(uint32_t time, CClientObjCreate& objCreate);
|
CGItem_C(uint32_t time, CClientObjCreate& objCreate);
|
||||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||||
|
|||||||
@ -1,53 +1,19 @@
|
|||||||
#include "object/client/CGObject_C.hpp"
|
#include "object/client/CGObject_C.hpp"
|
||||||
#include "object/client/ObjMgr.hpp"
|
#include "object/client/ObjMgr.hpp"
|
||||||
#include "world/World.hpp"
|
|
||||||
|
|
||||||
CGObject_C::CGObject_C(uint32_t time, CClientObjCreate& objCreate) {
|
CGObject_C::CGObject_C(uint32_t time, CClientObjCreate& objCreate) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
this->m_lockCount = 0;
|
|
||||||
this->m_disabled = false;
|
|
||||||
this->m_inReenable = false;
|
|
||||||
this->m_postInited = false;
|
|
||||||
this->m_flag19 = false;
|
|
||||||
this->m_disablePending = false;
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
ClntObjMgrLinkInNewObject(this);
|
ClntObjMgrLinkInNewObject(this);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGObject_C::~CGObject_C() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGObject_C::AddWorldObject() {
|
void CGObject_C::AddWorldObject() {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGObject_C::Disable() {
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
this->m_disabled = true;
|
|
||||||
// TODO other flag manipulation
|
|
||||||
|
|
||||||
this->m_disableTimeMs = CWorld::GetCurTimeMs();
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t CGObject_C::IsInReenable() {
|
|
||||||
return this->m_inReenable;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t CGObject_C::IsObjectLocked() {
|
|
||||||
return this->m_lockCount != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGObject_C::Reenable() {
|
void CGObject_C::Reenable() {
|
||||||
this->m_disabled = false;
|
|
||||||
this->m_inReenable = true;
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,23 +23,7 @@ void CGObject_C::SetBlock(uint32_t block, uint32_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CGObject_C::SetDisablePending(int32_t pending) {
|
void CGObject_C::SetDisablePending(int32_t pending) {
|
||||||
if (pending) {
|
// TODO
|
||||||
this->m_disablePending = true;
|
|
||||||
} else {
|
|
||||||
this->m_disablePending = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGObject_C::SetObjectLocked(int32_t locked) {
|
|
||||||
if (locked) {
|
|
||||||
if (this->m_lockCount != 0xFFFF) {
|
|
||||||
this->m_lockCount++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this->m_lockCount != 0) {
|
|
||||||
this->m_lockCount--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGObject_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
void CGObject_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
||||||
|
|||||||
@ -12,33 +12,14 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
|
|||||||
public:
|
public:
|
||||||
// Public member variables
|
// Public member variables
|
||||||
TSLink<CGObject_C> m_link;
|
TSLink<CGObject_C> m_link;
|
||||||
uint32_t m_disableTimeMs;
|
|
||||||
// TODO
|
|
||||||
uint32_t m_lockCount : 16;
|
|
||||||
uint32_t m_disabled : 1;
|
|
||||||
uint32_t m_inReenable : 1;
|
|
||||||
uint32_t m_postInited : 1;
|
|
||||||
uint32_t m_flag19 : 1;
|
|
||||||
uint32_t m_disablePending : 1;
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
// Virtual public member functions
|
|
||||||
virtual ~CGObject_C();
|
|
||||||
virtual void Disable();
|
|
||||||
// TODO
|
|
||||||
virtual void HandleOutOfRange(OUT_OF_RANGE_TYPE type) {};
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGObject_C() = default;
|
CGObject_C() = default;
|
||||||
CGObject_C(uint32_t time, CClientObjCreate& objCreate);
|
CGObject_C(uint32_t time, CClientObjCreate& objCreate);
|
||||||
void AddWorldObject();
|
void AddWorldObject();
|
||||||
int32_t IsInReenable();
|
|
||||||
int32_t IsObjectLocked();
|
|
||||||
void Reenable();
|
void Reenable();
|
||||||
void SetBlock(uint32_t block, uint32_t value);
|
void SetBlock(uint32_t block, uint32_t value);
|
||||||
void SetDisablePending(int32_t pending);
|
void SetDisablePending(int32_t pending);
|
||||||
void SetObjectLocked(int32_t locked);
|
|
||||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||||
void SetTypeID(OBJECT_TYPE_ID typeID);
|
void SetTypeID(OBJECT_TYPE_ID typeID);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,10 +7,6 @@ CGPlayer_C::CGPlayer_C(uint32_t time, CClientObjCreate& objCreate) : CGUnit_C(ti
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGPlayer_C::~CGPlayer_C() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGPlayer_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
void CGPlayer_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
||||||
this->CGUnit_C::SetStorage(storage, saved);
|
this->CGUnit_C::SetStorage(storage, saved);
|
||||||
|
|
||||||
|
|||||||
@ -10,9 +10,6 @@ class CreatureModelDataRec;
|
|||||||
|
|
||||||
class CGPlayer_C : public CGUnit_C, public CGPlayer {
|
class CGPlayer_C : public CGUnit_C, public CGPlayer {
|
||||||
public:
|
public:
|
||||||
// Virtual public member functions
|
|
||||||
virtual ~CGPlayer_C();
|
|
||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGPlayer_C(uint32_t time, CClientObjCreate& objCreate);
|
CGPlayer_C(uint32_t time, CClientObjCreate& objCreate);
|
||||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||||
|
|||||||
@ -93,10 +93,6 @@ CGUnit_C::CGUnit_C(uint32_t time, CClientObjCreate& objCreate) : CGObject_C(time
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGUnit_C::~CGUnit_C() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGUnit_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
void CGUnit_C::SetStorage(uint32_t* storage, uint32_t* saved) {
|
||||||
this->CGObject_C::SetStorage(storage, saved);
|
this->CGObject_C::SetStorage(storage, saved);
|
||||||
|
|
||||||
|
|||||||
@ -15,9 +15,6 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
|||||||
static const char* GetDisplayClassNameFromRecord(const ChrClassesRec* classRec, UNIT_SEX sex, UNIT_SEX* displaySex);
|
static const char* GetDisplayClassNameFromRecord(const ChrClassesRec* classRec, UNIT_SEX sex, UNIT_SEX* displaySex);
|
||||||
static const char* GetDisplayRaceNameFromRecord(const ChrRacesRec* raceRec, UNIT_SEX sex, UNIT_SEX* displaySex);
|
static const char* GetDisplayRaceNameFromRecord(const ChrRacesRec* raceRec, UNIT_SEX sex, UNIT_SEX* displaySex);
|
||||||
|
|
||||||
// Virtual public member functions
|
|
||||||
virtual ~CGUnit_C();
|
|
||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGUnit_C(uint32_t time, CClientObjCreate& objCreate);
|
CGUnit_C(uint32_t time, CClientObjCreate& objCreate);
|
||||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class ClntObjMgr {
|
|||||||
// Member variables
|
// Member variables
|
||||||
TSHashTable<CGObject_C, CHashKeyGUID> m_objects;
|
TSHashTable<CGObject_C, CHashKeyGUID> m_objects;
|
||||||
TSHashTable<CGObject_C, CHashKeyGUID> m_lazyCleanupObjects;
|
TSHashTable<CGObject_C, CHashKeyGUID> m_lazyCleanupObjects;
|
||||||
STORM_EXPLICIT_LIST(CGObject_C, m_link) m_lazyCleanupFifo[NUM_CLIENT_OBJECT_TYPES - 1];
|
// TODO
|
||||||
STORM_EXPLICIT_LIST(CGObject_C, m_link) m_visibleObjects;
|
STORM_EXPLICIT_LIST(CGObject_C, m_link) m_visibleObjects;
|
||||||
STORM_EXPLICIT_LIST(CGObject_C, m_link) m_reenabledObjects;
|
STORM_EXPLICIT_LIST(CGObject_C, m_link) m_reenabledObjects;
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -34,65 +34,22 @@ int32_t SkipPartialObjectUpdate(CDataStore* msg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UpdateOutOfRangeObjects(CDataStore* msg) {
|
void UpdateOutOfRangeObjects(CDataStore* msg) {
|
||||||
uint32_t count;
|
WHOA_UNIMPLEMENTED();
|
||||||
msg->Get(count);
|
|
||||||
|
|
||||||
// TODO CVehiclePassenger_C::StartAddingPendingRescueTransitions();
|
|
||||||
|
|
||||||
auto startPos = msg->Tell();
|
|
||||||
|
|
||||||
// Pass 1
|
|
||||||
|
|
||||||
for (int32_t i = 0; i < count; i++) {
|
|
||||||
SmartGUID guid;
|
|
||||||
*msg >> guid;
|
|
||||||
|
|
||||||
if (guid == ClntObjMgrGetActivePlayer()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto object = FindActiveObject(guid);
|
|
||||||
|
|
||||||
if (object) {
|
|
||||||
HandleObjectOutOfRangePass1(object, OUT_OF_RANGE_0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
msg->Seek(startPos);
|
|
||||||
|
|
||||||
// Pass 2
|
|
||||||
|
|
||||||
for (int32_t i = 0; i < count; i++) {
|
|
||||||
SmartGUID guid;
|
|
||||||
*msg >> guid;
|
|
||||||
|
|
||||||
if (guid == ClntObjMgrGetActivePlayer()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto object = FindActiveObject(guid);
|
|
||||||
|
|
||||||
if (object && !object->IsObjectLocked()) {
|
|
||||||
HandleObjectOutOfRangePass2(object);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO CVehiclePassenger_C::ExecutePendingRescueTransitions();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t UpdateObject(CDataStore* msg) {
|
int32_t UpdateObject(CDataStore* msg) {
|
||||||
SmartGUID guid;
|
SmartGUID guid;
|
||||||
*msg >> guid;
|
*msg >> guid;
|
||||||
|
|
||||||
int32_t reenable;
|
int32_t reenabled;
|
||||||
auto object = GetUpdateObject(guid, &reenable);
|
auto object = GetUpdateObject(guid, &reenabled);
|
||||||
|
|
||||||
if (object) {
|
if (object) {
|
||||||
if (!FillInPartialObjectData(object, object->m_obj->m_guid, msg, false, false)) {
|
if (!FillInPartialObjectData(object, object->m_obj->m_guid, msg, false, false)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reenable) {
|
if (reenabled) {
|
||||||
object->Reenable();
|
object->Reenable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,8 +167,8 @@ int32_t CreateObject(CDataStore* msg, uint32_t time) {
|
|||||||
msg->Get(_typeID);
|
msg->Get(_typeID);
|
||||||
auto typeID = static_cast<OBJECT_TYPE_ID>(_typeID);
|
auto typeID = static_cast<OBJECT_TYPE_ID>(_typeID);
|
||||||
|
|
||||||
int32_t reenable;
|
int32_t reenabled;
|
||||||
auto existingObject = GetUpdateObject(guid, &reenable);
|
auto existingObject = GetUpdateObject(guid, &reenabled);
|
||||||
|
|
||||||
if (existingObject) {
|
if (existingObject) {
|
||||||
CClientObjCreate::Skip(msg);
|
CClientObjCreate::Skip(msg);
|
||||||
@ -220,7 +177,7 @@ int32_t CreateObject(CDataStore* msg, uint32_t time) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reenable) {
|
if (reenabled) {
|
||||||
existingObject->Reenable();
|
existingObject->Reenable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +193,7 @@ int32_t CreateObject(CDataStore* msg, uint32_t time) {
|
|||||||
ClntObjMgrSetActivePlayer(guid);
|
ClntObjMgrSetActivePlayer(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto newObject = ClntObjMgrAllocObject(typeID, guid);
|
auto newObject = static_cast<CGObject_C*>(ClntObjMgrAllocObject(typeID, guid));
|
||||||
|
|
||||||
SetupObjectStorage(typeID, newObject, guid);
|
SetupObjectStorage(typeID, newObject, guid);
|
||||||
|
|
||||||
@ -262,10 +219,10 @@ void UpdateInRangeObjects(CDataStore* msg) {
|
|||||||
*msg >> guid;
|
*msg >> guid;
|
||||||
|
|
||||||
if (guid != ClntObjMgrGetActivePlayer()) {
|
if (guid != ClntObjMgrGetActivePlayer()) {
|
||||||
int32_t reenable;
|
int32_t reenabled;
|
||||||
auto object = GetUpdateObject(guid, &reenable);
|
auto object = GetUpdateObject(guid, &reenabled);
|
||||||
|
|
||||||
if (object && reenable) {
|
if (object && reenabled) {
|
||||||
object->Reenable();
|
object->Reenable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -384,8 +341,6 @@ int32_t ObjectUpdateHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataS
|
|||||||
uint32_t updateCount;
|
uint32_t updateCount;
|
||||||
msg->Get(updateCount);
|
msg->Get(updateCount);
|
||||||
|
|
||||||
// If first update type is out of range, handle it before continuing with normal processing
|
|
||||||
|
|
||||||
auto startPos = msg->Tell();
|
auto startPos = msg->Tell();
|
||||||
|
|
||||||
uint8_t firstUpdateType;
|
uint8_t firstUpdateType;
|
||||||
@ -400,8 +355,6 @@ int32_t ObjectUpdateHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataS
|
|||||||
msg->Seek(startPos);
|
msg->Seek(startPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process all updates in two passes (creates, updates and disables objects as appropriate)
|
|
||||||
|
|
||||||
int32_t result = 0;
|
int32_t result = 0;
|
||||||
|
|
||||||
if (ObjectUpdateFirstPass(msg, time, updateIdx, updateCount)) {
|
if (ObjectUpdateFirstPass(msg, time, updateIdx, updateCount)) {
|
||||||
@ -409,31 +362,11 @@ int32_t ObjectUpdateHandler(void* param, NETMESSAGE msgId, uint32_t time, CDataS
|
|||||||
result = ObjectUpdateSecondPass(msg, time, updateCount);
|
result = ObjectUpdateSecondPass(msg, time, updateCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Garbage collect objects disabled more than 2 minutes ago (catch all)
|
// TODO
|
||||||
|
|
||||||
for (int32_t typeID = ID_OBJECT; typeID < NUM_CLIENT_OBJECT_TYPES; typeID++) {
|
|
||||||
GarbageCollect(static_cast<OBJECT_TYPE_ID>(typeID), 120000);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t OnObjectDestroy(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
|
int32_t OnObjectDestroy(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg) {
|
||||||
WOWGUID guid;
|
WHOA_UNIMPLEMENTED(0);
|
||||||
msg->Get(guid);
|
|
||||||
|
|
||||||
uint8_t dead;
|
|
||||||
msg->Get(dead);
|
|
||||||
|
|
||||||
auto object = FindActiveObject(guid);
|
|
||||||
|
|
||||||
if (object) {
|
|
||||||
// TODO handle unit death
|
|
||||||
|
|
||||||
if (HandleObjectOutOfRangePass1(object, OUT_OF_RANGE_1)) {
|
|
||||||
HandleObjectOutOfRangePass2(object);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,15 +67,15 @@ void MirrorInitialize() {
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
CGObject_C* ClntObjMgrAllocObject(OBJECT_TYPE_ID typeID, WOWGUID guid) {
|
void* ClntObjMgrAllocObject(OBJECT_TYPE_ID typeID, WOWGUID guid) {
|
||||||
auto playerGUID = ClntObjMgrGetActivePlayer();
|
auto playerGUID = ClntObjMgrGetActivePlayer();
|
||||||
|
|
||||||
// Heap allocate player object for current player
|
// Heap allocate player object for current player
|
||||||
if (guid == playerGUID) {
|
if (guid == playerGUID) {
|
||||||
return static_cast<CGObject_C*>(STORM_ALLOC(sizeof(CGPlayer_C) + CGPlayer::GetDataSize() + CGPlayer::GetDataSizeSaved()));
|
return STORM_ALLOC(sizeof(CGPlayer_C) + CGPlayer::GetDataSize() + CGPlayer::GetDataSizeSaved());
|
||||||
}
|
}
|
||||||
|
|
||||||
GarbageCollect(typeID, 10000);
|
// TODO GarbageCollect(typeID, 10000);
|
||||||
|
|
||||||
uint32_t memHandle;
|
uint32_t memHandle;
|
||||||
void* mem;
|
void* mem;
|
||||||
@ -85,40 +85,9 @@ CGObject_C* ClntObjMgrAllocObject(OBJECT_TYPE_ID typeID, WOWGUID guid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO pointer should be fetched via ObjectPtr
|
// TODO pointer should be fetched via ObjectPtr
|
||||||
auto object = static_cast<CGObject_C*>(mem);
|
static_cast<CGObject_C*>(mem)->m_memHandle = memHandle;
|
||||||
object->m_memHandle = memHandle;
|
|
||||||
|
|
||||||
return object;
|
return mem;
|
||||||
}
|
|
||||||
|
|
||||||
void ClntObjMgrFreeObject(CGObject_C* object) {
|
|
||||||
auto playerGUID = ClntObjMgrGetActivePlayer();
|
|
||||||
auto isActivePlayer = object->m_obj->m_guid == playerGUID;
|
|
||||||
|
|
||||||
switch (object->m_obj->m_type) {
|
|
||||||
case TYPE_OBJECT:
|
|
||||||
case HIER_TYPE_ITEM:
|
|
||||||
case HIER_TYPE_CONTAINER:
|
|
||||||
case HIER_TYPE_UNIT:
|
|
||||||
case HIER_TYPE_PLAYER:
|
|
||||||
case HIER_TYPE_GAMEOBJECT:
|
|
||||||
case HIER_TYPE_DYNAMICOBJECT:
|
|
||||||
case HIER_TYPE_CORPSE: {
|
|
||||||
object->~CGObject_C();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isActivePlayer) {
|
|
||||||
STORM_FREE(object);
|
|
||||||
} else {
|
|
||||||
ObjectFree(s_objHeapId[object->m_typeID], object->m_memHandle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WOWGUID ClntObjMgrGetActivePlayer() {
|
WOWGUID ClntObjMgrGetActivePlayer() {
|
||||||
|
|||||||
@ -6,12 +6,10 @@
|
|||||||
#include "object/Types.hpp"
|
#include "object/Types.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
CGObject_C* ClntObjMgrAllocObject(OBJECT_TYPE_ID typeID, WOWGUID guid);
|
void* ClntObjMgrAllocObject(OBJECT_TYPE_ID typeID, WOWGUID guid);
|
||||||
|
|
||||||
WOWGUID ClntObjMgrGetActivePlayer();
|
WOWGUID ClntObjMgrGetActivePlayer();
|
||||||
|
|
||||||
void ClntObjMgrFreeObject(CGObject_C* object);
|
|
||||||
|
|
||||||
ClntObjMgr* ClntObjMgrGetCurrent();
|
ClntObjMgr* ClntObjMgrGetCurrent();
|
||||||
|
|
||||||
uint32_t ClntObjMgrGetMapID();
|
uint32_t ClntObjMgrGetMapID();
|
||||||
|
|||||||
@ -9,37 +9,13 @@
|
|||||||
#include "object/client/CGPlayer_C.hpp"
|
#include "object/client/CGPlayer_C.hpp"
|
||||||
#include "object/client/CGUnit_C.hpp"
|
#include "object/client/CGUnit_C.hpp"
|
||||||
#include "object/client/ObjMgr.hpp"
|
#include "object/client/ObjMgr.hpp"
|
||||||
#include <common/Time.hpp>
|
|
||||||
|
|
||||||
CGObject_C* FindActiveObject(WOWGUID guid) {
|
CGObject_C* FindActiveObject(WOWGUID guid) {
|
||||||
return ClntObjMgrGetCurrent()->m_objects.Ptr(guid, CHashKeyGUID(guid));
|
return ClntObjMgrGetCurrent()->m_objects.Ptr(guid, CHashKeyGUID(guid));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
CGObject_C* GetUpdateObject(WOWGUID guid, int32_t* reenabled) {
|
||||||
* Given an object type and collection age, free the object at the head of that type's FIFO queue
|
*reenabled = false;
|
||||||
* if it was disabled longer ago than the collection age. Only frees at most one object per call.
|
|
||||||
*/
|
|
||||||
void GarbageCollect(OBJECT_TYPE_ID typeID, uint32_t collectAgeMs) {
|
|
||||||
auto object = ClntObjMgrGetCurrent()->m_lazyCleanupFifo[typeID - 1].Head();
|
|
||||||
|
|
||||||
if (!object) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t disableAgeMs = OsGetAsyncTimeMsPrecise() - object->m_disableTimeMs;
|
|
||||||
|
|
||||||
if (disableAgeMs < collectAgeMs) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ClntObjMgrGetCurrent()->m_lazyCleanupObjects.Unlink(object);
|
|
||||||
object->m_link.Unlink();
|
|
||||||
|
|
||||||
ClntObjMgrFreeObject(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
CGObject_C* GetUpdateObject(WOWGUID guid, int32_t* reenable) {
|
|
||||||
*reenable = false;
|
|
||||||
|
|
||||||
// Active object
|
// Active object
|
||||||
|
|
||||||
@ -68,7 +44,7 @@ CGObject_C* GetUpdateObject(WOWGUID guid, int32_t* reenable) {
|
|||||||
!ClntObjMgrGetCurrent()->m_visibleObjects.IsLinked(disabledObject)
|
!ClntObjMgrGetCurrent()->m_visibleObjects.IsLinked(disabledObject)
|
||||||
&& !ClntObjMgrGetCurrent()->m_reenabledObjects.IsLinked(disabledObject)
|
&& !ClntObjMgrGetCurrent()->m_reenabledObjects.IsLinked(disabledObject)
|
||||||
) {
|
) {
|
||||||
*reenable = true;
|
*reenabled = true;
|
||||||
ClntObjMgrGetCurrent()->m_reenabledObjects.LinkToTail(disabledObject);
|
ClntObjMgrGetCurrent()->m_reenabledObjects.LinkToTail(disabledObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,36 +56,6 @@ CGObject_C* GetUpdateObject(WOWGUID guid, int32_t* reenable) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t HandleObjectOutOfRangePass1(CGObject_C* object, OUT_OF_RANGE_TYPE type) {
|
|
||||||
// TODO arena unit out of range handling
|
|
||||||
|
|
||||||
object->HandleOutOfRange(type);
|
|
||||||
|
|
||||||
if (object->IsObjectLocked()) {
|
|
||||||
object->SetDisablePending(true);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
object->SetDisablePending(false);
|
|
||||||
object->Disable();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleObjectOutOfRangePass2(CGObject_C* object) {
|
|
||||||
// TODO ClearObjectMirrorHandlers(object);
|
|
||||||
|
|
||||||
ClntObjMgrGetCurrent()->m_objects.Unlink(object);
|
|
||||||
|
|
||||||
if (ClntObjMgrGetCurrent()->m_visibleObjects.IsLinked(object)) {
|
|
||||||
ClntObjMgrGetCurrent()->m_visibleObjects.UnlinkNode(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
ClntObjMgrGetCurrent()->m_lazyCleanupObjects.Insert(object, object->m_hashval, CHashKeyGUID(object->m_key));
|
|
||||||
ClntObjMgrGetCurrent()->m_lazyCleanupFifo[object->m_typeID - 1].LinkToTail(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitObject(CGObject_C* object, uint32_t time, CClientObjCreate& objCreate) {
|
void InitObject(CGObject_C* object, uint32_t time, CClientObjCreate& objCreate) {
|
||||||
switch (object->m_typeID) {
|
switch (object->m_typeID) {
|
||||||
case ID_ITEM: {
|
case ID_ITEM: {
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#ifndef OBJECT_CLIENT_UTIL_HPP
|
#ifndef OBJECT_CLIENT_UTIL_HPP
|
||||||
#define OBJECT_CLIENT_UTIL_HPP
|
#define OBJECT_CLIENT_UTIL_HPP
|
||||||
|
|
||||||
#include "object/Types.hpp"
|
|
||||||
#include "util/GUID.hpp"
|
#include "util/GUID.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
@ -10,13 +9,7 @@ class CGObject_C;
|
|||||||
|
|
||||||
CGObject_C* FindActiveObject(WOWGUID guid);
|
CGObject_C* FindActiveObject(WOWGUID guid);
|
||||||
|
|
||||||
void GarbageCollect(OBJECT_TYPE_ID typeID, uint32_t collectAgeMs);
|
CGObject_C* GetUpdateObject(WOWGUID guid, int32_t* reenabled);
|
||||||
|
|
||||||
CGObject_C* GetUpdateObject(WOWGUID guid, int32_t* reenable);
|
|
||||||
|
|
||||||
int32_t HandleObjectOutOfRangePass1(CGObject_C* object, OUT_OF_RANGE_TYPE type);
|
|
||||||
|
|
||||||
void HandleObjectOutOfRangePass2(CGObject_C* object);
|
|
||||||
|
|
||||||
void InitObject(CGObject_C* object, uint32_t time, CClientObjCreate& objCreate);
|
void InitObject(CGObject_C* object, uint32_t time, CClientObjCreate& objCreate);
|
||||||
|
|
||||||
|
|||||||
@ -6,49 +6,10 @@
|
|||||||
#include "world/Weather.hpp"
|
#include "world/Weather.hpp"
|
||||||
#include <storm/Memory.hpp>
|
#include <storm/Memory.hpp>
|
||||||
|
|
||||||
uint32_t CWorld::s_curTimeMs;
|
|
||||||
float CWorld::s_curTimeSec;
|
|
||||||
uint32_t CWorld::s_enables;
|
uint32_t CWorld::s_enables;
|
||||||
uint32_t CWorld::s_enables2;
|
uint32_t CWorld::s_enables2;
|
||||||
uint32_t CWorld::s_gameTimeFixed;
|
|
||||||
float CWorld::s_gameTimeSec;
|
|
||||||
uint32_t CWorld::s_tickTimeFixed;
|
|
||||||
uint32_t CWorld::s_tickTimeMs;
|
|
||||||
float CWorld::s_tickTimeSec;
|
|
||||||
Weather* CWorld::s_weather;
|
Weather* CWorld::s_weather;
|
||||||
|
|
||||||
uint32_t CWorld::GetCurTimeMs() {
|
|
||||||
return CWorld::s_curTimeMs;
|
|
||||||
}
|
|
||||||
|
|
||||||
float CWorld::GetCurTimeSec() {
|
|
||||||
return CWorld::s_curTimeSec;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t CWorld::GetFixedPrecisionTime(float timeSec) {
|
|
||||||
return static_cast<uint32_t>(timeSec * 1024.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t CWorld::GetGameTimeFixed() {
|
|
||||||
return CWorld::s_gameTimeFixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
float CWorld::GetGameTimeSec() {
|
|
||||||
return CWorld::s_gameTimeSec;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t CWorld::GetTickTimeFixed() {
|
|
||||||
return CWorld::s_tickTimeFixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t CWorld::GetTickTimeMs() {
|
|
||||||
return CWorld::s_tickTimeMs;
|
|
||||||
}
|
|
||||||
|
|
||||||
float CWorld::GetTickTimeSec() {
|
|
||||||
return CWorld::s_tickTimeSec;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CWorld::Initialize() {
|
void CWorld::Initialize() {
|
||||||
CWorld::s_enables |=
|
CWorld::s_enables |=
|
||||||
Enables::Enable_1
|
Enables::Enable_1
|
||||||
@ -65,9 +26,6 @@ void CWorld::Initialize() {
|
|||||||
| Enables::Enable_Particulates
|
| Enables::Enable_Particulates
|
||||||
| Enables::Enable_LowDetail;
|
| Enables::Enable_LowDetail;
|
||||||
|
|
||||||
CWorld::s_gameTimeFixed = 0;
|
|
||||||
CWorld::s_gameTimeSec = 0.0f;
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
if (GxCaps().m_shaderTargets[GxSh_Pixel] > GxShPS_none) {
|
if (GxCaps().m_shaderTargets[GxSh_Pixel] > GxShPS_none) {
|
||||||
@ -100,23 +58,3 @@ void CWorld::LoadMap(const char* mapName, const C3Vector& position, int32_t zone
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CWorld::OnTick(const EVENT_DATA_TICK* data, void* param) {
|
|
||||||
CWorld::SetUpdateTime(data->tickTimeSec, data->curTimeMs);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CWorld::SetUpdateTime(float tickTimeSec, uint32_t curTimeMs) {
|
|
||||||
auto tickTimeFixed = CWorld::GetFixedPrecisionTime(tickTimeSec);
|
|
||||||
|
|
||||||
CWorld::s_curTimeMs = curTimeMs;
|
|
||||||
CWorld::s_curTimeSec = static_cast<float>(curTimeMs) * 0.001f;
|
|
||||||
|
|
||||||
CWorld::s_gameTimeFixed += tickTimeFixed;
|
|
||||||
CWorld::s_gameTimeSec += tickTimeSec;
|
|
||||||
|
|
||||||
CWorld::s_tickTimeFixed = tickTimeFixed;
|
|
||||||
CWorld::s_tickTimeMs = static_cast<uint32_t>(tickTimeSec * 1000.0f);
|
|
||||||
CWorld::s_tickTimeSec = tickTimeSec;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#ifndef WORLD_C_WORLD_HPP
|
#ifndef WORLD_C_WORLD_HPP
|
||||||
#define WORLD_C_WORLD_HPP
|
#define WORLD_C_WORLD_HPP
|
||||||
|
|
||||||
#include "event/Event.hpp"
|
|
||||||
#include <tempest/Vector.hpp>
|
#include <tempest/Vector.hpp>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
@ -45,36 +44,14 @@ class CWorld {
|
|||||||
Enable_HwPcf = 0x2
|
Enable_HwPcf = 0x2
|
||||||
};
|
};
|
||||||
|
|
||||||
// Public static variables
|
// Static variables
|
||||||
static uint32_t s_enables;
|
static uint32_t s_enables;
|
||||||
static uint32_t s_enables2;
|
static uint32_t s_enables2;
|
||||||
static Weather* s_weather;
|
static Weather* s_weather;
|
||||||
|
|
||||||
// Public static functions
|
// Static functions
|
||||||
static uint32_t GetCurTimeMs();
|
static void Initialize(void);
|
||||||
static float GetCurTimeSec();
|
|
||||||
static uint32_t GetGameTimeFixed();
|
|
||||||
static float GetGameTimeSec();
|
|
||||||
static uint32_t GetTickTimeFixed();
|
|
||||||
static uint32_t GetTickTimeMs();
|
|
||||||
static float GetTickTimeSec();
|
|
||||||
static void Initialize();
|
|
||||||
static void LoadMap(const char* mapName, const C3Vector& position, int32_t zoneID);
|
static void LoadMap(const char* mapName, const C3Vector& position, int32_t zoneID);
|
||||||
static int32_t OnTick(const EVENT_DATA_TICK* data, void* param);
|
|
||||||
static void SetUpdateTime(float tickTimeSec, uint32_t curTimeMs);
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Private static variables
|
|
||||||
static uint32_t s_curTimeMs;
|
|
||||||
static float s_curTimeSec;
|
|
||||||
static uint32_t s_gameTimeFixed;
|
|
||||||
static float s_gameTimeSec;
|
|
||||||
static uint32_t s_tickTimeFixed;
|
|
||||||
static uint32_t s_tickTimeMs;
|
|
||||||
static float s_tickTimeSec;
|
|
||||||
|
|
||||||
// Private static functions
|
|
||||||
static uint32_t GetFixedPrecisionTime(float timeSec);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user