mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-07-23 19:47:09 +00:00
Remove DWORD sizes from DLC payload APIs
This commit is contained in:
parent
7bdf4c8ced
commit
c10b1a1706
|
|
@ -9,20 +9,20 @@
|
|||
DLCAudioFile::DLCAudioFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCType_Audio,path)
|
||||
{
|
||||
m_pbData = NULL;
|
||||
m_dwBytes = 0;
|
||||
m_dataBytes = 0;
|
||||
}
|
||||
|
||||
void DLCAudioFile::addData(uint8_t *pbData, DWORD dwBytes)
|
||||
void DLCAudioFile::addData(uint8_t *pbData, std::uint32_t dataBytes)
|
||||
{
|
||||
m_pbData = pbData;
|
||||
m_dwBytes = dwBytes;
|
||||
m_dataBytes = dataBytes;
|
||||
|
||||
processDLCDataFile(pbData,dwBytes);
|
||||
processDLCDataFile(pbData,dataBytes);
|
||||
}
|
||||
|
||||
uint8_t *DLCAudioFile::getData(DWORD &dwBytes)
|
||||
uint8_t *DLCAudioFile::getData(std::uint32_t &dataBytes)
|
||||
{
|
||||
dwBytes = m_dwBytes;
|
||||
dataBytes = m_dataBytes;
|
||||
return m_pbData;
|
||||
}
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons
|
|||
}
|
||||
}
|
||||
|
||||
bool DLCAudioFile::processDLCDataFile(uint8_t *pbData, DWORD dwLength)
|
||||
bool DLCAudioFile::processDLCDataFile(uint8_t *pbData, std::uint32_t dataLength)
|
||||
{
|
||||
std::unordered_map<int, EAudioParameterType> parameterMapping;
|
||||
unsigned int uiCurrentByte=0;
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ public:
|
|||
|
||||
DLCAudioFile(const std::wstring &path);
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes);
|
||||
virtual uint8_t *getData(DWORD &dwBytes);
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes);
|
||||
virtual uint8_t *getData(std::uint32_t &dataBytes);
|
||||
|
||||
bool processDLCDataFile(uint8_t *pbData, DWORD dwLength);
|
||||
bool processDLCDataFile(uint8_t *pbData, std::uint32_t dataLength);
|
||||
int GetCountofType(DLCAudioFile::EAudioType ptype);
|
||||
std::wstring &GetSoundName(int iIndex);
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ private:
|
|||
using DLCFile::addParameter;
|
||||
|
||||
uint8_t *m_pbData;
|
||||
DWORD m_dwBytes;
|
||||
std::uint32_t m_dataBytes;
|
||||
static const int CURRENT_AUDIO_VERSION_NUM=1;
|
||||
//std::unordered_map<int, std::wstring> m_parameters;
|
||||
std::vector<std::wstring> m_parameters[e_AudioType_Max];
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ DLCCapeFile::DLCCapeFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCTy
|
|||
{
|
||||
}
|
||||
|
||||
void DLCCapeFile::addData(uint8_t *pbData, DWORD dwBytes)
|
||||
void DLCCapeFile::addData(uint8_t *pbData, std::uint32_t dataBytes)
|
||||
{
|
||||
app.AddMemoryTextureFile(m_path,pbData,dwBytes);
|
||||
app.AddMemoryTextureFile(m_path,pbData,dataBytes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@ class DLCCapeFile : public DLCFile
|
|||
public:
|
||||
DLCCapeFile(const std::wstring &path);
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes);
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ DLCColourTableFile::~DLCColourTableFile()
|
|||
}
|
||||
}
|
||||
|
||||
void DLCColourTableFile::addData(uint8_t *pbData, DWORD dwBytes)
|
||||
void DLCColourTableFile::addData(uint8_t *pbData, std::uint32_t dataBytes)
|
||||
{
|
||||
ColourTable *defaultColourTable = Minecraft::GetInstance()->skins->getDefault()->getColourTable();
|
||||
m_colourTable = new ColourTable(defaultColourTable, pbData, dwBytes);
|
||||
m_colourTable = new ColourTable(defaultColourTable, pbData, dataBytes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public:
|
|||
DLCColourTableFile(const std::wstring &path);
|
||||
~DLCColourTableFile();
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes);
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes);
|
||||
|
||||
ColourTable *getColourTable() { return m_colourTable; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ public:
|
|||
std::wstring getPath() { return m_path; }
|
||||
DWORD getSkinID() { return m_dwSkinId; }
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes) {}
|
||||
virtual uint8_t *getData(DWORD &dwBytes) { dwBytes = 0; return NULL; }
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes) {}
|
||||
virtual uint8_t *getData(std::uint32_t &dataBytes) { dataBytes = 0; return NULL; }
|
||||
virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value) {}
|
||||
|
||||
virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type) { return L""; }
|
||||
|
|
|
|||
|
|
@ -5,17 +5,17 @@
|
|||
DLCGameRulesFile::DLCGameRulesFile(const std::wstring &path) : DLCGameRules(DLCManager::e_DLCType_GameRules,path)
|
||||
{
|
||||
m_pbData = NULL;
|
||||
m_dwBytes = 0;
|
||||
m_dataBytes = 0;
|
||||
}
|
||||
|
||||
void DLCGameRulesFile::addData(uint8_t *pbData, DWORD dwBytes)
|
||||
void DLCGameRulesFile::addData(uint8_t *pbData, std::uint32_t dataBytes)
|
||||
{
|
||||
m_pbData = pbData;
|
||||
m_dwBytes = dwBytes;
|
||||
m_dataBytes = dataBytes;
|
||||
}
|
||||
|
||||
uint8_t *DLCGameRulesFile::getData(DWORD &dwBytes)
|
||||
uint8_t *DLCGameRulesFile::getData(std::uint32_t &dataBytes)
|
||||
{
|
||||
dwBytes = m_dwBytes;
|
||||
dataBytes = m_dataBytes;
|
||||
return m_pbData;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ class DLCGameRulesFile : public DLCGameRules
|
|||
{
|
||||
private:
|
||||
uint8_t *m_pbData;
|
||||
DWORD m_dwBytes;
|
||||
std::uint32_t m_dataBytes;
|
||||
|
||||
public:
|
||||
DLCGameRulesFile(const std::wstring &path);
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes);
|
||||
virtual uint8_t *getData(DWORD &dwBytes);
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes);
|
||||
virtual uint8_t *getData(std::uint32_t &dataBytes);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
DLCGameRulesHeader::DLCGameRulesHeader(const std::wstring &path) : DLCGameRules(DLCManager::e_DLCType_GameRulesHeader,path)
|
||||
{
|
||||
m_pbData = NULL;
|
||||
m_dwBytes = 0;
|
||||
m_dataBytes = 0;
|
||||
|
||||
m_hasData = false;
|
||||
|
||||
|
|
@ -21,14 +21,14 @@ DLCGameRulesHeader::DLCGameRulesHeader(const std::wstring &path) : DLCGameRules(
|
|||
lgo = NULL;
|
||||
}
|
||||
|
||||
void DLCGameRulesHeader::addData(uint8_t *pbData, DWORD dwBytes)
|
||||
void DLCGameRulesHeader::addData(uint8_t *pbData, std::uint32_t dataBytes)
|
||||
{
|
||||
m_pbData = pbData;
|
||||
m_dwBytes = dwBytes;
|
||||
m_dataBytes = dataBytes;
|
||||
|
||||
|
||||
#if 0
|
||||
byteArray data(m_pbData, m_dwBytes);
|
||||
byteArray data(m_pbData, m_dataBytes);
|
||||
ByteArrayInputStream bais(data);
|
||||
DataInputStream dis(&bais);
|
||||
|
||||
|
|
@ -73,13 +73,13 @@ void DLCGameRulesHeader::addData(uint8_t *pbData, DWORD dwBytes)
|
|||
#endif
|
||||
}
|
||||
|
||||
uint8_t *DLCGameRulesHeader::getData(DWORD &dwBytes)
|
||||
uint8_t *DLCGameRulesHeader::getData(std::uint32_t &dataBytes)
|
||||
{
|
||||
dwBytes = m_dwBytes;
|
||||
dataBytes = m_dataBytes;
|
||||
return m_pbData;
|
||||
}
|
||||
|
||||
void DLCGameRulesHeader::setGrfData(uint8_t *fData, DWORD fSize, StringTable *st)
|
||||
void DLCGameRulesHeader::setGrfData(uint8_t *fData, std::uint32_t dataSize, StringTable *st)
|
||||
{
|
||||
if (!m_hasData)
|
||||
{
|
||||
|
|
@ -87,6 +87,6 @@ void DLCGameRulesHeader::setGrfData(uint8_t *fData, DWORD fSize, StringTable *st
|
|||
|
||||
//app.m_gameRules.loadGameRules(lgo, fData, fSize);
|
||||
|
||||
app.m_gameRules.readRuleFile(lgo, fData, fSize, st);
|
||||
app.m_gameRules.readRuleFile(lgo, fData, dataSize, st);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ private:
|
|||
|
||||
// GR-Header
|
||||
uint8_t *m_pbData;
|
||||
DWORD m_dwBytes;
|
||||
std::uint32_t m_dataBytes;
|
||||
|
||||
bool m_hasData;
|
||||
|
||||
|
|
@ -33,10 +33,10 @@ public:
|
|||
public:
|
||||
DLCGameRulesHeader(const std::wstring &path);
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes);
|
||||
virtual uint8_t *getData(DWORD &dwBytes);
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes);
|
||||
virtual uint8_t *getData(std::uint32_t &dataBytes);
|
||||
|
||||
void setGrfData(uint8_t *fData, DWORD fSize, StringTable *);
|
||||
void setGrfData(uint8_t *fData, std::uint32_t dataSize, StringTable *);
|
||||
|
||||
virtual bool ready() { return m_hasData; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ DLCLocalisationFile::DLCLocalisationFile(const std::wstring &path) : DLCFile(DLC
|
|||
m_strings = NULL;
|
||||
}
|
||||
|
||||
void DLCLocalisationFile::addData(uint8_t *pbData, DWORD dwBytes)
|
||||
void DLCLocalisationFile::addData(uint8_t *pbData, std::uint32_t dataBytes)
|
||||
{
|
||||
m_strings = new StringTable(pbData, dwBytes);
|
||||
m_strings = new StringTable(pbData, dataBytes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ private:
|
|||
|
||||
public:
|
||||
DLCLocalisationFile(const std::wstring &path);
|
||||
DLCLocalisationFile(uint8_t *pbData, DWORD dwBytes); // when we load in a texture pack details file from TMS++
|
||||
DLCLocalisationFile(uint8_t *pbData, std::uint32_t dataBytes); // when we load in a texture pack details file from TMS++
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes);
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes);
|
||||
|
||||
StringTable *getStringTable() { return m_strings; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ DLCSkinFile::DLCSkinFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCTy
|
|||
m_uiAnimOverrideBitmask=0L;
|
||||
}
|
||||
|
||||
void DLCSkinFile::addData(uint8_t *pbData, DWORD dwBytes)
|
||||
void DLCSkinFile::addData(uint8_t *pbData, std::uint32_t dataBytes)
|
||||
{
|
||||
app.AddMemoryTextureFile(m_path,pbData,dwBytes);
|
||||
app.AddMemoryTextureFile(m_path,pbData,dataBytes);
|
||||
}
|
||||
|
||||
void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const std::wstring &value)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public:
|
|||
|
||||
DLCSkinFile(const std::wstring &path);
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes);
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes);
|
||||
virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value);
|
||||
|
||||
virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type);
|
||||
|
|
|
|||
|
|
@ -8,19 +8,19 @@ DLCTextureFile::DLCTextureFile(const std::wstring &path) : DLCFile(DLCManager::e
|
|||
m_animString = L"";
|
||||
|
||||
m_pbData = NULL;
|
||||
m_dwBytes = 0;
|
||||
m_dataBytes = 0;
|
||||
}
|
||||
|
||||
void DLCTextureFile::addData(uint8_t *pbData, DWORD dwBytes)
|
||||
void DLCTextureFile::addData(uint8_t *pbData, std::uint32_t dataBytes)
|
||||
{
|
||||
//app.AddMemoryTextureFile(m_path,pbData,dwBytes);
|
||||
m_pbData = pbData;
|
||||
m_dwBytes = dwBytes;
|
||||
m_dataBytes = dataBytes;
|
||||
}
|
||||
|
||||
uint8_t *DLCTextureFile::getData(DWORD &dwBytes)
|
||||
uint8_t *DLCTextureFile::getData(std::uint32_t &dataBytes)
|
||||
{
|
||||
dwBytes = m_dwBytes;
|
||||
dataBytes = m_dataBytes;
|
||||
return m_pbData;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ private:
|
|||
std::wstring m_animString;
|
||||
|
||||
uint8_t *m_pbData;
|
||||
DWORD m_dwBytes;
|
||||
std::uint32_t m_dataBytes;
|
||||
|
||||
public:
|
||||
DLCTextureFile(const std::wstring &path);
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes);
|
||||
virtual uint8_t *getData(DWORD &dwBytes);
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes);
|
||||
virtual uint8_t *getData(std::uint32_t &dataBytes);
|
||||
|
||||
virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
DLCUIDataFile::DLCUIDataFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCType_UIData,path)
|
||||
{
|
||||
m_pbData = NULL;
|
||||
m_dwBytes = 0;
|
||||
m_dataBytes = 0;
|
||||
m_canDeleteData = false;
|
||||
}
|
||||
|
||||
|
|
@ -18,15 +18,15 @@ DLCUIDataFile::~DLCUIDataFile()
|
|||
}
|
||||
}
|
||||
|
||||
void DLCUIDataFile::addData(uint8_t *pbData, DWORD dwBytes,bool canDeleteData)
|
||||
void DLCUIDataFile::addData(uint8_t *pbData, std::uint32_t dataBytes,bool canDeleteData)
|
||||
{
|
||||
m_pbData = pbData;
|
||||
m_dwBytes = dwBytes;
|
||||
m_dataBytes = dataBytes;
|
||||
m_canDeleteData = canDeleteData;
|
||||
}
|
||||
|
||||
uint8_t *DLCUIDataFile::getData(DWORD &dwBytes)
|
||||
uint8_t *DLCUIDataFile::getData(std::uint32_t &dataBytes)
|
||||
{
|
||||
dwBytes = m_dwBytes;
|
||||
dataBytes = m_dataBytes;
|
||||
return m_pbData;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ class DLCUIDataFile : public DLCFile
|
|||
{
|
||||
private:
|
||||
uint8_t *m_pbData;
|
||||
DWORD m_dwBytes;
|
||||
std::uint32_t m_dataBytes;
|
||||
bool m_canDeleteData;
|
||||
|
||||
public:
|
||||
|
|
@ -15,6 +15,6 @@ public:
|
|||
using DLCFile::addData;
|
||||
using DLCFile::addParameter;
|
||||
|
||||
virtual void addData(uint8_t *pbData, DWORD dwBytes,bool canDeleteData = false);
|
||||
virtual uint8_t *getData(DWORD &dwBytes);
|
||||
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes,bool canDeleteData = false);
|
||||
virtual uint8_t *getData(std::uint32_t &dataBytes);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -86,9 +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");
|
||||
DWORD iconSize = 0;
|
||||
std::uint32_t iconSize = 0;
|
||||
m_iconData = textureFile->getData(iconSize);
|
||||
m_iconSize = static_cast<std::uint32_t>(iconSize);
|
||||
m_iconSize = iconSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -101,9 +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");
|
||||
DWORD comparisonSize = 0;
|
||||
std::uint32_t comparisonSize = 0;
|
||||
m_comparisonData = textureFile->getData(comparisonSize);
|
||||
m_comparisonSize = static_cast<std::uint32_t>(comparisonSize);
|
||||
m_comparisonSize = comparisonSize;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ void DLCTexturePack::loadColourTable()
|
|||
{
|
||||
DLCUIDataFile *dataFile = (DLCUIDataFile *)m_dlcDataPack->getFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp");
|
||||
|
||||
DWORD dwSize = 0;
|
||||
std::uint32_t dwSize = 0;
|
||||
uint8_t *pbData = dataFile->getData(dwSize);
|
||||
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
|
|
@ -480,7 +480,7 @@ void DLCTexturePack::loadUI()
|
|||
{
|
||||
DLCUIDataFile *dataFile = (DLCUIDataFile *)m_dlcDataPack->getFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp");
|
||||
|
||||
DWORD dwSize = 0;
|
||||
std::uint32_t dwSize = 0;
|
||||
uint8_t *pbData = dataFile->getData(dwSize);
|
||||
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
|
|
@ -554,7 +554,7 @@ std::wstring DLCTexturePack::getXuiRootPath()
|
|||
{
|
||||
DLCUIDataFile *dataFile = (DLCUIDataFile *)m_dlcDataPack->getFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp");
|
||||
|
||||
DWORD dwSize = 0;
|
||||
std::uint32_t dwSize = 0;
|
||||
uint8_t *pbData = dataFile->getData(dwSize);
|
||||
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
|
|
|
|||
Loading…
Reference in a new issue