Remove Win32 byte counts from texture pack images

This commit is contained in:
notmatthewbeshay
2026-03-10 00:42:17 +11:00
parent 65dc775e84
commit 7bdf4c8ced
12 changed files with 113 additions and 105 deletions

View File

@@ -927,14 +927,14 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons()
// increment the count of the mash-up pack worlds in the save list
m_iMashUpButtonsC++;
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId());
DWORD dwImageBytes;
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes);
if(dwImageBytes > 0 && pbImageData)
if(imageBytes > 0 && imageData)
{
wchar_t imageName[64];
swprintf(imageName,64,L"tpack%08x",tp->getId());
registerSubstitutionTexture(imageName, pbImageData, dwImageBytes);
registerSubstitutionTexture(imageName, imageData, imageBytes);
m_buttonListSaves.setTextureName( m_buttonListSaves.getItemCount() - 1, imageName );
}
}
@@ -1691,8 +1691,8 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
TexturePack *tp = pMinecraft->skins->getTexturePackById(sessionInfo->data.texturePackParentId);
HRESULT hr;
DWORD dwImageBytes=0;
PBYTE pbImageData=NULL;
std::uint32_t imageBytes = 0;
uint8_t *imageData = NULL;
if(tp==NULL)
{
@@ -1701,20 +1701,22 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
app.GetTPD(sessionInfo->data.texturePackParentId,&pbData,&dwBytes);
// is it in the tpd data ?
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
if(dwImageBytes > 0 && pbImageData)
DWORD tpdImageBytes = 0;
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&imageData,&tpdImageBytes );
imageBytes = static_cast<std::uint32_t>(tpdImageBytes);
if(imageBytes > 0 && imageData)
{
swprintf(textureName,64,L"%ls",sessionInfo->displayLabel);
registerSubstitutionTexture(textureName,pbImageData,dwImageBytes);
registerSubstitutionTexture(textureName,imageData,imageBytes);
}
}
else
{
pbImageData = tp->getPackIcon(dwImageBytes);
if(dwImageBytes > 0 && pbImageData)
imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData)
{
swprintf(textureName,64,L"%ls",sessionInfo->displayLabel);
registerSubstitutionTexture(textureName,pbImageData,dwImageBytes);
registerSubstitutionTexture(textureName,imageData,imageBytes);
}
}
}
@@ -1724,13 +1726,13 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
Minecraft *pMinecraft = Minecraft::GetInstance();
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(0);
DWORD dwImageBytes;
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes);
if(dwImageBytes > 0 && pbImageData)
if(imageBytes > 0 && imageData)
{
swprintf(textureName,64,L"%ls",sessionInfo->displayLabel);
registerSubstitutionTexture(textureName,pbImageData,dwImageBytes);
registerSubstitutionTexture(textureName,imageData,imageBytes);
}
}