mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 05:31:07 +03:00
Compare commits
8 Commits
145bd5e2e3
...
7c2e1e582c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c2e1e582c | ||
|
|
74bc963a1c | ||
|
|
c3b9256fc5 | ||
|
|
2034536620 | ||
|
|
abf9eb3b05 | ||
|
|
00d340c242 | ||
|
|
d3d4fa884f | ||
|
|
c12a79d6e6 |
@ -1 +1 @@
|
|||||||
Subproject commit 489f2149b74b2ca8302ec1cbcec9c6250057f7a1
|
Subproject commit c6ee931690f71362ab76602fb6f34a6cf23d12b8
|
||||||
@ -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() {
|
void DrawBackground() {
|
||||||
uint16_t indices[] = {
|
uint16_t indices[] = {
|
||||||
0, 1, 2, 3
|
0, 1, 2, 3
|
||||||
|
|||||||
@ -19,6 +19,7 @@ class CONSOLELINE : public TSLinkedNode<CONSOLELINE> {
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
~CONSOLELINE();
|
~CONSOLELINE();
|
||||||
|
void Backspace();
|
||||||
};
|
};
|
||||||
|
|
||||||
void ConsoleScreenAnimate(float elapsedSec);
|
void ConsoleScreenAnimate(float elapsedSec);
|
||||||
|
|||||||
@ -111,6 +111,10 @@ C3Vector CGObject_C::GetPosition() const {
|
|||||||
return { 0.0f, 0.0f, 0.0f };
|
return { 0.0f, 0.0f, 0.0f };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float CGObject_C::GetRawFacing() const {
|
||||||
|
return this->GetFacing();
|
||||||
|
}
|
||||||
|
|
||||||
WOWGUID CGObject_C::GetTransportGUID() const {
|
WOWGUID CGObject_C::GetTransportGUID() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,7 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
|
|||||||
virtual C3Vector GetPosition() const;
|
virtual C3Vector GetPosition() const;
|
||||||
// TODO
|
// TODO
|
||||||
virtual float GetFacing() const;
|
virtual float GetFacing() const;
|
||||||
|
virtual float GetRawFacing() const;
|
||||||
// TODO
|
// TODO
|
||||||
virtual WOWGUID GetTransportGUID() const;
|
virtual WOWGUID GetTransportGUID() const;
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -42,6 +42,10 @@ C3Vector CGUnit::GetPosition() const {
|
|||||||
return this->m_move->GetPosition();
|
return this->m_move->GetPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float CGUnit::GetRawFacing() const {
|
||||||
|
return this->m_move->GetRawFacing();
|
||||||
|
}
|
||||||
|
|
||||||
CGUnitData* CGUnit::Unit() const {
|
CGUnitData* CGUnit::Unit() const {
|
||||||
return this->m_unit;
|
return this->m_unit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,6 +92,7 @@ class CGUnit {
|
|||||||
float GetFacing() const;
|
float GetFacing() const;
|
||||||
int32_t GetNativeDisplayID() const;
|
int32_t GetNativeDisplayID() const;
|
||||||
C3Vector GetPosition() const;
|
C3Vector GetPosition() const;
|
||||||
|
float GetRawFacing() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Protected member variables
|
// Protected member variables
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
#include "object/client/CGUnit_C.hpp"
|
#include "object/client/CGUnit_C.hpp"
|
||||||
#include "component/CCharacterComponent.hpp"
|
#include "component/CCharacterComponent.hpp"
|
||||||
|
#include "db/Db.hpp"
|
||||||
#include "model/Model2.hpp"
|
#include "model/Model2.hpp"
|
||||||
#include "object/client/ObjMgr.hpp"
|
#include "object/client/ObjMgr.hpp"
|
||||||
#include "db/Db.hpp"
|
|
||||||
#include "ui/Game.hpp"
|
#include "ui/Game.hpp"
|
||||||
#include <storm/Error.hpp>
|
#include <storm/Error.hpp>
|
||||||
|
#include <tempest/Math.hpp>
|
||||||
|
|
||||||
WOWGUID CGUnit_C::s_activeMover;
|
WOWGUID CGUnit_C::s_activeMover;
|
||||||
|
|
||||||
@ -183,6 +184,10 @@ C3Vector CGUnit_C::GetPosition() const {
|
|||||||
return this->CGUnit::GetPosition();
|
return this->CGUnit::GetPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float CGUnit_C::GetRawFacing() const {
|
||||||
|
return this->CGUnit::GetRawFacing();
|
||||||
|
}
|
||||||
|
|
||||||
float CGUnit_C::GetRawSmoothFacing() const {
|
float CGUnit_C::GetRawSmoothFacing() const {
|
||||||
return this->m_smoothFacing;
|
return this->m_smoothFacing;
|
||||||
}
|
}
|
||||||
@ -208,6 +213,10 @@ void CGUnit_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
this->m_smoothFacing = CMath::normalizeangle0to2pi(this->GetRawFacing());
|
||||||
|
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGUnit_C::PostMovementUpdate(const CClientMoveUpdate& move, int32_t activeMover) {
|
void CGUnit_C::PostMovementUpdate(const CClientMoveUpdate& move, int32_t activeMover) {
|
||||||
|
|||||||
@ -31,6 +31,7 @@ class CGUnit_C : public CGObject_C, public CGUnit {
|
|||||||
virtual C3Vector GetPosition() const;
|
virtual C3Vector GetPosition() const;
|
||||||
// TODO
|
// TODO
|
||||||
virtual float GetFacing() const;
|
virtual float GetFacing() const;
|
||||||
|
virtual float GetRawFacing() const;
|
||||||
// TODO
|
// TODO
|
||||||
virtual WOWGUID GetTransportGUID() const;
|
virtual WOWGUID GetTransportGUID() const;
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -33,6 +33,10 @@ C3Vector CPassenger::GetPosition(const C3Vector& position) const {
|
|||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float CPassenger::GetRawFacing() const {
|
||||||
|
return this->m_facing;
|
||||||
|
}
|
||||||
|
|
||||||
WOWGUID CPassenger::GetTransportGUID() const {
|
WOWGUID CPassenger::GetTransportGUID() const {
|
||||||
return this->m_transportGUID;
|
return this->m_transportGUID;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ class CPassenger {
|
|||||||
float GetFacing(float facing) const;
|
float GetFacing(float facing) const;
|
||||||
C3Vector GetPosition() const;
|
C3Vector GetPosition() const;
|
||||||
C3Vector GetPosition(const C3Vector& position) const;
|
C3Vector GetPosition(const C3Vector& position) const;
|
||||||
|
float GetRawFacing() const;
|
||||||
WOWGUID GetTransportGUID() const;
|
WOWGUID GetTransportGUID() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include "ui/game/CGCamera.hpp"
|
#include "ui/game/CGCamera.hpp"
|
||||||
|
#include "common/Time.hpp"
|
||||||
#include "console/CVar.hpp"
|
#include "console/CVar.hpp"
|
||||||
#include "object/Client.hpp"
|
#include "object/Client.hpp"
|
||||||
#include "object/client/CVehicleCamera_C.hpp"
|
#include "object/client/CVehicleCamera_C.hpp"
|
||||||
@ -39,10 +40,56 @@ bool ValidateCameraView(CVar* var, const char* oldValue, const char* value, void
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t CGCamera::UpdateCallback(const void*, void* param) {
|
||||||
|
auto camera = static_cast<CGCamera*>(param);
|
||||||
|
|
||||||
|
if (!camera) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto timestamp = OsGetAsyncTimeMsPrecise();
|
||||||
|
|
||||||
|
camera->m_nearZ = CWorld::GetNearClip();
|
||||||
|
camera->m_farZ = CWorld::GetFarClip();
|
||||||
|
|
||||||
|
// Model camera
|
||||||
|
|
||||||
|
if (camera->HasModel()) {
|
||||||
|
camera->CalcModelCamera(timestamp);
|
||||||
|
camera->CheckUnderwater();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Target camera
|
||||||
|
|
||||||
|
auto target = ClntObjMgrObjectPtr(camera->m_target, TYPE_OBJECT, __FILE__, __LINE__);
|
||||||
|
|
||||||
|
if (target) {
|
||||||
|
camera->CalcTargetCamera(target, timestamp);
|
||||||
|
camera->CheckUnderwater();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unknown camera
|
||||||
|
|
||||||
|
auto object90 = ClntObjMgrObjectPtr(camera->guid90, TYPE_OBJECT, __FILE__, __LINE__);
|
||||||
|
|
||||||
|
if (object90) {
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
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_model = nullptr;
|
||||||
|
|
||||||
this->m_target = 0;
|
this->m_target = 0;
|
||||||
|
this->guid90 = 0;
|
||||||
this->m_relativeTo = 0;
|
this->m_relativeTo = 0;
|
||||||
|
|
||||||
this->m_view = s_cameraView->GetInt();
|
this->m_view = s_cameraView->GetInt();
|
||||||
@ -55,6 +102,18 @@ CGCamera::CGCamera() : CSimpleCamera(CWorld::GetNearClip(), CWorld::GetFarClip()
|
|||||||
this->m_fovOffset = 0.0f;
|
this->m_fovOffset = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGCamera::CalcModelCamera(uint32_t timestamp) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGCamera::CalcTargetCamera(CGObject_C* target, uint32_t timestamp) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGCamera::CheckUnderwater() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
float CGCamera::FOV() const {
|
float CGCamera::FOV() const {
|
||||||
// Clamp offset-adjusted FOV between 0pi and 1pi
|
// Clamp offset-adjusted FOV between 0pi and 1pi
|
||||||
return std::min(std::max(this->m_fov + this->m_fovOffset, 0.0f), CMath::PI);
|
return std::min(std::max(this->m_fov + this->m_fovOffset, 0.0f), CMath::PI);
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include "ui/simple/CSimpleCamera.hpp"
|
#include "ui/simple/CSimpleCamera.hpp"
|
||||||
#include "util/GUID.hpp"
|
#include "util/GUID.hpp"
|
||||||
|
|
||||||
|
class CGObject_C;
|
||||||
class CM2Model;
|
class CM2Model;
|
||||||
|
|
||||||
class CGCamera : public CSimpleCamera {
|
class CGCamera : public CSimpleCamera {
|
||||||
@ -18,6 +19,9 @@ class CGCamera : public CSimpleCamera {
|
|||||||
// Public static variables
|
// Public static variables
|
||||||
static CameraViewData s_cameraViewDataDefault[];
|
static CameraViewData s_cameraViewDataDefault[];
|
||||||
|
|
||||||
|
// Public static functions
|
||||||
|
static int32_t UpdateCallback(const void*, void* param);
|
||||||
|
|
||||||
// Virtual public member functions
|
// Virtual public member functions
|
||||||
virtual ~CGCamera() = default;
|
virtual ~CGCamera() = default;
|
||||||
virtual float FOV() const;
|
virtual float FOV() const;
|
||||||
@ -27,6 +31,9 @@ class CGCamera : public CSimpleCamera {
|
|||||||
|
|
||||||
// Public member functions
|
// Public member functions
|
||||||
CGCamera();
|
CGCamera();
|
||||||
|
void CalcModelCamera(uint32_t timestamp);
|
||||||
|
void CalcTargetCamera(CGObject_C* target, uint32_t timestamp);
|
||||||
|
void CheckUnderwater();
|
||||||
const WOWGUID& GetTarget() const;
|
const WOWGUID& GetTarget() const;
|
||||||
int32_t HasModel() const;
|
int32_t HasModel() const;
|
||||||
C33Matrix ParentToWorld() const;
|
C33Matrix ParentToWorld() const;
|
||||||
@ -38,6 +45,7 @@ class CGCamera : public CSimpleCamera {
|
|||||||
CM2Model* m_model;
|
CM2Model* m_model;
|
||||||
// TODO
|
// TODO
|
||||||
WOWGUID m_target;
|
WOWGUID m_target;
|
||||||
|
WOWGUID guid90;
|
||||||
// TODO
|
// TODO
|
||||||
WOWGUID m_relativeTo;
|
WOWGUID m_relativeTo;
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -98,6 +98,10 @@ void CGWorldFrame::OnWorldUpdate() {
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
CGCamera::UpdateCallback(nullptr, this->m_camera);
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
this->m_camera->SetupWorldProjection(this->m_screenRect);
|
this->m_camera->SetupWorldProjection(this->m_screenRect);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#define UTIL_TIME_HPP
|
#define UTIL_TIME_HPP
|
||||||
|
|
||||||
#include "util/time/CGameTime.hpp"
|
#include "util/time/CGameTime.hpp"
|
||||||
|
#include "util/time/Types.hpp"
|
||||||
#include "util/time/WowTime.hpp"
|
#include "util/time/WowTime.hpp"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
8
src/util/time/Types.hpp
Normal file
8
src/util/time/Types.hpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef UTIL_TIME_TYPES_HPP
|
||||||
|
#define UTIL_TIME_TYPES_HPP
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
typedef uint64_t whoa_tick_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user