Compare commits

...

8 Commits

Author SHA1 Message Date
Tristan 'Natrist' Cormier
fb6daccf6f
Merge c500403cd9 into fa98bbc1f0 2026-02-23 10:35:05 +01:00
fallenoak
fa98bbc1f0
feat(object): add CGObject_C::GetFacing
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
2026-02-22 21:57:26 -06:00
fallenoak
af4b798942
feat(ui): call CWorld::Update from CGWorldFrame::OnWorldUpdate
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
2026-02-21 21:42:41 -06:00
fallenoak
9b18f2f3bd
feat(world): stub CWorld::Update 2026-02-21 21:42:02 -06:00
fallenoak
6cb5310430
feat(object): add CGObject_C::GetPosition 2026-02-21 21:41:37 -06:00
fallenoak
cb8291af1a
feat(ui): add CGCamera::HasModel 2026-02-21 21:41:08 -06:00
fallenoak
58c8975769
feat(ui): add CGCamera::GetTarget 2026-02-21 21:15:01 -06:00
Tristan Cormier
c500403cd9 feat(glue): implement CGlueMgr::PollCreateCharacter 2026-02-14 20:49:17 -05:00
9 changed files with 86 additions and 0 deletions

View File

@ -393,6 +393,11 @@ int32_t CGlueMgr::Idle(const void* a1, void* a2) {
break; break;
} }
case IDLE_CREATE_CHARACTER: {
CGlueMgr::PollCreateCharacter(msg, complete, result);
break;
}
case IDLE_DELETE_CHARACTER: { case IDLE_DELETE_CHARACTER: {
CGlueMgr::PollDeleteCharacter(msg, complete, result); CGlueMgr::PollDeleteCharacter(msg, complete, result);
break; break;
@ -763,6 +768,37 @@ void CGlueMgr::PollCharacterList(const char* msg, int32_t complete, int32_t resu
} }
} }
void CGlueMgr::PollCreateCharacter(const char* msg, int32_t complete, int32_t result) {
FrameScript_SignalEvent(UPDATE_STATUS_DIALOG, "%s", msg);
if (CGlueMgr::HandleBattlenetDisconnect()) {
SetIdleState(IDLE_NONE);
}
if (!complete) {
return;
}
// Error
if (result == 0) {
FrameScript_SignalEvent(OPEN_STATUS_DIALOG, "%s%s", "OKAY", msg);
CGlueMgr::SetIdleState(IDLE_NONE);
return;
}
// Success
CGlueMgr::SetIdleState(IDLE_NONE);
FrameScript_SignalEvent(CLOSE_STATUS_DIALOG, nullptr);
FrameScript_SignalEvent(SELECT_LAST_CHARACTER, nullptr);
CGlueMgr::SetScreen("charselect");
}
void CGlueMgr::PollDeleteCharacter(const char* msg, int32_t complete, int32_t result) { void CGlueMgr::PollDeleteCharacter(const char* msg, int32_t complete, int32_t result) {
FrameScript_SignalEvent(UPDATE_STATUS_DIALOG, "%s", msg); FrameScript_SignalEvent(UPDATE_STATUS_DIALOG, "%s", msg);

View File

@ -80,6 +80,7 @@ class CGlueMgr {
static int32_t OnKickReasonMsg(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg); static int32_t OnKickReasonMsg(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op); static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
static void PollCharacterList(const char* msg, int32_t complete, int32_t result, int32_t errorCode); static void PollCharacterList(const char* msg, int32_t complete, int32_t result, int32_t errorCode);
static void PollCreateCharacter(const char* msg, int32_t complete, int32_t result);
static void PollDeleteCharacter(const char* msg, int32_t complete, int32_t result); static void PollDeleteCharacter(const char* msg, int32_t complete, int32_t result);
static void PollEnterWorld(); static void PollEnterWorld();
static void PollLoginServerLogin(); static void PollLoginServerLogin();

View File

@ -95,6 +95,10 @@ void CGObject_C::Disable() {
this->m_disableTimeMs = CWorld::GetCurTimeMs(); this->m_disableTimeMs = CWorld::GetCurTimeMs();
} }
float CGObject_C::GetFacing() const {
return 0.0f;
}
int32_t CGObject_C::GetModelFileName(const char*& name) const { int32_t CGObject_C::GetModelFileName(const char*& name) const {
return false; return false;
} }
@ -103,6 +107,10 @@ CM2Model* CGObject_C::GetObjectModel() {
return this->m_model; return this->m_model;
} }
C3Vector CGObject_C::GetPosition() const {
return { 0.0f, 0.0f, 0.0f };
}
int32_t CGObject_C::IsInReenable() { int32_t CGObject_C::IsInReenable() {
return this->m_inReenable; return this->m_inReenable;
} }

View File

@ -36,6 +36,10 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
virtual void HandleOutOfRange(OUT_OF_RANGE_TYPE type) {}; virtual void HandleOutOfRange(OUT_OF_RANGE_TYPE type) {};
virtual void UpdateWorldObject(int32_t a2); virtual void UpdateWorldObject(int32_t a2);
// TODO // TODO
virtual C3Vector GetPosition() const;
// TODO
virtual float GetFacing() const;
// TODO
virtual int32_t GetModelFileName(const char*& name) const; virtual int32_t GetModelFileName(const char*& name) const;
// TODO // TODO
virtual int32_t CanHighlight(); virtual int32_t CanHighlight();

View File

@ -38,6 +38,9 @@ bool ValidateCameraView(CVar* var, const char* oldValue, const char* value, void
} }
CGCamera::CGCamera() : CSimpleCamera(CWorld::GetNearClip(), CWorld::GetFarClip(), 90.0f * CMath::DEG2RAD) { CGCamera::CGCamera() : CSimpleCamera(CWorld::GetNearClip(), CWorld::GetFarClip(), 90.0f * CMath::DEG2RAD) {
this->m_model = nullptr;
this->m_target = 0;
this->m_relativeTo = 0; this->m_relativeTo = 0;
this->m_view = s_cameraView->GetInt(); this->m_view = s_cameraView->GetInt();
@ -63,6 +66,14 @@ C3Vector CGCamera::Forward() const {
return this->CSimpleCamera::Forward(); return this->CSimpleCamera::Forward();
} }
const WOWGUID& CGCamera::GetTarget() const {
return this->m_target;
}
int32_t CGCamera::HasModel() const {
return this->m_model != nullptr;
}
C33Matrix CGCamera::ParentToWorld() const { C33Matrix CGCamera::ParentToWorld() const {
// TODO // TODO
return {}; return {};

View File

@ -4,6 +4,8 @@
#include "ui/simple/CSimpleCamera.hpp" #include "ui/simple/CSimpleCamera.hpp"
#include "util/GUID.hpp" #include "util/GUID.hpp"
class CM2Model;
class CGCamera : public CSimpleCamera { class CGCamera : public CSimpleCamera {
public: public:
// Public structs // Public structs
@ -25,12 +27,17 @@ class CGCamera : public CSimpleCamera {
// Public member functions // Public member functions
CGCamera(); CGCamera();
const WOWGUID& GetTarget() const;
int32_t HasModel() const;
C33Matrix ParentToWorld() const; C33Matrix ParentToWorld() const;
void SetupWorldProjection(const CRect& projRect); void SetupWorldProjection(const CRect& projRect);
C3Vector Target() const; C3Vector Target() const;
private: private:
// Private member variables // Private member variables
CM2Model* m_model;
// TODO
WOWGUID m_target;
// TODO // TODO
WOWGUID m_relativeTo; WOWGUID m_relativeTo;
// TODO // TODO

View File

@ -2,8 +2,10 @@
#include "gx/Coordinate.hpp" #include "gx/Coordinate.hpp"
#include "gx/Shader.hpp" #include "gx/Shader.hpp"
#include "gx/Transform.hpp" #include "gx/Transform.hpp"
#include "object/Client.hpp"
#include "ui/game/CGCamera.hpp" #include "ui/game/CGCamera.hpp"
#include "ui/game/PlayerName.hpp" #include "ui/game/PlayerName.hpp"
#include "world/World.hpp"
#include <storm/Memory.hpp> #include <storm/Memory.hpp>
#include <tempest/Matrix.hpp> #include <tempest/Matrix.hpp>
@ -92,7 +94,19 @@ void CGWorldFrame::OnWorldRender() {
void CGWorldFrame::OnWorldUpdate() { void CGWorldFrame::OnWorldUpdate() {
// TODO // TODO
auto target = ClntObjMgrObjectPtr(this->m_camera->GetTarget(), TYPE_OBJECT, __FILE__, __LINE__);
// TODO
this->m_camera->SetupWorldProjection(this->m_screenRect); this->m_camera->SetupWorldProjection(this->m_screenRect);
// TODO // TODO
auto targetPos = target && !this->m_camera->HasModel()
? target->GetPosition()
: this->m_camera->Position();
CWorld::Update(this->m_camera->Position(), this->m_camera->Target(), targetPos);
// TODO
} }

View File

@ -213,3 +213,7 @@ void CWorld::SetUpdateTime(float tickTimeSec, uint32_t curTimeMs) {
CWorld::s_tickTimeMs = static_cast<uint32_t>(tickTimeSec * 1000.0f); CWorld::s_tickTimeMs = static_cast<uint32_t>(tickTimeSec * 1000.0f);
CWorld::s_tickTimeSec = tickTimeSec; CWorld::s_tickTimeSec = tickTimeSec;
} }
void CWorld::Update(const C3Vector& cameraPos, const C3Vector& cameraTarget, const C3Vector& targetPos) {
// TODO
}

View File

@ -70,6 +70,7 @@ class CWorld {
static int32_t OnTick(const EVENT_DATA_TICK* data, void* param); static int32_t OnTick(const EVENT_DATA_TICK* data, void* param);
static void SetFarClip(float farClip); static void SetFarClip(float farClip);
static void SetUpdateTime(float tickTimeSec, uint32_t curTimeMs); static void SetUpdateTime(float tickTimeSec, uint32_t curTimeMs);
static void Update(const C3Vector& cameraPos, const C3Vector& cameraTarget, const C3Vector& targetPos);
private: private:
// Private static variables // Private static variables