mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(component): set up texture format and size in CCharacterComponent::Initialize
This commit is contained in:
parent
3226184a45
commit
a040fdbd5b
@ -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
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user