mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-19 14:11:06 +03:00
Compare commits
No commits in common. "b4751725a6a679e37f6733b50c0a5582bb43fc0c" and "c604ae6d197e429d3e912d070a58658a464f832d" have entirely different histories.
b4751725a6
...
c604ae6d19
@ -1,5 +1,4 @@
|
||||
#include "object/client/CGObject_C.hpp"
|
||||
#include "model/Model2.hpp"
|
||||
#include "object/client/ObjMgr.hpp"
|
||||
#include "world/World.hpp"
|
||||
|
||||
@ -7,7 +6,6 @@ CGObject_C::CGObject_C(uint32_t time, CClientObjCreate& objCreate) {
|
||||
// TODO
|
||||
|
||||
this->m_model = nullptr;
|
||||
this->m_worldObject = 0;
|
||||
|
||||
// TODO
|
||||
|
||||
@ -30,52 +28,7 @@ CGObject_C::~CGObject_C() {
|
||||
}
|
||||
|
||||
void CGObject_C::AddWorldObject() {
|
||||
if (!this->m_model) {
|
||||
const char* fileName;
|
||||
if (this->GetModelFileName(fileName)) {
|
||||
auto model = CWorld::GetM2Scene()->CreateModel(fileName, 0);
|
||||
this->SetModel(model);
|
||||
model->Release();
|
||||
}
|
||||
}
|
||||
|
||||
if (!this->m_model) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ClntObjMgrGetPlayerType() != PLAYER_NORMAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->m_worldObject) {
|
||||
// TODO SysMsgPrintf(1, 2, "OBJECTALREADYACTIVE|0x%016I64X", this->GetGUID());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t objFlags = 0x0;
|
||||
|
||||
if (this->IsA(TYPE_GAMEOBJECT)) {
|
||||
objFlags |= 0x8 | 0x2 | 0x1;
|
||||
} else if (this->IsA(TYPE_DYNAMICOBJECT)) {
|
||||
objFlags |= 0x8 | 0x2;
|
||||
} else if (this->IsA(TYPE_CORPSE)) {
|
||||
// TODO
|
||||
} else if (this->IsA(TYPE_UNIT)) {
|
||||
// TODO
|
||||
|
||||
objFlags |= 0x10;
|
||||
|
||||
if (this->IsA(TYPE_PLAYER)) {
|
||||
objFlags |= 0x20;
|
||||
}
|
||||
}
|
||||
|
||||
this->m_worldObject = CWorld::AddObject(this->GetObjectModel(), nullptr, nullptr, this->GetGUID(), 0, objFlags);
|
||||
|
||||
if (!this->m_inReenable && this->m_postInited) {
|
||||
this->UpdateWorldObject(false);
|
||||
}
|
||||
}
|
||||
|
||||
int32_t CGObject_C::CanBeTargetted() {
|
||||
@ -95,14 +48,6 @@ void CGObject_C::Disable() {
|
||||
this->m_disableTimeMs = CWorld::GetCurTimeMs();
|
||||
}
|
||||
|
||||
int32_t CGObject_C::GetModelFileName(const char*& name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
CM2Model* CGObject_C::GetObjectModel() {
|
||||
return this->m_model;
|
||||
}
|
||||
|
||||
int32_t CGObject_C::IsInReenable() {
|
||||
return this->m_inReenable;
|
||||
}
|
||||
@ -145,25 +90,6 @@ void CGObject_C::SetDisablePending(int32_t pending) {
|
||||
}
|
||||
}
|
||||
|
||||
void CGObject_C::SetModel(CM2Model* model) {
|
||||
// No change
|
||||
if (this->m_model == model) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (model) {
|
||||
model->AddRef();
|
||||
}
|
||||
|
||||
this->m_model = model;
|
||||
|
||||
this->SetModelFinish(model);
|
||||
}
|
||||
|
||||
void CGObject_C::SetModelFinish(CM2Model* model) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CGObject_C::SetObjectLocked(int32_t locked) {
|
||||
if (locked) {
|
||||
if (this->m_lockCount != 0xFFFF) {
|
||||
@ -221,7 +147,3 @@ void CGObject_C::SetTypeID(OBJECT_TYPE_ID typeID) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CGObject_C::UpdateWorldObject(int32_t a2) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
#include "object/client/CClientObjCreate.hpp"
|
||||
#include "object/client/CGObject.hpp"
|
||||
#include "util/GUID.hpp"
|
||||
#include "world/Types.hpp"
|
||||
#include <storm/Hash.hpp>
|
||||
#include <storm/List.hpp>
|
||||
|
||||
@ -19,7 +18,6 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
|
||||
// TODO
|
||||
CM2Model* m_model;
|
||||
// TODO
|
||||
HWORLDOBJECT m_worldObject;
|
||||
uint32_t m_lockCount : 16;
|
||||
uint32_t m_disabled : 1;
|
||||
uint32_t m_inReenable : 1;
|
||||
@ -34,14 +32,9 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
|
||||
void Reenable();
|
||||
void PostReenable();
|
||||
virtual void HandleOutOfRange(OUT_OF_RANGE_TYPE type) {};
|
||||
virtual void UpdateWorldObject(int32_t a2);
|
||||
// TODO
|
||||
virtual int32_t GetModelFileName(const char*& name);
|
||||
// TODO
|
||||
virtual int32_t CanHighlight();
|
||||
virtual int32_t CanBeTargetted();
|
||||
// TODO
|
||||
virtual CM2Model* GetObjectModel();
|
||||
|
||||
// Public member functions
|
||||
CGObject_C() = default;
|
||||
@ -52,8 +45,6 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
|
||||
void PostInit(uint32_t time, const CClientObjCreate& init, bool a4);
|
||||
void SetBlock(uint32_t block, uint32_t value);
|
||||
void SetDisablePending(int32_t pending);
|
||||
void SetModel(CM2Model* model);
|
||||
void SetModelFinish(CM2Model* model);
|
||||
void SetObjectLocked(int32_t locked);
|
||||
void SetStorage(uint32_t* storage, uint32_t* saved);
|
||||
void SetTypeID(OBJECT_TYPE_ID typeID);
|
||||
|
||||
@ -12,7 +12,6 @@ uint32_t CWorld::s_enables;
|
||||
uint32_t CWorld::s_enables2;
|
||||
uint32_t CWorld::s_gameTimeFixed;
|
||||
float CWorld::s_gameTimeSec;
|
||||
CM2Scene* CWorld::s_m2Scene;
|
||||
uint32_t CWorld::s_tickTimeFixed;
|
||||
uint32_t CWorld::s_tickTimeMs;
|
||||
float CWorld::s_tickTimeSec;
|
||||
@ -67,10 +66,6 @@ float CWorld::GetGameTimeSec() {
|
||||
return CWorld::s_gameTimeSec;
|
||||
}
|
||||
|
||||
CM2Scene* CWorld::GetM2Scene() {
|
||||
return CWorld::s_m2Scene;
|
||||
}
|
||||
|
||||
uint32_t CWorld::GetTickTimeFixed() {
|
||||
return CWorld::s_tickTimeFixed;
|
||||
}
|
||||
@ -102,6 +97,8 @@ void CWorld::Initialize() {
|
||||
CWorld::s_gameTimeFixed = 0;
|
||||
CWorld::s_gameTimeSec = 0.0f;
|
||||
|
||||
// TODO
|
||||
|
||||
if (GxCaps().m_shaderTargets[GxSh_Pixel] > GxShPS_none) {
|
||||
CWorld::s_enables |= Enables::Enable_PixelShader;
|
||||
}
|
||||
@ -112,10 +109,6 @@ void CWorld::Initialize() {
|
||||
|
||||
// TODO
|
||||
|
||||
CWorld::s_m2Scene = M2CreateScene();
|
||||
|
||||
// TODO
|
||||
|
||||
uint32_t m2Flags = M2GetCacheFlags();
|
||||
CShaderEffect::InitShaderSystem(
|
||||
(m2Flags & 0x8) != 0,
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
#include <cstdint>
|
||||
|
||||
class CM2Model;
|
||||
class CM2Scene;
|
||||
class Weather;
|
||||
|
||||
class CWorld {
|
||||
@ -59,7 +58,6 @@ class CWorld {
|
||||
static float GetCurTimeSec();
|
||||
static uint32_t GetGameTimeFixed();
|
||||
static float GetGameTimeSec();
|
||||
static CM2Scene* GetM2Scene();
|
||||
static uint32_t GetTickTimeFixed();
|
||||
static uint32_t GetTickTimeMs();
|
||||
static float GetTickTimeSec();
|
||||
@ -74,7 +72,6 @@ class CWorld {
|
||||
static float s_curTimeSec;
|
||||
static uint32_t s_gameTimeFixed;
|
||||
static float s_gameTimeSec;
|
||||
static CM2Scene* s_m2Scene;
|
||||
static uint32_t s_tickTimeFixed;
|
||||
static uint32_t s_tickTimeMs;
|
||||
static float s_tickTimeSec;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user