diff --git a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp b/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp index f4f74fb4c..3f9311ce5 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp @@ -363,7 +363,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const std::string &pat } DWORD bytesRead,dwFileSize = GetFileSize(file,NULL); - PBYTE pbData = (PBYTE) new BYTE[dwFileSize]; + uint8_t *pbData = new uint8_t[dwFileSize]; BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); if(bSuccess==FALSE) { @@ -385,7 +385,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const std::string &pat return processDLCDataFile(dwFilesProcessed, pbData, bytesRead, pack); } -bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack) +bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, uint8_t *pbData, DWORD dwLength, DLCPack *pack) { std::unordered_map parameterMapping; unsigned int uiCurrentByte=0; @@ -439,7 +439,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwTemp+=DLC_DETAIL_ADV(pFile->dwWchCount); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; } - PBYTE pbTemp=((PBYTE )pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount; + uint8_t *pbTemp = reinterpret_cast(pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount; pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; for(unsigned int i=0;idwWchCount); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; } - PBYTE pbTemp=((PBYTE )pFile); + uint8_t *pbTemp = reinterpret_cast(pFile); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; for(unsigned int i=0;i #include class DLCPack; class DLCSkinFile; @@ -93,7 +94,7 @@ public: DWORD retrievePackIDFromDLCDataFile(const std::string &path, DLCPack *pack); private: - bool processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack); + bool processDLCDataFile(DWORD &dwFilesProcessed, uint8_t *pbData, DWORD dwLength, DLCPack *pack); - DWORD retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack); + DWORD retrievePackID(uint8_t *pbData, DWORD dwLength, DLCPack *pack); }; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCPack.h b/Minecraft.Client/Platform/Common/DLC/DLCPack.h index 7a0ba2bac..9dcb8d982 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCPack.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCPack.h @@ -1,5 +1,6 @@ #pragma once //using namespace std; +#include #include "DLCManager.h" class DLCFile; @@ -28,7 +29,7 @@ private: DWORD m_packId; DWORD m_packVersion; - PBYTE m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children. + uint8_t *m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children. public: DLCPack(const std::wstring &name,DWORD dwLicenseMask); @@ -39,7 +40,7 @@ public: std::wstring getFullDataPath() { return m_dataPath; } - void SetDataPointer(PBYTE pbData) { m_data = pbData; } + void SetDataPointer(uint8_t *pbData) { m_data = pbData; } bool IsCorrupt() { return m_isCorrupt; } void SetIsCorrupt(bool val) { m_isCorrupt = val; }