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

@@ -130,12 +130,12 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl
// retrieve the save icon from the texture pack, if there is one
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
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)
{
XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&m_hXuiBrush);
XuiCreateTextureBrushFromMemory(imageData,imageBytes,&m_hXuiBrush);
}
// Set this level as created in creative mode, so that people can't use the themed worlds as an easy way to get achievements
@@ -270,10 +270,10 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
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)
{
ListInfo.fEnabled = TRUE;
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
@@ -297,7 +297,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl
OutputDebugStringW(tp->getName().c_str());
app.DebugPrintf(", sort index - %d\n",ListInfo.iSortIndex);
#endif
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&ListInfo.hXuiBrush);
m_pTexturePacksList->AddData(ListInfo,0,CXuiCtrl4JList::eSortList_Index);
}
@@ -1280,12 +1280,12 @@ void CScene_LoadGameSettings::UpdateTexturePackDescription(int index)
m_texturePackTitle.SetText(tp->getName().c_str());
m_texturePackDescription.SetText(tp->getDesc1().c_str());
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)
{
XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&m_hTexturePackIconBrush);
XuiCreateTextureBrushFromMemory(imageData,imageBytes,&m_hTexturePackIconBrush);
m_texturePackIcon->UseBrush(m_hTexturePackIconBrush);
}
else
@@ -1293,11 +1293,11 @@ void CScene_LoadGameSettings::UpdateTexturePackDescription(int index)
m_texturePackIcon->UseBrush(NULL);
}
pbImageData = tp->getPackComparison(dwImageBytes);
imageData = tp->getPackComparison(imageBytes);
if(dwImageBytes > 0 && pbImageData)
if(imageBytes > 0 && imageData)
{
XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&m_hTexturePackComparisonBrush);
XuiCreateTextureBrushFromMemory(imageData,imageBytes,&m_hTexturePackComparisonBrush);
m_texturePackComparison->UseBrush(m_hTexturePackComparisonBrush);
}
else
@@ -1532,13 +1532,13 @@ HRESULT CScene_LoadGameSettings::OnCustomMessage_DLCMountingComplete()
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
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)
{
ListInfo.fEnabled = TRUE;
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&ListInfo.hXuiBrush);
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
if(pDLCTexPack)
@@ -1683,4 +1683,4 @@ HRESULT CScene_LoadGameSettings::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled)
#endif
CXuiSceneBase::SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK, -1, -1,-1,-1,-1,iRB);
return S_OK;
}
}