mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-26 15:53:36 +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);
|
||||
|
||||
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_texturePackList.addPack(i,imageName);
|
||||
}
|
||||
}
|
||||
|
|
@ -180,12 +180,12 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index)
|
|||
m_labelTexturePackName.setLabel(tp->getName());
|
||||
m_labelTexturePackDescription.setLabel(tp->getDesc1());
|
||||
|
||||
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)
|
||||
//{
|
||||
// registerSubstitutionTexture(L"texturePackIcon", pbImageData, dwImageBytes);
|
||||
// registerSubstitutionTexture(L"texturePackIcon", imageData, imageBytes);
|
||||
// m_bitmapTexturePackIcon.setTextureName(L"texturePackIcon");
|
||||
//}
|
||||
|
||||
|
|
@ -193,12 +193,12 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index)
|
|||
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
||||
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());
|
||||
registerSubstitutionTexture(imageName, pbImageData, dwImageBytes);
|
||||
registerSubstitutionTexture(imageName, imageData, imageBytes);
|
||||
m_bitmapComparison.setTextureName(imageName);
|
||||
}
|
||||
else
|
||||
|
|
@ -376,4 +376,4 @@ int IUIScene_StartGame::TexturePackDialogReturned(void *pParam,int iPad,C4JStora
|
|||
#endif
|
||||
pClass->m_bIgnoreInput=false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,14 +167,14 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
|
|||
{
|
||||
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
||||
|
||||
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_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
|
||||
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)
|
||||
{
|
||||
wchar_t textureName[64];
|
||||
swprintf(textureName,64,L"loadsave");
|
||||
registerSubstitutionTexture(textureName,pbImageData,dwImageBytes);
|
||||
registerSubstitutionTexture(textureName,imageData,imageBytes);
|
||||
m_bitmapIcon.setTextureName( textureName );
|
||||
}
|
||||
}
|
||||
|
|
@ -259,14 +259,14 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
|
|||
{
|
||||
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
|
||||
|
||||
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_texturePackList.addPack(i,imageName);
|
||||
}
|
||||
}
|
||||
|
|
@ -1801,4 +1801,4 @@ int UIScene_LoadMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EM
|
|||
// pClass->m_bIgnoreInput=false;
|
||||
// return 0;
|
||||
// }
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,10 +184,10 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
|||
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;
|
||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp;
|
||||
|
|
@ -213,7 +213,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
|
|||
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);
|
||||
}
|
||||
|
|
@ -1138,20 +1138,20 @@ void CScene_MultiGameCreate::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);
|
||||
}
|
||||
|
||||
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
|
||||
|
|
@ -1287,13 +1287,13 @@ HRESULT CScene_MultiGameCreate::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)
|
||||
|
|
@ -1394,4 +1394,4 @@ void CScene_MultiGameCreate::ClearTexturePackDescription()
|
|||
m_texturePackDescription.SetText(L" ");
|
||||
m_texturePackComparison->UseBrush(NULL);
|
||||
m_texturePackIcon->UseBrush(NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,13 +295,13 @@ void CScene_MultiGameJoinLoad::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);
|
||||
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
|
||||
m_pSavesList->UpdateGraphic(iSavesListIndex+1,hXuiBrush);
|
||||
}
|
||||
|
|
@ -1270,8 +1270,8 @@ void CScene_MultiGameJoinLoad::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)
|
||||
{
|
||||
|
|
@ -1280,19 +1280,21 @@ void CScene_MultiGameJoinLoad::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)
|
||||
{
|
||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush);
|
||||
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&hXuiBrush);
|
||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pbImageData = tp->getPackIcon(dwImageBytes);
|
||||
if(dwImageBytes > 0 && pbImageData)
|
||||
imageData = tp->getPackIcon(imageBytes);
|
||||
if(imageBytes > 0 && imageData)
|
||||
{
|
||||
hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush);
|
||||
hr=XuiCreateTextureBrushFromMemory(imageData,imageBytes,&hXuiBrush);
|
||||
m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush);
|
||||
}
|
||||
}
|
||||
|
|
@ -2764,4 +2766,4 @@ void CScene_MultiGameJoinLoad::SaveUploadCompleteCallback(LPVOID lpParam)
|
|||
app.TMSPP_SetTitleGroupID(GROUP_ID);
|
||||
// app.getRemoteStorage()->abort();
|
||||
// pClass->m_eSaveUploadState = eSaveUpload_Idle;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ void AbstractTexturePack::loadIcon()
|
|||
|
||||
UINT size = 0;
|
||||
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size);
|
||||
m_iconSize = size;
|
||||
m_iconSize = static_cast<std::uint32_t>(size);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ void AbstractTexturePack::loadComparison()
|
|||
|
||||
UINT size = 0;
|
||||
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_comparisonData, &size);
|
||||
m_comparisonSize = size;
|
||||
m_comparisonSize = static_cast<std::uint32_t>(size);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -373,18 +373,18 @@ std::wstring AbstractTexturePack::getXuiRootPath()
|
|||
return szResourceLocator;
|
||||
}
|
||||
|
||||
uint8_t *AbstractTexturePack::getPackIcon(DWORD &dwImageBytes)
|
||||
uint8_t *AbstractTexturePack::getPackIcon(std::uint32_t &imageBytes)
|
||||
{
|
||||
if(m_iconSize == 0 || m_iconData == NULL) loadIcon();
|
||||
dwImageBytes = m_iconSize;
|
||||
imageBytes = m_iconSize;
|
||||
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();
|
||||
|
||||
dwImageBytes = m_comparisonSize;
|
||||
imageBytes = m_comparisonSize;
|
||||
return m_comparisonData;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ protected:
|
|||
std::wstring desc2;
|
||||
|
||||
uint8_t *m_iconData;
|
||||
DWORD m_iconSize;
|
||||
std::uint32_t m_iconSize;
|
||||
|
||||
uint8_t *m_comparisonData;
|
||||
DWORD m_comparisonSize;
|
||||
std::uint32_t m_comparisonSize;
|
||||
|
||||
TexturePack *fallback;
|
||||
|
||||
|
|
@ -84,8 +84,8 @@ public:
|
|||
virtual void loadUI();
|
||||
virtual void unloadUI();
|
||||
virtual std::wstring getXuiRootPath();
|
||||
virtual uint8_t *getPackIcon(DWORD &dwImageBytes);
|
||||
virtual uint8_t *getPackComparison(DWORD &dwImageBytes);
|
||||
virtual uint8_t *getPackIcon(std::uint32_t &imageBytes);
|
||||
virtual uint8_t *getPackComparison(std::uint32_t &imageBytes);
|
||||
virtual unsigned int getDLCParentPackId();
|
||||
virtual unsigned char getDLCSubPackId();
|
||||
virtual ColourTable *getColourTable() { return m_colourTable; }
|
||||
|
|
|
|||
|
|
@ -86,7 +86,9 @@ void DLCTexturePack::loadIcon()
|
|||
if(m_dlcInfoPack->doesPackContainFile(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
|
||||
{
|
||||
|
|
@ -99,7 +101,9 @@ void DLCTexturePack::loadComparison()
|
|||
if(m_dlcInfoPack->doesPackContainFile(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");
|
||||
m_iconData = ba.data;
|
||||
m_iconSize = ba.length;
|
||||
m_iconSize = static_cast<std::uint32_t>(ba.length);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ public:
|
|||
virtual void loadUI() = 0;
|
||||
virtual void unloadUI() = 0;
|
||||
virtual std::wstring getXuiRootPath() = 0;
|
||||
virtual uint8_t *getPackIcon(DWORD &dwImageBytes) = 0;
|
||||
virtual uint8_t *getPackComparison(DWORD &dwImageBytes) = 0;
|
||||
virtual uint8_t *getPackIcon(std::uint32_t &imageBytes) = 0;
|
||||
virtual uint8_t *getPackComparison(std::uint32_t &imageBytes) = 0;
|
||||
virtual unsigned int getDLCParentPackId() = 0;
|
||||
virtual unsigned char getDLCSubPackId() = 0;
|
||||
virtual ColourTable *getColourTable() = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue