diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index 32a960d..117347c 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -9,6 +9,9 @@ st_race* CCharacterComponent::s_chrVarArray; uint32_t CCharacterComponent::s_chrVarArrayLength; +EGxTexFormat CCharacterComponent::s_gxFormat; +uint32_t CCharacterComponent::s_mipLevels; +uint32_t CCharacterComponent::s_textureSize; int32_t s_bInRenderPrep = 0; char* s_pathEnd; @@ -35,6 +38,23 @@ void CCharacterComponent::Initialize(EGxTexFormat textureFormat, uint32_t textur // TODO + // Clamp mip levels between 6 and 9 + uint32_t mipLevels = std::min(std::max(textureLevel, 6u), 9u); + + // Cap mip levels to 8 if compression isn't enabled + if (!compress && mipLevels > 8) { + mipLevels = 8; + } + + CCharacterComponent::s_mipLevels = mipLevels; + CCharacterComponent::s_textureSize = 1 << mipLevels; + + // TODO + + CCharacterComponent::s_gxFormat = textureFormat; + + // TODO + CCharacterComponent::InitDbData(); // TODO diff --git a/src/component/CCharacterComponent.hpp b/src/component/CCharacterComponent.hpp index d0d9fb1..1af0e11 100644 --- a/src/component/CCharacterComponent.hpp +++ b/src/component/CCharacterComponent.hpp @@ -52,6 +52,9 @@ class CCharacterComponent { // Static variables static st_race* s_chrVarArray; static uint32_t s_chrVarArrayLength; + static EGxTexFormat s_gxFormat; + static uint32_t s_mipLevels; + static uint32_t s_textureSize; // Static functions static CCharacterComponent* AllocComponent();