mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 00:32: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;
|
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
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user