diff --git a/Source/Client/Input/TextInputBuffer.cpp b/Source/Client/Input/TextInputBuffer.cpp index d7e6cb83e..4e64c701e 100644 --- a/Source/Client/Input/TextInputBuffer.cpp +++ b/Source/Client/Input/TextInputBuffer.cpp @@ -9,7 +9,7 @@ // OFFSET: 0x00ACF2A0 // FUNCTION: fn_17794 -void TextInputBuffer::CancelComposition() { +void TextInputBuffer::ResetInput() { HIMC context = ImmGetContext(this->window); if (context) { @@ -199,7 +199,7 @@ void TextInputBuffer::SetFlag8C(unsigned char value) { } // OFFSET: 0x00ACE4C0 // FUNCTION: fn_17787 -void TextInputBuffer::MoveForward(unsigned codePage) { +void TextInputBuffer::IncreaseSelection(unsigned codePage) { const auto length = static_cast(this->text.size()); const auto position = static_cast(this->cursor); if (position > length) { @@ -286,7 +286,7 @@ void TextInputBuffer::KeyDown( this->MoveBack(codePage); break; case VK_RIGHT: - this->MoveForward(codePage); + this->IncreaseSelection(codePage); break; case VK_HOME: this->cursor = 0; @@ -328,7 +328,7 @@ void TextInputBuffer::KeyDown( switch (key) { case VK_DELETE: if (this->cursor == this->anchor) { - this->MoveForward(codePage); + this->IncreaseSelection(codePage); } this->DeleteSelection(); break; @@ -340,7 +340,7 @@ void TextInputBuffer::KeyDown( if (key == VK_LEFT) { this->MoveBack(codePage); } else { - this->MoveForward(codePage); + this->IncreaseSelection(codePage); } this->anchor = this->cursor; diff --git a/Source/Client/Input/TextInputBuffer.h b/Source/Client/Input/TextInputBuffer.h index e58582e29..3d8e055d4 100644 --- a/Source/Client/Input/TextInputBuffer.h +++ b/Source/Client/Input/TextInputBuffer.h @@ -29,7 +29,7 @@ struct TextInputBuffer { const bool& chatOpen; TextInputSuggestions& suggestions; - void CancelComposition(); + void ResetInput(); void DeleteSelection(); void Insert(const char* value); void Select(int anchor, int cursor); @@ -45,7 +45,7 @@ struct TextInputBuffer { void MoveBack(unsigned codePage); - void MoveForward(unsigned codePage); + void IncreaseSelection(unsigned codePage); void SetFlag8C(unsigned char value); void AdvanceCursor(int delta); void RetreatCursor(int delta); diff --git a/Source/Client/Input/TraditionalKeyInput.cpp b/Source/Client/Input/TraditionalKeyInput.cpp index 71a031806..77b1f83ac 100644 --- a/Source/Client/Input/TraditionalKeyInput.cpp +++ b/Source/Client/Input/TraditionalKeyInput.cpp @@ -96,7 +96,7 @@ int TraditionalKeyInput::DisplayLength() const { // OFFSET: 0x00ACE330 // FUNCTION: fn_17780 -int TraditionalKeyInput::Count() const { +int TraditionalKeyInput::GetKeyStrokeSize() const { if (this->keys.size() == 1 && this->mappings[this->keys.back()].category == 4) { return 0; } diff --git a/Source/Client/Input/TraditionalKeyInput.h b/Source/Client/Input/TraditionalKeyInput.h index 842fdf4a4..c45a4689d 100644 --- a/Source/Client/Input/TraditionalKeyInput.h +++ b/Source/Client/Input/TraditionalKeyInput.h @@ -25,7 +25,7 @@ struct TraditionalKeyInput { int DisplayLength() const; const char* NextChar(const char* current, int unused); const char* NextCharArabic(const char* current, int unused); - int Count() const; + int GetKeyStrokeSize() const; void ClearKeys(); void ResetState(); void ResetCandidate(); diff --git a/Source/Client/Mode/ActiveGameMode.cpp b/Source/Client/Mode/ActiveGameMode.cpp index beb282c5a..61affaaff 100644 --- a/Source/Client/Mode/ActiveGameMode.cpp +++ b/Source/Client/Mode/ActiveGameMode.cpp @@ -6,13 +6,13 @@ CWorld g_world = {1}; // OFFSET: 0x00AD6450 // FUNCTION: fn_17831 -CMode* CWorld::ActiveGameMode() { +CMode* CWorld::GetGameMode() { return this->state == 1 ? this->gameMode : nullptr; } // OFFSET: 0x00AD6460 // FUNCTION: fn_17832 -CMode* CWorld::ActiveLoginMode() { +CMode* CWorld::GetLoginMode() { return this->state == 0 ? this->gameMode : nullptr; } diff --git a/Source/Client/Mode/ActiveGameMode.h b/Source/Client/Mode/ActiveGameMode.h index 2f78ac311..0bbcf9a8d 100644 --- a/Source/Client/Mode/ActiveGameMode.h +++ b/Source/Client/Mode/ActiveGameMode.h @@ -11,8 +11,8 @@ struct CWorld { /* 0058 */ int state; /* 005C */ int nextState; - CMode* ActiveGameMode(); - CMode* ActiveLoginMode(); + CMode* GetGameMode(); + CMode* GetLoginMode(); void Quit(); void Switch(int mode, const char* name); }; diff --git a/Source/Contents/ActorGeometry.cpp b/Source/Contents/ActorGeometry.cpp index 1088905e0..48bbfc3fd 100644 --- a/Source/Contents/ActorGeometry.cpp +++ b/Source/Contents/ActorGeometry.cpp @@ -64,7 +64,7 @@ float CRenderObject::Distance(float x, float y, float z) const { // OFFSET: 0x00CAD9E0 // FUNCTION: fn_21057 bool CRenderObject::GetTargetPos(std::uint32_t targetAid, vector3d& targetPos) const { - const WorldScene* world = static_cast(g_world.ActiveGameMode())->scene; + const WorldScene* world = static_cast(g_world.GetGameMode())->scene; const CRenderObject* player = reinterpret_cast(world->player); if (targetAid == g_session.m_aid) { diff --git a/Source/Contents/Actors/GameObject.cpp b/Source/Contents/Actors/GameObject.cpp index 1766691d4..4abcda42c 100644 --- a/Source/Contents/Actors/GameObject.cpp +++ b/Source/Contents/Actors/GameObject.cpp @@ -61,7 +61,7 @@ void CGameObject::Draw(int) { // OFFSET: 0x00CABF10 // FUNCTION: fn_21041 int CGameObject::GetDir(float rot) { - CGameMode* gameMode = static_cast(g_world.ActiveGameMode()); + CGameMode* gameMode = static_cast(g_world.GetGameMode()); int longitude = 0; if (gameMode) { @@ -122,7 +122,7 @@ void CRenderObject::DrawShadow(int argument, float scale) { const float* matrix = reinterpret_cast(argument); const float z = this->render.position.z; - CGameMode* mode = static_cast(g_world.ActiveGameMode()); + CGameMode* mode = static_cast(g_world.GetGameMode()); float position[3]; position[0] = this->render.position.x; position[1] = mode->scene->terrain->Grid().Height(this->render.position.x, this->render.position.z); diff --git a/Source/Contents/Actors/RenderObject.cpp b/Source/Contents/Actors/RenderObject.cpp index 7bee2b80d..9a6f9d105 100644 --- a/Source/Contents/Actors/RenderObject.cpp +++ b/Source/Contents/Actors/RenderObject.cpp @@ -50,13 +50,13 @@ void CRenderObject::SendObjectMessage(CGameObject*, int, int, int, int, int, int // FUNCTION: fn_21116 void CRenderObject::SetActionName(ResourceMgr& resources, const char* name) { if (this->render.action) { - this->render.action->Release(); + this->render.action->Unlock(); } this->render.action = static_cast(resources.Load(name)); if (this->render.action) { - this->render.action->AddRef(); + this->render.action->Lock(); } } @@ -75,13 +75,13 @@ void CGameActor::SetUnknown0260(int value) { // FUNCTION: fn_21151 void CRenderObject::SetSpriteName(ResourceMgr& resources, const char* name) { if (this->render.sprite) { - this->render.sprite->Release(); + this->render.sprite->Unlock(); } this->render.sprite = static_cast(resources.Load(name)); if (this->render.sprite) { - this->render.sprite->AddRef(); + this->render.sprite->Lock(); } } @@ -298,7 +298,7 @@ int CRenderObject::HoverHeight() { } const short height = static_cast(ClientSine(angle) * 4.0f + this->render.unknown_00FA); - CGameMode* mode = static_cast(g_world.ActiveGameMode()); + CGameMode* mode = static_cast(g_world.GetGameMode()); const short scaled = static_cast(400.0f / mode->camera->camera.desiredDistance * height); return scaled < 0 ? 0 : scaled; } @@ -489,7 +489,7 @@ void CRenderObject::JitterBounds(float* output, const int* input, float offset, } } - CGameMode* mode = static_cast(g_world.ActiveGameMode()); + CGameMode* mode = static_cast(g_world.GetGameMode()); jitter[index] = 400.0f / mode->camera->camera.desiredDistance * static_cast(value - base); } @@ -670,7 +670,7 @@ float* CGameActor::Slot53(int index) { // OFFSET: 0x00CAE500 // FUNCTION: fn_21074 void CGameActor::Slot38() { - CGameMode* mode = static_cast(g_world.ActiveGameMode()); + CGameMode* mode = static_cast(g_world.GetGameMode()); const float angle = this->render.angle; const int motion = this->render.curMotion; const int animation = this->render.animation; diff --git a/Source/Contents/Actors/RenderObjectState.cpp b/Source/Contents/Actors/RenderObjectState.cpp index d41906083..4338e682f 100644 --- a/Source/Contents/Actors/RenderObjectState.cpp +++ b/Source/Contents/Actors/RenderObjectState.cpp @@ -16,11 +16,11 @@ RenderObjectState::RenderObjectState() : sprite(nullptr), action(nullptr) { // INLINED RenderObjectState::~RenderObjectState() { if (this->sprite) { - this->sprite->Release(); + this->sprite->Unlock(); } if (this->action) { - this->action->Release(); + this->action->Unlock(); } } @@ -68,7 +68,7 @@ void RenderObjectState::Reset() { std::sprintf(actionName, "NPC\\%s.act", g_session.GetJobName(46, -1)); if (this->sprite) { - this->sprite->Release(); + this->sprite->Unlock(); } this->sprite = static_cast(ResourceMgr::Instance().Load(spriteName)); @@ -78,7 +78,7 @@ void RenderObjectState::Reset() { } if (this->action) { - this->action->Release(); + this->action->Unlock(); } this->action = static_cast(ResourceMgr::Instance().Load(actionName)); diff --git a/Source/Contents/Camera/CameraFrame.cpp b/Source/Contents/Camera/CameraFrame.cpp index 555d988dc..38e584752 100644 --- a/Source/Contents/Camera/CameraFrame.cpp +++ b/Source/Contents/Camera/CameraFrame.cpp @@ -15,8 +15,8 @@ void ResetCamera(CameraState& camera, CameraFrame& frame) { void CameraFrame::Build(const CameraState& camera, const TerrainHeight& terrain) { constexpr float pi = 3.141592f; AffineMatrix orbit; - orbit.SetXRotation((camera.pitch / 180.0f) * pi); - orbit.RotateY((camera.yaw / 180.0f) * pi); + orbit.MakeXRotation((camera.pitch / 180.0f) * pi); + orbit.AppendYRotation((camera.yaw / 180.0f) * pi); const float distance = -camera.distance; this->eye[1] = ((orbit.values[4] * 0.0f + orbit.values[1] * 0.0f) + distance * orbit.values[7]) + orbit.values[10]; this->eye[2] = ((orbit.values[5] * 0.0f + orbit.values[2] * 0.0f) + distance * orbit.values[8]) + orbit.values[11]; @@ -30,7 +30,7 @@ void CameraFrame::Build(const CameraState& camera, const TerrainHeight& terrain) } this->view.LookAt(this->eye, camera.target, this->up); - this->inverse.Inverse(this->view); + this->inverse.MakeInverse(this->view); } // OFFSET: 0x00ADB560 diff --git a/Source/Contents/Camera/CameraQueries.cpp b/Source/Contents/Camera/CameraQueries.cpp index 02266dc5b..fed26519e 100644 --- a/Source/Contents/Camera/CameraQueries.cpp +++ b/Source/Contents/Camera/CameraQueries.cpp @@ -33,8 +33,8 @@ void CameraFrame::Forward(const CameraState& camera, float* output) const { void CameraFrame::AlternateView(const CameraState& camera, float yaw, const TerrainHeight& terrain, AffineMatrix& output) const { constexpr float pi = 3.141592f; AffineMatrix orbit; - orbit.SetXRotation((camera.pitch / 180.0f) * pi); - orbit.RotateY((yaw / 180.0f) * pi); + orbit.MakeXRotation((camera.pitch / 180.0f) * pi); + orbit.AppendYRotation((yaw / 180.0f) * pi); const float distance = -camera.distance; float eye[3]; eye[0] = (((orbit.values[3] * 0.0f + orbit.values[0] * 0.0f) + distance * orbit.values[6]) + orbit.values[9]) + camera.target[0]; diff --git a/Source/Contents/Effects/AttachedEffect.cpp b/Source/Contents/Effects/AttachedEffect.cpp index 6e176b750..3a66e0f1a 100644 --- a/Source/Contents/Effects/AttachedEffect.cpp +++ b/Source/Contents/Effects/AttachedEffect.cpp @@ -37,7 +37,7 @@ inline RagEffectState::~RagEffectState() { } if (this->resource) { - this->resource->Release(); + this->resource->Unlock(); } } diff --git a/Source/Contents/Effects/EffectParticle.h b/Source/Contents/Effects/EffectParticle.h index 9c310434c..8eef43f48 100644 --- a/Source/Contents/Effects/EffectParticle.h +++ b/Source/Contents/Effects/EffectParticle.h @@ -14,12 +14,12 @@ struct EffectParticle : CRenderObject { bool UpdateFireWall(); bool UpdateStoneCurse(); - void UpdateBeginSpell(); + void Prim3DCircle(); bool UpdateHit6(); bool UpdateCoin(); bool UpdateDetoxication(); bool UpdateExit(); - bool UpdateWarp(); + bool Prim3DParticleSpline(); void PrimBottom2(); void PrimBottom(); void PrimBottomOut(); @@ -47,12 +47,12 @@ struct EffectParticle : CRenderObject { void PrimGI3(); void PrimWaterFall(); - bool AdvanceFrame(); + bool AnimMotion(); bool FollowMasterAndAdvance(); void FollowMasterAndTickSlots(); void FollowMasterAndTickSlots2(); - void UpdateRecords(); - void InitializeRecords(); + void ShiftSegment(); + void InitSegment(); /* 0138 */ EffectPrimitiveState state; }; diff --git a/Source/Contents/Effects/EffectPrimitiveColor.cpp b/Source/Contents/Effects/EffectPrimitiveColor.cpp index 36f92fa77..f2594597c 100644 --- a/Source/Contents/Effects/EffectPrimitiveColor.cpp +++ b/Source/Contents/Effects/EffectPrimitiveColor.cpp @@ -4,7 +4,7 @@ // OFFSET: 0x00BC5E00 // FUNCTION: fn_19849 -void EffectPrimitiveState::UpdateColor() { +void EffectPrimitiveState::ProcessAlpha() { const int current = this->unknown_01E0; const bool valuesAndLimit = this->unknown_0158 != 0; diff --git a/Source/Contents/Effects/EffectPrimitiveMotion.cpp b/Source/Contents/Effects/EffectPrimitiveMotion.cpp index 5b63b35c8..e30aac8d2 100644 --- a/Source/Contents/Effects/EffectPrimitiveMotion.cpp +++ b/Source/Contents/Effects/EffectPrimitiveMotion.cpp @@ -64,7 +64,7 @@ namespace { // INLINED void FaceCamera(EffectPrimitiveSlot* slots) { - const CView* view = static_cast(g_world.ActiveGameMode())->camera; + const CView* view = static_cast(g_world.GetGameMode())->camera; slots[0].alphaT = static_cast(360 - static_cast(view->camera.yaw)); slots[1].alphaT = static_cast(360 - static_cast(view->camera.pitch) + 90); @@ -207,15 +207,15 @@ bool MoveEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& rend } else if ((particle.flags & 0x40u) != 0) { particle.unknown_030C = context.cameraYaw + 90.0f; particle.unknown_0314 = context.cameraPitch; - matrix.SetXRotation(ClientRadians(TruncateToInt(particle.unknown_0310))); - matrix.RotateZ(ClientRadians(TruncateToInt(particle.unknown_0314))); + matrix.MakeXRotation(GetRadian(TruncateToInt(particle.unknown_0310))); + matrix.RotateZ(GetRadian(TruncateToInt(particle.unknown_0314))); } else { - matrix.SetZRotation(ClientRadians(TruncateToInt(particle.unknown_0314))); - matrix.RotateX(ClientRadians(TruncateToInt(particle.unknown_0310))); + matrix.SetZRotation(GetRadian(TruncateToInt(particle.unknown_0314))); + matrix.RotateX(GetRadian(TruncateToInt(particle.unknown_0310))); } const float angle = (particle.flags & 0x200u) != 0 ? render.angle : particle.unknown_030C; - matrix.RotateY(ClientRadians(TruncateToInt(angle))); + matrix.AppendYRotation(GetRadian(TruncateToInt(angle))); std::memcpy(particle.matrix2, matrix.values, sizeof(particle.matrix2)); if ((particle.flags & 2u) != 0) { @@ -277,7 +277,7 @@ bool MoveEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& rend particle.blue = particle.blue > 255 ? 255 : particle.blue < 0 ? 0 : particle.blue; } - particle.UpdateColor(); + particle.ProcessAlpha(); if (particle.unknown_01E0 % particle.unknown_01E8 == 0) { const auto next = render.curMotion + 1u; @@ -311,7 +311,7 @@ bool UpdateEffectPrimitive15(EffectPrimitiveState& particle, RenderObjectState& // OFFSET: 0x00BB6180 // FUNCTION: fn_19773 -bool ShrinkEffectPrimitiveSlots(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context) { +bool Prim3DCasting4(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context) { const vector3d& parent = context.parentRender.position; render.position.x = parent.x; render.position.y = parent.y; @@ -363,7 +363,7 @@ bool ShrinkEffectPrimitiveSlots(EffectPrimitiveState& particle, RenderObjectStat // OFFSET: 0x00BB62A0 // FUNCTION: fn_19774 -bool PulseEffectPrimitiveSlots(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context) { +bool Prim3DCasting5(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context) { const vector3d& parent = context.parentRender.position; render.position.x = parent.x; render.position.y = parent.y; @@ -423,7 +423,7 @@ bool PulseEffectPrimitiveSlots(EffectPrimitiveState& particle, RenderObjectState // OFFSET: 0x00BB6820 // FUNCTION: fn_19777 -bool SpinEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context) { +bool Prim3DCylinder(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context) { particle.origin = { context.parentRender.position.x + particle.velocity.x, context.parentRender.position.y + particle.velocity.y, context.parentRender.position.z + particle.velocity.z @@ -439,8 +439,8 @@ bool SpinEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& rend particle.unknown_030C = particle.unknown_0330 + particle.unknown_030C; AffineMatrix& matrix = *reinterpret_cast(particle.matrix1); - matrix.SetXRotation(ClientRadians(static_cast(particle.unknown_0310))); - matrix.RotateY(ClientRadians(static_cast(particle.unknown_030C))); + matrix.MakeXRotation(GetRadian(static_cast(particle.unknown_0310))); + matrix.AppendYRotation(GetRadian(static_cast(particle.unknown_030C))); particle.unknown_0370 = Upward(particle.unknown_02BC, particle.matrix1); particle.offset.y = particle.unknown_0370.y + particle.offset.y; @@ -462,7 +462,7 @@ bool SpinEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& rend particle.unknown_0300 = -(particle.unknown_02F8 / static_cast(particle.lifetime - particle.unknown_01E0 + 1)); } - particle.UpdateColor(); + particle.ProcessAlpha(); if (particle.unknown_01E0 % particle.unknown_01E8 == 0) { const auto next = render.curMotion + 1u; @@ -480,7 +480,7 @@ bool SpinEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& rend // OFFSET: 0x00BB6B30 // FUNCTION: fn_19778 -bool RollEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context) { +bool Prim3DCylinderHalf(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context) { particle.origin = { context.parentRender.position.x + particle.velocity.x, context.parentRender.position.y + particle.velocity.y, context.parentRender.position.z + particle.velocity.z @@ -492,8 +492,8 @@ bool RollEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& rend particle.unknown_0364 = particle.unknown_0368 + particle.unknown_0364; AffineMatrix& matrix = *reinterpret_cast(particle.matrix1); - matrix.SetXRotation(ClientRadians(static_cast(particle.unknown_0310))); - matrix.RotateY(ClientRadians(static_cast(particle.unknown_030C))); + matrix.MakeXRotation(GetRadian(static_cast(particle.unknown_0310))); + matrix.AppendYRotation(GetRadian(static_cast(particle.unknown_030C))); particle.unknown_0370 = Upward(particle.unknown_02BC, particle.matrix1); particle.offset.x = particle.unknown_0370.x + particle.offset.x; @@ -515,7 +515,7 @@ bool RollEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& rend particle.unknown_0300 = -(particle.unknown_02F8 / static_cast(particle.lifetime - particle.unknown_01E0 + 1)); } - particle.UpdateColor(); + particle.ProcessAlpha(); if (particle.unknown_01E0 % particle.unknown_01E8 == 0) { const auto next = render.curMotion + 1u; @@ -564,13 +564,13 @@ void AdvanceEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& r particle.unknown_02C0 = particle.unknown_02B0.y; } } else { - particle.UpdateColor(); + particle.ProcessAlpha(); } } // OFFSET: 0x00BAE3A0 // FUNCTION: fn_19764 -bool EffectParticle::AdvanceFrame() { +bool EffectParticle::AnimMotion() { CActRes* action = this->render.action; if (this->state.unknown_01E0 % this->state.unknown_01E8 != 0) { @@ -798,7 +798,7 @@ bool EffectParticle::UpdateStoneCurse() { // OFFSET: 0x00BB65C0 // FUNCTION: fn_19776 -void EffectParticle::UpdateBeginSpell() { +void EffectParticle::Prim3DCircle() { const AttachedEffect* master = this->state.master; this->state.origin.x = master->render.position.x + this->state.velocity.x; this->state.origin.y = master->render.position.y + this->state.velocity.y; @@ -827,8 +827,8 @@ void EffectParticle::UpdateBeginSpell() { this->state.unknown_0348 = side; this->state.unknown_02F4 = vertical; - reinterpret_cast(this->state.matrix1)->SetXRotation(ClientRadians(static_cast(this->state.unknown_0310))); - reinterpret_cast(this->state.matrix1)->RotateY(ClientRadians(static_cast(this->state.unknown_030C))); + reinterpret_cast(this->state.matrix1)->MakeXRotation(GetRadian(static_cast(this->state.unknown_0310))); + reinterpret_cast(this->state.matrix1)->AppendYRotation(GetRadian(static_cast(this->state.unknown_030C))); const float distance = this->state.unknown_02BC; this->state.unknown_0370 = Forward(distance, this->state.matrix1); @@ -849,8 +849,8 @@ void EffectParticle::UpdateBeginSpell() { } this->state.scale = scale; - this->state.UpdateColor(); - this->UpdateRecords(); + this->state.ProcessAlpha(); + this->ShiftSegment(); } // OFFSET: 0x00BBAB10 @@ -1414,7 +1414,7 @@ void EffectParticle::PrimGuard() { // OFFSET: 0x00BBFAA0 // FUNCTION: fn_19818 bool EffectParticle::PrimLineLink() { - CGameMode* gameMode = static_cast(g_world.ActiveGameMode()); + CGameMode* gameMode = static_cast(g_world.GetGameMode()); const CRenderObject* target = nullptr; const AttachedEffect* master = this->state.master; @@ -1490,7 +1490,7 @@ void EffectParticle::PrimSMA() { if (slot.process == 1) { const float x = this->state.offset.x - this->render.position.x; const float z = this->state.offset.z - this->render.position.z; - CalculateVectorAngle(x, z, &slot.rotStart); + Get_Angle(x, z, &slot.rotStart); } slot.vecBNow.x += slot.height[1] * g_cosTable[slot.rotStart]; @@ -1617,7 +1617,7 @@ void EffectParticle::PrimShieldBoomerang() { if (slot.process == 1) { const float rx = this->state.offset.x - slot.vecBNow.x; const float rz = this->state.offset.z - slot.vecBNow.z; - CalculateVectorAngle(rx, rz, &slot.rotStart); + Get_Angle(rx, rz, &slot.rotStart); } if (slot.flag1[1] == 0) { @@ -1649,7 +1649,7 @@ void EffectParticle::PrimShieldBoomerang() { const float rx = this->render.position.x - slot.vecBNow.x; const float rz = this->render.position.z - slot.vecBNow.z; std::int16_t angle; - CalculateVectorAngle(rx, rz, &angle); + Get_Angle(rx, rz, &angle); if (slot.rotStart < angle - 4 || slot.rotStart > angle + 4) { slot.rotStart += 5; @@ -1721,12 +1721,12 @@ bool EffectParticle::PrimKouenka() { this->render.position = this->state.offset; if ((this->state.flags & 0x20) != 0) { - this->state.unknown_0314 = this->render.angle - static_cast(g_world.ActiveGameMode())->camera->camera.yaw; + this->state.unknown_0314 = this->render.angle - static_cast(g_world.GetGameMode())->camera->camera.yaw; } - this->state.UpdateColor(); - this->UpdateRecords(); - return this->AdvanceFrame(); + this->state.ProcessAlpha(); + this->ShiftSegment(); + return this->AnimMotion(); } // OFFSET: 0x00BC27B0 @@ -1783,12 +1783,12 @@ bool EffectParticle::PrimSakura() { this->render.position = this->state.offset; if ((this->state.flags & 0x20) != 0) { - this->state.unknown_0314 = this->render.angle - static_cast(g_world.ActiveGameMode())->camera->camera.yaw; + this->state.unknown_0314 = this->render.angle - static_cast(g_world.GetGameMode())->camera->camera.yaw; } - this->state.UpdateColor(); - this->UpdateRecords(); - return this->AdvanceFrame(); + this->state.ProcessAlpha(); + this->ShiftSegment(); + return this->AnimMotion(); } // OFFSET: 0x00BC4410 @@ -1820,7 +1820,7 @@ void EffectParticle::PrimTeiHit2() { if (slot.process == 1) { const float rx = this->state.offset.x - this->render.position.x; const float rz = this->state.offset.z - this->render.position.z; - CalculateVectorAngle(rx, rz, &slot.rotStart); + Get_Angle(rx, rz, &slot.rotStart); slot.rotStart += Random(60) - 30; if (slot.rotStart >= 360) { @@ -1992,7 +1992,7 @@ bool EffectParticle::PrimSuperAngel() { this->render.position.x = this->state.offset.x; this->render.position.y = this->state.offset.y; this->render.position.z = this->state.offset.z; - this->UpdateRecords(); + this->ShiftSegment(); return true; } @@ -2068,7 +2068,7 @@ bool EffectParticle::PrimGhost() { slot.vecBPre.y += slot.maxHeight * g_sinTable[slot.riseAngle]; this->state.offset = slot.vecBPre; - const CView* view = static_cast(g_world.ActiveGameMode())->camera; + const CView* view = static_cast(g_world.GetGameMode())->camera; int angle = slot.rotStart + static_cast(view->camera.yaw); if (angle < 0) { @@ -2101,9 +2101,9 @@ bool EffectParticle::PrimGhost() { } this->render.position = this->state.offset; - this->state.UpdateColor(); - this->UpdateRecords(); - return this->AdvanceFrame(); + this->state.ProcessAlpha(); + this->ShiftSegment(); + return this->AnimMotion(); } // OFFSET: 0x00BC4730 @@ -2152,7 +2152,7 @@ void EffectParticle::PrimThrowItem() { if (slot.process == 1) { const float x = this->state.offset.x - slot.vecBNow.x; const float z = this->state.offset.z - slot.vecBNow.z; - CalculateVectorAngle(x, z, &slot.rotStart); + Get_Angle(x, z, &slot.rotStart); } float progress = static_cast(slot.process); @@ -2353,8 +2353,8 @@ bool EffectParticle::UpdateHit6() { this->state.unknown_02BC = static_cast(rand() % 35 + 15) / 100.0f; this->state.unknown_030C = static_cast(rand() % 80) + (this->state.unknown_030C - 40.0f); this->state.unknown_0310 = static_cast(rand() % 80) + (this->state.unknown_0310 - 40.0f); - reinterpret_cast(this->state.matrix1)->SetYRotation(ClientRadians(static_cast(this->state.unknown_030C))); - reinterpret_cast(this->state.matrix1)->RotateX(ClientRadians(static_cast(this->state.unknown_0310))); + reinterpret_cast(this->state.matrix1)->SetYRotation(GetRadian(static_cast(this->state.unknown_030C))); + reinterpret_cast(this->state.matrix1)->RotateX(GetRadian(static_cast(this->state.unknown_0310))); flags = this->state.flags; this->state.unknown_01D4 = rand() % 10 + 5; } @@ -2362,8 +2362,8 @@ bool EffectParticle::UpdateHit6() { if ((flags & 8u) != 0 && this->state.unknown_01E0 % this->state.unknown_01D4 == 0) { this->state.unknown_030C = static_cast(rand() % 10) + (this->state.unknown_030C - 5.0f); this->state.unknown_0310 = static_cast(rand() % 10) + (this->state.unknown_0310 - 5.0f); - reinterpret_cast(this->state.matrix1)->SetXRotation(ClientRadians(static_cast(this->state.unknown_0310))); - reinterpret_cast(this->state.matrix1)->RotateY(ClientRadians(static_cast(this->state.unknown_030C))); + reinterpret_cast(this->state.matrix1)->MakeXRotation(GetRadian(static_cast(this->state.unknown_0310))); + reinterpret_cast(this->state.matrix1)->AppendYRotation(GetRadian(static_cast(this->state.unknown_030C))); this->state.unknown_01D4 = rand() % 15 + 5; } @@ -2379,18 +2379,18 @@ bool EffectParticle::UpdateHit6() { } if ((this->state.flags & 0x20u) != 0) { - this->state.unknown_0314 = this->render.angle - static_cast(g_world.ActiveGameMode())->camera->camera.yaw; + this->state.unknown_0314 = this->render.angle - static_cast(g_world.GetGameMode())->camera->camera.yaw; } - this->state.UpdateColor(); - this->UpdateRecords(); - return this->AdvanceFrame(); + this->state.ProcessAlpha(); + this->ShiftSegment(); + return this->AnimMotion(); } // OFFSET: 0x00BB75B0 // FUNCTION: fn_19780 bool EffectParticle::UpdateCoin() { - CGameMode* mode = static_cast(g_world.ActiveGameMode()); + CGameMode* mode = static_cast(g_world.GetGameMode()); const AttachedEffect* master = this->state.master; this->state.origin.z = master->render.position.z + this->state.velocity.z; this->state.origin.y = master->render.position.y + this->state.velocity.y; @@ -2416,16 +2416,16 @@ bool EffectParticle::UpdateCoin() { if (this->state.unknown_0208 == 1) { char name[52]; std::sprintf(name, "effect\\EF_Coin%d.wav", rand() % 3 + 1); - const auto* player = reinterpret_cast(static_cast(g_world.ActiveGameMode())->scene->player); + const auto* player = reinterpret_cast(static_cast(g_world.GetGameMode())->scene->player); g_soundMgr->PlayWave( name, this->render.position.x - player->render.position.x, 0.0f, this->render.position.z - player->render.position.z, 250, 40, 1.0f, 0 ); } } - this->state.UpdateColor(); - this->UpdateRecords(); - return this->AdvanceFrame(); + this->state.ProcessAlpha(); + this->ShiftSegment(); + return this->AnimMotion(); } // OFFSET: 0x00BB78A0 @@ -2494,8 +2494,8 @@ bool EffectParticle::UpdateDetoxication() { this->state.unknown_02BC = static_cast(rand() % 35 + 15) / 100.0f; this->state.unknown_030C = static_cast(rand() % 80) + (this->state.unknown_030C - 40.0f); this->state.unknown_0310 = static_cast(rand() % 80) + (this->state.unknown_0310 - 40.0f); - reinterpret_cast(this->state.matrix1)->SetYRotation(ClientRadians(static_cast(this->state.unknown_030C))); - reinterpret_cast(this->state.matrix1)->RotateX(ClientRadians(static_cast(this->state.unknown_0310))); + reinterpret_cast(this->state.matrix1)->SetYRotation(GetRadian(static_cast(this->state.unknown_030C))); + reinterpret_cast(this->state.matrix1)->RotateX(GetRadian(static_cast(this->state.unknown_0310))); this->state.unknown_01D4 = rand() % 10 + 5; flags = this->state.flags; } @@ -2503,8 +2503,8 @@ bool EffectParticle::UpdateDetoxication() { if ((flags & 8u) != 0 && this->state.unknown_01E0 % this->state.unknown_01D4 == 0) { this->state.unknown_030C = static_cast(rand() % 10) + (this->state.unknown_030C - 5.0f); this->state.unknown_0310 = static_cast(rand() % 10) + (this->state.unknown_0310 - 5.0f); - reinterpret_cast(this->state.matrix1)->SetXRotation(ClientRadians(static_cast(this->state.unknown_0310))); - reinterpret_cast(this->state.matrix1)->RotateY(ClientRadians(static_cast(this->state.unknown_030C))); + reinterpret_cast(this->state.matrix1)->MakeXRotation(GetRadian(static_cast(this->state.unknown_0310))); + reinterpret_cast(this->state.matrix1)->AppendYRotation(GetRadian(static_cast(this->state.unknown_030C))); this->state.unknown_01D4 = rand() % 15 + 5; flags = this->state.flags; } @@ -2514,12 +2514,12 @@ bool EffectParticle::UpdateDetoxication() { this->render.position.z = positionZ + this->state.offset.z; if ((flags & 0x20u) != 0) { - this->state.unknown_0314 = this->render.angle - static_cast(g_world.ActiveGameMode())->camera->camera.yaw; + this->state.unknown_0314 = this->render.angle - static_cast(g_world.GetGameMode())->camera->camera.yaw; } - this->state.UpdateColor(); - this->UpdateRecords(); - return this->AdvanceFrame(); + this->state.ProcessAlpha(); + this->ShiftSegment(); + return this->AnimMotion(); } // OFFSET: 0x00BB7EC0 @@ -2568,7 +2568,7 @@ bool EffectParticle::UpdateExit() { } } - reinterpret_cast(this->state.matrix1)->SetYRotation(ClientRadians(static_cast(this->state.unknown_030C))); + reinterpret_cast(this->state.matrix1)->SetYRotation(GetRadian(static_cast(this->state.unknown_030C))); const float distance = this->state.unknown_0348; this->state.offset = Forward(distance, this->state.matrix1); @@ -2581,14 +2581,14 @@ bool EffectParticle::UpdateExit() { this->state.unknown_0310 = rotation; reinterpret_cast(this->state.matrix1)->RotateZ(rotation); - this->state.UpdateColor(); - this->UpdateRecords(); - return this->AdvanceFrame(); + this->state.ProcessAlpha(); + this->ShiftSegment(); + return this->AnimMotion(); } // OFFSET: 0x00BB8180 // FUNCTION: fn_19783 -bool EffectParticle::UpdateWarp() { +bool EffectParticle::Prim3DParticleSpline() { const AttachedEffect* master = this->state.master; this->state.origin = { master->render.position.x + this->state.velocity.x, master->render.position.y + this->state.velocity.y, @@ -2604,7 +2604,7 @@ bool EffectParticle::UpdateWarp() { const float distance = this->state.unknown_02BC - this->state.unknown_02EC; this->state.unknown_0370 = Forward(distance, this->state.matrix1); - reinterpret_cast(this->state.matrix2)->MakeTransform(this->state.unknown_0290, ClientRadians(angle)); + reinterpret_cast(this->state.matrix2)->MakeTransform(this->state.unknown_0290, GetRadian(angle)); const float move = this->state.unknown_0310; this->state.unknown_03A0 = Lift(move, this->state.matrix2); @@ -2618,14 +2618,14 @@ bool EffectParticle::UpdateWarp() { this->render.position.y = this->state.offset.y + this->state.origin.y + this->state.unknown_03A0.y; this->render.position.z = this->state.offset.z + this->state.origin.z + this->state.unknown_03A0.z; - this->state.UpdateColor(); - this->UpdateRecords(); - return this->AdvanceFrame(); + this->state.ProcessAlpha(); + this->ShiftSegment(); + return this->AnimMotion(); } // OFFSET: 0x00BE6FE0 // FUNCTION: fn_19931 -void EffectParticle::UpdateRecords() { +void EffectParticle::ShiftSegment() { const int count = this->state.unknown_01F4; for (int index = count - 1; index > 0; --index) { @@ -2691,7 +2691,7 @@ static void TickLiveSlots(EffectPrimitiveSlot* slots) { // FUNCTION: fn_19966 bool EffectParticle::FollowMasterAndAdvance() { FollowMaster(*this); - return this->AdvanceFrame(); + return this->AnimMotion(); } // OFFSET: 0x00BE9560 diff --git a/Source/Contents/Effects/EffectPrimitiveMotion.h b/Source/Contents/Effects/EffectPrimitiveMotion.h index 9f6449145..5dc5967ba 100644 --- a/Source/Contents/Effects/EffectPrimitiveMotion.h +++ b/Source/Contents/Effects/EffectPrimitiveMotion.h @@ -14,10 +14,10 @@ struct EffectMotionContext { }; bool MoveEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); -bool ShrinkEffectPrimitiveSlots(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); -bool PulseEffectPrimitiveSlots(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); -bool SpinEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); -bool RollEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); +bool Prim3DCasting4(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); +bool Prim3DCasting5(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); +bool Prim3DCylinder(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); +bool Prim3DCylinderHalf(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); void AdvanceEffectPrimitive(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context); bool UpdateEffectPrimitive15(EffectPrimitiveState& particle, RenderObjectState& render, EffectMotionContext& context, int updateTick); diff --git a/Source/Contents/Effects/EffectPrimitiveRecords.cpp b/Source/Contents/Effects/EffectPrimitiveRecords.cpp index dd72c7d37..d5b50d14f 100644 --- a/Source/Contents/Effects/EffectPrimitiveRecords.cpp +++ b/Source/Contents/Effects/EffectPrimitiveRecords.cpp @@ -7,7 +7,7 @@ // OFFSET: 0x00BAE670 // FUNCTION: fn_19768 -void EffectParticle::InitializeRecords() { +void EffectParticle::InitSegment() { for (int index = 0; index < this->state.unknown_01F4; ++index) { EffectPrimitiveRecord& record = this->state.records[index]; record.position = this->render.position; diff --git a/Source/Contents/Effects/EffectPrimitiveState.cpp b/Source/Contents/Effects/EffectPrimitiveState.cpp index 6d8cb2ed0..f4b4e3dd8 100644 --- a/Source/Contents/Effects/EffectPrimitiveState.cpp +++ b/Source/Contents/Effects/EffectPrimitiveState.cpp @@ -180,7 +180,7 @@ void EffectPrimitiveState::GetColorOverride(unsigned char* red, unsigned char* g // OFFSET: 0x00BAE4B0 // FUNCTION: fn_19766 -void __stdcall CalculateVectorAngle(float x, float y, std::int16_t* angle) { +void __stdcall Get_Angle(float x, float y, std::int16_t* angle) { const float length = SquareRoot(x * x + y * y); const float normalY = y / length; const float normalX = x / length; diff --git a/Source/Contents/Effects/EffectPrimitiveState.h b/Source/Contents/Effects/EffectPrimitiveState.h index 8b76a6519..d8b571204 100644 --- a/Source/Contents/Effects/EffectPrimitiveState.h +++ b/Source/Contents/Effects/EffectPrimitiveState.h @@ -57,7 +57,7 @@ struct EffectPrimitiveState { explicit EffectPrimitiveState(RenderObjectState& render); ~EffectPrimitiveState(); void Initialize(RenderObjectState& render, AttachedEffect& master, const RenderObjectState& masterRender, int type, float x, float y, float z); - void UpdateColor(); + void ProcessAlpha(); void GetColorOverride(unsigned char* red, unsigned char* green, unsigned char* blue); /* 0138 */ std::uint32_t unknown_0138; @@ -177,7 +177,7 @@ struct EffectPrimitiveObject { bool AdvanceFrame(); }; -void __stdcall CalculateVectorAngle(float x, float y, std::int16_t* angle); +void __stdcall Get_Angle(float x, float y, std::int16_t* angle); static_assert(sizeof(EffectPrimitiveRecord) == 140); static_assert(sizeof(EffectPrimitiveSlot) == 0xB4); diff --git a/Source/Contents/Jobs/JobInheritance.cpp b/Source/Contents/Jobs/JobInheritance.cpp index aa5b6496b..43b43b33c 100644 --- a/Source/Contents/Jobs/JobInheritance.cpp +++ b/Source/Contents/Jobs/JobInheritance.cpp @@ -697,7 +697,7 @@ int CSession::SetHotkeyEntry(char enabled, int id, int value, int slot) { entry.unknown_0000 = 0; entry.itemId = 0; entry.unknown_0005 = 0; - g_world.ActiveGameMode()->SendMsg(313, index + 36, 0, 0, 0); + g_world.GetGameMode()->SendMsg(313, index + 36, 0, 0, 0); } } @@ -711,7 +711,7 @@ int CSession::SetHotkeyEntry(char enabled, int id, int value, int slot) { target.itemId = static_cast(id); target.unknown_0005 = static_cast(value); - return g_world.ActiveGameMode()->SendMsg(313, slot + 36, 0, 0, 0); + return g_world.GetGameMode()->SendMsg(313, slot + 36, 0, 0, 0); } // OFFSET: 0x00E26030 diff --git a/Source/Contents/Messenger/ClientMessenger.cpp b/Source/Contents/Messenger/ClientMessenger.cpp index 8d208802c..154323cf4 100644 --- a/Source/Contents/Messenger/ClientMessenger.cpp +++ b/Source/Contents/Messenger/ClientMessenger.cpp @@ -766,7 +766,7 @@ void SessionMessengerContext::UpdateRandomStats() { } const auto notify = [this]() { - if (g_world.ActiveGameMode()) { + if (g_world.GetGameMode()) { if (g_windowMgr.unknown_01DC) { if (this->bound6C < this->bound68 || this->bound74 < this->bound70) { return; @@ -774,7 +774,7 @@ void SessionMessengerContext::UpdateRandomStats() { reinterpret_cast(g_windowMgr.unknown_01DC)->Invalidate(); reinterpret_cast(g_windowMgr.unknown_01DC)->InvalidateChildren(); } - static_cast(g_world.ActiveGameMode())->NotifyItemBounds(); + static_cast(g_world.GetGameMode())->NotifyItemBounds(); } }; if (this->bound68 != bound68) { diff --git a/Source/Contents/Models/ModelActor.cpp b/Source/Contents/Models/ModelActor.cpp index 34a39b694..b234b2199 100644 --- a/Source/Contents/Models/ModelActor.cpp +++ b/Source/Contents/Models/ModelActor.cpp @@ -94,28 +94,28 @@ void C3dActorV2::Assign(const C3dModelRes& resource) { // OFFSET: 0x00ABB890 // FUNCTION: fn_17516 -void C3dActor::UpdateTransform() { - this->transform.SetTranslation(this->offset[0], this->offset[1], this->offset[2]); +void C3dActor::UpdateMatrix() { + this->transform.MakeTranslate(this->offset[0], this->offset[1], this->offset[2]); this->transform.Scale(this->scale[0], this->scale[1], this->scale[2]); - this->transform.RotateY(Radians(this->rotation[1])); + this->transform.AppendYRotation(Radians(this->rotation[1])); this->transform.RotateX(Radians(this->rotation[0])); this->transform.RotateZ(Radians(this->rotation[2])); this->transform.Translate(this->position); - this->inverseTransform.Inverse(this->transform); + this->inverseTransform.MakeInverse(this->transform); this->dirty = 0; } // OFFSET: 0x00ABB970 // FUNCTION: fn_17517 -void C3dActorV2::UpdateTransform() { +void C3dActorV2::UpdateMatrix() { this->transform.Identity(); this->transform.values[4] = -1.0f; this->transform.Scale(this->scale[0], this->scale[1], this->scale[2]); - this->transform.RotateY(Radians(this->rotation[1])); + this->transform.AppendYRotation(Radians(this->rotation[1])); this->transform.RotateX(Radians(this->rotation[0])); this->transform.RotateZ(Radians(this->rotation[2])); this->transform.Translate(this->position); - this->inverseTransform.Inverse(this->transform); + this->inverseTransform.MakeInverse(this->transform); this->dirty = 0; } @@ -133,7 +133,7 @@ void C3dActor::Prepare(ModelLightingContext&) { // FUNCTION: fn_17519 void C3dActorV1::Prepare(ModelLightingContext& context) { if (this->dirty == 1) { - this->UpdateTransform(); + this->UpdateMatrix(); } const float* previousPosition = context.position; @@ -153,7 +153,7 @@ void C3dActorV1::Prepare(ModelLightingContext& context) { // FUNCTION: fn_17520 void C3dActorV2::Prepare(ModelLightingContext& context) { if (this->dirty == 1) { - this->UpdateTransform(); + this->UpdateMatrix(); } const float* previousPosition = context.position; @@ -283,7 +283,7 @@ void C3dActor::Draw(const float*, bool, ModelRenderContext&) { // FUNCTION: fn_17496 void C3dActorV1::Draw(const float* matrix, bool clip, ModelRenderContext& context) { if (this->dirty == 1) { - this->UpdateTransform(); + this->UpdateMatrix(); } AffineMatrix camera; @@ -301,7 +301,7 @@ void C3dActorV1::Draw(const float* matrix, bool clip, ModelRenderContext& contex // FUNCTION: fn_17497 void C3dActorV2::Draw(const float* matrix, bool clip, ModelRenderContext& context) { if (this->dirty == 1) { - this->UpdateTransform(); + this->UpdateMatrix(); } AffineMatrix camera; diff --git a/Source/Contents/Models/ModelActor.h b/Source/Contents/Models/ModelActor.h index f17269b76..0c300129e 100644 --- a/Source/Contents/Models/ModelActor.h +++ b/Source/Contents/Models/ModelActor.h @@ -12,7 +12,7 @@ public: C3dActor& operator=(const C3dActor&) = delete; virtual void Assign(const C3dModelRes& resource); - virtual void UpdateTransform(); + virtual void UpdateMatrix(); virtual void UpdateBounds(); virtual void Prepare(ModelLightingContext& context); virtual void Animate(double frame); @@ -77,7 +77,7 @@ public: C3dActorV2(); ~C3dActorV2() override; void Assign(const C3dModelRes& resource) override; - void UpdateTransform() override; + void UpdateMatrix() override; void UpdateBounds() override; void Prepare(ModelLightingContext& context) override; void Animate(double frame) override; diff --git a/Source/Contents/Models/ModelActorBounds.cpp b/Source/Contents/Models/ModelActorBounds.cpp index f56574ed3..f4caef2d6 100644 --- a/Source/Contents/Models/ModelActorBounds.cpp +++ b/Source/Contents/Models/ModelActorBounds.cpp @@ -36,9 +36,9 @@ void C3dActorV1::UpdateBounds() { this->offset[0] = -(bounds[3] + bounds[0]) * 0.5f; this->offset[1] = -bounds[4]; this->offset[2] = -(bounds[5] + bounds[2]) * 0.5f; - this->transform.SetTranslation(this->offset[0], this->offset[1], this->offset[2]); + this->transform.MakeTranslate(this->offset[0], this->offset[1], this->offset[2]); this->transform.Scale(this->scale[0], this->scale[1], this->scale[2]); - this->transform.RotateY(Radians(this->rotation[1])); + this->transform.AppendYRotation(Radians(this->rotation[1])); this->transform.RotateX(Radians(this->rotation[0])); this->transform.RotateZ(Radians(this->rotation[2])); this->transform.Translate(this->position); @@ -56,7 +56,7 @@ void C3dActorV2::UpdateBounds() { root->AccumulateBounds(bounds, identity.values); } - this->UpdateTransform(); + this->UpdateMatrix(); this->FinishBounds(bounds, true); } @@ -95,7 +95,7 @@ void C3dActor::FinishBounds(const float* bounds, bool modern) { AffineMatrix axes; axes.SetScale(this->scale[0], this->scale[1], this->scale[2]); - axes.RotateY(Radians(this->rotation[1])); + axes.AppendYRotation(Radians(this->rotation[1])); axes.RotateX(Radians(this->rotation[0])); axes.RotateZ(Radians(this->rotation[2])); @@ -112,13 +112,13 @@ void C3dActor::FinishBounds(const float* bounds, bool modern) { for (ModelVolume* volume : this->volumes) { AffineMatrix rotation; - rotation.SetXRotation(Radians(volume->rotation[0])); - rotation.RotateY(Radians(volume->rotation[1])); + rotation.MakeXRotation(Radians(volume->rotation[0])); + rotation.AppendYRotation(Radians(volume->rotation[1])); rotation.RotateZ(Radians(volume->rotation[2])); rotation.Translate(volume->position); std::memcpy(volume->unknown_0084, rotation.values, sizeof(rotation.values)); AffineMatrix inverse; - inverse.Inverse(rotation); + inverse.MakeInverse(rotation); std::memcpy(volume->unknown_0084 + 48, inverse.values, sizeof(inverse.values)); AffineMatrix combined; combined.Compose(rotation, this->transform); diff --git a/Source/Contents/Models/ModelAnimation.cpp b/Source/Contents/Models/ModelAnimation.cpp index 66178ee2f..36f6c3fec 100644 --- a/Source/Contents/Models/ModelAnimation.cpp +++ b/Source/Contents/Models/ModelAnimation.cpp @@ -26,7 +26,7 @@ void SampleLegacyPosition(std::span keys, int frame, Aff if (keys.empty()) { output.Identity(); } else if (keys.size() == 1) { - output.SetTranslation(keys[0].position[0], keys[0].position[1], keys[0].position[2]); + output.MakeTranslate(keys[0].position[0], keys[0].position[1], keys[0].position[2]); } else { unsigned next = 1; @@ -40,7 +40,7 @@ void SampleLegacyPosition(std::span keys, int frame, Aff const auto& b = keys[next]; const float amount = static_cast((frame - a.frame)) / static_cast((b.frame - a.frame)); const float previous = static_cast(1.0 - static_cast(amount)); - output.SetTranslation( + output.MakeTranslate( previous * a.position[0] + amount * b.position[0], previous * a.position[1] + amount * b.position[1], previous * a.position[2] + amount * b.position[2] ); } diff --git a/Source/Contents/Models/ModelNode.cpp b/Source/Contents/Models/ModelNode.cpp index 21ca05d8a..77ab8477a 100644 --- a/Source/Contents/Models/ModelNode.cpp +++ b/Source/Contents/Models/ModelNode.cpp @@ -96,7 +96,7 @@ void C3dNodeV2::Initialize(const ModelNode& base) { const AffineMatrix world = this->resourceTransform; const AffineMatrix parentWorld = static_cast(this->parent)->resourceTransform; AffineMatrix inverse; - inverse.Inverse(parentWorld); + inverse.MakeInverse(parentWorld); this->localTransform.Compose(world, inverse); } else { this->localTransform = this->resourceTransform; diff --git a/Source/Contents/MonsterSpeech.cpp b/Source/Contents/MonsterSpeech.cpp index 83fcebce9..5f3a85e5a 100644 --- a/Source/Contents/MonsterSpeech.cpp +++ b/Source/Contents/MonsterSpeech.cpp @@ -100,7 +100,7 @@ void CSession::FormatMonsterSpeech(char* text, char* output, std::uint32_t aid, } } - const std::string name = static_cast(g_world.ActiveGameMode())->nameCard.Name(aid); + const std::string name = static_cast(g_world.GetGameMode())->nameCard.Name(aid); const char* speaker; if (!name.empty()) { speaker = name.c_str(); diff --git a/Source/Contents/NavigationRequest.cpp b/Source/Contents/NavigationRequest.cpp index 4aa4a2331..9edb4850f 100644 --- a/Source/Contents/NavigationRequest.cpp +++ b/Source/Contents/NavigationRequest.cpp @@ -87,7 +87,7 @@ bool CNaviData::SetDestination(CNaviInfo* info, int cellX, int cellY) { // OFFSET: 0x00BA1260 // FUNCTION: fn_19638 bool CNavigationManager::UpdateGround() { - CGameMode* mode = static_cast(g_world.ActiveGameMode()); + CGameMode* mode = static_cast(g_world.GetGameMode()); if (mode == nullptr || mode->scene == nullptr || mode->scene->terrain == nullptr) { return false; } @@ -144,7 +144,7 @@ int CNavigationManager::RequestRoute(int cellX, int cellY) { int startX = 0; int startY = 0; - CGameMode* mode = static_cast(g_world.ActiveGameMode()); + CGameMode* mode = static_cast(g_world.GetGameMode()); if (mode == nullptr) { return -95; } diff --git a/Source/Contents/Skills/ClientSkills.cpp b/Source/Contents/Skills/ClientSkills.cpp index 2f56ad2b9..143a8c15a 100644 --- a/Source/Contents/Skills/ClientSkills.cpp +++ b/Source/Contents/Skills/ClientSkills.cpp @@ -444,7 +444,7 @@ void CSession::EraseUnknownKey(std::int64_t key) { // FUNCTION: fn_23772 int CSession::CountProhibitionLog(std::uint32_t aid) { const int count = static_cast(this->m_prohibitionLog.size()); - const CRenderObject* actor = static_cast(g_world.ActiveGameMode())->scene->GetGameActorByAID(aid); + const CRenderObject* actor = static_cast(g_world.GetGameMode())->scene->GetGameActorByAID(aid); if (!actor) { return -1; } @@ -731,7 +731,7 @@ int CharacterConfigSave::SkillLevel(int id) const { // OFFSET: 0x00E094E0 // FUNCTION: fn_23778 CRenderObject* CSession::FindGameActor(std::uint32_t aid) const { - CGameMode* mode = static_cast(g_world.ActiveGameMode()); + CGameMode* mode = static_cast(g_world.GetGameMode()); if (mode == nullptr) { return nullptr; } diff --git a/Source/Contents/Skills/SkillInfo.cpp b/Source/Contents/Skills/SkillInfo.cpp index 703303e2c..9a621d709 100644 --- a/Source/Contents/Skills/SkillInfo.cpp +++ b/Source/Contents/Skills/SkillInfo.cpp @@ -596,16 +596,16 @@ std::pair CSkillActionMgr::ActionSlot01(int skillId) { // OFFSET: 0x0077AD90 // FUNCTION: fn_08405 vector3d CellWorldPosition(int column, int row) { - if (!g_world.ActiveGameMode() || !static_cast(g_world.ActiveGameMode())->scene || - !static_cast(g_world.ActiveGameMode())->scene->terrain) { + if (!g_world.GetGameMode() || !static_cast(g_world.GetGameMode())->scene || + !static_cast(g_world.GetGameMode())->scene->terrain) { return vector3d{0.0f, 0.0f, 0.0f}; } float x = 0.0f; float y = 0.0f; float z = 0.0f; - static_cast(g_world.ActiveGameMode())->scene->terrain->Grid().CellOrigin(column, row, x, z); - y = static_cast(g_world.ActiveGameMode())->scene->terrain->Grid().Height(x, z); + static_cast(g_world.GetGameMode())->scene->terrain->Grid().CellOrigin(column, row, x, z); + y = static_cast(g_world.GetGameMode())->scene->terrain->Grid().Height(x, z); return vector3d{x + 2.5f, y + 0.0f, z + 2.5f}; } diff --git a/Source/Contents/Sound/SoundMaker.cpp b/Source/Contents/Sound/SoundMaker.cpp index 032e5c3f4..322e3b51b 100644 --- a/Source/Contents/Sound/SoundMaker.cpp +++ b/Source/Contents/Sound/SoundMaker.cpp @@ -102,7 +102,7 @@ bool CSoundMaker::Update() { return true; } - const auto* player = reinterpret_cast(static_cast(g_world.ActiveGameMode())->scene->player); + const auto* player = reinterpret_cast(static_cast(g_world.GetGameMode())->scene->player); if (!player) { return true; } @@ -169,7 +169,7 @@ float* CPc::GetExtent(float* extent) const { // OFFSET: 0x00DA2FA0 // FUNCTION: fn_22397 bool CBlurPC::Update() { - WorldScene* scene = static_cast(g_world.ActiveGameMode())->scene; + WorldScene* scene = static_cast(g_world.GetGameMode())->scene; if (scene) { const CRenderObject* owner = scene->GetGameActorByAidIncludeMe(this->render.accountId); if (owner && (owner->render.flags & 0x10) != 0) { @@ -189,7 +189,7 @@ bool CBlurPC::Update() { // OFFSET: 0x00DA3240 // FUNCTION: fn_22401 bool CHalluPC2::Update() { - WorldScene* scene = static_cast(g_world.ActiveGameMode())->scene; + WorldScene* scene = static_cast(g_world.GetGameMode())->scene; if (scene) { const CRenderObject* owner = scene->GetGameActorByAidIncludeMe(this->render.accountId); if (owner && (owner->render.flags & 0x10) != 0) { diff --git a/Source/Contents/World/WorldObjects.cpp b/Source/Contents/World/WorldObjects.cpp index 8bc4dc4db..9ad11ce51 100644 --- a/Source/Contents/World/WorldObjects.cpp +++ b/Source/Contents/World/WorldObjects.cpp @@ -119,7 +119,7 @@ CRenderObject* WorldScene::GetSkillByAID(std::uint32_t aid) const { // OFFSET: 0x00B3C350 // FUNCTION: fn_18807 CRenderObject* FindRenderObject(std::uint32_t aid) { - WorldScene* scene = static_cast(g_world.ActiveGameMode())->scene; + WorldScene* scene = static_cast(g_world.GetGameMode())->scene; if (g_session.m_aid == aid) { return reinterpret_cast(scene->player); diff --git a/Source/Contents/WorldNavigation.cpp b/Source/Contents/WorldNavigation.cpp index 9d053a1c0..5e7f07c19 100644 --- a/Source/Contents/WorldNavigation.cpp +++ b/Source/Contents/WorldNavigation.cpp @@ -11,7 +11,7 @@ // OFFSET: 0x00B961E0 // FUNCTION: fn_19581 bool CNavigationManager::PlayerCell(int* column, int* row) { - CGameMode* mode = static_cast(g_world.ActiveGameMode()); + CGameMode* mode = static_cast(g_world.GetGameMode()); if (mode == nullptr) { return false; } diff --git a/Source/Network/Connection/Connection.cpp b/Source/Network/Connection/Connection.cpp index d94f33c93..e1b631b58 100644 --- a/Source/Network/Connection/Connection.cpp +++ b/Source/Network/Connection/Connection.cpp @@ -273,7 +273,7 @@ void CConnection::ResetDeferred() { // OFFSET: 0x00C7CDC0 // FUNCTION: fn_20404 -void CConnection::ResetBuffers() { +void CConnection::ResetQueue() { this->m_input.Reset(0xA000); this->m_output.Reset(0xA000); this->m_pending.Reset(0xA000); diff --git a/Source/Network/Connection/Connection.h b/Source/Network/Connection/Connection.h index 0e6bf1e7c..3cb4cfbb9 100644 --- a/Source/Network/Connection/Connection.h +++ b/Source/Network/Connection/Connection.h @@ -29,7 +29,7 @@ public: bool ReadPacket(void* output, unsigned short* bytes, const PacketLengths& lengths); void Prepend(int bytes, const void* data); void ResetDeferred(); - void ResetBuffers(); + void ResetQueue(); void SetDeferred(unsigned char value); // INLINED diff --git a/Source/Network/Connection/ConnectionRuntime.cpp b/Source/Network/Connection/ConnectionRuntime.cpp index bc85a21ff..842137c22 100644 --- a/Source/Network/Connection/ConnectionRuntime.cpp +++ b/Source/Network/Connection/ConnectionRuntime.cpp @@ -51,7 +51,7 @@ bool InitializeConnections() { // OFFSET: 0x00C7C4B0 // FUNCTION: fn_20388 -void ShutdownConnections() { +void Cleanup() { WSACleanup(); FreeLibrary(module); } diff --git a/Source/Network/Connection/ConnectionRuntime.h b/Source/Network/Connection/ConnectionRuntime.h index ea09384c8..a8349e07f 100644 --- a/Source/Network/Connection/ConnectionRuntime.h +++ b/Source/Network/Connection/ConnectionRuntime.h @@ -7,7 +7,7 @@ extern int(WSAAPI* g_connectionSend)(SOCKET socket, const char* data, int bytes, extern int(WSAAPI* g_connectionReceive)(SOCKET socket, char* data, int bytes, int flags); bool InitializeConnections(); -void ShutdownConnections(); +void Cleanup(); bool CheckConnectionRuntime(); #endif diff --git a/Source/Resource/Resource.cpp b/Source/Resource/Resource.cpp index d87556ede..454654f5e 100644 --- a/Source/Resource/Resource.cpp +++ b/Source/Resource/Resource.cpp @@ -56,13 +56,13 @@ void CRes::MissingFile(CRenderSystemBase* system, const char* name) { // OFFSET: 0x00AEFAD0 // FUNCTION: fn_18183 -std::uint32_t CRes::AddRef() { +std::uint32_t CRes::Lock() { return ++this->references; } // OFFSET: 0x00AF0BE0 // FUNCTION: fn_18194 -void CRes::Release() { +void CRes::Unlock() { this->lastUse = timeGetTime(); --this->references; } diff --git a/Source/Resource/Resource.h b/Source/Resource/Resource.h index 5eb642632..a7b3be551 100644 --- a/Source/Resource/Resource.h +++ b/Source/Resource/Resource.h @@ -27,8 +27,8 @@ public: virtual bool Load(const char* name) = 0; virtual void Unload(); virtual void MissingFile(CRenderSystemBase* system, const char* name); - std::uint32_t AddRef(); - void Release(); + std::uint32_t Lock(); + void Unlock(); /* 0004 */ std::uint32_t references; /* 0008 */ std::uint32_t lastUse; diff --git a/Source/Resource/World/WorldResource.cpp b/Source/Resource/World/WorldResource.cpp index 8713b96fe..22653c8e3 100644 --- a/Source/Resource/World/WorldResource.cpp +++ b/Source/Resource/World/WorldResource.cpp @@ -153,8 +153,8 @@ inline void C3dWorldRes::ReadEnvironment(CFile& input, unsigned version) { constexpr float pi = 3.141592f; AffineMatrix matrix; - matrix.SetXRotation((static_cast(this->latitude) / 180.0f) * pi); - matrix.RotateY((static_cast(this->longitude) / 180.0f) * pi); + matrix.MakeXRotation((static_cast(this->latitude) / 180.0f) * pi); + matrix.AppendYRotation((static_cast(this->longitude) / 180.0f) * pi); for (unsigned component = 0; component < 3; ++component) { this->lightDirection[component] = diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 390391886..1acbbfbe5 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -276,7 +276,7 @@ void UIMinimapZoomWnd::Paint() { this->ClearSurface(0xFFFF00FF); int column = 0; int row = 0; - static_cast(g_world.ActiveGameMode())->PlayerCell(&column, &row); + static_cast(g_world.GetGameMode())->PlayerCell(&column, &row); const std::string text = FormatOwnedString(" %d %d", column, row); this->DrawTextAt(controls.fonts, controls.locale, 19, 128, text.c_str(), 0, 0, 12, 0, 0, 0); this->DrawTextAt(controls.fonts, controls.locale, 20, 128, text.c_str(), 0, 0, 12, 0xFFFFFF, 0, 0); @@ -667,7 +667,7 @@ void UIPetTamingDeceiveWnd::Slot25(int, int) { this->m_state = 1; this->m_frame = 7; this->m_started = 1; - g_world.ActiveGameMode()->SendMsg(149, this->m_target, 0, 0, 0); + g_world.GetGameMode()->SendMsg(149, this->m_target, 0, 0, 0); } // OFFSET: 0x008EFB40 diff --git a/Source/UI/Edit/EditTextState.cpp b/Source/UI/Edit/EditTextState.cpp index 63a059732..1fb5a4f9c 100644 --- a/Source/UI/Edit/EditTextState.cpp +++ b/Source/UI/Edit/EditTextState.cpp @@ -9,8 +9,8 @@ void EditTextState::SetText(const char* value) { this->Trim(); if (this->focused) { - this->input.CancelComposition(); - this->input.CancelComposition(); + this->input.ResetInput(); + this->input.ResetInput(); this->input.Insert(this->text.c_str()); } diff --git a/Source/UI/Edit/UIEditCtrl.cpp b/Source/UI/Edit/UIEditCtrl.cpp index e31a0c358..3026d6e00 100644 --- a/Source/UI/Edit/UIEditCtrl.cpp +++ b/Source/UI/Edit/UIEditCtrl.cpp @@ -268,8 +268,8 @@ void UIEditCtrl::Paint() { // OFFSET: 0x0085AAB0 // FUNCTION: fn_10783 void UIEditCtrl::Slot23() { - this->m_edit->input.CancelComposition(); - this->m_edit->input.CancelComposition(); + this->m_edit->input.ResetInput(); + this->m_edit->input.ResetInput(); this->m_edit->input.Insert(this->text.c_str()); this->m_edit->password = this->mask != 0; this->SelectAll(); @@ -327,7 +327,7 @@ int UIEditCtrl::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::int UIWindow::SendMsg(sender, message, a, b, c, d); if (message == 0 && this->preserveInput == 0) { - this->m_edit->input.CancelComposition(); + this->m_edit->input.ResetInput(); } return 0; @@ -346,8 +346,8 @@ void UIEditCtrl::SetText(const char* value) { this->Trim(); if (this->m_edit->focus.window == this) { - this->m_edit->input.CancelComposition(); - this->m_edit->input.CancelComposition(); + this->m_edit->input.ResetInput(); + this->m_edit->input.ResetInput(); this->m_edit->input.Insert(this->text.c_str()); } diff --git a/Source/UI/Edit/UIEditLinks.cpp b/Source/UI/Edit/UIEditLinks.cpp index 78979f915..670511f85 100644 --- a/Source/UI/Edit/UIEditLinks.cpp +++ b/Source/UI/Edit/UIEditLinks.cpp @@ -49,7 +49,7 @@ bool UIEditCtrl::RemoveInvalidLink(std::list::iterator& entry) { const auto begin = left ? absolute - 1 : absolute; const auto end = absolute + bytes + (right ? 1 : 0); remaining = this->text.substr(0, begin) + this->text.substr(end); - this->m_edit->input.CancelComposition(); + this->m_edit->input.ResetInput(); this->m_edit->input.Insert(remaining.c_str()); this->RemoveChild(button, 1); entry = this->links.erase(entry); diff --git a/Source/UI/Edit/UIEditVariants.cpp b/Source/UI/Edit/UIEditVariants.cpp index c752d302c..48181286f 100644 --- a/Source/UI/Edit/UIEditVariants.cpp +++ b/Source/UI/Edit/UIEditVariants.cpp @@ -62,8 +62,8 @@ UIEditCtrl4::~UIEditCtrl4() = default; // FUNCTION: fn_10782 void UIEditCtrl4::Slot23() { this->text.clear(); - this->m_edit->input.CancelComposition(); - this->m_edit->input.CancelComposition(); + this->m_edit->input.ResetInput(); + this->m_edit->input.ResetInput(); this->m_edit->input.Insert(this->text.c_str()); this->m_edit->password = this->mask != 0; this->SelectAll(); diff --git a/Source/UI/UILapineUpgradeBoxWnd.cpp b/Source/UI/UILapineUpgradeBoxWnd.cpp index 2353f3fd5..8d10831ad 100644 --- a/Source/UI/UILapineUpgradeBoxWnd.cpp +++ b/Source/UI/UILapineUpgradeBoxWnd.cpp @@ -65,7 +65,7 @@ void UILapineUpgradeBoxWnd::Slot25(int x, int y) { } if (static_cast(x - 101) <= 24 && static_cast(y - 165) <= 24 && this->item.unknown_0000[1] != 0) { ItemDescriptions descriptions{g_itemDescriptions}; - static_cast(g_world.ActiveGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 26, this->item, 1, -1); + static_cast(g_world.GetGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 26, this->item, 1, -1); } } @@ -74,7 +74,7 @@ void UILapineUpgradeBoxWnd::Slot25(int x, int y) { void UILapineUpgradeBox_IngredientInfoWnd::Slot25(int x, int y) { if (this->item.unknown_0000[1] != 0) { ItemDescriptions descriptions{g_itemDescriptions}; - static_cast(g_world.ActiveGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 27, this->item, this->quantity, -1); + static_cast(g_world.GetGameMode())->drag.BeginItem(this->m_frameContext->windows, descriptions, 27, this->item, this->quantity, -1); } } @@ -126,7 +126,7 @@ void UILapineUpgradeBoxWnd::SetWaiting(unsigned char value) { // OFFSET: 0x00603680 // FUNCTION: fn_04196 void UILapineUpgradeBox_IngredientListWnd::Slot10(int x, int y, std::intptr_t value) { - CMode* mode = g_world.ActiveGameMode(); + CMode* mode = g_world.GetGameMode(); const ModeDragState* drag = reinterpret_cast(value); if (drag->source == 26) { this->SendMsg(this, 31, drag->id, 0, 0, 0); diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index f7c0ea918..3d8ff4e3f 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -262,7 +262,7 @@ void UIMonsterInfoWnd::Slot28(int x, int y) { int screenX = 0; int screenY = 0; this->ToScreen(screenX, screenY); - std::string name = static_cast(g_world.ActiveGameMode())->nameCard.Name(g_monsterInfoActorId); + std::string name = static_cast(g_world.GetGameMode())->nameCard.Name(g_monsterInfoActorId); const std::size_t mark = name.find("#", 0); if (mark != std::string::npos) { name.erase(mark, name.size()); diff --git a/Source/UI/Window/UIMessageBox.cpp b/Source/UI/Window/UIMessageBox.cpp index 6ca58c255..b3a53980f 100644 --- a/Source/UI/Window/UIMessageBox.cpp +++ b/Source/UI/Window/UIMessageBox.cpp @@ -604,7 +604,7 @@ int UITalkboxTrapInputWnd::SendMsg(UIWindow* sender, int message, std::intptr_t TalkboxTrapRequest request; request.target = this->target; request.text = this->edit->Text(); - g_world.ActiveGameMode()->SendMsg(131, reinterpret_cast(&request), 0, 0, 0); + g_world.GetGameMode()->SendMsg(131, reinterpret_cast(&request), 0, 0, 0); } else if (a != 185) { return 0; } diff --git a/Source/UI/Window/UIWindowMgr.cpp b/Source/UI/Window/UIWindowMgr.cpp index b0cecded0..acfb50220 100644 --- a/Source/UI/Window/UIWindowMgr.cpp +++ b/Source/UI/Window/UIWindowMgr.cpp @@ -465,7 +465,7 @@ void UIWindowMgr::ResetWindows() { this->window_01D0 = nullptr; this->unknown_0224 = 0; if (hadWindow0270) { - if (CMode* mode = g_world.ActiveGameMode()) { + if (CMode* mode = g_world.GetGameMode()) { mode->SendMsg(292, 0, 0, 0, 0); } } @@ -632,7 +632,7 @@ void UIWindowMgr::RegisterNamedWindow(std::string name, UIWindow* window) { // OFFSET: 0x00AA9B00 // FUNCTION: fn_17254 void UIWindowMgr::NotifyMode() { - if (CMode* mode = g_world.ActiveGameMode()) { + if (CMode* mode = g_world.GetGameMode()) { mode->SendMsg(292, 0, 0, 0, 0); } } diff --git a/Source/Utility/Math/AffineMatrix.cpp b/Source/Utility/Math/AffineMatrix.cpp index b2b8af8e3..b7a4f884a 100644 --- a/Source/Utility/Math/AffineMatrix.cpp +++ b/Source/Utility/Math/AffineMatrix.cpp @@ -33,7 +33,7 @@ void AffineMatrix::Identity() { // OFFSET: 0x00555360 // FUNCTION: fn_02034 -void AffineMatrix::SetXRotation(float radians) { +void AffineMatrix::MakeXRotation(float radians) { this->Identity(); const float sine = ClientSin(radians); @@ -74,13 +74,13 @@ void AffineMatrix::SetZRotation(float radians) { // FUNCTION: fn_02016 void AffineMatrix::RotateX(float radians) { AffineMatrix rotation; - rotation.SetXRotation(radians); + rotation.MakeXRotation(radians); Rotate(this->values, rotation.values); } // OFFSET: 0x00553270 // FUNCTION: fn_02017 -void AffineMatrix::RotateY(float radians) { +void AffineMatrix::AppendYRotation(float radians) { AffineMatrix rotation; rotation.SetYRotation(radians); Rotate(this->values, rotation.values); @@ -96,7 +96,7 @@ void AffineMatrix::RotateZ(float radians) { // OFFSET: 0x005550C0 // FUNCTION: fn_02032 -void AffineMatrix::SetTranslation(float x, float y, float z) { +void AffineMatrix::MakeTranslate(float x, float y, float z) { std::memcpy(this->values, g_identityMatrix, sizeof(g_identityMatrix)); this->values[9] = x; this->values[10] = y; @@ -124,7 +124,7 @@ void AffineMatrix::Scale(float x, float y, float z) { // FUNCTION: fn_02015 void AffineMatrix::Translate(const float* position) { AffineMatrix translation; - translation.SetTranslation(position[0], position[1], position[2]); + translation.MakeTranslate(position[0], position[1], position[2]); Rotate(this->values, translation.values); } @@ -153,7 +153,7 @@ void AffineMatrix::Compose(const AffineMatrix& first, const AffineMatrix& second // OFFSET: 0x00554920 // FUNCTION: fn_02027 -void AffineMatrix::Inverse(const AffineMatrix& source) { +void AffineMatrix::MakeInverse(const AffineMatrix& source) { const float* a = source.values; float* output = this->values; const float minor = a[4] * a[8] - a[5] * a[7]; diff --git a/Source/Utility/Math/AffineMatrix.h b/Source/Utility/Math/AffineMatrix.h index 4bdb530d5..41c7a9d1e 100644 --- a/Source/Utility/Math/AffineMatrix.h +++ b/Source/Utility/Math/AffineMatrix.h @@ -12,7 +12,7 @@ void CreateTrigonometricTable(); float ClientSin(float radians); float ClientCos(float radians); -float ClientRadians(int degrees); +float GetRadian(int degrees); float ClientSine(int degrees); float ClientCosine(int degrees); float SquareRoot(float value); @@ -23,18 +23,18 @@ struct AffineMatrix { void Identity(); int IsIdentity() const; void MakeTransform(const float* rotaxis, float rotangle); - void SetXRotation(float radians); + void MakeXRotation(float radians); void SetYRotation(float radians); void SetZRotation(float radians); void RotateX(float radians); - void RotateY(float radians); + void AppendYRotation(float radians); void RotateZ(float radians); - void SetTranslation(float x, float y, float z); + void MakeTranslate(float x, float y, float z); void SetScale(float x, float y, float z); void Scale(float x, float y, float z); void Translate(const float* position); void Compose(const AffineMatrix& first, const AffineMatrix& second); - void Inverse(const AffineMatrix& source); + void MakeInverse(const AffineMatrix& source); void LookAt(const float* origin, const float* target, const float* up); }; diff --git a/Source/Utility/Math/ClientAngles.cpp b/Source/Utility/Math/ClientAngles.cpp index 1baef83d3..e8ac2f6fc 100644 --- a/Source/Utility/Math/ClientAngles.cpp +++ b/Source/Utility/Math/ClientAngles.cpp @@ -45,7 +45,7 @@ void CreateTrigonometricTable() { // OFFSET: 0x00554420 // FUNCTION: fn_02024 -float ClientRadians(int degrees) { +float GetRadian(int degrees) { const int index = Wrapped(degrees); return g_radTable[index >= 0 ? index : 361 + index]; }