diff --git a/Source/Contents/Actors/GameObject.cpp b/Source/Contents/Actors/GameObject.cpp index 22b1c9b1..8717061e 100644 --- a/Source/Contents/Actors/GameObject.cpp +++ b/Source/Contents/Actors/GameObject.cpp @@ -1,4 +1,7 @@ #include "Contents/Actors/GameObject.h" +#include "Client/Replay.h" +#include "Contents/Actors/RenderObject.h" +#include "Resource/Sprites/ActionResource.h" #include "Utility/Math/ScalarConversion.h" namespace { @@ -54,48 +57,12 @@ int CGameObject::Direction(float angle, const CameraDirectionContext& camera) { return TruncateToInt(relative / 45.0f); } -struct GameObjectActorContext : public CGameObject { - /* 0010 */ unsigned char pad_0010[0x24]; - /* 0034 */ int field_0034; - /* 0038 */ unsigned char pad_0038[0x18]; - /* 0050 */ float field_0050; - /* 0054 */ unsigned char pad_0054[4]; - /* 0058 */ float field_0058; - /* 005C */ unsigned char pad_005C[0x14]; - /* 0070 */ int field_0070; - /* 0074 */ unsigned char pad_0074[0x28]; - /* 009C */ unsigned char field_009C; - /* 009D */ unsigned char pad_009D; - /* 009E */ unsigned char field_009E; - /* 009F */ unsigned char pad_009F; - /* 00A0 */ unsigned char field_00A0; - /* 00A1 */ unsigned char pad_00A1[4]; - /* 00A5 */ unsigned char field_00A5; - /* 00A6 */ unsigned char pad_00A6[0x6E]; - /* 0114 */ unsigned char field_0114; - /* 0115 */ unsigned char pad_0115[0x147]; - /* 025C */ int field_025C; - /* 0260 */ unsigned char pad_0260[0x1A4]; - /* 0404 */ int field_0404; - /* 0408 */ int field_0408; - - void SubCB20B0(int a); - void SubCB20F0(int a, int b, int c); - void SubCB2830(); - void SubCB35F0(int a, float b); - void SubCB39A0(); - void SubCB3FA0(float speed); - void SubCB4070(); - void SubCB4100(); - void SubCB4800(); -}; - // OFFSET: 0x00CB20B0 // FUNCTION: fn_21102 -void GameObjectActorContext::SubCB20B0(int a) { - if (this->field_00A0 != 0) { - this->SubCB35F0(a, this->field_0050); - this->SubCB20F0(a, 0, 0); +void CRenderObject::Draw(int argument) { + if (this->render.visible != 0) { + this->DrawShadow(argument, this->render.scale); + this->DrawSprite(argument, false, 0.0f); } } @@ -110,6 +77,18 @@ void GameObjectActorContext::SubCB20B0(int a) { // OFFSET: 0x00CB3F40 // OFFSET: 0x00CB3FA0 +// FUNCTION: fn_21108 +void CRenderObject::SetActionSpeed(float speed) { + speed *= this->render.action->Speed(this->render.animation); + + if (g_replayAnimationScaling != 0) { + speed *= Replay::Instance().AnimationScale(); + } + + if (speed > 0.0f) { + this->render.speed = speed; + } +} // OFFSET: 0x00CB3FF0 diff --git a/Source/Contents/Actors/RenderObject.h b/Source/Contents/Actors/RenderObject.h index dc2439db..1fb8c958 100644 --- a/Source/Contents/Actors/RenderObject.h +++ b/Source/Contents/Actors/RenderObject.h @@ -12,6 +12,7 @@ public: ~CRenderObject() override; bool Update() override; void SendObjectMessage(CGameObject* sender, int message, int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m) override; + void Draw(int argument) override; virtual void SetScreenBounds(const float* bounds, float x, float y); @@ -22,6 +23,9 @@ public: float HorizontalDistance(float x, float z) const; float Distance(float x, float y, float z) const; void SetAnimationSpeed(float speed); + void SetActionSpeed(float speed); + void DrawSprite(int argument, bool seasonal, float offset); + void DrawShadow(int argument, float scale); void SetActionName(ResourceMgr& resources, const char* name); void SetSpriteName(ResourceMgr& resources, const char* name); void SetColor(int alpha, int red, int green, int blue);