Compare commits

...
8 Commits
Author SHA1 Message Date
Tristan 'Natrist' Cormier c511e0733b Merge c12a79d6e6 into fa98bbc1f0 2026-02-23 22:05:48 -05:00
fallenoak fa98bbc1f0 feat(object): add CGObject_C::GetFacing
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
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 c12a79d6e6 feat(console): add CONSOLELINE::Backspace 2025-12-08 09:17:54 -05:00
9 changed files with 70 additions and 0 deletions

No files matched your search

+20
View File
@@ -84,6 +84,26 @@ CONSOLELINE::~CONSOLELINE() {
}
}
void CONSOLELINE::Backspace() {
if (this->inputpos > this->inputstart) {
if (this->chars <= this->inputpos) {
this->buffer[this->inputpos - 1] = '\0';
}
else {
memcpy(
&this->buffer[this->inputpos - 1],
&this->buffer[this->inputpos],
this->chars - this->inputpos + 1
);
}
this->inputpos--;
this->chars--;
SetInputString(this->buffer);
}
}
void DrawBackground() {
uint16_t indices[] = {
0, 1, 2, 3
+1
View File
@@ -19,6 +19,7 @@ class CONSOLELINE : public TSLinkedNode<CONSOLELINE> {
// Member functions
~CONSOLELINE();
void Backspace();
};
void ConsoleScreenAnimate(float elapsedSec);
+8
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;
}
+4
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();
+11
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 {};
+7
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
+14
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
}
+4
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
}
+1
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