diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index 9458a11..36ff157 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -2,11 +2,17 @@ #include "model/CM2Model.hpp" #include +int32_t s_bInRenderPrep = 0; + CCharacterComponent* CCharacterComponent::AllocComponent() { // TODO ObjectAlloc return STORM_NEW(CCharacterComponent); } +void CCharacterComponent::CreateBaseTexture() { + // TODO +} + void CCharacterComponent::GeosRenderPrep() { // TODO @@ -44,6 +50,10 @@ int32_t CCharacterComponent::ItemsLoaded(int32_t a2) { return 1; } +void CCharacterComponent::PrepSections() { + // TODO +} + int32_t CCharacterComponent::RenderPrep(int32_t a2) { if (this->m_data.flags & 0x1) { if (this->m_flags & 0x4) { @@ -73,7 +83,23 @@ int32_t CCharacterComponent::RenderPrep(int32_t a2) { } void CCharacterComponent::RenderPrepSections() { + s_bInRenderPrep = 1; + + if (this->m_flags & 0x4) { + this->GeosRenderPrep(); + } + + if (!this->m_baseTexture) { + this->CreateBaseTexture(); + } + + this->PrepSections(); + + this->m_flags &= ~0x1; + // TODO + + s_bInRenderPrep = 0; } int32_t CCharacterComponent::VariationsLoaded(int32_t a2) { diff --git a/src/component/CCharacterComponent.hpp b/src/component/CCharacterComponent.hpp index 156422a..c47c1ec 100644 --- a/src/component/CCharacterComponent.hpp +++ b/src/component/CCharacterComponent.hpp @@ -2,6 +2,7 @@ #define COMPONENT_C_CHARACTER_COMPONENT_HPP #include "component/Types.hpp" +#include "gx/Texture.hpp" #include class CM2Model; @@ -50,11 +51,14 @@ class CCharacterComponent { // Member variables uint32_t m_flags = 0x1 | 0x2 | 0x4; ComponentData m_data; + HTEXTURE m_baseTexture = nullptr; // Member functions + void CreateBaseTexture(); void GeosRenderPrep(); void Init(ComponentData* data, const char* a3); int32_t ItemsLoaded(int32_t a2); + void PrepSections(); int32_t RenderPrep(int32_t a2); void RenderPrepSections(); int32_t VariationsLoaded(int32_t a2);