mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(component): implement CCharacterComponent::Paste
This commit is contained in:
parent
15deaf2ce0
commit
bccfec9f14
@ -117,8 +117,85 @@ 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 srcMipLevel) {
|
void CCharacterComponent::Paste(void* srcTexture, MipBits* dstMips, const C2iVector& dstPos, const C2iVector& srcPos, const C2iVector& srcSize, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel) {
|
||||||
// TODO
|
uint32_t dstStride = CCharacterComponent::s_textureSize * 4;
|
||||||
|
auto srcPal = TextureCacheGetPal(srcTexture);
|
||||||
|
|
||||||
|
if (!srcPal) {
|
||||||
|
// TODO fill in with crappy green (0x00FF00FF)
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (srcInfo.alphaSize) {
|
||||||
|
case 0:
|
||||||
|
CCharacterComponent::PasteOpaque(
|
||||||
|
srcTexture,
|
||||||
|
srcPal,
|
||||||
|
dstMips,
|
||||||
|
dstPos,
|
||||||
|
dstStride,
|
||||||
|
srcPos,
|
||||||
|
srcSize,
|
||||||
|
srcInfo,
|
||||||
|
srcMipLevel,
|
||||||
|
-srcMipLevel
|
||||||
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
CCharacterComponent::PasteTransparent1Bit(
|
||||||
|
srcTexture,
|
||||||
|
srcPal,
|
||||||
|
dstMips,
|
||||||
|
dstPos,
|
||||||
|
dstStride,
|
||||||
|
srcPos,
|
||||||
|
srcSize,
|
||||||
|
srcInfo,
|
||||||
|
srcMipLevel,
|
||||||
|
-srcMipLevel
|
||||||
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
CCharacterComponent::PasteTransparent4Bit(
|
||||||
|
srcTexture,
|
||||||
|
srcPal,
|
||||||
|
dstMips,
|
||||||
|
dstPos,
|
||||||
|
dstStride,
|
||||||
|
srcPos,
|
||||||
|
srcSize,
|
||||||
|
srcInfo,
|
||||||
|
srcMipLevel,
|
||||||
|
-srcMipLevel
|
||||||
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
CCharacterComponent::PasteTransparent8Bit(
|
||||||
|
srcTexture,
|
||||||
|
srcPal,
|
||||||
|
dstMips,
|
||||||
|
dstPos,
|
||||||
|
dstStride,
|
||||||
|
srcPos,
|
||||||
|
srcSize,
|
||||||
|
srcInfo,
|
||||||
|
srcMipLevel,
|
||||||
|
-srcMipLevel
|
||||||
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Do nothing
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCharacterComponent::PasteFromSkin(COMPONENT_SECTIONS section, void* srcTexture, MipBits* dstMips) {
|
void CCharacterComponent::PasteFromSkin(COMPONENT_SECTIONS section, void* srcTexture, MipBits* dstMips) {
|
||||||
@ -149,10 +226,26 @@ void CCharacterComponent::PasteFromSkin(COMPONENT_SECTIONS section, void* srcTex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCharacterComponent::PasteOpaque(void* srcTexture, const BlpPalPixel* srcPal, MipBits* dstMips, const C2iVector& dstPos, uint32_t dstStride, const C2iVector& srcPos, const C2iVector& srcSize, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel, int32_t dstMipLevelOfs) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void CCharacterComponent::PasteScale(void* srcTexture, MipBits* dstMips, const C2iVector& a3, const C2iVector& a4, const C2iVector& a5, TCTEXTUREINFO& srcInfo) {
|
void CCharacterComponent::PasteScale(void* srcTexture, MipBits* dstMips, const C2iVector& a3, const C2iVector& a4, const C2iVector& a5, TCTEXTUREINFO& srcInfo) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCharacterComponent::PasteTransparent1Bit(void* srcTexture, const BlpPalPixel* srcPal, MipBits* dstMips, const C2iVector& dstPos, uint32_t dstStride, const C2iVector& srcPos, const C2iVector& srcSize, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel, int32_t dstMipLevelOfs) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCharacterComponent::PasteTransparent4Bit(void* srcTexture, const BlpPalPixel* srcPal, MipBits* dstMips, const C2iVector& dstPos, uint32_t dstStride, const C2iVector& srcPos, const C2iVector& srcSize, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel, int32_t dstMipLevelOfs) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void CCharacterComponent::PasteTransparent8Bit(void* srcTexture, const BlpPalPixel* srcPal, MipBits* dstMips, const C2iVector& dstPos, uint32_t dstStride, const C2iVector& srcPos, const C2iVector& srcSize, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel, int32_t dstMipLevelOfs) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void CCharacterComponent::RenderPrepAL(CCharacterComponent* component) {
|
void CCharacterComponent::RenderPrepAL(CCharacterComponent* component) {
|
||||||
auto skin = component->m_texture[TEXTURE_INDEX(VARIATION_SKIN, 0)];
|
auto skin = component->m_texture[TEXTURE_INDEX(VARIATION_SKIN, 0)];
|
||||||
CCharacterComponent::PasteFromSkin(SECTION_ARM_LOWER, skin, CCharacterComponent::s_textureBuffer);
|
CCharacterComponent::PasteFromSkin(SECTION_ARM_LOWER, skin, CCharacterComponent::s_textureBuffer);
|
||||||
|
|||||||
@ -11,6 +11,7 @@ class CCharacterComponent;
|
|||||||
class CharSectionsRec;
|
class CharSectionsRec;
|
||||||
class CM2Model;
|
class CM2Model;
|
||||||
|
|
||||||
|
struct BlpPalPixel;
|
||||||
struct MipBits;
|
struct MipBits;
|
||||||
struct st_race;
|
struct st_race;
|
||||||
struct TCTEXTUREINFO;
|
struct TCTEXTUREINFO;
|
||||||
@ -89,7 +90,11 @@ class CCharacterComponent {
|
|||||||
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 srcMipLevel);
|
static void Paste(void* srcTexture, MipBits* dstMips, const C2iVector& a3, const C2iVector& a4, const C2iVector& a5, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel);
|
||||||
static void PasteFromSkin(COMPONENT_SECTIONS section, void* srcTexture, MipBits* dstMips);
|
static void PasteFromSkin(COMPONENT_SECTIONS section, void* srcTexture, MipBits* dstMips);
|
||||||
|
static void PasteOpaque(void* srcTexture, const BlpPalPixel* srcPal, MipBits* dstMips, const C2iVector& dstPos, uint32_t dstStride, const C2iVector& srcPos, const C2iVector& srcSize, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel, int32_t dstMipLevelOfs);
|
||||||
static void PasteScale(void* srcTexture, MipBits* dstMips, const C2iVector& a3, const C2iVector& a4, const C2iVector& a5, TCTEXTUREINFO& srcInfo);
|
static void PasteScale(void* srcTexture, MipBits* dstMips, const C2iVector& a3, const C2iVector& a4, const C2iVector& a5, TCTEXTUREINFO& srcInfo);
|
||||||
|
static void PasteTransparent1Bit(void* srcTexture, const BlpPalPixel* srcPal, MipBits* dstMips, const C2iVector& dstPos, uint32_t dstStride, const C2iVector& srcPos, const C2iVector& srcSize, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel, int32_t dstMipLevelOfs);
|
||||||
|
static void PasteTransparent4Bit(void* srcTexture, const BlpPalPixel* srcPal, MipBits* dstMips, const C2iVector& dstPos, uint32_t dstStride, const C2iVector& srcPos, const C2iVector& srcSize, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel, int32_t dstMipLevelOfs);
|
||||||
|
static void PasteTransparent8Bit(void* srcTexture, const BlpPalPixel* srcPal, MipBits* dstMips, const C2iVector& dstPos, uint32_t dstStride, const C2iVector& srcPos, const C2iVector& srcSize, TCTEXTUREINFO& srcInfo, int32_t srcMipLevel, int32_t dstMipLevelOfs);
|
||||||
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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user