feat(component): implement CCharacterComponent::PasteFromSkin

This commit is contained in:
fallenoak 2025-10-22 01:06:05 -05:00
parent 36ce090013
commit af887872d0
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 33 additions and 0 deletions

View File

@ -117,7 +117,37 @@ void CCharacterComponent::InitDbData() {
// TODO CountFacialFeatures(varArrayLength, &CCharacterComponent::s_characterFacialHairStylesList); // TODO CountFacialFeatures(varArrayLength, &CCharacterComponent::s_characterFacialHairStylesList);
} }
void CCharacterComponent::Paste(void* srcTexture, MipBits* dstMips, const C2iVector& a3, const C2iVector& a4, const C2iVector& a5, TCTEXTUREINFO& srcInfo, int32_t a7) {
// TODO
}
void CCharacterComponent::PasteFromSkin(COMPONENT_SECTIONS section, void* srcTexture, MipBits* dstMips) { void CCharacterComponent::PasteFromSkin(COMPONENT_SECTIONS section, void* srcTexture, MipBits* dstMips) {
if (!TextureCacheHasMips(srcTexture)) {
return;
}
auto& sectionInfo = CCharacterComponent::s_sectionInfo[section];
TCTEXTUREINFO srcInfo;
TextureCacheGetInfo(srcTexture, srcInfo, 1);
// Skin is always opaque
srcInfo.alphaSize = 0;
if (srcInfo.width >= CCharacterComponent::s_textureSize || srcInfo.height >= CCharacterComponent::s_textureSize ) {
int32_t levelDelta;
int32_t srcWidth = srcInfo.width;
for (levelDelta = 0; CCharacterComponent::s_textureSize < srcWidth; levelDelta++) {
srcWidth >>= 1;
}
CCharacterComponent::Paste(srcTexture, dstMips, sectionInfo.pos, sectionInfo.pos, sectionInfo.size, srcInfo, levelDelta);
} else {
CCharacterComponent::PasteScale(srcTexture, dstMips, sectionInfo.pos, sectionInfo.pos, sectionInfo.size, srcInfo);
}
}
void CCharacterComponent::PasteScale(void* srcTexture, MipBits* dstMips, const C2iVector& a3, const C2iVector& a4, const C2iVector& a5, TCTEXTUREINFO& srcInfo) {
// TODO // TODO
} }

View File

@ -13,6 +13,7 @@ class CM2Model;
struct MipBits; struct MipBits;
struct st_race; struct st_race;
struct TCTEXTUREINFO;
typedef void (PREP_FUNC)(CCharacterComponent* component); typedef void (PREP_FUNC)(CCharacterComponent* component);
@ -86,7 +87,9 @@ class CCharacterComponent {
static void RenderPrepLU(CCharacterComponent* component); static void RenderPrepLU(CCharacterComponent* component);
static void RenderPrepTL(CCharacterComponent* component); static void RenderPrepTL(CCharacterComponent* component);
static void RenderPrepTU(CCharacterComponent* component); static void RenderPrepTU(CCharacterComponent* component);
static void Paste(void* srcTexture, MipBits* dstMips, const C2iVector& a3, const C2iVector& a4, const C2iVector& a5, TCTEXTUREINFO& srcInfo, int32_t a7);
static void PasteFromSkin(COMPONENT_SECTIONS section, void* srcTexture, MipBits* dstMips); static void PasteFromSkin(COMPONENT_SECTIONS section, void* srcTexture, MipBits* dstMips);
static void PasteScale(void* srcTexture, MipBits* dstMips, const C2iVector& a3, const C2iVector& a4, const C2iVector& a5, TCTEXTUREINFO& srcInfo);
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); 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 // Member variables