feat(component): set up texture format and size in CCharacterComponent::Initialize

This commit is contained in:
fallenoak 2025-10-20 22:40:55 -05:00
parent 3226184a45
commit a040fdbd5b
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 23 additions and 0 deletions

View File

@ -9,6 +9,9 @@
st_race* CCharacterComponent::s_chrVarArray; st_race* CCharacterComponent::s_chrVarArray;
uint32_t CCharacterComponent::s_chrVarArrayLength; uint32_t CCharacterComponent::s_chrVarArrayLength;
EGxTexFormat CCharacterComponent::s_gxFormat;
uint32_t CCharacterComponent::s_mipLevels;
uint32_t CCharacterComponent::s_textureSize;
int32_t s_bInRenderPrep = 0; int32_t s_bInRenderPrep = 0;
char* s_pathEnd; char* s_pathEnd;
@ -35,6 +38,23 @@ void CCharacterComponent::Initialize(EGxTexFormat textureFormat, uint32_t textur
// TODO // 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(); CCharacterComponent::InitDbData();
// TODO // TODO

View File

@ -52,6 +52,9 @@ class CCharacterComponent {
// Static variables // Static variables
static st_race* s_chrVarArray; static st_race* s_chrVarArray;
static uint32_t s_chrVarArrayLength; static uint32_t s_chrVarArrayLength;
static EGxTexFormat s_gxFormat;
static uint32_t s_mipLevels;
static uint32_t s_textureSize;
// Static functions // Static functions
static CCharacterComponent* AllocComponent(); static CCharacterComponent* AllocComponent();