Use standard buffer types for in-memory TPD data

This commit is contained in:
notmatthewbeshay 2026-03-10 19:56:26 +11:00
parent 37aa3463be
commit 5f991ccd6a
8 changed files with 28 additions and 22 deletions

View file

@ -5426,7 +5426,7 @@ void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **
LeaveCriticalSection(&csMemFilesLock); LeaveCriticalSection(&csMemFilesLock);
} }
void CMinecraftApp::AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes) void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int dwBytes)
{ {
EnterCriticalSection(&csMemTPDLock); EnterCriticalSection(&csMemTPDLock);
// check it's not already in // check it's not already in
@ -5515,7 +5515,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig)
return val; return val;
} }
void CMinecraftApp::GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes) void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pdwBytes)
{ {
EnterCriticalSection(&csMemTPDLock); EnterCriticalSection(&csMemTPDLock);
AUTO_VAR(it, m_MEM_TPD.find(iConfig)); AUTO_VAR(it, m_MEM_TPD.find(iConfig));

View file

@ -347,10 +347,10 @@ public:
bool IsFileInMemoryTextures(const std::wstring &wName); bool IsFileInMemoryTextures(const std::wstring &wName);
// Texture Pack Data files (icon, banner, comparison shot & text) // Texture Pack Data files (icon, banner, comparison shot & text)
void AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes); void AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int dwBytes);
void RemoveMemoryTPDFile(int iConfig); void RemoveMemoryTPDFile(int iConfig);
bool IsFileInTPD(int iConfig); bool IsFileInTPD(int iConfig);
void GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes); void GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pdwBytes);
int GetTPDSize() {return m_MEM_TPD.size();} int GetTPDSize() {return m_MEM_TPD.size();}
#ifndef __PS3__ #ifndef __PS3__
int GetTPConfigVal(WCHAR *pwchDataFile); int GetTPConfigVal(WCHAR *pwchDataFile);

View file

@ -140,8 +140,10 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index)
#if TO_BE_IMPLEMENTED #if TO_BE_IMPLEMENTED
// this is probably a texture pack icon added from TMS // this is probably a texture pack icon added from TMS
DWORD dwBytes=0,dwFileBytes=0; unsigned int dwBytes=0;
PBYTE pbData=NULL,pbFileData=NULL; DWORD dwFileBytes=0;
std::uint8_t *pbData=NULL;
PBYTE pbFileData=NULL;
CXuiCtrl4JList::LIST_ITEM_INFO ListItem; CXuiCtrl4JList::LIST_ITEM_INFO ListItem;
// get the current index of the list, and then get the data // get the current index of the list, and then get the data

View file

@ -708,8 +708,8 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id)
{ {
if(m_iConfigA[i]!=-1) if(m_iConfigA[i]!=-1)
{ {
DWORD dwBytes=0; unsigned int dwBytes=0;
PBYTE pbData=NULL; std::uint8_t *pbData=NULL;
//app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]); //app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]);
app.GetTPD(m_iConfigA[i],&pbData,&dwBytes); app.GetTPD(m_iConfigA[i],&pbData,&dwBytes);

View file

@ -1696,8 +1696,8 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
if(tp==NULL) if(tp==NULL)
{ {
DWORD dwBytes=0; unsigned int dwBytes=0;
PBYTE pbData=NULL; std::uint8_t *pbData=NULL;
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 ?

View file

@ -783,8 +783,8 @@ HRESULT CScene_LoadGameSettings::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandle
{ {
if(m_iConfigA[i]!=-1) if(m_iConfigA[i]!=-1)
{ {
DWORD dwBytes=0; unsigned int dwBytes=0;
PBYTE pbData=NULL; std::uint8_t *pbData=NULL;
app.GetTPD(m_iConfigA[i],&pbData,&dwBytes); app.GetTPD(m_iConfigA[i],&pbData,&dwBytes);
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
@ -1241,8 +1241,10 @@ void CScene_LoadGameSettings::UpdateTexturePackDescription(int index)
if(tp==NULL) if(tp==NULL)
{ {
// this is probably a texture pack icon added from TMS // this is probably a texture pack icon added from TMS
DWORD dwBytes=0,dwFileBytes=0; unsigned int dwBytes=0;
PBYTE pbData=NULL,pbFileData=NULL; DWORD dwFileBytes=0;
std::uint8_t *pbData=NULL;
PBYTE pbFileData=NULL;
CXuiCtrl4JList::LIST_ITEM_INFO ListItem; CXuiCtrl4JList::LIST_ITEM_INFO ListItem;
// get the current index of the list, and then get the data // get the current index of the list, and then get the data

View file

@ -705,8 +705,8 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled
{ {
if(m_iConfigA[i]!=-1) if(m_iConfigA[i]!=-1)
{ {
DWORD dwBytes=0; unsigned int dwBytes=0;
PBYTE pbData=NULL; std::uint8_t *pbData=NULL;
//app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]); //app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]);
app.GetTPD(m_iConfigA[i],&pbData,&dwBytes); app.GetTPD(m_iConfigA[i],&pbData,&dwBytes);
@ -1099,8 +1099,10 @@ void CScene_MultiGameCreate::UpdateTexturePackDescription(int index)
{ {
// this is probably a texture pack icon added from TMS // this is probably a texture pack icon added from TMS
DWORD dwBytes=0,dwFileBytes=0; unsigned int dwBytes=0;
PBYTE pbData=NULL,pbFileData=NULL; DWORD dwFileBytes=0;
std::uint8_t *pbData=NULL;
PBYTE pbFileData=NULL;
CXuiCtrl4JList::LIST_ITEM_INFO ListItem; CXuiCtrl4JList::LIST_ITEM_INFO ListItem;
// get the current index of the list, and then get the data // get the current index of the list, and then get the data

View file

@ -1275,8 +1275,8 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
if(tp==NULL) if(tp==NULL)
{ {
DWORD dwBytes=0; unsigned int dwBytes=0;
PBYTE pbData=NULL; std::uint8_t *pbData=NULL;
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 ?
@ -1744,8 +1744,8 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl
{ {
if(m_iConfigA[i]!=-1) if(m_iConfigA[i]!=-1)
{ {
DWORD dwBytes=0; unsigned int dwBytes=0;
PBYTE pbData=NULL; std::uint8_t *pbData=NULL;
//app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]); //app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]);
app.GetTPD(m_iConfigA[i],&pbData,&dwBytes); app.GetTPD(m_iConfigA[i],&pbData,&dwBytes);