diff --git a/Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.cpp b/Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.cpp index 175e96362..59eab4f28 100644 --- a/Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.cpp +++ b/Minecraft.Client/Platform/Common/UI/IUIScene_StartGame.cpp @@ -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; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp index 32c1f8065..efa2cae05 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp @@ -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); } } diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp index 2382f5a5c..9febff710 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp @@ -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 \ No newline at end of file +#endif diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp index 034d55a4e..bbfd4ed0d 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -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(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); } } diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp index 987997a87..4695a769a 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp @@ -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; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp index 3aeb139cd..253f33807 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp @@ -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); -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp index b431a4f71..f60944386 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp @@ -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(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; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp b/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp index 26f2b8012..a70351355 100644 --- a/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp @@ -46,7 +46,7 @@ void AbstractTexturePack::loadIcon() UINT size = 0; HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size); - m_iconSize = size; + m_iconSize = static_cast(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(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; } diff --git a/Minecraft.Client/Textures/Packs/AbstractTexturePack.h b/Minecraft.Client/Textures/Packs/AbstractTexturePack.h index dec6d1362..7f6e23f2b 100644 --- a/Minecraft.Client/Textures/Packs/AbstractTexturePack.h +++ b/Minecraft.Client/Textures/Packs/AbstractTexturePack.h @@ -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; } diff --git a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp b/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp index afae70edf..b0a958d2a 100644 --- a/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/DLCTexturePack.cpp @@ -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(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(comparisonSize); } } diff --git a/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp b/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp index 62418287b..7f49ed7cd 100644 --- a/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/DefaultTexturePack.cpp @@ -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(ba.length); } #endif } diff --git a/Minecraft.Client/Textures/Packs/TexturePack.h b/Minecraft.Client/Textures/Packs/TexturePack.h index 2bd1b0364..a5954c77e 100644 --- a/Minecraft.Client/Textures/Packs/TexturePack.h +++ b/Minecraft.Client/Textures/Packs/TexturePack.h @@ -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;