Compare commits

...

8 Commits

Author SHA1 Message Date
Tristan 'Natrist' Cormier
2c18e4c3ab
Merge 4a102c6ace into fa98bbc1f0 2026-02-23 22:05:48 -05: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
4a102c6ace feat(glue): implement Script_ContestAccepted 2026-01-11 17:01:24 -05:00
10 changed files with 59 additions and 1 deletions

View File

@ -47,6 +47,7 @@ float CGlueMgr::m_aspect;
bool CGlueMgr::m_authenticated;
const CharacterSelectionDisplay* CGlueMgr::m_characterInfo;
int32_t CGlueMgr::m_clientKickReason;
int32_t CGlueMgr::m_contestAccepted = 1; // TODO
char CGlueMgr::m_currentScreen[64];
EffectDeath* CGlueMgr::m_deathEffect;
int32_t CGlueMgr::m_disconnectPending;

View File

@ -41,6 +41,7 @@ class CGlueMgr {
static bool m_authenticated;
static const CharacterSelectionDisplay* m_characterInfo;
static int32_t m_clientKickReason;
static int32_t m_contestAccepted;
static char m_currentScreen[];
static EffectDeath* m_deathEffect;
static int32_t m_disconnectPending;

View File

@ -228,7 +228,14 @@ int32_t Script_ShowContestNotice(lua_State* L) {
}
int32_t Script_ContestAccepted(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
if (CGlueMgr::m_contestAccepted) {
lua_pushnumber(L, 1.0);
}
else {
lua_pushnil(L);
}
return 1;
}
int32_t Script_AcceptContest(lua_State* L) {

View File

@ -95,6 +95,10 @@ void CGObject_C::Disable() {
this->m_disableTimeMs = CWorld::GetCurTimeMs();
}
float CGObject_C::GetFacing() const {
return 0.0f;
}
int32_t CGObject_C::GetModelFileName(const char*& name) const {
return false;
}
@ -103,6 +107,10 @@ CM2Model* CGObject_C::GetObjectModel() {
return this->m_model;
}
C3Vector CGObject_C::GetPosition() const {
return { 0.0f, 0.0f, 0.0f };
}
int32_t CGObject_C::IsInReenable() {
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 UpdateWorldObject(int32_t a2);
// TODO
virtual C3Vector GetPosition() const;
// TODO
virtual float GetFacing() const;
// TODO
virtual int32_t GetModelFileName(const char*& name) const;
// TODO
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) {
this->m_model = nullptr;
this->m_target = 0;
this->m_relativeTo = 0;
this->m_view = s_cameraView->GetInt();
@ -63,6 +66,14 @@ C3Vector CGCamera::Forward() const {
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 {
// TODO
return {};

View File

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

View File

@ -2,8 +2,10 @@
#include "gx/Coordinate.hpp"
#include "gx/Shader.hpp"
#include "gx/Transform.hpp"
#include "object/Client.hpp"
#include "ui/game/CGCamera.hpp"
#include "ui/game/PlayerName.hpp"
#include "world/World.hpp"
#include <storm/Memory.hpp>
#include <tempest/Matrix.hpp>
@ -92,7 +94,19 @@ void CGWorldFrame::OnWorldRender() {
void CGWorldFrame::OnWorldUpdate() {
// TODO
auto target = ClntObjMgrObjectPtr(this->m_camera->GetTarget(), TYPE_OBJECT, __FILE__, __LINE__);
// TODO
this->m_camera->SetupWorldProjection(this->m_screenRect);
// 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_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 void SetFarClip(float farClip);
static void SetUpdateTime(float tickTimeSec, uint32_t curTimeMs);
static void Update(const C3Vector& cameraPos, const C3Vector& cameraTarget, const C3Vector& targetPos);
private:
// Private static variables