mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(component): set up component base texture in character model
This commit is contained in:
parent
5e6bdc78f6
commit
8b418a68b1
@ -14,6 +14,7 @@ uint32_t CCharacterComponent::s_chrVarArrayLength;
|
|||||||
EGxTexFormat CCharacterComponent::s_gxFormat;
|
EGxTexFormat CCharacterComponent::s_gxFormat;
|
||||||
uint32_t CCharacterComponent::s_mipLevels;
|
uint32_t CCharacterComponent::s_mipLevels;
|
||||||
MipBits* CCharacterComponent::s_textureBuffer;
|
MipBits* CCharacterComponent::s_textureBuffer;
|
||||||
|
MipBits* CCharacterComponent::s_textureBufferCompressed;
|
||||||
uint32_t CCharacterComponent::s_textureSize;
|
uint32_t CCharacterComponent::s_textureSize;
|
||||||
|
|
||||||
int32_t s_bInRenderPrep = 0;
|
int32_t s_bInRenderPrep = 0;
|
||||||
@ -80,7 +81,42 @@ void CCharacterComponent::InitDbData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
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) {
|
||||||
// TODO
|
auto component = static_cast<CCharacterComponent*>(userArg);
|
||||||
|
|
||||||
|
switch(cmd) {
|
||||||
|
case GxTex_Lock: {
|
||||||
|
if (!s_bInRenderPrep) {
|
||||||
|
component->RenderPrepAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case GxTex_Latch: {
|
||||||
|
if (component->m_textureFormat == GxTex_Dxt1) {
|
||||||
|
// TODO
|
||||||
|
STORM_ASSERT(false);
|
||||||
|
} else {
|
||||||
|
texelStrideInBytes = 4 * width;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO conditional check on some member of component
|
||||||
|
|
||||||
|
auto buffer = component->m_textureFormat == GxTex_Dxt1
|
||||||
|
? CCharacterComponent::s_textureBufferCompressed
|
||||||
|
: CCharacterComponent::s_textureBuffer;
|
||||||
|
|
||||||
|
texels = buffer[mipLevel].mip[0];
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO unknown command
|
||||||
|
case 3: {
|
||||||
|
// TODO
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCharacterComponent::CreateBaseTexture() {
|
void CCharacterComponent::CreateBaseTexture() {
|
||||||
@ -107,7 +143,7 @@ void CCharacterComponent::CreateBaseTexture() {
|
|||||||
|
|
||||||
this->m_baseTexture = baseTexture;
|
this->m_baseTexture = baseTexture;
|
||||||
|
|
||||||
// TODO this->m_data->m_model->ReplaceTexture(1, this->m_baseTexture);
|
this->m_data.model->ReplaceTexture(1, this->m_baseTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCharacterComponent::GeosRenderPrep() {
|
void CCharacterComponent::GeosRenderPrep() {
|
||||||
@ -230,6 +266,10 @@ int32_t CCharacterComponent::RenderPrep(int32_t a2) {
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCharacterComponent::RenderPrepAll() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void CCharacterComponent::RenderPrepSections() {
|
void CCharacterComponent::RenderPrepSections() {
|
||||||
s_bInRenderPrep = 1;
|
s_bInRenderPrep = 1;
|
||||||
|
|
||||||
|
|||||||
@ -56,6 +56,7 @@ class CCharacterComponent {
|
|||||||
static EGxTexFormat s_gxFormat;
|
static EGxTexFormat s_gxFormat;
|
||||||
static uint32_t s_mipLevels;
|
static uint32_t s_mipLevels;
|
||||||
static MipBits* s_textureBuffer;
|
static MipBits* s_textureBuffer;
|
||||||
|
static MipBits* s_textureBufferCompressed;
|
||||||
static uint32_t s_textureSize;
|
static uint32_t s_textureSize;
|
||||||
|
|
||||||
// Static functions
|
// Static functions
|
||||||
@ -82,6 +83,7 @@ class CCharacterComponent {
|
|||||||
void LoadBaseVariation(COMPONENT_VARIATIONS sectionIndex, int32_t textureIndex, int32_t variationIndex, int32_t colorIndex, COMPONENT_SECTIONS section, const char* a7);
|
void LoadBaseVariation(COMPONENT_VARIATIONS sectionIndex, int32_t textureIndex, int32_t variationIndex, int32_t colorIndex, COMPONENT_SECTIONS section, const char* a7);
|
||||||
void PrepSections();
|
void PrepSections();
|
||||||
int32_t RenderPrep(int32_t a2);
|
int32_t RenderPrep(int32_t a2);
|
||||||
|
void RenderPrepAll();
|
||||||
void RenderPrepSections();
|
void RenderPrepSections();
|
||||||
void ReplaceExtraSkinTexture(const char* a2);
|
void ReplaceExtraSkinTexture(const char* a2);
|
||||||
void SetFace(int32_t faceID, bool a3, const char* a4);
|
void SetFace(int32_t faceID, bool a3, const char* a4);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user