mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-23 11:42:27 +00:00
Rename misleading DWORD-style count parameters
This commit is contained in:
@@ -16,7 +16,7 @@ TMS_FILE;
|
||||
typedef struct
|
||||
{
|
||||
std::uint8_t *pbData;
|
||||
unsigned int dwBytes;
|
||||
unsigned int byteCount;
|
||||
std::uint8_t ucRefCount;
|
||||
}
|
||||
MEMDATA,*PMEMDATA;
|
||||
@@ -197,7 +197,7 @@ FEATURE_DATA;
|
||||
typedef struct
|
||||
{
|
||||
std::uint8_t *pBannedList;
|
||||
unsigned int dwBytes;
|
||||
unsigned int byteCount;
|
||||
}
|
||||
BANNEDLIST;
|
||||
|
||||
|
||||
@@ -5319,7 +5319,7 @@ bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid)
|
||||
return false;
|
||||
}
|
||||
|
||||
void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int dwBytes)
|
||||
void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int byteCount)
|
||||
{
|
||||
EnterCriticalSection(&csMemFilesLock);
|
||||
// check it's not already in
|
||||
@@ -5332,13 +5332,13 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t
|
||||
#endif
|
||||
pData = (*it).second;
|
||||
|
||||
if(pData->dwBytes == 0 && dwBytes != 0)
|
||||
if(pData->byteCount == 0 && byteCount != 0)
|
||||
{
|
||||
// This should never be NULL if dwBytes is 0
|
||||
// This should never be NULL if byteCount is 0
|
||||
if(pData->pbData!=NULL) delete [] pData->pbData;
|
||||
|
||||
pData->pbData=pbData;
|
||||
pData->dwBytes=dwBytes;
|
||||
pData->byteCount=byteCount;
|
||||
}
|
||||
|
||||
++pData->ucRefCount;
|
||||
@@ -5355,7 +5355,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t
|
||||
|
||||
pData = new MEMDATA();
|
||||
pData->pbData=pbData;
|
||||
pData->dwBytes=dwBytes;
|
||||
pData->byteCount=byteCount;
|
||||
pData->ucRefCount = 1;
|
||||
|
||||
// use the xuid to access the skin data
|
||||
@@ -5413,7 +5413,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const std::wstring &wName)
|
||||
return val;
|
||||
}
|
||||
|
||||
void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pdwBytes)
|
||||
void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pByteCount)
|
||||
{
|
||||
EnterCriticalSection(&csMemFilesLock);
|
||||
AUTO_VAR(it, m_MEM_Files.find(wName));
|
||||
@@ -5421,12 +5421,12 @@ void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **
|
||||
{
|
||||
PMEMDATA pData = (*it).second;
|
||||
*ppbData=pData->pbData;
|
||||
*pdwBytes=pData->dwBytes;
|
||||
*pByteCount=pData->byteCount;
|
||||
}
|
||||
LeaveCriticalSection(&csMemFilesLock);
|
||||
}
|
||||
|
||||
void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int dwBytes)
|
||||
void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int byteCount)
|
||||
{
|
||||
EnterCriticalSection(&csMemTPDLock);
|
||||
// check it's not already in
|
||||
@@ -5436,7 +5436,7 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned
|
||||
{
|
||||
pData = new MEMDATA();
|
||||
pData->pbData=pbData;
|
||||
pData->dwBytes=dwBytes;
|
||||
pData->byteCount=byteCount;
|
||||
pData->ucRefCount = 1;
|
||||
|
||||
m_MEM_TPD[iConfig]=pData;
|
||||
@@ -5514,7 +5514,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig)
|
||||
return val;
|
||||
}
|
||||
|
||||
void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pdwBytes)
|
||||
void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pByteCount)
|
||||
{
|
||||
EnterCriticalSection(&csMemTPDLock);
|
||||
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
|
||||
@@ -5522,7 +5522,7 @@ void CMinecraftApp::GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pd
|
||||
{
|
||||
PMEMDATA pData = (*it).second;
|
||||
*ppbData=pData->pbData;
|
||||
*pdwBytes=pData->dwBytes;
|
||||
*pByteCount=pData->byteCount;
|
||||
}
|
||||
LeaveCriticalSection(&csMemTPDLock);
|
||||
}
|
||||
@@ -8332,14 +8332,14 @@ int CMinecraftApp::TMSPPFileReturned(void *pParam,int iPad,int iUserData,C4JStor
|
||||
case e_DLC_TexturePackData:
|
||||
{
|
||||
// 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory
|
||||
std::uint8_t *pbData = new std::uint8_t[pFileData->dwSize];
|
||||
memcpy(pbData,pFileData->pbData,pFileData->dwSize);
|
||||
std::uint8_t *pbData = new std::uint8_t[pFileData->size];
|
||||
memcpy(pbData,pFileData->pbData,pFileData->size);
|
||||
|
||||
pClass->m_vTMSPPData.push_back(pbData);
|
||||
app.DebugPrintf("Got texturepack data\n");
|
||||
// get the config value for the texture pack
|
||||
int iConfig=app.GetTPConfigVal(pCurrent->wchFilename);
|
||||
app.AddMemoryTPDFile(iConfig, pbData, pFileData->dwSize);
|
||||
app.AddMemoryTPDFile(iConfig, pbData, pFileData->size);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -8347,12 +8347,12 @@ int CMinecraftApp::TMSPPFileReturned(void *pParam,int iPad,int iUserData,C4JStor
|
||||
if(pFileData->pbData[0]==0x89)
|
||||
{
|
||||
// 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory
|
||||
std::uint8_t *pbData = new std::uint8_t[pFileData->dwSize];
|
||||
memcpy(pbData,pFileData->pbData,pFileData->dwSize);
|
||||
std::uint8_t *pbData = new std::uint8_t[pFileData->size];
|
||||
memcpy(pbData,pFileData->pbData,pFileData->size);
|
||||
|
||||
pClass->m_vTMSPPData.push_back(pbData);
|
||||
app.DebugPrintf("Got image data - %ls\n",pCurrent->wchFilename);
|
||||
app.AddMemoryTextureFile(pCurrent->wchFilename, pbData, pFileData->dwSize);
|
||||
app.AddMemoryTextureFile(pCurrent->wchFilename, pbData, pFileData->size);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -8369,12 +8369,12 @@ int CMinecraftApp::TMSPPFileReturned(void *pParam,int iPad,int iUserData,C4JStor
|
||||
app.DebugPrintf("--- Got texturepack data %ls\n",pCurrent->wchFilename);
|
||||
// get the config value for the texture pack
|
||||
int iConfig=app.GetTPConfigVal(pCurrent->wchFilename);
|
||||
app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->dwSize);
|
||||
app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->size);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
app.DebugPrintf("--- Got image data - %ls\n",pCurrent->wchFilename);
|
||||
app.AddMemoryTextureFile(pCurrent->wchFilename, pFileData->pbData, pFileData->dwSize);
|
||||
app.AddMemoryTextureFile(pCurrent->wchFilename, pFileData->pbData, pFileData->size);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -341,16 +341,16 @@ public:
|
||||
bool isXuidNotch(PlayerUID xuid);
|
||||
bool isXuidDeadmau5(PlayerUID xuid);
|
||||
|
||||
void AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int dwBytes);
|
||||
void AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int byteCount);
|
||||
void RemoveMemoryTextureFile(const std::wstring &wName);
|
||||
void GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pdwBytes);
|
||||
void GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pByteCount);
|
||||
bool IsFileInMemoryTextures(const std::wstring &wName);
|
||||
|
||||
// Texture Pack Data files (icon, banner, comparison shot & text)
|
||||
void AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int dwBytes);
|
||||
void AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned int byteCount);
|
||||
void RemoveMemoryTPDFile(int iConfig);
|
||||
bool IsFileInTPD(int iConfig);
|
||||
void GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pdwBytes);
|
||||
void GetTPD(int iConfig, std::uint8_t **ppbData, unsigned int *pByteCount);
|
||||
int GetTPDSize() {return m_MEM_TPD.size();}
|
||||
#ifndef __PS3__
|
||||
int GetTPConfigVal(WCHAR *pwchDataFile);
|
||||
@@ -839,12 +839,12 @@ public:
|
||||
|
||||
bool GetBanListRead(int iPad) { return m_bRead_BannedListA[iPad];}
|
||||
void SetBanListRead(int iPad,bool bVal) { m_bRead_BannedListA[iPad]=bVal;}
|
||||
void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].dwBytes=0;}
|
||||
void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].byteCount=0;}
|
||||
|
||||
std::uint32_t GetRequiredTexturePackID() { return m_dwRequiredTexturePackID; }
|
||||
void SetRequiredTexturePackID(std::uint32_t texturePackId) { m_dwRequiredTexturePackID = texturePackId; }
|
||||
|
||||
virtual void GetFileFromTPD(eTPDFileType eType, std::uint8_t *pbData, unsigned int dwBytes, std::uint8_t **ppbData, unsigned int *pdwBytes ) {*ppbData = NULL; *pdwBytes = 0;}
|
||||
virtual void GetFileFromTPD(eTPDFileType eType, std::uint8_t *pbData, unsigned int byteCount, std::uint8_t **ppbData, unsigned int *pByteCount ) {*ppbData = NULL; *pByteCount = 0;}
|
||||
|
||||
//XTITLE_DEPLOYMENT_TYPE getDeploymentType() { return m_titleDeploymentType; }
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@ void C_4JProfile::ShowProfileCard(int iPad, PlayerUID targetUid) {}
|
||||
#if defined(__linux__)
|
||||
C4JStorage::C4JStorage() {}
|
||||
void C4JStorage::Tick() {}
|
||||
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int dwPad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,unsigned int dwFocusButton) { return C4JStorage::EMessage_Undefined; }
|
||||
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int pad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,unsigned int focusButton) { return C4JStorage::EMessage_Undefined; }
|
||||
C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult() { return C4JStorage::EMessage_Undefined; }
|
||||
bool C4JStorage::SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice) { return true; }
|
||||
void C4JStorage::Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam) {}
|
||||
@@ -585,8 +585,8 @@ void C4JStorage::SetSaveMessageVPosition(float fY) {}
|
||||
//C4JStorage::ESGIStatus C4JStorage::GetSavesInfo(int iPad,bool ( *Func)(LPVOID, int, CACHEINFOSTRUCT *, int, HRESULT),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESGIStatus_Idle; }
|
||||
C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName) { return C4JStorage::ESaveGame_Idle; }
|
||||
|
||||
void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile,XCONTENT_DATA &xContentData) {}
|
||||
void C4JStorage::GetSaveCacheFileInfo(unsigned int dwFile, std::uint8_t * *ppbImageData, unsigned int *pdwImageBytes) {}
|
||||
void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex,XCONTENT_DATA &xContentData) {}
|
||||
void C4JStorage::GetSaveCacheFileInfo(unsigned int fileIndex, std::uint8_t * *ppbImageData, unsigned int *pImageBytes) {}
|
||||
C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam) {return C4JStorage::ESaveGame_Idle;}
|
||||
C4JStorage::EDeleteGameStatus C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam) { return C4JStorage::EDeleteGame_Idle; }
|
||||
PSAVE_DETAILS C4JStorage::ReturnSavesInfo() {return NULL;}
|
||||
@@ -604,8 +604,8 @@ XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) { static XCONTENT_DATA r
|
||||
C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam) { return C4JStorage::EDLC_Idle; }
|
||||
std::uint32_t C4JStorage::MountInstalledDLC(int iPad,std::uint32_t dwDLC,int( *Func)(void *, int, std::uint32_t, std::uint32_t),void *lpParam,LPCSTR szMountDrive) { return 0; }
|
||||
unsigned int C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive) { return 0; }
|
||||
C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; }
|
||||
bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,std::uint8_t *pBuffer,unsigned int dwBufferSize) { return true; }
|
||||
C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; }
|
||||
bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,std::uint8_t *pBuffer,unsigned int bufferSize) { return true; }
|
||||
bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; }
|
||||
void C4JStorage::StoreTMSPathName(WCHAR *pwchName) {}
|
||||
unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; }
|
||||
|
||||
Reference in New Issue
Block a user