Compare commits

...

4 Commits

Author SHA1 Message Date
Tristan 'Natrist' Cormier
db71994e3a
Merge c500403cd9 into 817cec99fe 2026-02-21 19:26:33 -05:00
fallenoak
817cec99fe
feat(ui): add CGCamera::Target
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 14:11:22 -06:00
fallenoak
6675586a29
feat(ui): add CSimpleCamera::Position 2026-02-21 14:07:33 -06:00
Tristan Cormier
c500403cd9 feat(glue): implement CGlueMgr::PollCreateCharacter 2026-02-14 20:49:17 -05:00
6 changed files with 47 additions and 0 deletions

View File

@ -393,6 +393,11 @@ int32_t CGlueMgr::Idle(const void* a1, void* a2) {
break;
}
case IDLE_CREATE_CHARACTER: {
CGlueMgr::PollCreateCharacter(msg, complete, result);
break;
}
case IDLE_DELETE_CHARACTER: {
CGlueMgr::PollDeleteCharacter(msg, complete, result);
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) {
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 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 PollCreateCharacter(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 PollLoginServerLogin();

View File

@ -80,6 +80,10 @@ void CGCamera::SetupWorldProjection(const CRect& projRect) {
this->SetGxProjectionAndView(projRect);
}
C3Vector CGCamera::Target() const {
return this->m_position + this->Forward();
}
C3Vector CGCamera::Up() const {
if (this->m_relativeTo) {
return this->CSimpleCamera::Up() * this->ParentToWorld();

View File

@ -27,6 +27,7 @@ class CGCamera : public CSimpleCamera {
CGCamera();
C33Matrix ParentToWorld() const;
void SetupWorldProjection(const CRect& projRect);
C3Vector Target() const;
private:
// Private member variables

View File

@ -84,6 +84,10 @@ C3Vector CSimpleCamera::Right() const {
return { this->m_facing.b0, this->m_facing.b1, this->m_facing.b2 };
}
const C3Vector& CSimpleCamera::Position() const {
return this->m_position;
}
void CSimpleCamera::SetFacing(const C3Vector& forward) {
BuildBillboardMatrix(forward, this->m_facing);
}

View File

@ -18,6 +18,7 @@ class CSimpleCamera {
// Public member functions
CSimpleCamera(float nearZ, float farZ, float fov);
CM2Scene* GetScene();
const C3Vector& Position() const;
void SetFacing(const C3Vector& forward);
void SetFacing(const C3Vector& forward, const C3Vector& up);
void SetFacing(float yaw, float pitch, float roll);