diff --git a/Source/Contents/Effects/EffectPrimitiveState.cpp b/Source/Contents/Effects/EffectPrimitiveState.cpp index 09d4c0d..cf47f8b 100644 --- a/Source/Contents/Effects/EffectPrimitiveState.cpp +++ b/Source/Contents/Effects/EffectPrimitiveState.cpp @@ -1,11 +1,20 @@ #include "Contents/Effects/EffectPrimitiveState.h" #include "Contents/Effects/RagEffectState.h" #include "Contents/Actors/RenderObjectState.h" +#include "Resource/Sprites/ActionResource.h" #include "Utility/Math/AffineMatrix.h" #include #include +// OFFSET: 0x00BAE170 +// FUNCTION: fn_19762 +EffectPrimitiveSlot::EffectPrimitiveSlot() { + for (int i = 0; i < 4; ++i) { + this->unknown_0084[i] = {0.0f, 0.0f, 0.0f}; + } +} + // INLINED EffectPrimitiveState::EffectPrimitiveState(RenderObjectState& render) { this->textures = nullptr; @@ -152,6 +161,26 @@ EffectPrimitiveState::~EffectPrimitiveState() { std::free(this->textures); } +// OFFSET: 0x00BAE3A0 + +// OFFSET: 0x00BAE460 +// FUNCTION: fn_19765 +void EffectPrimitiveState::GetColorOverride(unsigned char* red, unsigned char* green, unsigned char* blue) { + if (this->parent->unknown_11C88[0] != -1) { + *red = static_cast(this->parent->unknown_11C88[0]); + } + + if (this->parent->unknown_11C88[1] != -1) { + *green = static_cast(this->parent->unknown_11C88[1]); + } + + if (this->parent->unknown_11C88[2] != -1) { + *blue = static_cast(this->parent->unknown_11C88[2]); + } +} + +// OFFSET: 0x00BAE4B0 + // OFFSET: 0x00BAE5D0 // FUNCTION: fn_19767 void EffectPrimitiveState::Initialize( @@ -169,19 +198,3 @@ void EffectPrimitiveState::Initialize( render.position[2] = this->origin.z; this->unknown_013C = 0; } - -// OFFSET: 0x00BAE460 -// FUNCTION: fn_19765 -void EffectPrimitiveState::GetColorOverride(unsigned char* red, unsigned char* green, unsigned char* blue) { - if (this->parent->unknown_11C88[0] != -1) { - *red = static_cast(this->parent->unknown_11C88[0]); - } - - if (this->parent->unknown_11C88[1] != -1) { - *green = static_cast(this->parent->unknown_11C88[1]); - } - - if (this->parent->unknown_11C88[2] != -1) { - *blue = static_cast(this->parent->unknown_11C88[2]); - } -} diff --git a/Source/Contents/Effects/EffectPrimitiveState.h b/Source/Contents/Effects/EffectPrimitiveState.h index f398f8e..081ee6f 100644 --- a/Source/Contents/Effects/EffectPrimitiveState.h +++ b/Source/Contents/Effects/EffectPrimitiveState.h @@ -7,7 +7,7 @@ #include #include -struct RenderObjectState; +#include "Contents/Actors/RenderObjectState.h" struct RagEffectState; class CTexture; @@ -32,6 +32,7 @@ struct EffectPrimitiveRecord { }; struct EffectPrimitiveSlot { + EffectPrimitiveSlot(); /* 0000 */ unsigned char active; /* 0001 */ unsigned char unknown_0001; /* 0002 */ std::int16_t unknown_0002; @@ -164,6 +165,18 @@ struct EffectPrimitiveState { /* FA14 */ std::uint32_t unknown_FA14; }; +class CActRes; + +struct EffectPrimitiveObject { + /* 0000 */ RenderObjectState render; + /* 0138 */ EffectPrimitiveState state; + + CActRes* ActionResource(); + bool AdvanceFrame(); +}; + +void CalculateVectorAngle(float x, float y, std::int16_t* angle); + static_assert(sizeof(EffectVector3) == 12); static_assert(sizeof(EffectPrimitiveRecord) == 140); static_assert(sizeof(EffectPrimitiveSlot) == 0xB4);