mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-07-30 06:22:24 +00:00
Remove Win32 byte counts from texture pack images
This commit is contained in:
parent
65dc775e84
commit
7bdf4c8ced
|
|
@ -29,14 +29,14 @@ void IUIScene_StartGame::HandleDLCMountingComplete()
|
||||||
{
|
{
|
||||||
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
wchar_t imageName[64];
|
wchar_t imageName[64];
|
||||||
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
||||||
registerSubstitutionTexture(imageName, pbImageData, dwImageBytes);
|
registerSubstitutionTexture(imageName, imageData, imageBytes);
|
||||||
m_texturePackList.addPack(i,imageName);
|
m_texturePackList.addPack(i,imageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -180,12 +180,12 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index)
|
||||||
m_labelTexturePackName.setLabel(tp->getName());
|
m_labelTexturePackName.setLabel(tp->getName());
|
||||||
m_labelTexturePackDescription.setLabel(tp->getDesc1());
|
m_labelTexturePackDescription.setLabel(tp->getDesc1());
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
//if(dwImageBytes > 0 && pbImageData)
|
//if(imageBytes > 0 && imageData)
|
||||||
//{
|
//{
|
||||||
// registerSubstitutionTexture(L"texturePackIcon", pbImageData, dwImageBytes);
|
// registerSubstitutionTexture(L"texturePackIcon", imageData, imageBytes);
|
||||||
// m_bitmapTexturePackIcon.setTextureName(L"texturePackIcon");
|
// m_bitmapTexturePackIcon.setTextureName(L"texturePackIcon");
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
@ -193,12 +193,12 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index)
|
||||||
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
||||||
m_bitmapTexturePackIcon.setTextureName(imageName);
|
m_bitmapTexturePackIcon.setTextureName(imageName);
|
||||||
|
|
||||||
pbImageData = tp->getPackComparison(dwImageBytes);
|
imageData = tp->getPackComparison(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
swprintf(imageName,64,L"texturePackComparison%08x",tp->getId());
|
swprintf(imageName,64,L"texturePackComparison%08x",tp->getId());
|
||||||
registerSubstitutionTexture(imageName, pbImageData, dwImageBytes);
|
registerSubstitutionTexture(imageName, imageData, imageBytes);
|
||||||
m_bitmapComparison.setTextureName(imageName);
|
m_bitmapComparison.setTextureName(imageName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -167,14 +167,14 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
|
||||||
{
|
{
|
||||||
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
wchar_t imageName[64];
|
wchar_t imageName[64];
|
||||||
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
||||||
registerSubstitutionTexture(imageName, pbImageData, dwImageBytes);
|
registerSubstitutionTexture(imageName, imageData, imageBytes);
|
||||||
m_texturePackList.addPack(i,imageName);
|
m_texturePackList.addPack(i,imageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -173,14 +173,14 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
|
||||||
|
|
||||||
// retrieve the save icon from the texture pack, if there is one
|
// retrieve the save icon from the texture pack, if there is one
|
||||||
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
wchar_t textureName[64];
|
wchar_t textureName[64];
|
||||||
swprintf(textureName,64,L"loadsave");
|
swprintf(textureName,64,L"loadsave");
|
||||||
registerSubstitutionTexture(textureName,pbImageData,dwImageBytes);
|
registerSubstitutionTexture(textureName,imageData,imageBytes);
|
||||||
m_bitmapIcon.setTextureName( textureName );
|
m_bitmapIcon.setTextureName( textureName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -259,14 +259,14 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
|
||||||
{
|
{
|
||||||
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
wchar_t imageName[64];
|
wchar_t imageName[64];
|
||||||
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
||||||
registerSubstitutionTexture(imageName, pbImageData, dwImageBytes);
|
registerSubstitutionTexture(imageName, imageData, imageBytes);
|
||||||
m_texturePackList.addPack(i,imageName);
|
m_texturePackList.addPack(i,imageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -927,14 +927,14 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons()
|
||||||
// increment the count of the mash-up pack worlds in the save list
|
// increment the count of the mash-up pack worlds in the save list
|
||||||
m_iMashUpButtonsC++;
|
m_iMashUpButtonsC++;
|
||||||
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId());
|
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId());
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
wchar_t imageName[64];
|
wchar_t imageName[64];
|
||||||
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
||||||
registerSubstitutionTexture(imageName, pbImageData, dwImageBytes);
|
registerSubstitutionTexture(imageName, imageData, imageBytes);
|
||||||
m_buttonListSaves.setTextureName( m_buttonListSaves.getItemCount() - 1, imageName );
|
m_buttonListSaves.setTextureName( m_buttonListSaves.getItemCount() - 1, imageName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1691,8 +1691,8 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
|
||||||
TexturePack *tp = pMinecraft->skins->getTexturePackById(sessionInfo->data.texturePackParentId);
|
TexturePack *tp = pMinecraft->skins->getTexturePackById(sessionInfo->data.texturePackParentId);
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
DWORD dwImageBytes=0;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData=NULL;
|
uint8_t *imageData = NULL;
|
||||||
|
|
||||||
if(tp==NULL)
|
if(tp==NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -1701,20 +1701,22 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
|
||||||
app.GetTPD(sessionInfo->data.texturePackParentId,&pbData,&dwBytes);
|
app.GetTPD(sessionInfo->data.texturePackParentId,&pbData,&dwBytes);
|
||||||
|
|
||||||
// is it in the tpd data ?
|
// is it in the tpd data ?
|
||||||
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
|
DWORD tpdImageBytes = 0;
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
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);
|
swprintf(textureName,64,L"%ls",sessionInfo->displayLabel);
|
||||||
registerSubstitutionTexture(textureName,pbImageData,dwImageBytes);
|
registerSubstitutionTexture(textureName,imageData,imageBytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pbImageData = tp->getPackIcon(dwImageBytes);
|
imageData = tp->getPackIcon(imageBytes);
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
swprintf(textureName,64,L"%ls",sessionInfo->displayLabel);
|
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();
|
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||||
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(0);
|
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(0);
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
swprintf(textureName,64,L"%ls",sessionInfo->displayLabel);
|
swprintf(textureName,64,L"%ls",sessionInfo->displayLabel);
|
||||||
registerSubstitutionTexture(textureName,pbImageData,dwImageBytes);
|
registerSubstitutionTexture(textureName,imageData,imageBytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,12 +130,12 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl
|
||||||
|
|
||||||
// retrieve the save icon from the texture pack, if there is one
|
// retrieve the save icon from the texture pack, if there is one
|
||||||
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
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
|
// 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));
|
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
|
||||||
|
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
ListInfo.fEnabled = TRUE;
|
ListInfo.fEnabled = TRUE;
|
||||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
||||||
|
|
@ -297,7 +297,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl
|
||||||
OutputDebugStringW(tp->getName().c_str());
|
OutputDebugStringW(tp->getName().c_str());
|
||||||
app.DebugPrintf(", sort index - %d\n",ListInfo.iSortIndex);
|
app.DebugPrintf(", sort index - %d\n",ListInfo.iSortIndex);
|
||||||
#endif
|
#endif
|
||||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
|
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&ListInfo.hXuiBrush);
|
||||||
|
|
||||||
m_pTexturePacksList->AddData(ListInfo,0,CXuiCtrl4JList::eSortList_Index);
|
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_texturePackTitle.SetText(tp->getName().c_str());
|
||||||
m_texturePackDescription.SetText(tp->getDesc1().c_str());
|
m_texturePackDescription.SetText(tp->getDesc1().c_str());
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
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);
|
m_texturePackIcon->UseBrush(m_hTexturePackIconBrush);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1293,11 +1293,11 @@ void CScene_LoadGameSettings::UpdateTexturePackDescription(int index)
|
||||||
m_texturePackIcon->UseBrush(NULL);
|
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);
|
m_texturePackComparison->UseBrush(m_hTexturePackComparisonBrush);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1532,13 +1532,13 @@ HRESULT CScene_LoadGameSettings::OnCustomMessage_DLCMountingComplete()
|
||||||
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
||||||
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
|
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
ListInfo.fEnabled = TRUE;
|
ListInfo.fEnabled = TRUE;
|
||||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
|
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&ListInfo.hXuiBrush);
|
||||||
|
|
||||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
||||||
if(pDLCTexPack)
|
if(pDLCTexPack)
|
||||||
|
|
|
||||||
|
|
@ -184,10 +184,10 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||||
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
||||||
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
|
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
ListInfo.fEnabled = TRUE;
|
ListInfo.fEnabled = TRUE;
|
||||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
||||||
|
|
@ -213,7 +213,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
||||||
app.DebugPrintf(", sort index - %d\n",ListInfo.iSortIndex);
|
app.DebugPrintf(", sort index - %d\n",ListInfo.iSortIndex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
|
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&ListInfo.hXuiBrush);
|
||||||
|
|
||||||
m_pTexturePacksList->AddData(ListInfo,0,CXuiCtrl4JList::eSortList_Index);
|
m_pTexturePacksList->AddData(ListInfo,0,CXuiCtrl4JList::eSortList_Index);
|
||||||
}
|
}
|
||||||
|
|
@ -1138,20 +1138,20 @@ void CScene_MultiGameCreate::UpdateTexturePackDescription(int index)
|
||||||
m_texturePackTitle.SetText(tp->getName().c_str());
|
m_texturePackTitle.SetText(tp->getName().c_str());
|
||||||
m_texturePackDescription.SetText(tp->getDesc1().c_str());
|
m_texturePackDescription.SetText(tp->getDesc1().c_str());
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
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);
|
m_texturePackIcon->UseBrush(m_hTexturePackIconBrush);
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
m_texturePackComparison->UseBrush(m_hTexturePackComparisonBrush);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1287,13 +1287,13 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete()
|
||||||
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
||||||
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
|
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
|
||||||
|
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
ListInfo.fEnabled = TRUE;
|
ListInfo.fEnabled = TRUE;
|
||||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush);
|
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&ListInfo.hXuiBrush);
|
||||||
|
|
||||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
||||||
if(pDLCTexPack)
|
if(pDLCTexPack)
|
||||||
|
|
|
||||||
|
|
@ -295,13 +295,13 @@ void CScene_MultiGameJoinLoad::AddDefaultButtons()
|
||||||
// increment the count of the mash-up pack worlds in the save list
|
// increment the count of the mash-up pack worlds in the save list
|
||||||
m_iMashUpButtonsC++;
|
m_iMashUpButtonsC++;
|
||||||
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId());
|
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId());
|
||||||
DWORD dwImageBytes;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData = tp->getPackIcon(dwImageBytes);
|
uint8_t *imageData = tp->getPackIcon(imageBytes);
|
||||||
HXUIBRUSH hXuiBrush;
|
HXUIBRUSH hXuiBrush;
|
||||||
|
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush);
|
XuiCreateTextureBrushFromMemory(imageData,imageBytes,&hXuiBrush);
|
||||||
// the index inside the list item for this will be i+1 because they start at m_vListData.size(), so the first etry (tutorial) is 1
|
// the index inside the list item for this will be i+1 because they start at m_vListData.size(), so the first etry (tutorial) is 1
|
||||||
m_pSavesList->UpdateGraphic(iSavesListIndex+1,hXuiBrush);
|
m_pSavesList->UpdateGraphic(iSavesListIndex+1,hXuiBrush);
|
||||||
}
|
}
|
||||||
|
|
@ -1270,8 +1270,8 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
||||||
TexturePack *tp = pMinecraft->skins->getTexturePackById(sessionInfo->data.texturePackParentId);
|
TexturePack *tp = pMinecraft->skins->getTexturePackById(sessionInfo->data.texturePackParentId);
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
DWORD dwImageBytes=0;
|
std::uint32_t imageBytes = 0;
|
||||||
PBYTE pbImageData=NULL;
|
uint8_t *imageData = NULL;
|
||||||
|
|
||||||
if(tp==NULL)
|
if(tp==NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -1280,19 +1280,21 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
|
||||||
app.GetTPD(sessionInfo->data.texturePackParentId,&pbData,&dwBytes);
|
app.GetTPD(sessionInfo->data.texturePackParentId,&pbData,&dwBytes);
|
||||||
|
|
||||||
// is it in the tpd data ?
|
// is it in the tpd data ?
|
||||||
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
|
DWORD tpdImageBytes = 0;
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&imageData,&tpdImageBytes );
|
||||||
|
imageBytes = static_cast<std::uint32_t>(tpdImageBytes);
|
||||||
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush);
|
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&hXuiBrush);
|
||||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pbImageData = tp->getPackIcon(dwImageBytes);
|
imageData = tp->getPackIcon(imageBytes);
|
||||||
if(dwImageBytes > 0 && pbImageData)
|
if(imageBytes > 0 && imageData)
|
||||||
{
|
{
|
||||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush);
|
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&hXuiBrush);
|
||||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ void AbstractTexturePack::loadIcon()
|
||||||
|
|
||||||
UINT size = 0;
|
UINT size = 0;
|
||||||
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size);
|
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size);
|
||||||
m_iconSize = size;
|
m_iconSize = static_cast<std::uint32_t>(size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ void AbstractTexturePack::loadComparison()
|
||||||
|
|
||||||
UINT size = 0;
|
UINT size = 0;
|
||||||
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_comparisonData, &size);
|
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_comparisonData, &size);
|
||||||
m_comparisonSize = size;
|
m_comparisonSize = static_cast<std::uint32_t>(size);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -373,18 +373,18 @@ std::wstring AbstractTexturePack::getXuiRootPath()
|
||||||
return szResourceLocator;
|
return szResourceLocator;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *AbstractTexturePack::getPackIcon(DWORD &dwImageBytes)
|
uint8_t *AbstractTexturePack::getPackIcon(std::uint32_t &imageBytes)
|
||||||
{
|
{
|
||||||
if(m_iconSize == 0 || m_iconData == NULL) loadIcon();
|
if(m_iconSize == 0 || m_iconData == NULL) loadIcon();
|
||||||
dwImageBytes = m_iconSize;
|
imageBytes = m_iconSize;
|
||||||
return m_iconData;
|
return m_iconData;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *AbstractTexturePack::getPackComparison(DWORD &dwImageBytes)
|
uint8_t *AbstractTexturePack::getPackComparison(std::uint32_t &imageBytes)
|
||||||
{
|
{
|
||||||
if(m_comparisonSize == 0 || m_comparisonData == NULL) loadComparison();
|
if(m_comparisonSize == 0 || m_comparisonData == NULL) loadComparison();
|
||||||
|
|
||||||
dwImageBytes = m_comparisonSize;
|
imageBytes = m_comparisonSize;
|
||||||
return m_comparisonData;
|
return m_comparisonData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@ protected:
|
||||||
std::wstring desc2;
|
std::wstring desc2;
|
||||||
|
|
||||||
uint8_t *m_iconData;
|
uint8_t *m_iconData;
|
||||||
DWORD m_iconSize;
|
std::uint32_t m_iconSize;
|
||||||
|
|
||||||
uint8_t *m_comparisonData;
|
uint8_t *m_comparisonData;
|
||||||
DWORD m_comparisonSize;
|
std::uint32_t m_comparisonSize;
|
||||||
|
|
||||||
TexturePack *fallback;
|
TexturePack *fallback;
|
||||||
|
|
||||||
|
|
@ -84,8 +84,8 @@ public:
|
||||||
virtual void loadUI();
|
virtual void loadUI();
|
||||||
virtual void unloadUI();
|
virtual void unloadUI();
|
||||||
virtual std::wstring getXuiRootPath();
|
virtual std::wstring getXuiRootPath();
|
||||||
virtual uint8_t *getPackIcon(DWORD &dwImageBytes);
|
virtual uint8_t *getPackIcon(std::uint32_t &imageBytes);
|
||||||
virtual uint8_t *getPackComparison(DWORD &dwImageBytes);
|
virtual uint8_t *getPackComparison(std::uint32_t &imageBytes);
|
||||||
virtual unsigned int getDLCParentPackId();
|
virtual unsigned int getDLCParentPackId();
|
||||||
virtual unsigned char getDLCSubPackId();
|
virtual unsigned char getDLCSubPackId();
|
||||||
virtual ColourTable *getColourTable() { return m_colourTable; }
|
virtual ColourTable *getColourTable() { return m_colourTable; }
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,9 @@ void DLCTexturePack::loadIcon()
|
||||||
if(m_dlcInfoPack->doesPackContainFile(DLCManager::e_DLCType_Texture, L"icon.png"))
|
if(m_dlcInfoPack->doesPackContainFile(DLCManager::e_DLCType_Texture, L"icon.png"))
|
||||||
{
|
{
|
||||||
DLCTextureFile *textureFile = (DLCTextureFile *)m_dlcInfoPack->getFile(DLCManager::e_DLCType_Texture, L"icon.png");
|
DLCTextureFile *textureFile = (DLCTextureFile *)m_dlcInfoPack->getFile(DLCManager::e_DLCType_Texture, L"icon.png");
|
||||||
m_iconData = textureFile->getData(m_iconSize);
|
DWORD iconSize = 0;
|
||||||
|
m_iconData = textureFile->getData(iconSize);
|
||||||
|
m_iconSize = static_cast<std::uint32_t>(iconSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -99,7 +101,9 @@ void DLCTexturePack::loadComparison()
|
||||||
if(m_dlcInfoPack->doesPackContainFile(DLCManager::e_DLCType_Texture, L"comparison.png"))
|
if(m_dlcInfoPack->doesPackContainFile(DLCManager::e_DLCType_Texture, L"comparison.png"))
|
||||||
{
|
{
|
||||||
DLCTextureFile *textureFile = (DLCTextureFile *)m_dlcInfoPack->getFile(DLCManager::e_DLCType_Texture, L"comparison.png");
|
DLCTextureFile *textureFile = (DLCTextureFile *)m_dlcInfoPack->getFile(DLCManager::e_DLCType_Texture, L"comparison.png");
|
||||||
m_comparisonData = textureFile->getData(m_comparisonSize);
|
DWORD comparisonSize = 0;
|
||||||
|
m_comparisonData = textureFile->getData(comparisonSize);
|
||||||
|
m_comparisonSize = static_cast<std::uint32_t>(comparisonSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ void DefaultTexturePack::loadIcon()
|
||||||
{
|
{
|
||||||
byteArray ba = app.getArchiveFile(L"Graphics\\TexturePackIcon.png");
|
byteArray ba = app.getArchiveFile(L"Graphics\\TexturePackIcon.png");
|
||||||
m_iconData = ba.data;
|
m_iconData = ba.data;
|
||||||
m_iconSize = ba.length;
|
m_iconSize = static_cast<std::uint32_t>(ba.length);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,8 @@ public:
|
||||||
virtual void loadUI() = 0;
|
virtual void loadUI() = 0;
|
||||||
virtual void unloadUI() = 0;
|
virtual void unloadUI() = 0;
|
||||||
virtual std::wstring getXuiRootPath() = 0;
|
virtual std::wstring getXuiRootPath() = 0;
|
||||||
virtual uint8_t *getPackIcon(DWORD &dwImageBytes) = 0;
|
virtual uint8_t *getPackIcon(std::uint32_t &imageBytes) = 0;
|
||||||
virtual uint8_t *getPackComparison(DWORD &dwImageBytes) = 0;
|
virtual uint8_t *getPackComparison(std::uint32_t &imageBytes) = 0;
|
||||||
virtual unsigned int getDLCParentPackId() = 0;
|
virtual unsigned int getDLCParentPackId() = 0;
|
||||||
virtual unsigned char getDLCSubPackId() = 0;
|
virtual unsigned char getDLCSubPackId() = 0;
|
||||||
virtual ColourTable *getColourTable() = 0;
|
virtual ColourTable *getColourTable() = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue