From 66538b67f286d45e8a4ee0b64b00e845e7d29321 Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Tue, 10 Mar 2026 00:17:57 +1100 Subject: [PATCH] Remove Win32 byte pointers from DLC file interfaces --- Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp | 10 +++++----- Minecraft.Client/Platform/Common/DLC/DLCAudioFile.h | 8 ++++---- Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp | 4 ++-- Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h | 4 ++-- .../Platform/Common/DLC/DLCColourTableFile.cpp | 4 ++-- .../Platform/Common/DLC/DLCColourTableFile.h | 4 ++-- Minecraft.Client/Platform/Common/DLC/DLCFile.h | 7 ++++--- .../Platform/Common/DLC/DLCGameRulesFile.cpp | 6 +++--- .../Platform/Common/DLC/DLCGameRulesFile.h | 8 ++++---- .../Platform/Common/DLC/DLCGameRulesHeader.cpp | 8 ++++---- .../Platform/Common/DLC/DLCGameRulesHeader.h | 10 +++++----- .../Platform/Common/DLC/DLCLocalisationFile.cpp | 4 ++-- .../Platform/Common/DLC/DLCLocalisationFile.h | 6 +++--- Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp | 2 +- Minecraft.Client/Platform/Common/DLC/DLCSkinFile.h | 2 +- .../Platform/Common/DLC/DLCTextureFile.cpp | 6 +++--- Minecraft.Client/Platform/Common/DLC/DLCTextureFile.h | 8 ++++---- Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.cpp | 6 +++--- Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.h | 6 +++--- 19 files changed, 57 insertions(+), 56 deletions(-) diff --git a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp index 0caf3f5de..92a5003c4 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp @@ -12,7 +12,7 @@ DLCAudioFile::DLCAudioFile(const std::wstring &path) : DLCFile(DLCManager::e_DLC m_dwBytes = 0; } -void DLCAudioFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCAudioFile::addData(uint8_t *pbData, DWORD dwBytes) { m_pbData = pbData; m_dwBytes = dwBytes; @@ -20,7 +20,7 @@ void DLCAudioFile::addData(PBYTE pbData, DWORD dwBytes) processDLCDataFile(pbData,dwBytes); } -PBYTE DLCAudioFile::getData(DWORD &dwBytes) +uint8_t *DLCAudioFile::getData(DWORD &dwBytes) { dwBytes = m_dwBytes; return m_pbData; @@ -120,7 +120,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons } } -bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength) +bool DLCAudioFile::processDLCDataFile(uint8_t *pbData, DWORD dwLength) { std::unordered_map parameterMapping; unsigned int uiCurrentByte=0; @@ -164,7 +164,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength) dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR); 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 m_parameters; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp index 6ef5c97f4..35f58ad1f 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp @@ -6,7 +6,7 @@ DLCCapeFile::DLCCapeFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCTy { } -void DLCCapeFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCCapeFile::addData(uint8_t *pbData, DWORD dwBytes) { app.AddMemoryTextureFile(m_path,pbData,dwBytes); -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h b/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h index 6626387a8..dde0617ab 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h @@ -6,5 +6,5 @@ class DLCCapeFile : public DLCFile public: DLCCapeFile(const std::wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); -}; \ No newline at end of file + virtual void addData(uint8_t *pbData, DWORD dwBytes); +}; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp index beab8161e..239a3fb99 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp @@ -19,8 +19,8 @@ DLCColourTableFile::~DLCColourTableFile() } } -void DLCColourTableFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCColourTableFile::addData(uint8_t *pbData, DWORD dwBytes) { ColourTable *defaultColourTable = Minecraft::GetInstance()->skins->getDefault()->getColourTable(); m_colourTable = new ColourTable(defaultColourTable, pbData, dwBytes); -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h b/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h index cb7a8cf5a..97d5723ea 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h @@ -12,7 +12,7 @@ public: DLCColourTableFile(const std::wstring &path); ~DLCColourTableFile(); - virtual void addData(PBYTE pbData, DWORD dwBytes); + virtual void addData(uint8_t *pbData, DWORD dwBytes); ColourTable *getColourTable() { return m_colourTable; } -}; \ No newline at end of file +}; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCFile.h b/Minecraft.Client/Platform/Common/DLC/DLCFile.h index 0f652f849..0a91a650e 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCFile.h @@ -1,4 +1,5 @@ #pragma once +#include #include "DLCManager.h" class DLCFile @@ -16,10 +17,10 @@ public: std::wstring getPath() { return m_path; } DWORD getSkinID() { return m_dwSkinId; } - virtual void addData(PBYTE pbData, DWORD dwBytes) {} - virtual PBYTE getData(DWORD &dwBytes) { dwBytes = 0; return NULL; } + virtual void addData(uint8_t *pbData, DWORD dwBytes) {} + virtual uint8_t *getData(DWORD &dwBytes) { dwBytes = 0; return NULL; } virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value) {} virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type) { return L""; } virtual bool getParameterAsBool(DLCManager::EDLCParameterType type) { return false;} -}; \ No newline at end of file +}; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp index b383bd70d..b7550abe2 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp @@ -8,14 +8,14 @@ DLCGameRulesFile::DLCGameRulesFile(const std::wstring &path) : DLCGameRules(DLCM m_dwBytes = 0; } -void DLCGameRulesFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCGameRulesFile::addData(uint8_t *pbData, DWORD dwBytes) { m_pbData = pbData; m_dwBytes = dwBytes; } -PBYTE DLCGameRulesFile::getData(DWORD &dwBytes) +uint8_t *DLCGameRulesFile::getData(DWORD &dwBytes) { dwBytes = m_dwBytes; return m_pbData; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h index 9924ca849..aebb0ebd3 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h @@ -4,12 +4,12 @@ class DLCGameRulesFile : public DLCGameRules { private: - PBYTE m_pbData; + uint8_t *m_pbData; DWORD m_dwBytes; public: DLCGameRulesFile(const std::wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); - virtual PBYTE getData(DWORD &dwBytes); -}; \ No newline at end of file + virtual void addData(uint8_t *pbData, DWORD dwBytes); + virtual uint8_t *getData(DWORD &dwBytes); +}; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp index 5b2d705f0..f0c9f2a67 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp @@ -21,7 +21,7 @@ DLCGameRulesHeader::DLCGameRulesHeader(const std::wstring &path) : DLCGameRules( lgo = NULL; } -void DLCGameRulesHeader::addData(PBYTE pbData, DWORD dwBytes) +void DLCGameRulesHeader::addData(uint8_t *pbData, DWORD dwBytes) { m_pbData = pbData; m_dwBytes = dwBytes; @@ -73,13 +73,13 @@ void DLCGameRulesHeader::addData(PBYTE pbData, DWORD dwBytes) #endif } -PBYTE DLCGameRulesHeader::getData(DWORD &dwBytes) +uint8_t *DLCGameRulesHeader::getData(DWORD &dwBytes) { dwBytes = m_dwBytes; return m_pbData; } -void DLCGameRulesHeader::setGrfData(PBYTE fData, DWORD fSize, StringTable *st) +void DLCGameRulesHeader::setGrfData(uint8_t *fData, DWORD fSize, StringTable *st) { if (!m_hasData) { @@ -89,4 +89,4 @@ void DLCGameRulesHeader::setGrfData(PBYTE fData, DWORD fSize, StringTable *st) app.m_gameRules.readRuleFile(lgo, fData, fSize, st); } -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h index fddc7318c..b8c0bdb9e 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h @@ -8,7 +8,7 @@ class DLCGameRulesHeader : public DLCGameRules, public JustGrSource private: // GR-Header - PBYTE m_pbData; + uint8_t *m_pbData; DWORD m_dwBytes; bool m_hasData; @@ -33,10 +33,10 @@ public: public: DLCGameRulesHeader(const std::wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); - virtual PBYTE getData(DWORD &dwBytes); + virtual void addData(uint8_t *pbData, DWORD dwBytes); + virtual uint8_t *getData(DWORD &dwBytes); - void setGrfData(PBYTE fData, DWORD fSize, StringTable *); + void setGrfData(uint8_t *fData, DWORD fSize, StringTable *); virtual bool ready() { return m_hasData; } -}; \ No newline at end of file +}; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp index 67e6639a6..870e07117 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp @@ -8,7 +8,7 @@ DLCLocalisationFile::DLCLocalisationFile(const std::wstring &path) : DLCFile(DLC m_strings = NULL; } -void DLCLocalisationFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCLocalisationFile::addData(uint8_t *pbData, DWORD dwBytes) { m_strings = new StringTable(pbData, dwBytes); -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h b/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h index db4211667..d4194687a 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h @@ -10,9 +10,9 @@ private: public: DLCLocalisationFile(const std::wstring &path); - DLCLocalisationFile(PBYTE pbData, DWORD dwBytes); // when we load in a texture pack details file from TMS++ + DLCLocalisationFile(uint8_t *pbData, DWORD dwBytes); // when we load in a texture pack details file from TMS++ - virtual void addData(PBYTE pbData, DWORD dwBytes); + virtual void addData(uint8_t *pbData, DWORD dwBytes); StringTable *getStringTable() { return m_strings; } -}; \ No newline at end of file +}; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp index 2a4df2cc6..87fb2adfa 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.cpp @@ -16,7 +16,7 @@ DLCSkinFile::DLCSkinFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCTy m_uiAnimOverrideBitmask=0L; } -void DLCSkinFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCSkinFile::addData(uint8_t *pbData, DWORD dwBytes) { app.AddMemoryTextureFile(m_path,pbData,dwBytes); } diff --git a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.h b/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.h index 08ceb6920..36fd7e242 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCSkinFile.h @@ -17,7 +17,7 @@ public: DLCSkinFile(const std::wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); + virtual void addData(uint8_t *pbData, DWORD dwBytes); virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value); virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type); diff --git a/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp index 10085c834..81d32b806 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.cpp @@ -11,14 +11,14 @@ DLCTextureFile::DLCTextureFile(const std::wstring &path) : DLCFile(DLCManager::e m_dwBytes = 0; } -void DLCTextureFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCTextureFile::addData(uint8_t *pbData, DWORD dwBytes) { //app.AddMemoryTextureFile(m_path,pbData,dwBytes); m_pbData = pbData; m_dwBytes = dwBytes; } -PBYTE DLCTextureFile::getData(DWORD &dwBytes) +uint8_t *DLCTextureFile::getData(DWORD &dwBytes) { dwBytes = m_dwBytes; return m_pbData; @@ -56,4 +56,4 @@ bool DLCTextureFile::getParameterAsBool(DLCManager::EDLCParameterType type) default: return false; } -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.h b/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.h index 831740601..7e5bff9fc 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCTextureFile.h @@ -8,17 +8,17 @@ private: bool m_bIsAnim; std::wstring m_animString; - PBYTE m_pbData; + uint8_t *m_pbData; DWORD m_dwBytes; public: DLCTextureFile(const std::wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); - virtual PBYTE getData(DWORD &dwBytes); + virtual void addData(uint8_t *pbData, DWORD dwBytes); + virtual uint8_t *getData(DWORD &dwBytes); virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value); virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type); virtual bool getParameterAsBool(DLCManager::EDLCParameterType type); -}; \ No newline at end of file +}; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.cpp index 9ba227607..aa6f0dbe1 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.cpp @@ -18,15 +18,15 @@ DLCUIDataFile::~DLCUIDataFile() } } -void DLCUIDataFile::addData(PBYTE pbData, DWORD dwBytes,bool canDeleteData) +void DLCUIDataFile::addData(uint8_t *pbData, DWORD dwBytes,bool canDeleteData) { m_pbData = pbData; m_dwBytes = dwBytes; m_canDeleteData = canDeleteData; } -PBYTE DLCUIDataFile::getData(DWORD &dwBytes) +uint8_t *DLCUIDataFile::getData(DWORD &dwBytes) { dwBytes = m_dwBytes; return m_pbData; -} \ No newline at end of file +} diff --git a/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.h b/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.h index a9ffa6c1f..fa0d2fc6b 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCUIDataFile.h @@ -4,7 +4,7 @@ class DLCUIDataFile : public DLCFile { private: - PBYTE m_pbData; + uint8_t *m_pbData; DWORD m_dwBytes; bool m_canDeleteData; @@ -15,6 +15,6 @@ public: using DLCFile::addData; using DLCFile::addParameter; - virtual void addData(PBYTE pbData, DWORD dwBytes,bool canDeleteData = false); - virtual PBYTE getData(DWORD &dwBytes); + virtual void addData(uint8_t *pbData, DWORD dwBytes,bool canDeleteData = false); + virtual uint8_t *getData(DWORD &dwBytes); };