feat(component): initialize prep functions

This commit is contained in:
fallenoak 2025-10-21 20:47:41 -05:00
parent 8b418a68b1
commit d2dfa27f4a
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 66 additions and 0 deletions

View File

@ -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<CCharacterComponent*>(userArg);

View File

@ -6,12 +6,15 @@
#include <cstdint>
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