diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index 86faad6..b004ad1 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -13,6 +13,7 @@ st_race* CCharacterComponent::s_chrVarArray; uint32_t CCharacterComponent::s_chrVarArrayLength; EGxTexFormat CCharacterComponent::s_gxFormat; uint32_t CCharacterComponent::s_mipLevels; +PREP_FUNC* CCharacterComponent::s_prepFunc[]; MipBits* CCharacterComponent::s_textureBuffer; MipBits* CCharacterComponent::s_textureBufferCompressed; uint32_t CCharacterComponent::s_textureSize; @@ -40,6 +41,17 @@ void CCharacterComponent::Initialize(EGxTexFormat textureFormat, uint32_t textur s_pathEnd = s_path; + CCharacterComponent::s_prepFunc[SECTION_ARM_UPPER] = &CCharacterComponent::RenderPrepAU; + CCharacterComponent::s_prepFunc[SECTION_ARM_LOWER] = &CCharacterComponent::RenderPrepAL; + CCharacterComponent::s_prepFunc[SECTION_HAND] = &CCharacterComponent::RenderPrepHA; + CCharacterComponent::s_prepFunc[SECTION_TORSO_UPPER] = &CCharacterComponent::RenderPrepTU; + CCharacterComponent::s_prepFunc[SECTION_TORSO_LOWER] = &CCharacterComponent::RenderPrepTL; + CCharacterComponent::s_prepFunc[SECTION_LEG_UPPER] = &CCharacterComponent::RenderPrepLU; + CCharacterComponent::s_prepFunc[SECTION_LEG_LOWER] = &CCharacterComponent::RenderPrepLL; + CCharacterComponent::s_prepFunc[SECTION_FOOT] = &CCharacterComponent::RenderPrepFO; + CCharacterComponent::s_prepFunc[SECTION_HEAD_UPPER] = &CCharacterComponent::RenderPrepHU; + CCharacterComponent::s_prepFunc[SECTION_HEAD_LOWER] = &CCharacterComponent::RenderPrepHL; + // TODO // Clamp mip levels between 6 and 9 @@ -80,6 +92,46 @@ void CCharacterComponent::InitDbData() { // TODO CountFacialFeatures(varArrayLength, &CCharacterComponent::s_characterFacialHairStylesList); } +void CCharacterComponent::RenderPrepAL(CCharacterComponent* component) { + // TODO +} + +void CCharacterComponent::RenderPrepAU(CCharacterComponent* component) { + // TODO +} + +void CCharacterComponent::RenderPrepFO(CCharacterComponent* component) { + // TODO +} + +void CCharacterComponent::RenderPrepHA(CCharacterComponent* component) { + // TODO +} + +void CCharacterComponent::RenderPrepHL(CCharacterComponent* component) { + // TODO +} + +void CCharacterComponent::RenderPrepHU(CCharacterComponent* component) { + // TODO +} + +void CCharacterComponent::RenderPrepLL(CCharacterComponent* component) { + // TODO +} + +void CCharacterComponent::RenderPrepLU(CCharacterComponent* component) { + // TODO +} + +void CCharacterComponent::RenderPrepTL(CCharacterComponent* component) { + // TODO +} + +void CCharacterComponent::RenderPrepTU(CCharacterComponent* component) { + // TODO +} + void CCharacterComponent::UpdateBaseTexture(EGxTexCommand cmd, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipLevel, void* userArg, uint32_t& texelStrideInBytes, const void*& texels) { auto component = static_cast(userArg); diff --git a/src/component/CCharacterComponent.hpp b/src/component/CCharacterComponent.hpp index 64d9068..9d84e49 100644 --- a/src/component/CCharacterComponent.hpp +++ b/src/component/CCharacterComponent.hpp @@ -6,12 +6,15 @@ #include class CACHEENTRY; +class CCharacterComponent; class CharSectionsRec; class CM2Model; struct MipBits; struct st_race; +typedef void (PREP_FUNC)(CCharacterComponent* component); + struct ComponentData { int32_t raceID = 0; int32_t sexID = 0; @@ -55,6 +58,7 @@ class CCharacterComponent { static uint32_t s_chrVarArrayLength; static EGxTexFormat s_gxFormat; static uint32_t s_mipLevels; + static PREP_FUNC* s_prepFunc[NUM_COMPONENT_SECTIONS]; static MipBits* s_textureBuffer; static MipBits* s_textureBufferCompressed; static uint32_t s_textureSize; @@ -64,6 +68,16 @@ class CCharacterComponent { static void Initialize(); static void Initialize(EGxTexFormat textureFormat, uint32_t textureLevel, int32_t thread, int32_t compress); static void InitDbData(); + static void RenderPrepAL(CCharacterComponent* component); + static void RenderPrepAU(CCharacterComponent* component); + static void RenderPrepFO(CCharacterComponent* component); + static void RenderPrepHA(CCharacterComponent* component); + static void RenderPrepHL(CCharacterComponent* component); + static void RenderPrepHU(CCharacterComponent* component); + static void RenderPrepLL(CCharacterComponent* component); + static void RenderPrepLU(CCharacterComponent* component); + static void RenderPrepTL(CCharacterComponent* component); + static void RenderPrepTU(CCharacterComponent* component); static void UpdateBaseTexture(EGxTexCommand cmd, uint32_t width, uint32_t height, uint32_t depth, uint32_t mipLevel, void* userArg, uint32_t& texelStrideInBytes, const void*& texels); // Member variables