From 4c9eca2d0c0a0f370440acbc24447d7e3c6501e9 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sat, 13 Dec 2025 11:52:12 -0600 Subject: [PATCH] fix(component): correct mip pointer handling in CCharacterComponent paste functions --- src/component/CCharacterComponent.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index 632f26a..65a99d1 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -544,7 +544,7 @@ void CCharacterComponent::PasteOpaque(void* srcTexture, const BlpPalPixel* srcPa auto srcMip = TextureCacheGetMip(srcTexture, curMipLevel); auto srcRow = &srcMip[(curSrcPos.y * curSrcWidth) + curSrcPos.x]; - auto dstMip = reinterpret_cast(dstMips[curMipLevel + dstMipLevelOfs].mip[0]); + auto dstMip = reinterpret_cast(dstMips->mip[curMipLevel + dstMipLevelOfs]); auto dstRow = &dstMip[(curDstPos.y * curDstWidth) + (curDstPos.x * 4)]; // Calculate the end of the source region @@ -640,7 +640,7 @@ void CCharacterComponent::PasteTransparent1Bit(void* srcTexture, const BlpPalPix auto srcRow = &srcMip[(curSrcPos.y * curSrcWidth) + curSrcPos.x]; auto srcAlphaRow = &srcMip[(curSrcWidth * curSrcHeight) + ((curSrcPos.y * curSrcWidth) + curSrcPos.x) / 8]; - auto dstMip = reinterpret_cast(dstMips[curMipLevel + dstMipLevelOfs].mip[0]); + auto dstMip = reinterpret_cast(dstMips->mip[curMipLevel + dstMipLevelOfs]); auto dstRow = &dstMip[(curDstPos.y * curDstWidth) + (curDstPos.x * 4)]; // Calculate the end of the source region @@ -714,7 +714,7 @@ void CCharacterComponent::PasteTransparent8Bit(void* srcTexture, const BlpPalPix auto srcRow = &srcMip[(curSrcPos.y * curSrcWidth) + curSrcPos.x]; auto srcAlphaRow = &srcMip[(curSrcWidth * curSrcHeight) + (curSrcPos.y * curSrcWidth) + curSrcPos.x]; - auto dstMip = reinterpret_cast(dstMips[curMipLevel + dstMipLevelOfs].mip[0]); + auto dstMip = reinterpret_cast(dstMips->mip[curMipLevel + dstMipLevelOfs]); auto dstRow = &dstMip[(curDstPos.y * curDstWidth) + (curDstPos.x * 4)]; // Calculate the end of the source region @@ -810,7 +810,7 @@ void CCharacterComponent::UpdateBaseTexture(EGxTexCommand cmd, uint32_t width, u ? CCharacterComponent::s_textureBufferCompressed : CCharacterComponent::s_textureBuffer; - texels = buffer[mipLevel].mip[0]; + texels = buffer->mip[mipLevel]; break; }