Standardise fixed-width integer usage in touched files

This commit is contained in:
notmatthewbeshay 2026-03-10 19:14:32 +11:00
parent 83ba8d8384
commit 0ab0fd9209
64 changed files with 229 additions and 229 deletions

View file

@ -1205,7 +1205,7 @@ void PlayerConnection::handleSetCreativeModeSlot(std::shared_ptr<SetCreativeMode
// 4J-PB - for Xbox maps, we'll centre them on the origin of the world, since we can fit the whole world in our map // 4J-PB - for Xbox maps, we'll centre them on the origin of the world, since we can fit the whole world in our map
data->x = centreXC; data->x = centreXC;
data->z = centreZC; data->z = centreZC;
data->dimension = (uint8_t) player->level->dimension->id; data->dimension = (std::uint8_t) player->level->dimension->id;
data->setDirty(); data->setDirty();
} }

View file

@ -211,7 +211,7 @@ void PlayerList::placeNewPlayer(Connection *connection, std::shared_ptr<ServerPl
addPlayerToReceiving( player ); addPlayerToReceiving( player );
playerConnection->send( std::shared_ptr<LoginPacket>( new LoginPacket(L"", player->entityId, level->getLevelData()->getGenerator(), level->getSeed(), player->gameMode->getGameModeForPlayer()->getId(), playerConnection->send( std::shared_ptr<LoginPacket>( new LoginPacket(L"", player->entityId, level->getLevelData()->getGenerator(), level->getSeed(), player->gameMode->getGameModeForPlayer()->getId(),
(uint8_t) level->dimension->id, (uint8_t) level->getMaxBuildHeight(), (uint8_t) getMaxPlayers(), (std::uint8_t) level->dimension->id, (std::uint8_t) level->getMaxBuildHeight(), (std::uint8_t) getMaxPlayers(),
level->difficulty, TelemetryManager->GetMultiplayerInstanceID(), playerIndex, level->useNewSeaLevel(), player->getAllPlayerGamePrivileges(), level->difficulty, TelemetryManager->GetMultiplayerInstanceID(), playerIndex, level->useNewSeaLevel(), player->getAllPlayerGamePrivileges(),
level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale() ) ) ); level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale() ) ) );
playerConnection->send( std::shared_ptr<SetSpawnPositionPacket>( new SetSpawnPositionPacket(spawnPos->x, spawnPos->y, spawnPos->z) ) ); playerConnection->send( std::shared_ptr<SetSpawnPositionPacket>( new SetSpawnPositionPacket(spawnPos->x, spawnPos->y, spawnPos->z) ) );

View file

@ -687,7 +687,7 @@ bool ServerChunkCache::save(bool force, ProgressListener *progressListener)
} }
LevelChunk *chunk = NULL; LevelChunk *chunk = NULL;
uint8_t workingThreads; std::uint8_t workingThreads;
bool chunkSet = false; bool chunkSet = false;
// Created a roughly sorted list to match the order that the files were created in McRegionChunkStorage::McRegionChunkStorage. // Created a roughly sorted list to match the order that the files were created in McRegionChunkStorage::McRegionChunkStorage.

View file

@ -12,7 +12,7 @@ DLCAudioFile::DLCAudioFile(const std::wstring &path) : DLCFile(DLCManager::e_DLC
m_dataBytes = 0; m_dataBytes = 0;
} }
void DLCAudioFile::addData(uint8_t *pbData, std::uint32_t dataBytes) void DLCAudioFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes)
{ {
m_pbData = pbData; m_pbData = pbData;
m_dataBytes = dataBytes; m_dataBytes = dataBytes;
@ -20,7 +20,7 @@ void DLCAudioFile::addData(uint8_t *pbData, std::uint32_t dataBytes)
processDLCDataFile(pbData,dataBytes); processDLCDataFile(pbData,dataBytes);
} }
uint8_t *DLCAudioFile::getData(std::uint32_t &dataBytes) std::uint8_t *DLCAudioFile::getData(std::uint32_t &dataBytes)
{ {
dataBytes = m_dataBytes; dataBytes = m_dataBytes;
return m_pbData; return m_pbData;
@ -120,7 +120,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons
} }
} }
bool DLCAudioFile::processDLCDataFile(uint8_t *pbData, std::uint32_t dataLength) bool DLCAudioFile::processDLCDataFile(std::uint8_t *pbData, std::uint32_t dataLength)
{ {
std::unordered_map<int, EAudioParameterType> parameterMapping; std::unordered_map<int, EAudioParameterType> parameterMapping;
unsigned int uiCurrentByte=0; unsigned int uiCurrentByte=0;
@ -164,7 +164,7 @@ bool DLCAudioFile::processDLCDataFile(uint8_t *pbData, std::uint32_t dataLength)
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR); dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
} }
uint8_t *pbTemp = reinterpret_cast<uint8_t *>(pFile); std::uint8_t *pbTemp = reinterpret_cast<std::uint8_t *>(pFile);
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
for(unsigned int i=0;i<uiFileCount;i++) for(unsigned int i=0;i<uiFileCount;i++)

View file

@ -32,17 +32,17 @@ public:
DLCAudioFile(const std::wstring &path); DLCAudioFile(const std::wstring &path);
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes);
virtual uint8_t *getData(std::uint32_t &dataBytes); virtual std::uint8_t *getData(std::uint32_t &dataBytes);
bool processDLCDataFile(uint8_t *pbData, std::uint32_t dataLength); bool processDLCDataFile(std::uint8_t *pbData, std::uint32_t dataLength);
int GetCountofType(DLCAudioFile::EAudioType ptype); int GetCountofType(DLCAudioFile::EAudioType ptype);
std::wstring &GetSoundName(int iIndex); std::wstring &GetSoundName(int iIndex);
private: private:
using DLCFile::addParameter; using DLCFile::addParameter;
uint8_t *m_pbData; std::uint8_t *m_pbData;
std::uint32_t m_dataBytes; std::uint32_t m_dataBytes;
static const int CURRENT_AUDIO_VERSION_NUM=1; static const int CURRENT_AUDIO_VERSION_NUM=1;
//std::unordered_map<int, std::wstring> m_parameters; //std::unordered_map<int, std::wstring> m_parameters;

View file

@ -6,7 +6,7 @@ DLCCapeFile::DLCCapeFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCTy
{ {
} }
void DLCCapeFile::addData(uint8_t *pbData, std::uint32_t dataBytes) void DLCCapeFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes)
{ {
app.AddMemoryTextureFile(m_path,pbData,dataBytes); app.AddMemoryTextureFile(m_path,pbData,dataBytes);
} }

View file

@ -6,5 +6,5 @@ class DLCCapeFile : public DLCFile
public: public:
DLCCapeFile(const std::wstring &path); DLCCapeFile(const std::wstring &path);
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes);
}; };

View file

@ -19,7 +19,7 @@ DLCColourTableFile::~DLCColourTableFile()
} }
} }
void DLCColourTableFile::addData(uint8_t *pbData, std::uint32_t dataBytes) void DLCColourTableFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes)
{ {
ColourTable *defaultColourTable = Minecraft::GetInstance()->skins->getDefault()->getColourTable(); ColourTable *defaultColourTable = Minecraft::GetInstance()->skins->getDefault()->getColourTable();
m_colourTable = new ColourTable(defaultColourTable, pbData, dataBytes); m_colourTable = new ColourTable(defaultColourTable, pbData, dataBytes);

View file

@ -12,7 +12,7 @@ public:
DLCColourTableFile(const std::wstring &path); DLCColourTableFile(const std::wstring &path);
~DLCColourTableFile(); ~DLCColourTableFile();
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes);
ColourTable *getColourTable() { return m_colourTable; } ColourTable *getColourTable() { return m_colourTable; }
}; };

View file

@ -17,8 +17,8 @@ public:
std::wstring getPath() { return m_path; } std::wstring getPath() { return m_path; }
DWORD getSkinID() { return m_dwSkinId; } DWORD getSkinID() { return m_dwSkinId; }
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes) {} virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes) {}
virtual uint8_t *getData(std::uint32_t &dataBytes) { dataBytes = 0; return NULL; } virtual std::uint8_t *getData(std::uint32_t &dataBytes) { dataBytes = 0; return NULL; }
virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value) {} virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value) {}
virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type) { return L""; } virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type) { return L""; }

View file

@ -8,13 +8,13 @@ DLCGameRulesFile::DLCGameRulesFile(const std::wstring &path) : DLCGameRules(DLCM
m_dataBytes = 0; m_dataBytes = 0;
} }
void DLCGameRulesFile::addData(uint8_t *pbData, std::uint32_t dataBytes) void DLCGameRulesFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes)
{ {
m_pbData = pbData; m_pbData = pbData;
m_dataBytes = dataBytes; m_dataBytes = dataBytes;
} }
uint8_t *DLCGameRulesFile::getData(std::uint32_t &dataBytes) std::uint8_t *DLCGameRulesFile::getData(std::uint32_t &dataBytes)
{ {
dataBytes = m_dataBytes; dataBytes = m_dataBytes;
return m_pbData; return m_pbData;

View file

@ -4,12 +4,12 @@
class DLCGameRulesFile : public DLCGameRules class DLCGameRulesFile : public DLCGameRules
{ {
private: private:
uint8_t *m_pbData; std::uint8_t *m_pbData;
std::uint32_t m_dataBytes; std::uint32_t m_dataBytes;
public: public:
DLCGameRulesFile(const std::wstring &path); DLCGameRulesFile(const std::wstring &path);
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes);
virtual uint8_t *getData(std::uint32_t &dataBytes); virtual std::uint8_t *getData(std::uint32_t &dataBytes);
}; };

View file

@ -21,7 +21,7 @@ DLCGameRulesHeader::DLCGameRulesHeader(const std::wstring &path) : DLCGameRules(
lgo = NULL; lgo = NULL;
} }
void DLCGameRulesHeader::addData(uint8_t *pbData, std::uint32_t dataBytes) void DLCGameRulesHeader::addData(std::uint8_t *pbData, std::uint32_t dataBytes)
{ {
m_pbData = pbData; m_pbData = pbData;
m_dataBytes = dataBytes; m_dataBytes = dataBytes;
@ -73,13 +73,13 @@ void DLCGameRulesHeader::addData(uint8_t *pbData, std::uint32_t dataBytes)
#endif #endif
} }
uint8_t *DLCGameRulesHeader::getData(std::uint32_t &dataBytes) std::uint8_t *DLCGameRulesHeader::getData(std::uint32_t &dataBytes)
{ {
dataBytes = m_dataBytes; dataBytes = m_dataBytes;
return m_pbData; return m_pbData;
} }
void DLCGameRulesHeader::setGrfData(uint8_t *fData, std::uint32_t dataSize, StringTable *st) void DLCGameRulesHeader::setGrfData(std::uint8_t *fData, std::uint32_t dataSize, StringTable *st)
{ {
if (!m_hasData) if (!m_hasData)
{ {

View file

@ -8,7 +8,7 @@ class DLCGameRulesHeader : public DLCGameRules, public JustGrSource
private: private:
// GR-Header // GR-Header
uint8_t *m_pbData; std::uint8_t *m_pbData;
std::uint32_t m_dataBytes; std::uint32_t m_dataBytes;
bool m_hasData; bool m_hasData;
@ -33,10 +33,10 @@ public:
public: public:
DLCGameRulesHeader(const std::wstring &path); DLCGameRulesHeader(const std::wstring &path);
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes);
virtual uint8_t *getData(std::uint32_t &dataBytes); virtual std::uint8_t *getData(std::uint32_t &dataBytes);
void setGrfData(uint8_t *fData, std::uint32_t dataSize, StringTable *); void setGrfData(std::uint8_t *fData, std::uint32_t dataSize, StringTable *);
virtual bool ready() { return m_hasData; } virtual bool ready() { return m_hasData; }
}; };

View file

@ -8,7 +8,7 @@ DLCLocalisationFile::DLCLocalisationFile(const std::wstring &path) : DLCFile(DLC
m_strings = NULL; m_strings = NULL;
} }
void DLCLocalisationFile::addData(uint8_t *pbData, std::uint32_t dataBytes) void DLCLocalisationFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes)
{ {
m_strings = new StringTable(pbData, dataBytes); m_strings = new StringTable(pbData, dataBytes);
} }

View file

@ -10,9 +10,9 @@ private:
public: public:
DLCLocalisationFile(const std::wstring &path); DLCLocalisationFile(const std::wstring &path);
DLCLocalisationFile(uint8_t *pbData, std::uint32_t dataBytes); // when we load in a texture pack details file from TMS++ DLCLocalisationFile(std::uint8_t *pbData, std::uint32_t dataBytes); // when we load in a texture pack details file from TMS++
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes);
StringTable *getStringTable() { return m_strings; } StringTable *getStringTable() { return m_strings; }
}; };

View file

@ -12,7 +12,7 @@
static const size_t DLC_WCHAR_BINARY = 2; static const size_t DLC_WCHAR_BINARY = 2;
static std::wstring dlc_read_wstring(const void *data) static std::wstring dlc_read_wstring(const void *data)
{ {
const uint16_t *p = (const uint16_t *)data; const std::uint16_t *p = (const std::uint16_t *)data;
std::wstring s; std::wstring s;
while (*p) s += (wchar_t)*p++; while (*p) s += (wchar_t)*p++;
return s; return s;
@ -363,7 +363,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const std::string &pat
} }
DWORD bytesRead,dwFileSize = GetFileSize(file,NULL); DWORD bytesRead,dwFileSize = GetFileSize(file,NULL);
uint8_t *pbData = new uint8_t[dwFileSize]; std::uint8_t *pbData = new std::uint8_t[dwFileSize];
BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL);
if(bSuccess==FALSE) if(bSuccess==FALSE)
{ {
@ -385,7 +385,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const std::string &pat
return processDLCDataFile(dwFilesProcessed, pbData, bytesRead, pack); return processDLCDataFile(dwFilesProcessed, pbData, bytesRead, pack);
} }
bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, uint8_t *pbData, DWORD dwLength, DLCPack *pack) bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, std::uint8_t *pbData, DWORD dwLength, DLCPack *pack)
{ {
std::unordered_map<int, DLCManager::EDLCParameterType> parameterMapping; std::unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
unsigned int uiCurrentByte=0; unsigned int uiCurrentByte=0;
@ -439,7 +439,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, uint8_t *pbData, DW
dwTemp+=DLC_DETAIL_ADV(pFile->dwWchCount); dwTemp+=DLC_DETAIL_ADV(pFile->dwWchCount);
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
} }
uint8_t *pbTemp = reinterpret_cast<uint8_t *>(pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount; std::uint8_t *pbTemp = reinterpret_cast<std::uint8_t *>(pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount;
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
for(unsigned int i=0;i<uiFileCount;i++) for(unsigned int i=0;i<uiFileCount;i++)
@ -566,7 +566,7 @@ DWORD DLCManager::retrievePackIDFromDLCDataFile(const std::string &path, DLCPack
} }
DWORD bytesRead,dwFileSize = GetFileSize(file,NULL); DWORD bytesRead,dwFileSize = GetFileSize(file,NULL);
uint8_t *pbData = new uint8_t[dwFileSize]; std::uint8_t *pbData = new std::uint8_t[dwFileSize];
BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL);
if(bSuccess==FALSE) if(bSuccess==FALSE)
{ {
@ -590,7 +590,7 @@ DWORD DLCManager::retrievePackIDFromDLCDataFile(const std::string &path, DLCPack
return packId; return packId;
} }
DWORD DLCManager::retrievePackID(uint8_t *pbData, DWORD dwLength, DLCPack *pack) DWORD DLCManager::retrievePackID(std::uint8_t *pbData, DWORD dwLength, DLCPack *pack)
{ {
DWORD packId=0; DWORD packId=0;
bool bPackIDSet=false; bool bPackIDSet=false;
@ -643,7 +643,7 @@ DWORD DLCManager::retrievePackID(uint8_t *pbData, DWORD dwLength, DLCPack *pack)
dwTemp+=DLC_DETAIL_ADV(pFile->dwWchCount); dwTemp+=DLC_DETAIL_ADV(pFile->dwWchCount);
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
} }
uint8_t *pbTemp = reinterpret_cast<uint8_t *>(pFile); std::uint8_t *pbTemp = reinterpret_cast<std::uint8_t *>(pFile);
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
for(unsigned int i=0;i<uiFileCount;i++) for(unsigned int i=0;i<uiFileCount;i++)

View file

@ -94,7 +94,7 @@ public:
DWORD retrievePackIDFromDLCDataFile(const std::string &path, DLCPack *pack); DWORD retrievePackIDFromDLCDataFile(const std::string &path, DLCPack *pack);
private: private:
bool processDLCDataFile(DWORD &dwFilesProcessed, uint8_t *pbData, DWORD dwLength, DLCPack *pack); bool processDLCDataFile(DWORD &dwFilesProcessed, std::uint8_t *pbData, DWORD dwLength, DLCPack *pack);
DWORD retrievePackID(uint8_t *pbData, DWORD dwLength, DLCPack *pack); DWORD retrievePackID(std::uint8_t *pbData, DWORD dwLength, DLCPack *pack);
}; };

View file

@ -29,7 +29,7 @@ private:
DWORD m_packId; DWORD m_packId;
DWORD m_packVersion; DWORD m_packVersion;
uint8_t *m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children. std::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: public:
DLCPack(const std::wstring &name,DWORD dwLicenseMask); DLCPack(const std::wstring &name,DWORD dwLicenseMask);
@ -40,7 +40,7 @@ public:
std::wstring getFullDataPath() { return m_dataPath; } std::wstring getFullDataPath() { return m_dataPath; }
void SetDataPointer(uint8_t *pbData) { m_data = pbData; } void SetDataPointer(std::uint8_t *pbData) { m_data = pbData; }
bool IsCorrupt() { return m_isCorrupt; } bool IsCorrupt() { return m_isCorrupt; }
void SetIsCorrupt(bool val) { m_isCorrupt = val; } void SetIsCorrupt(bool val) { m_isCorrupt = val; }

View file

@ -16,7 +16,7 @@ DLCSkinFile::DLCSkinFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCTy
m_uiAnimOverrideBitmask=0L; m_uiAnimOverrideBitmask=0L;
} }
void DLCSkinFile::addData(uint8_t *pbData, std::uint32_t dataBytes) void DLCSkinFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes)
{ {
app.AddMemoryTextureFile(m_path,pbData,dataBytes); app.AddMemoryTextureFile(m_path,pbData,dataBytes);
} }

View file

@ -17,7 +17,7 @@ public:
DLCSkinFile(const std::wstring &path); DLCSkinFile(const std::wstring &path);
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes);
virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value); virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value);
virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type); virtual std::wstring getParameterAsString(DLCManager::EDLCParameterType type);

View file

@ -11,14 +11,14 @@ DLCTextureFile::DLCTextureFile(const std::wstring &path) : DLCFile(DLCManager::e
m_dataBytes = 0; m_dataBytes = 0;
} }
void DLCTextureFile::addData(uint8_t *pbData, std::uint32_t dataBytes) void DLCTextureFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes)
{ {
//app.AddMemoryTextureFile(m_path,pbData,dwBytes); //app.AddMemoryTextureFile(m_path,pbData,dwBytes);
m_pbData = pbData; m_pbData = pbData;
m_dataBytes = dataBytes; m_dataBytes = dataBytes;
} }
uint8_t *DLCTextureFile::getData(std::uint32_t &dataBytes) std::uint8_t *DLCTextureFile::getData(std::uint32_t &dataBytes)
{ {
dataBytes = m_dataBytes; dataBytes = m_dataBytes;
return m_pbData; return m_pbData;

View file

@ -8,14 +8,14 @@ private:
bool m_bIsAnim; bool m_bIsAnim;
std::wstring m_animString; std::wstring m_animString;
uint8_t *m_pbData; std::uint8_t *m_pbData;
std::uint32_t m_dataBytes; std::uint32_t m_dataBytes;
public: public:
DLCTextureFile(const std::wstring &path); DLCTextureFile(const std::wstring &path);
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes);
virtual uint8_t *getData(std::uint32_t &dataBytes); virtual std::uint8_t *getData(std::uint32_t &dataBytes);
virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value); virtual void addParameter(DLCManager::EDLCParameterType type, const std::wstring &value);

View file

@ -18,14 +18,14 @@ DLCUIDataFile::~DLCUIDataFile()
} }
} }
void DLCUIDataFile::addData(uint8_t *pbData, std::uint32_t dataBytes,bool canDeleteData) void DLCUIDataFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes,bool canDeleteData)
{ {
m_pbData = pbData; m_pbData = pbData;
m_dataBytes = dataBytes; m_dataBytes = dataBytes;
m_canDeleteData = canDeleteData; m_canDeleteData = canDeleteData;
} }
uint8_t *DLCUIDataFile::getData(std::uint32_t &dataBytes) std::uint8_t *DLCUIDataFile::getData(std::uint32_t &dataBytes)
{ {
dataBytes = m_dataBytes; dataBytes = m_dataBytes;
return m_pbData; return m_pbData;

View file

@ -4,7 +4,7 @@
class DLCUIDataFile : public DLCFile class DLCUIDataFile : public DLCFile
{ {
private: private:
uint8_t *m_pbData; std::uint8_t *m_pbData;
std::uint32_t m_dataBytes; std::uint32_t m_dataBytes;
bool m_canDeleteData; bool m_canDeleteData;
@ -15,6 +15,6 @@ public:
using DLCFile::addData; using DLCFile::addData;
using DLCFile::addParameter; using DLCFile::addParameter;
virtual void addData(uint8_t *pbData, std::uint32_t dataBytes,bool canDeleteData = false); virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes,bool canDeleteData = false);
virtual uint8_t *getData(std::uint32_t &dataBytes); virtual std::uint8_t *getData(std::uint32_t &dataBytes);
}; };

View file

@ -30,7 +30,7 @@ void IUIScene_StartGame::HandleDLCMountingComplete()
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -181,7 +181,7 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index)
m_labelTexturePackDescription.setLabel(tp->getDesc1()); m_labelTexturePackDescription.setLabel(tp->getDesc1());
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
//if(imageBytes > 0 && imageData) //if(imageBytes > 0 && imageData)
//{ //{

View file

@ -168,7 +168,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -759,8 +759,8 @@ int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bo
// 4J HEG - No reason to set value if keyboard was cancelled // 4J HEG - No reason to set value if keyboard was cancelled
if (bRes) if (bRes)
{ {
uint16_t pchText[128]; std::uint16_t pchText[128];
ZeroMemory(pchText, 128 * sizeof(uint16_t) ); ZeroMemory(pchText, 128 * sizeof(std::uint16_t) );
InputManager.GetText(pchText); InputManager.GetText(pchText);
if(pchText[0]!=0) if(pchText[0]!=0)
@ -783,11 +783,11 @@ int UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,bool bR
{ {
#ifdef __PSVITA__ #ifdef __PSVITA__
//CD - Changed to 2048 [SCE_IME_MAX_TEXT_LENGTH] //CD - Changed to 2048 [SCE_IME_MAX_TEXT_LENGTH]
uint16_t pchText[2048]; std::uint16_t pchText[2048];
ZeroMemory(pchText, 2048 * sizeof(uint16_t) ); ZeroMemory(pchText, 2048 * sizeof(std::uint16_t) );
#else #else
uint16_t pchText[128]; std::uint16_t pchText[128];
ZeroMemory(pchText, 128 * sizeof(uint16_t) ); ZeroMemory(pchText, 128 * sizeof(std::uint16_t) );
#endif #endif
InputManager.GetText(pchText); InputManager.GetText(pchText);
pClass->m_editSeed.setLabel((wchar_t *)pchText); pClass->m_editSeed.setLabel((wchar_t *)pchText);
@ -896,7 +896,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time! // 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time!
// upsell psplus // upsell psplus
int32_t iResult=sceNpCommerceDialogInitialize(); std::int32_t iResult=sceNpCommerceDialogInitialize();
SceNpCommerceDialogParam param; SceNpCommerceDialogParam param;
sceNpCommerceDialogParamInitialize(&param); sceNpCommerceDialogParamInitialize(&param);
@ -975,7 +975,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time! // 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time!
// upsell psplus // upsell psplus
int32_t iResult=sceNpCommerceDialogInitialize(); std::int32_t iResult=sceNpCommerceDialogInitialize();
SceNpCommerceDialogParam param; SceNpCommerceDialogParam param;
sceNpCommerceDialogParamInitialize(&param); sceNpCommerceDialogParamInitialize(&param);
@ -1023,7 +1023,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time! // 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time!
// upsell psplus // upsell psplus
int32_t iResult=sceNpCommerceDialogInitialize(); std::int32_t iResult=sceNpCommerceDialogInitialize();
SceNpCommerceDialogParam param; SceNpCommerceDialogParam param;
sceNpCommerceDialogParamInitialize(&param); sceNpCommerceDialogParamInitialize(&param);
@ -1421,14 +1421,14 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor
// int UIScene_CreateWorldMenu::PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) // int UIScene_CreateWorldMenu::PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
// { // {
// int32_t iResult; // std::int32_t iResult;
// UIScene_CreateWorldMenu *pClass = (UIScene_CreateWorldMenu *)pParam; // UIScene_CreateWorldMenu *pClass = (UIScene_CreateWorldMenu *)pParam;
// //
// // continue offline, or upsell PS Plus? // // continue offline, or upsell PS Plus?
// if(result==C4JStorage::EMessage_ResultDecline) // if(result==C4JStorage::EMessage_ResultDecline)
// { // {
// // upsell psplus // // upsell psplus
// int32_t iResult=sceNpCommerceDialogInitialize(); // std::int32_t iResult=sceNpCommerceDialogInitialize();
// //
// SceNpCommerceDialogParam param; // SceNpCommerceDialogParam param;
// sceNpCommerceDialogParamInitialize(&param); // sceNpCommerceDialogParamInitialize(&param);

View file

@ -174,7 +174,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
// retrieve the save icon from the texture pack, if there is one // retrieve the save icon from the texture pack, if there is one
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -193,12 +193,12 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
#if defined(__PS3__) || defined(__ORBIS__)|| defined(_DURANGO) || defined (__PSVITA__) #if defined(__PS3__) || defined(__ORBIS__)|| defined(_DURANGO) || defined (__PSVITA__)
// convert to utf16 // convert to utf16
uint16_t u16Message[MAX_SAVEFILENAME_LENGTH]; std::uint16_t u16Message[MAX_SAVEFILENAME_LENGTH];
size_t srclen,dstlen; size_t srclen,dstlen;
srclen=MAX_SAVEFILENAME_LENGTH; srclen=MAX_SAVEFILENAME_LENGTH;
dstlen=MAX_SAVEFILENAME_LENGTH; dstlen=MAX_SAVEFILENAME_LENGTH;
#ifdef __PS3__ #ifdef __PS3__
L10nResult lres= UTF8stoUTF16s((uint8_t *)params->saveDetails->UTF8SaveFilename,&srclen,u16Message,&dstlen); L10nResult lres= UTF8stoUTF16s((std::uint8_t *)params->saveDetails->UTF8SaveFilename,&srclen,u16Message,&dstlen);
#elif defined(_DURANGO) #elif defined(_DURANGO)
// Already utf16 on durango // Already utf16 on durango
memcpy(u16Message,params->saveDetails->UTF16SaveFilename, MAX_SAVEFILENAME_LENGTH); memcpy(u16Message,params->saveDetails->UTF16SaveFilename, MAX_SAVEFILENAME_LENGTH);
@ -206,8 +206,8 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
{ {
SceCesUcsContext Context; SceCesUcsContext Context;
sceCesUcsContextInit( &Context ); sceCesUcsContextInit( &Context );
uint32_t utf8Len, utf16Len; std::uint32_t utf8Len, utf16Len;
sceCesUtf8StrToUtf16Str(&Context, (uint8_t *)params->saveDetails->UTF8SaveFilename, srclen, &utf8Len, u16Message, dstlen, &utf16Len); sceCesUtf8StrToUtf16Str(&Context, (std::uint8_t *)params->saveDetails->UTF8SaveFilename, srclen, &utf8Len, u16Message, dstlen, &utf16Len);
} }
#endif #endif
m_thumbnailName = (wchar_t *)u16Message; m_thumbnailName = (wchar_t *)u16Message;
@ -260,7 +260,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i);
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -1259,7 +1259,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
// 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time! // 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time!
// upsell psplus // upsell psplus
int32_t iResult=sceNpCommerceDialogInitialize(); std::int32_t iResult=sceNpCommerceDialogInitialize();
SceNpCommerceDialogParam param; SceNpCommerceDialogParam param;
sceNpCommerceDialogParamInitialize(&param); sceNpCommerceDialogParamInitialize(&param);
@ -1319,7 +1319,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
// 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time! // 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time!
// upsell psplus // upsell psplus
int32_t iResult=sceNpCommerceDialogInitialize(); std::int32_t iResult=sceNpCommerceDialogInitialize();
SceNpCommerceDialogParam param; SceNpCommerceDialogParam param;
sceNpCommerceDialogParamInitialize(&param); sceNpCommerceDialogParamInitialize(&param);
@ -1773,7 +1773,7 @@ int UIScene_LoadMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EM
// int UIScene_LoadMenu::PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) // int UIScene_LoadMenu::PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
// { // {
// int32_t iResult; // std::int32_t iResult;
// UIScene_LoadMenu *pClass = (UIScene_LoadMenu *)pParam; // UIScene_LoadMenu *pClass = (UIScene_LoadMenu *)pParam;
// //
// // continue offline, or upsell PS Plus? // // continue offline, or upsell PS Plus?

View file

@ -657,7 +657,7 @@ void UIScene_LoadOrJoinMenu::tick()
if(!m_bExitScene) if(!m_bExitScene)
{ {
// convert to utf16 // convert to utf16
uint16_t u16Message[MAX_SAVEFILENAME_LENGTH]; std::uint16_t u16Message[MAX_SAVEFILENAME_LENGTH];
#ifdef _DURANGO #ifdef _DURANGO
// Already utf16 on durango // Already utf16 on durango
memcpy(u16Message, m_saveDetails[m_iRequestingThumbnailId].UTF16SaveFilename, MAX_SAVEFILENAME_LENGTH); memcpy(u16Message, m_saveDetails[m_iRequestingThumbnailId].UTF16SaveFilename, MAX_SAVEFILENAME_LENGTH);
@ -675,19 +675,19 @@ void UIScene_LoadOrJoinMenu::tick()
#ifdef __PS3 #ifdef __PS3
size_t srcmax,dstmax; size_t srcmax,dstmax;
#else #else
uint32_t srcmax,dstmax; std::uint32_t srcmax,dstmax;
uint32_t srclen,dstlen; std::uint32_t srclen,dstlen;
#endif #endif
srcmax=MAX_SAVEFILENAME_LENGTH; srcmax=MAX_SAVEFILENAME_LENGTH;
dstmax=MAX_SAVEFILENAME_LENGTH; dstmax=MAX_SAVEFILENAME_LENGTH;
#if defined(__PS3__) #if defined(__PS3__)
L10nResult lres= UTF8stoUTF16s((uint8_t *)m_saveDetails[m_iRequestingThumbnailId].UTF8SaveFilename,&srcmax,u16Message,&dstmax); L10nResult lres= UTF8stoUTF16s((std::uint8_t *)m_saveDetails[m_iRequestingThumbnailId].UTF8SaveFilename,&srcmax,u16Message,&dstmax);
#else #else
SceCesUcsContext context; SceCesUcsContext context;
sceCesUcsContextInit(&context); sceCesUcsContextInit(&context);
sceCesUtf8StrToUtf16Str(&context, (uint8_t *)m_saveDetails[m_iRequestingThumbnailId].UTF8SaveFilename,srcmax,&srclen,u16Message,dstmax,&dstlen); sceCesUtf8StrToUtf16Str(&context, (std::uint8_t *)m_saveDetails[m_iRequestingThumbnailId].UTF8SaveFilename,srcmax,&srclen,u16Message,dstmax,&dstlen);
#endif #endif
#endif #endif
if( m_saveDetails[m_iRequestingThumbnailId].pbThumbnailData ) if( m_saveDetails[m_iRequestingThumbnailId].pbThumbnailData )
@ -928,7 +928,7 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons()
m_iMashUpButtonsC++; m_iMashUpButtonsC++;
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId()); TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId());
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -1172,8 +1172,8 @@ int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,boo
pClass->m_bIgnoreInput=false; pClass->m_bIgnoreInput=false;
if (bRes) if (bRes)
{ {
uint16_t ui16Text[128]; std::uint16_t ui16Text[128];
ZeroMemory(ui16Text, 128 * sizeof(uint16_t) ); ZeroMemory(ui16Text, 128 * sizeof(std::uint16_t) );
InputManager.GetText(ui16Text); InputManager.GetText(ui16Text);
// check the name is valid // check the name is valid
@ -1453,7 +1453,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
// PS Plus upsell // PS Plus upsell
// 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time! // 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time!
// upsell psplus // upsell psplus
int32_t iResult=sceNpCommerceDialogInitialize(); std::int32_t iResult=sceNpCommerceDialogInitialize();
SceNpCommerceDialogParam param; SceNpCommerceDialogParam param;
sceNpCommerceDialogParamInitialize(&param); sceNpCommerceDialogParamInitialize(&param);
@ -1692,7 +1692,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
HRESULT hr; HRESULT hr;
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = NULL; std::uint8_t *imageData = NULL;
if(tp==NULL) if(tp==NULL)
{ {
@ -1727,7 +1727,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(0); TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(0);
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {

View file

@ -131,7 +131,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl
// retrieve the save icon from the texture pack, if there is one // retrieve the save icon from the texture pack, if there is one
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -271,7 +271,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -1281,7 +1281,7 @@ void CScene_LoadGameSettings::UpdateTexturePackDescription(int index)
m_texturePackDescription.SetText(tp->getDesc1().c_str()); m_texturePackDescription.SetText(tp->getDesc1().c_str());
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -1533,7 +1533,7 @@ HRESULT CScene_LoadGameSettings::OnCustomMessage_DLCMountingComplete()
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {

View file

@ -185,7 +185,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -1139,7 +1139,7 @@ void CScene_MultiGameCreate::UpdateTexturePackDescription(int index)
m_texturePackDescription.SetText(tp->getDesc1().c_str()); m_texturePackDescription.SetText(tp->getDesc1().c_str());
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {
@ -1288,7 +1288,7 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete()
ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO));
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
{ {

View file

@ -296,7 +296,7 @@ void CScene_MultiGameJoinLoad::AddDefaultButtons()
m_iMashUpButtonsC++; m_iMashUpButtonsC++;
TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId()); TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId());
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = tp->getPackIcon(imageBytes); std::uint8_t *imageData = tp->getPackIcon(imageBytes);
HXUIBRUSH hXuiBrush; HXUIBRUSH hXuiBrush;
if(imageBytes > 0 && imageData) if(imageBytes > 0 && imageData)
@ -1271,7 +1271,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList()
HRESULT hr; HRESULT hr;
std::uint32_t imageBytes = 0; std::uint32_t imageBytes = 0;
uint8_t *imageData = NULL; std::uint8_t *imageData = NULL;
if(tp==NULL) if(tp==NULL)
{ {

View file

@ -85,12 +85,12 @@ int SonyRemoteStorage_PS3::initPreconditions()
return 0; return 0;
} }
void SonyRemoteStorage_PS3::staticInternalCallback(const SceRemoteStorageEvent event, int32_t retCode, void * userData) void SonyRemoteStorage_PS3::staticInternalCallback(const SceRemoteStorageEvent event, std::int32_t retCode, void * userData)
{ {
((SonyRemoteStorage_PS3*)userData)->internalCallback(event, retCode); ((SonyRemoteStorage_PS3*)userData)->internalCallback(event, retCode);
} }
void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, int32_t retCode) void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, std::int32_t retCode)
{ {
m_lastErrorCode = retCode; m_lastErrorCode = retCode;
@ -452,7 +452,7 @@ int SonyRemoteStorage_PS3::LoadCompressCallback(void *pParam,bool bIsCorrupt, bo
// We add 4 bytes to the start so that we can signal compressed data // We add 4 bytes to the start so that we can signal compressed data
// And another 4 bytes to store the decompressed data size // And another 4 bytes to store the decompressed data size
unsigned int compLength = origFilesize+8; unsigned int compLength = origFilesize+8;
uint8_t *compData = (uint8_t *)malloc( compLength ); std::uint8_t *compData = (std::uint8_t *)malloc( compLength );
Compression::UseDefaultThreadStorage(); Compression::UseDefaultThreadStorage();
Compression::getCompression()->Compress(compData+8,&compLength,pOrigSaveData,origFilesize); Compression::getCompression()->Compress(compData+8,&compLength,pOrigSaveData,origFilesize);
ZeroMemory(compData,8); ZeroMemory(compData,8);

View file

@ -25,12 +25,12 @@
static SceRemoteStorageData s_getDataOutput; static SceRemoteStorageData s_getDataOutput;
void SonyRemoteStorage_Vita::staticInternalCallback(const SceRemoteStorageEvent event, int32_t retCode, void * userData) void SonyRemoteStorage_Vita::staticInternalCallback(const SceRemoteStorageEvent event, std::int32_t retCode, void * userData)
{ {
((SonyRemoteStorage_Vita*)userData)->internalCallback(event, retCode); ((SonyRemoteStorage_Vita*)userData)->internalCallback(event, retCode);
} }
void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, int32_t retCode) void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, std::int32_t retCode)
{ {
m_lastErrorCode = retCode; m_lastErrorCode = retCode;

View file

@ -57,7 +57,7 @@ C4JThread* GameRenderer::m_updateThread;
C4JThread::EventArray* GameRenderer::m_updateEvents; C4JThread::EventArray* GameRenderer::m_updateEvents;
bool GameRenderer::nearThingsToDo = false; bool GameRenderer::nearThingsToDo = false;
bool GameRenderer::updateRunning = false; bool GameRenderer::updateRunning = false;
std::vector<uint8_t *> GameRenderer::m_deleteStackByte; std::vector<std::uint8_t *> GameRenderer::m_deleteStackByte;
std::vector<SparseLightStorage *> GameRenderer::m_deleteStackSparseLightStorage; std::vector<SparseLightStorage *> GameRenderer::m_deleteStackSparseLightStorage;
std::vector<CompressedTileStorage *> GameRenderer::m_deleteStackCompressedTileStorage; std::vector<CompressedTileStorage *> GameRenderer::m_deleteStackCompressedTileStorage;
std::vector<SparseDataStorage *> GameRenderer::m_deleteStackSparseDataStorage; std::vector<SparseDataStorage *> GameRenderer::m_deleteStackSparseDataStorage;
@ -1129,7 +1129,7 @@ void GameRenderer::renderLevel(float a)
#ifdef MULTITHREAD_ENABLE #ifdef MULTITHREAD_ENABLE
// Request that an item be deleted, when it is safe to do so // Request that an item be deleted, when it is safe to do so
void GameRenderer::AddForDelete(uint8_t *deleteThis) void GameRenderer::AddForDelete(std::uint8_t *deleteThis)
{ {
EnterCriticalSection(&m_csDeleteStack); EnterCriticalSection(&m_csDeleteStack);
m_deleteStackByte.push_back(deleteThis); m_deleteStackByte.push_back(deleteThis);
@ -1892,9 +1892,9 @@ void GameRenderer::setupClearColor(float a)
{ {
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Clear_Colour ); unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Clear_Colour );
uint8_t redComponent = ((colour>>16)&0xFF); std::uint8_t redComponent = ((colour>>16)&0xFF);
uint8_t greenComponent = ((colour>>8)&0xFF); std::uint8_t greenComponent = ((colour>>8)&0xFF);
uint8_t blueComponent = ((colour)&0xFF); std::uint8_t blueComponent = ((colour)&0xFF);
fr = (float)redComponent/256;//0.02f; fr = (float)redComponent/256;//0.02f;
fg = (float)greenComponent/256;//0.02f; fg = (float)greenComponent/256;//0.02f;
@ -1904,9 +1904,9 @@ void GameRenderer::setupClearColor(float a)
{ {
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Clear_Colour ); unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Clear_Colour );
uint8_t redComponent = ((colour>>16)&0xFF); std::uint8_t redComponent = ((colour>>16)&0xFF);
uint8_t greenComponent = ((colour>>8)&0xFF); std::uint8_t greenComponent = ((colour>>8)&0xFF);
uint8_t blueComponent = ((colour)&0xFF); std::uint8_t blueComponent = ((colour)&0xFF);
fr = (float)redComponent/256;//0.6f; fr = (float)redComponent/256;//0.6f;
fg = (float)greenComponent/256;//0.1f; fg = (float)greenComponent/256;//0.1f;
@ -2048,9 +2048,9 @@ void GameRenderer::setupFog(int i, float alpha)
glFogf(GL_FOG_DENSITY, 0.1f); // was 0.06 glFogf(GL_FOG_DENSITY, 0.1f); // was 0.06
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_In_Cloud_Fog_Colour ); unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_In_Cloud_Fog_Colour );
uint8_t redComponent = ((colour>>16)&0xFF); std::uint8_t redComponent = ((colour>>16)&0xFF);
uint8_t greenComponent = ((colour>>8)&0xFF); std::uint8_t greenComponent = ((colour>>8)&0xFF);
uint8_t blueComponent = ((colour)&0xFF); std::uint8_t blueComponent = ((colour)&0xFF);
float rr = (float)redComponent/256;//1.0f; float rr = (float)redComponent/256;//1.0f;
float gg = (float)greenComponent/256;//1.0f; float gg = (float)greenComponent/256;//1.0f;
@ -2080,9 +2080,9 @@ void GameRenderer::setupFog(int i, float alpha)
} }
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Fog_Colour ); unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Fog_Colour );
uint8_t redComponent = ((colour>>16)&0xFF); std::uint8_t redComponent = ((colour>>16)&0xFF);
uint8_t greenComponent = ((colour>>8)&0xFF); std::uint8_t greenComponent = ((colour>>8)&0xFF);
uint8_t blueComponent = ((colour)&0xFF); std::uint8_t blueComponent = ((colour)&0xFF);
float rr = (float)redComponent/256;//0.4f; float rr = (float)redComponent/256;//0.4f;
float gg = (float)greenComponent/256;//0.4f; float gg = (float)greenComponent/256;//0.4f;
@ -2105,9 +2105,9 @@ void GameRenderer::setupFog(int i, float alpha)
glFogf(GL_FOG_DENSITY, 2.0f); // was 0.06 glFogf(GL_FOG_DENSITY, 2.0f); // was 0.06
unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Fog_Colour ); unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Fog_Colour );
uint8_t redComponent = ((colour>>16)&0xFF); std::uint8_t redComponent = ((colour>>16)&0xFF);
uint8_t greenComponent = ((colour>>8)&0xFF); std::uint8_t greenComponent = ((colour>>8)&0xFF);
uint8_t blueComponent = ((colour)&0xFF); std::uint8_t blueComponent = ((colour)&0xFF);
float rr = (float)redComponent/256;//0.4f; float rr = (float)redComponent/256;//0.4f;
float gg = (float)greenComponent/256;//0.3f; float gg = (float)greenComponent/256;//0.3f;

View file

@ -156,12 +156,12 @@ public:
static bool nearThingsToDo; static bool nearThingsToDo;
static bool updateRunning; static bool updateRunning;
#endif #endif
static std::vector<uint8_t *> m_deleteStackByte; static std::vector<std::uint8_t *> m_deleteStackByte;
static std::vector<SparseLightStorage *> m_deleteStackSparseLightStorage; static std::vector<SparseLightStorage *> m_deleteStackSparseLightStorage;
static std::vector<CompressedTileStorage *> m_deleteStackCompressedTileStorage; static std::vector<CompressedTileStorage *> m_deleteStackCompressedTileStorage;
static std::vector<SparseDataStorage *> m_deleteStackSparseDataStorage; static std::vector<SparseDataStorage *> m_deleteStackSparseDataStorage;
static CRITICAL_SECTION m_csDeleteStack; static CRITICAL_SECTION m_csDeleteStack;
static void AddForDelete(uint8_t *deleteThis); static void AddForDelete(std::uint8_t *deleteThis);
static void AddForDelete(SparseLightStorage *deleteThis); static void AddForDelete(SparseLightStorage *deleteThis);
static void AddForDelete(CompressedTileStorage *deleteThis); static void AddForDelete(CompressedTileStorage *deleteThis);
static void AddForDelete(SparseDataStorage *deleteThis); static void AddForDelete(SparseDataStorage *deleteThis);

View file

@ -329,7 +329,7 @@ void Tesselator::color(int r, int g, int b, int a)
col = (r << 24) | (g << 16) | (b << 8) | (a); col = (r << 24) | (g << 16) | (b << 8) | (a);
} }
void Tesselator::color(uint8_t r, uint8_t g, uint8_t b) void Tesselator::color(std::uint8_t r, std::uint8_t g, std::uint8_t b)
{ {
color(r & 0xff, g & 0xff, b & 0xff); color(r & 0xff, g & 0xff, b & 0xff);
} }
@ -510,16 +510,16 @@ void Tesselator::tileQuad(float x1, float y1, float z1, float u1, float v1, floa
count+=4; count+=4;
// AP - alpha cut out is expensive on vita. This will choose the correct data buffer depending on cut out enabled // AP - alpha cut out is expensive on vita. This will choose the correct data buffer depending on cut out enabled
int16_t* pShortData; std::int16_t* pShortData;
if( !alphaCutOutEnabled ) if( !alphaCutOutEnabled )
{ {
pShortData = (int16_t*)&_array->data[p]; pShortData = (std::int16_t*)&_array->data[p];
p += 16; p += 16;
vertices+=4; vertices+=4;
} }
else else
{ {
pShortData = (int16_t*)&_array2->data[p2]; pShortData = (std::int16_t*)&_array2->data[p2];
p2 += 16; p2 += 16;
vertices2+=4; vertices2+=4;
} }
@ -784,25 +784,25 @@ void Tesselator::vertex(float x, float y, float z)
#ifdef __PSVITA__ #ifdef __PSVITA__
// AP - alpha cut out is expensive on vita. This will choose the correct data buffer depending on cut out enabled // AP - alpha cut out is expensive on vita. This will choose the correct data buffer depending on cut out enabled
int16_t* pShortData; std::int16_t* pShortData;
if( !alphaCutOutEnabled ) if( !alphaCutOutEnabled )
{ {
pShortData = (int16_t*)&_array->data[p]; pShortData = (std::int16_t*)&_array->data[p];
} }
else else
{ {
pShortData = (int16_t*)&_array2->data[p2]; pShortData = (std::int16_t*)&_array2->data[p2];
} }
#else #else
int16_t* pShortData = (int16_t*)&_array->data[p]; std::int16_t* pShortData = (std::int16_t*)&_array->data[p];
#endif #endif
#ifdef __PS3__ #ifdef __PS3__
float tex2U = ((int16_t*)&_tex2)[1] + 8; float tex2U = ((std::int16_t*)&_tex2)[1] + 8;
float tex2V = ((int16_t*)&_tex2)[0] + 8; float tex2V = ((std::int16_t*)&_tex2)[0] + 8;
float colVal1 = ((col&0xff000000)>>24)/256.0f; float colVal1 = ((col&0xff000000)>>24)/256.0f;
float colVal2 = ((col&0x00ff0000)>>16)/256.0f; float colVal2 = ((col&0x00ff0000)>>16)/256.0f;
float colVal3 = ((col&0x0000ff00)>>8)/256.0f; float colVal3 = ((col&0x0000ff00)>>8)/256.0f;
@ -833,8 +833,8 @@ void Tesselator::vertex(float x, float y, float z)
pShortData[3] = ipackedcol; pShortData[3] = ipackedcol;
pShortData[4] = (((int)(uu * 8192.0f))&0xffff); pShortData[4] = (((int)(uu * 8192.0f))&0xffff);
pShortData[5] = (((int)(v * 8192.0f))&0xffff); pShortData[5] = (((int)(v * 8192.0f))&0xffff);
int16_t u2 = ((int16_t*)&_tex2)[0]; std::int16_t u2 = ((std::int16_t*)&_tex2)[0];
int16_t v2 = ((int16_t*)&_tex2)[1]; std::int16_t v2 = ((std::int16_t*)&_tex2)[1];
#if defined _XBOX_ONE || defined __ORBIS__ #if defined _XBOX_ONE || defined __ORBIS__
// Optimisation - pack the second UVs into a single short (they could actually go in a byte), which frees up a short to store the x offset for this chunk in the vertex itself. // Optimisation - pack the second UVs into a single short (they could actually go in a byte), which frees up a short to store the x offset for this chunk in the vertex itself.
// This means that when rendering chunks, we don't need to update the vertex constants that specify the location for a chunk, when only the x offset has changed. // This means that when rendering chunks, we don't need to update the vertex constants that specify the location for a chunk, when only the x offset has changed.
@ -943,9 +943,9 @@ void Tesselator::vertex(float x, float y, float z)
_array->data[p + 7] = ( ( _tex2 >> 16 ) & 0xffff ) | ( _tex2 << 16 ); _array->data[p + 7] = ( ( _tex2 >> 16 ) & 0xffff ) | ( _tex2 << 16 );
#else #else
#ifdef __PS3__ #ifdef __PS3__
int16_t tex2U = ((int16_t*)&_tex2)[1] + 8; std::int16_t tex2U = ((std::int16_t*)&_tex2)[1] + 8;
int16_t tex2V = ((int16_t*)&_tex2)[0] + 8; std::int16_t tex2V = ((std::int16_t*)&_tex2)[0] + 8;
int16_t* pShortArray = (int16_t*)&_array->data[p + 7]; std::int16_t* pShortArray = (std::int16_t*)&_array->data[p + 7];
pShortArray[0] = tex2U; pShortArray[0] = tex2U;
pShortArray[1] = tex2V; pShortArray[1] = tex2V;
#else #else
@ -997,7 +997,7 @@ void Tesselator::noColor()
} }
#ifdef __PS3__ #ifdef __PS3__
uint32_t _ConvertF32toX11Y11Z10N(float x, float y, float z) std::uint32_t _ConvertF32toX11Y11Z10N(float x, float y, float z)
{ {
// 11111111111 X 0x000007FF // 11111111111 X 0x000007FF
// 1111111111100000000000 Y 0x003FF800 // 1111111111100000000000 Y 0x003FF800
@ -1022,10 +1022,10 @@ uint32_t _ConvertF32toX11Y11Z10N(float x, float y, float z)
if (z<-1.0f || z>1.0f) { printf("Value (%5.3f) should be in range [-1..1]. Conversion will clamp to X11Y11Z10N.\n", z); } if (z<-1.0f || z>1.0f) { printf("Value (%5.3f) should be in range [-1..1]. Conversion will clamp to X11Y11Z10N.\n", z); }
#endif #endif
const uint32_t uX = ((int32_t(std::max(std::min(((x)*2047.f - 1.f)*0.5f, 1023.f), -1024.f)) & (X11Y11Z10N_X_MASK >> X11Y11Z10N_X_SHIFT)) << X11Y11Z10N_X_SHIFT); const std::uint32_t uX = ((std::int32_t(std::max(std::min(((x)*2047.f - 1.f)*0.5f, 1023.f), -1024.f)) & (X11Y11Z10N_X_MASK >> X11Y11Z10N_X_SHIFT)) << X11Y11Z10N_X_SHIFT);
const uint32_t uY = ((int32_t(std::max(std::min(((y)*2047.f - 1.f)*0.5f, 1023.f), -1024.f)) & (X11Y11Z10N_Y_MASK >> X11Y11Z10N_Y_SHIFT)) << X11Y11Z10N_Y_SHIFT); const std::uint32_t uY = ((std::int32_t(std::max(std::min(((y)*2047.f - 1.f)*0.5f, 1023.f), -1024.f)) & (X11Y11Z10N_Y_MASK >> X11Y11Z10N_Y_SHIFT)) << X11Y11Z10N_Y_SHIFT);
const uint32_t uZ = ((int32_t(std::max(std::min(((z)*1023.f - 1.f)*0.5f, 511.f), -512.f )) & (X11Y11Z10N_Z_MASK >> X11Y11Z10N_Z_SHIFT)) << X11Y11Z10N_Z_SHIFT); const std::uint32_t uZ = ((std::int32_t(std::max(std::min(((z)*1023.f - 1.f)*0.5f, 511.f), -512.f )) & (X11Y11Z10N_Z_MASK >> X11Y11Z10N_Z_SHIFT)) << X11Y11Z10N_Z_SHIFT);
const uint32_t xyz = uX | uY | uZ; const std::uint32_t xyz = uX | uY | uZ;
return xyz; return xyz;
} }
#endif // __PS3__ #endif // __PS3__
@ -1038,14 +1038,14 @@ void Tesselator::normal(float x, float y, float z)
_normal = _ConvertF32toX11Y11Z10N(x,y,z); _normal = _ConvertF32toX11Y11Z10N(x,y,z);
#elif __PSVITA__ #elif __PSVITA__
// AP - casting a negative value to 'byte' on Vita results in zero. changed to a signed 8 value // AP - casting a negative value to 'byte' on Vita results in zero. changed to a signed 8 value
int8_t xx = (int8_t) (x * 127); std::int8_t xx = (std::int8_t) (x * 127);
int8_t yy = (int8_t) (y * 127); std::int8_t yy = (std::int8_t) (y * 127);
int8_t zz = (int8_t) (z * 127); std::int8_t zz = (std::int8_t) (z * 127);
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16); _normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
#else #else
uint8_t xx = (uint8_t) (x * 127); std::uint8_t xx = (std::uint8_t) (x * 127);
uint8_t yy = (uint8_t) (y * 127); std::uint8_t yy = (std::uint8_t) (y * 127);
uint8_t zz = (uint8_t) (z * 127); std::uint8_t zz = (std::uint8_t) (z * 127);
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16); _normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
#endif #endif
} }

View file

@ -138,7 +138,7 @@ public:
void color(float r, float g, float b, float a); void color(float r, float g, float b, float a);
void color(int r, int g, int b); void color(int r, int g, int b);
void color(int r, int g, int b, int a); void color(int r, int g, int b, int a);
void color(uint8_t r, uint8_t g, uint8_t b); void color(std::uint8_t r, std::uint8_t g, std::uint8_t b);
void vertexUV(float x, float y, float z, float u, float v); void vertexUV(float x, float y, float z, float u, float v);
void vertex(float x, float y, float z); void vertex(float x, float y, float z);
void color(int c); void color(int c);

View file

@ -373,14 +373,14 @@ std::wstring AbstractTexturePack::getXuiRootPath()
return szResourceLocator; return szResourceLocator;
} }
uint8_t *AbstractTexturePack::getPackIcon(std::uint32_t &imageBytes) std::uint8_t *AbstractTexturePack::getPackIcon(std::uint32_t &imageBytes)
{ {
if(m_iconSize == 0 || m_iconData == NULL) loadIcon(); if(m_iconSize == 0 || m_iconData == NULL) loadIcon();
imageBytes = m_iconSize; imageBytes = m_iconSize;
return m_iconData; return m_iconData;
} }
uint8_t *AbstractTexturePack::getPackComparison(std::uint32_t &imageBytes) std::uint8_t *AbstractTexturePack::getPackComparison(std::uint32_t &imageBytes)
{ {
if(m_comparisonSize == 0 || m_comparisonData == NULL) loadComparison(); if(m_comparisonSize == 0 || m_comparisonData == NULL) loadComparison();

View file

@ -19,10 +19,10 @@ protected:
std::wstring desc1; std::wstring desc1;
std::wstring desc2; std::wstring desc2;
uint8_t *m_iconData; std::uint8_t *m_iconData;
std::uint32_t m_iconSize; std::uint32_t m_iconSize;
uint8_t *m_comparisonData; std::uint8_t *m_comparisonData;
std::uint32_t m_comparisonSize; std::uint32_t m_comparisonSize;
TexturePack *fallback; TexturePack *fallback;
@ -84,8 +84,8 @@ public:
virtual void loadUI(); virtual void loadUI();
virtual void unloadUI(); virtual void unloadUI();
virtual std::wstring getXuiRootPath(); virtual std::wstring getXuiRootPath();
virtual uint8_t *getPackIcon(std::uint32_t &imageBytes); virtual std::uint8_t *getPackIcon(std::uint32_t &imageBytes);
virtual uint8_t *getPackComparison(std::uint32_t &imageBytes); virtual std::uint8_t *getPackComparison(std::uint32_t &imageBytes);
virtual unsigned int getDLCParentPackId(); virtual unsigned int getDLCParentPackId();
virtual unsigned char getDLCSubPackId(); virtual unsigned char getDLCSubPackId();
virtual ColourTable *getColourTable() { return m_colourTable; } virtual ColourTable *getColourTable() { return m_colourTable; }

View file

@ -47,8 +47,8 @@ public:
virtual void loadUI() = 0; virtual void loadUI() = 0;
virtual void unloadUI() = 0; virtual void unloadUI() = 0;
virtual std::wstring getXuiRootPath() = 0; virtual std::wstring getXuiRootPath() = 0;
virtual uint8_t *getPackIcon(std::uint32_t &imageBytes) = 0; virtual std::uint8_t *getPackIcon(std::uint32_t &imageBytes) = 0;
virtual uint8_t *getPackComparison(std::uint32_t &imageBytes) = 0; virtual std::uint8_t *getPackComparison(std::uint32_t &imageBytes) = 0;
virtual unsigned int getDLCParentPackId() = 0; virtual unsigned int getDLCParentPackId() = 0;
virtual unsigned char getDLCSubPackId() = 0; virtual unsigned char getDLCSubPackId() = 0;
virtual ColourTable *getColourTable() = 0; virtual ColourTable *getColourTable() = 0;

View file

@ -122,7 +122,7 @@ byteArray ArchiveFile::getFile(const std::wstring &filename)
memcpy( out.data, m_cachedData + data->ptr, data->filesize ); memcpy( out.data, m_cachedData + data->ptr, data->filesize );
#else #else
const unsigned int fileSize = static_cast<unsigned int>(data->filesize); const unsigned int fileSize = static_cast<unsigned int>(data->filesize);
uint8_t *pbData = new uint8_t[fileSize == 0 ? 1 : fileSize]; std::uint8_t *pbData = new std::uint8_t[fileSize == 0 ? 1 : fileSize];
out = byteArray(pbData, fileSize); out = byteArray(pbData, fileSize);
const PortableFileIO::BinaryReadResult readResult = PortableFileIO::ReadBinaryFileSegment( const PortableFileIO::BinaryReadResult readResult = PortableFileIO::ReadBinaryFileSegment(
m_sourcefile.getPath(), m_sourcefile.getPath(),
@ -151,7 +151,7 @@ byteArray ArchiveFile::getFile(const std::wstring &filename)
unsigned int decompressedSize = dis.readInt(); unsigned int decompressedSize = dis.readInt();
dis.close(); dis.close();
uint8_t *uncompressedBuffer = new uint8_t[decompressedSize]; std::uint8_t *uncompressedBuffer = new std::uint8_t[decompressedSize];
Compression::getCompression()->Decompress(uncompressedBuffer, &decompressedSize, out.data+4, out.length-4); Compression::getCompression()->Decompress(uncompressedBuffer, &decompressedSize, out.data+4, out.length-4);
delete [] out.data; delete [] out.data;

View file

@ -13,7 +13,7 @@ class ArchiveFile
{ {
protected: protected:
File m_sourcefile; File m_sourcefile;
uint8_t *m_cachedData; std::uint8_t *m_cachedData;
typedef struct _MetaData typedef struct _MetaData
{ {

View file

@ -7,7 +7,7 @@ StringTable::StringTable(void)
} }
// Load string table from a binary blob, filling out with the current localisation data only // Load string table from a binary blob, filling out with the current localisation data only
StringTable::StringTable(uint8_t *pbData, unsigned int dataSize) StringTable::StringTable(std::uint8_t *pbData, unsigned int dataSize)
{ {
src = byteArray(pbData, dataSize); src = byteArray(pbData, dataSize);
@ -119,7 +119,7 @@ StringTable::~StringTable(void)
// delete src.data; TODO 4J-JEV: ? // delete src.data; TODO 4J-JEV: ?
} }
void StringTable::getData(uint8_t **ppData, unsigned int *pSize) void StringTable::getData(std::uint8_t **ppData, unsigned int *pSize)
{ {
*ppData = src.data; *ppData = src.data;
*pSize = src.length; *pSize = src.length;

View file

@ -61,10 +61,10 @@ public:
// }; // };
StringTable(void); StringTable(void);
StringTable(uint8_t *pbData, unsigned int dataSize); StringTable(std::uint8_t *pbData, unsigned int dataSize);
~StringTable(void); ~StringTable(void);
void getData(uint8_t **ppData, unsigned int *pSize); void getData(std::uint8_t **ppData, unsigned int *pSize);
const wchar_t *getString(const std::wstring &id); const wchar_t *getString(const std::wstring &id);
const wchar_t *getString(int id); const wchar_t *getString(int id);

View file

@ -10,7 +10,7 @@ void ConsoleSaveFileConverter::ProcessSimpleFile(ConsoleSaveFile *sourceSave, Fi
unsigned int numberOfBytesRead = 0; unsigned int numberOfBytesRead = 0;
unsigned int numberOfBytesWritten = 0; unsigned int numberOfBytesWritten = 0;
uint8_t *data = new uint8_t[sourceFileEntry->getFileSize()]; std::uint8_t *data = new std::uint8_t[sourceFileEntry->getFileSize()];
// Read from source // Read from source
sourceSave->readFile(sourceFileEntry, data, sourceFileEntry->getFileSize(), &numberOfBytesRead); sourceSave->readFile(sourceFileEntry, data, sourceFileEntry->getFileSize(), &numberOfBytesRead);

View file

@ -25,7 +25,7 @@ ConsoleSaveFileInputStream::ConsoleSaveFileInputStream(ConsoleSaveFile *saveFile
//the next byte of data, or -1 if the end of the file is reached. //the next byte of data, or -1 if the end of the file is reached.
int ConsoleSaveFileInputStream::read() int ConsoleSaveFileInputStream::read()
{ {
uint8_t byteRead = static_cast<uint8_t>(0); std::uint8_t byteRead = static_cast<std::uint8_t>(0);
unsigned int numberOfBytesRead; unsigned int numberOfBytesRead;
bool result = m_saveFile->readFile( bool result = m_saveFile->readFile(

View file

@ -38,7 +38,7 @@ void ConsoleSaveFileOutputStream::write(unsigned int b)
{ {
unsigned int numberOfBytesWritten; unsigned int numberOfBytesWritten;
uint8_t value = (uint8_t) b; std::uint8_t value = (std::uint8_t) b;
bool result = m_saveFile->writeFile( bool result = m_saveFile->writeFile(
m_file, m_file,

View file

@ -410,7 +410,7 @@ std::vector<File *> *File::listFiles() const
CellFsErrno err = cellFsOpendir(filePath , &fd); CellFsErrno err = cellFsOpendir(filePath , &fd);
CellFsDirectoryEntry de; CellFsDirectoryEntry de;
uint32_t count = 0; std::uint32_t count = 0;
err = cellFsGetDirectoryEntries(fd, &de, sizeof(CellFsDirectoryEntry), &count); err = cellFsGetDirectoryEntries(fd, &de, sizeof(CellFsDirectoryEntry), &count);
if(count != 0) if(count != 0)
{ {
@ -572,7 +572,7 @@ std::vector<File *> *File::listFiles(FileFilter *filter) const
CellFsErrno err = cellFsOpendir(filePath, &fd); CellFsErrno err = cellFsOpendir(filePath, &fd);
CellFsDirectoryEntry de; CellFsDirectoryEntry de;
uint32_t count = 0; std::uint32_t count = 0;
err = cellFsGetDirectoryEntries(fd, &de, sizeof(CellFsDirectoryEntry), &count); err = cellFsGetDirectoryEntries(fd, &de, sizeof(CellFsDirectoryEntry), &count);
if(count != 0) if(count != 0)
{ {

View file

@ -75,7 +75,7 @@ int FileInputStream::read()
return -1; return -1;
} }
uint8_t byteRead = static_cast<uint8_t>(0); std::uint8_t byteRead = static_cast<std::uint8_t>(0);
const size_t numberOfBytesRead = std::fread(&byteRead, 1, 1, m_fileHandle); const size_t numberOfBytesRead = std::fread(&byteRead, 1, 1, m_fileHandle);
if( std::ferror(m_fileHandle) != 0 ) if( std::ferror(m_fileHandle) != 0 )

View file

@ -51,7 +51,7 @@ void FileOutputStream::write(unsigned int b)
return; return;
} }
uint8_t value = (uint8_t) b; std::uint8_t value = (std::uint8_t) b;
const size_t numberOfBytesWritten = std::fwrite(&value, 1, 1, m_fileHandle); const size_t numberOfBytesWritten = std::fwrite(&value, 1, 1, m_fileHandle);
const int result = std::ferror(m_fileHandle); const int result = std::ferror(m_fileHandle);

View file

@ -312,7 +312,7 @@ HRESULT Compression::Compress(void *pDestination, unsigned int *pDestSize, void
*pDestSize = (unsigned int)destSize; *pDestSize = (unsigned int)destSize;
return ( ( res == Z_OK ) ? S_OK : -1 ); return ( ( res == Z_OK ) ? S_OK : -1 );
#elif defined __PS3__ #elif defined __PS3__
uint32_t destSize = (uint32_t)(*pDestSize); std::uint32_t destSize = (std::uint32_t)(*pDestSize);
bool res = EdgeZLib::Compress(pDestination, &destSize, pSource, SrcSize); bool res = EdgeZLib::Compress(pDestination, &destSize, pSource, SrcSize);
*pDestSize = (unsigned int)destSize; *pDestSize = (unsigned int)destSize;
return ( ( res ) ? S_OK : -1 ); return ( ( res ) ? S_OK : -1 );
@ -340,7 +340,7 @@ HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, voi
*pDestSize = (unsigned int)destSize; *pDestSize = (unsigned int)destSize;
return ( ( res == Z_OK ) ? S_OK : -1 ); return ( ( res == Z_OK ) ? S_OK : -1 );
#elif defined __PS3__ #elif defined __PS3__
uint32_t destSize = (uint32_t)(*pDestSize); std::uint32_t destSize = (std::uint32_t)(*pDestSize);
bool res = EdgeZLib::Decompress(pDestination, &destSize, pSource, SrcSize); bool res = EdgeZLib::Decompress(pDestination, &destSize, pSource, SrcSize);
*pDestSize = (unsigned int)destSize; *pDestSize = (unsigned int)destSize;
return ( ( res ) ? S_OK : -1 ); return ( ( res ) ? S_OK : -1 );
@ -356,11 +356,11 @@ HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, voi
#ifndef _XBOX #ifndef _XBOX
void Compression::VitaVirtualDecompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) // (LPVOID buf, SIZE_T dwSize, LPVOID dst) void Compression::VitaVirtualDecompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) // (LPVOID buf, SIZE_T dwSize, LPVOID dst)
{ {
uint8_t *pSrc = (uint8_t *)pSource; std::uint8_t *pSrc = (std::uint8_t *)pSource;
int Offset = 0; int Offset = 0;
int Page = 0; int Page = 0;
int Index = 0; int Index = 0;
uint8_t* Data = (uint8_t*)pDestination; std::uint8_t* Data = (std::uint8_t*)pDestination;
while( Index != SrcSize ) while( Index != SrcSize )
{ {
// is this a normal value // is this a normal value

View file

@ -164,11 +164,11 @@ void CustomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks)
// 4J - this comparison used to just be with 0.0f but is now varied by block above // 4J - this comparison used to just be with 0.0f but is now varied by block above
if (yc * CHUNK_HEIGHT + y < mapHeight) if (yc * CHUNK_HEIGHT + y < mapHeight)
{ {
tileId = (uint8_t) Tile::rock_Id; tileId = (std::uint8_t) Tile::rock_Id;
} }
else if (yc * CHUNK_HEIGHT + y < waterHeight) else if (yc * CHUNK_HEIGHT + y < waterHeight)
{ {
tileId = (uint8_t) Tile::calmWater_Id; tileId = (std::uint8_t) Tile::calmWater_Id;
} }
// 4J - more extra code to make sure that the column at the edge of the world is just water & rock, to match the infinite sea that // 4J - more extra code to make sure that the column at the edge of the world is just water & rock, to match the infinite sea that
@ -226,8 +226,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
int run = -1; int run = -1;
uint8_t top = b->topMaterial; std::uint8_t top = b->topMaterial;
uint8_t material = b->material; std::uint8_t material = b->material;
LevelGenerationOptions *lgo = app.getLevelGenerationOptions(); LevelGenerationOptions *lgo = app.getLevelGenerationOptions();
if(lgo != NULL) if(lgo != NULL)
@ -250,7 +250,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
if (y <= 1 + random->nextInt(2)) // 4J - changed to make the bedrock not have bits you can get stuck in if (y <= 1 + random->nextInt(2)) // 4J - changed to make the bedrock not have bits you can get stuck in
// if (y <= 0 + random->nextInt(5)) // if (y <= 0 + random->nextInt(5))
{ {
blocks[offs] = (uint8_t) Tile::unbreakable_Id; blocks[offs] = (std::uint8_t) Tile::unbreakable_Id;
} }
else else
{ {
@ -267,7 +267,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
if (runDepth <= 0) if (runDepth <= 0)
{ {
top = 0; top = 0;
material = (uint8_t) Tile::rock_Id; material = (std::uint8_t) Tile::rock_Id;
} }
else if (y >= waterHeight - 4 && y <= waterHeight + 1) else if (y >= waterHeight - 4 && y <= waterHeight + 1)
{ {
@ -281,8 +281,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
if (y < waterHeight && top == 0) if (y < waterHeight && top == 0)
{ {
if (temp < 0.15f) top = (uint8_t) Tile::ice_Id; if (temp < 0.15f) top = (std::uint8_t) Tile::ice_Id;
else top = (uint8_t) Tile::calmWater_Id; else top = (std::uint8_t) Tile::calmWater_Id;
} }
run = runDepth; run = runDepth;
@ -299,7 +299,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
if (run == 0 && material == Tile::sand_Id) if (run == 0 && material == Tile::sand_Id)
{ {
run = random->nextInt(4); run = random->nextInt(4);
material = (uint8_t) Tile::sandStone_Id; material = (std::uint8_t) Tile::sandStone_Id;
} }
} }
} }
@ -328,7 +328,7 @@ LevelChunk *CustomLevelSource::getChunk(int xOffs, int zOffs)
// 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed // 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed
int blocksSize = Level::maxBuildHeight * 16 * 16; int blocksSize = Level::maxBuildHeight * 16 * 16;
uint8_t *tileData = (uint8_t *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); std::uint8_t *tileData = (std::uint8_t *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE);
XMemSet128(tileData,0,blocksSize); XMemSet128(tileData,0,blocksSize);
byteArray blocks = byteArray(tileData,blocksSize); byteArray blocks = byteArray(tileData,blocksSize);
// byteArray blocks = byteArray(16 * level->depth * 16); // byteArray blocks = byteArray(16 * level->depth * 16);

View file

@ -19,7 +19,7 @@ _MapDataMappings::_MapDataMappings()
#ifndef _DURANGO #ifndef _DURANGO
ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA); ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA);
#endif #endif
ZeroMemory(dimensions,sizeof(uint8_t)*(MAXIMUM_MAP_SAVE_DATA/4)); ZeroMemory(dimensions,sizeof(std::uint8_t)*(MAXIMUM_MAP_SAVE_DATA/4));
} }
int _MapDataMappings::getDimension(int id) int _MapDataMappings::getDimension(int id)
@ -84,7 +84,7 @@ _MapDataMappings_old::_MapDataMappings_old()
#ifndef _DURANGO #ifndef _DURANGO
ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA); ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA);
#endif #endif
ZeroMemory(dimensions,sizeof(uint8_t)*(MAXIMUM_MAP_SAVE_DATA/8)); ZeroMemory(dimensions,sizeof(std::uint8_t)*(MAXIMUM_MAP_SAVE_DATA/8));
} }
int _MapDataMappings_old::getDimension(int id) int _MapDataMappings_old::getDimension(int id)

View file

@ -57,10 +57,10 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path)
//if ((GetFileSize(file,NULL) & 0xfff) != 0) //if ((GetFileSize(file,NULL) & 0xfff) != 0)
if ((fileEntry->getFileSize() & 0xfff) != 0) if ((fileEntry->getFileSize() & 0xfff) != 0)
{ {
//uint8_t zero = 0; //std::uint8_t zero = 0;
unsigned int numberOfBytesWritten = 0; unsigned int numberOfBytesWritten = 0;
unsigned int bytesToWrite = 0x1000 - (fileEntry->getFileSize() & 0xfff); unsigned int bytesToWrite = 0x1000 - (fileEntry->getFileSize() & 0xfff);
uint8_t *zeroBytes = new uint8_t[ bytesToWrite ]; std::uint8_t *zeroBytes = new std::uint8_t[ bytesToWrite ];
ZeroMemory(zeroBytes, bytesToWrite); ZeroMemory(zeroBytes, bytesToWrite);
/* the file size is not a multiple of 4KB, grow it */ /* the file size is not a multiple of 4KB, grow it */
@ -233,8 +233,8 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was
} }
MemSect(50); MemSect(50);
uint8_t *data = new uint8_t[length]; std::uint8_t *data = new std::uint8_t[length];
uint8_t *decomp = new uint8_t[decompLength]; std::uint8_t *decomp = new std::uint8_t[decompLength];
MemSect(0); MemSect(0);
readDecompLength = decompLength; readDecompLength = decompLength;
m_saveFile->readFile(fileEntry,data,length,&numberOfBytesRead); m_saveFile->readFile(fileEntry,data,length,&numberOfBytesRead);
@ -273,10 +273,10 @@ DataOutputStream *RegionFile::getChunkDataOutputStream(int x, int z)
} }
/* write a chunk at (x,z) with length bytes of data to disk */ /* write a chunk at (x,z) with length bytes of data to disk */
void RegionFile::write(int x, int z, uint8_t *data, int length) // TODO - was synchronized void RegionFile::write(int x, int z, std::uint8_t *data, int length) // TODO - was synchronized
{ {
// 4J Stu - Do the compression here so that we know how much space we need to store the compressed data // 4J Stu - Do the compression here so that we know how much space we need to store the compressed data
uint8_t *compData = new uint8_t[length + 2048]; // presuming compression is going to make this smaller... UPDATE - for some really small things this isn't the case. Added 2K on here to cover those. std::uint8_t *compData = new std::uint8_t[length + 2048]; // presuming compression is going to make this smaller... UPDATE - for some really small things this isn't the case. Added 2K on here to cover those.
unsigned int compLength = length; unsigned int compLength = length;
Compression::getCompression()->CompressLZXRLE(compData,&compLength,data,length); Compression::getCompression()->CompressLZXRLE(compData,&compLength,data,length);
@ -403,7 +403,7 @@ void RegionFile::write(int x, int z, uint8_t *data, int length) // TODO - was s
} }
/* write a chunk data to the region file at specified sector number */ /* write a chunk data to the region file at specified sector number */
void RegionFile::write(int sectorNumber, uint8_t *data, int length, unsigned int compLength) void RegionFile::write(int sectorNumber, std::uint8_t *data, int length, unsigned int compLength)
{ {
unsigned int numberOfBytesWritten = 0; unsigned int numberOfBytesWritten = 0;
//SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN);
@ -451,7 +451,7 @@ void RegionFile::insertInitialSectors()
{ {
m_saveFile->setFilePointer( fileEntry, 0, SaveFileSeekOrigin::Begin ); m_saveFile->setFilePointer( fileEntry, 0, SaveFileSeekOrigin::Begin );
unsigned int numberOfBytesWritten = 0; unsigned int numberOfBytesWritten = 0;
uint8_t zeroBytes[ SECTOR_BYTES ]; std::uint8_t zeroBytes[ SECTOR_BYTES ];
ZeroMemory(zeroBytes, SECTOR_BYTES); ZeroMemory(zeroBytes, SECTOR_BYTES);
/* we need to write the chunk offset table */ /* we need to write the chunk offset table */

View file

@ -45,9 +45,9 @@ AddPlayerPacket::AddPlayerPacket(std::shared_ptr<Player> player, PlayerUID xuid,
// 4J - changed - send current "previously sent" value of rotations to put this in sync with other clients // 4J - changed - send current "previously sent" value of rotations to put this in sync with other clients
yRot = yRotp; yRot = yRotp;
xRot = xRotp; xRot = xRotp;
yHeadRot = static_cast<uint8_t>(yHeadRotp); // 4J Added yHeadRot = static_cast<std::uint8_t>(yHeadRotp); // 4J Added
// yRot = (uint8_t) (player->yRot * 256 / 360); // yRot = (std::uint8_t) (player->yRot * 256 / 360);
// xRot = (uint8_t) (player->xRot * 256 / 360); // xRot = (std::uint8_t) (player->xRot * 256 / 360);
//printf("%d: New add player (%f,%f,%f) : (%d,%d,%d) : xRot %d, yRot %d\n",id,player->x,player->y,player->z,x,y,z,xRot,yRot); //printf("%d: New add player (%f,%f,%f) : (%d,%d,%d) : xRot %d, yRot %d\n",id,player->x,player->y,player->z,x,y,z,xRot,yRot);
@ -97,13 +97,13 @@ void AddPlayerPacket::write(DataOutputStream *dos) //throws IOException
dos->writeInt(x); dos->writeInt(x);
dos->writeInt(y); dos->writeInt(y);
dos->writeInt(z); dos->writeInt(z);
dos->writeByte(static_cast<uint8_t>(yRot)); dos->writeByte(static_cast<std::uint8_t>(yRot));
dos->writeByte(static_cast<uint8_t>(xRot)); dos->writeByte(static_cast<std::uint8_t>(xRot));
dos->writeByte(static_cast<uint8_t>(m_playerIndex)); // 4J Added dos->writeByte(static_cast<std::uint8_t>(m_playerIndex)); // 4J Added
dos->writeShort(carriedItem); dos->writeShort(carriedItem);
dos->writePlayerUID(xuid); dos->writePlayerUID(xuid);
dos->writePlayerUID(OnlineXuid); dos->writePlayerUID(OnlineXuid);
dos->writeByte(static_cast<uint8_t>(m_playerIndex)); // 4J Added dos->writeByte(static_cast<std::uint8_t>(m_playerIndex)); // 4J Added
int skinId = 0; int skinId = 0;
std::memcpy(&skinId, &m_skinId, sizeof(m_skinId)); std::memcpy(&skinId, &m_skinId, sizeof(m_skinId));
dos->writeInt(skinId); dos->writeInt(skinId);
@ -122,7 +122,7 @@ void AddPlayerPacket::handle(PacketListener *listener)
int AddPlayerPacket::getEstimatedSize() int AddPlayerPacket::getEstimatedSize()
{ {
int iSize= sizeof(int) + Player::MAX_NAME_LENGTH + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(std::uint8_t) + sizeof(std::uint8_t) +sizeof(short) + sizeof(PlayerUID) + sizeof(PlayerUID) + sizeof(int) + sizeof(std::uint8_t) + sizeof(unsigned int) + sizeof(uint8_t); int iSize= sizeof(int) + Player::MAX_NAME_LENGTH + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(std::uint8_t) + sizeof(std::uint8_t) +sizeof(short) + sizeof(PlayerUID) + sizeof(PlayerUID) + sizeof(int) + sizeof(std::uint8_t) + sizeof(unsigned int) + sizeof(std::uint8_t);
if( entityData != NULL ) if( entityData != NULL )
{ {

View file

@ -26,7 +26,7 @@ public:
std::uint32_t m_skinId; // 4J Added std::uint32_t m_skinId; // 4J Added
std::uint32_t m_capeId; // 4J Added std::uint32_t m_capeId; // 4J Added
unsigned int m_uiGamePrivileges; // 4J Added unsigned int m_uiGamePrivileges; // 4J Added
uint8_t yHeadRot; // 4J Added std::uint8_t yHeadRot; // 4J Added
AddPlayerPacket(); AddPlayerPacket();
~AddPlayerPacket(); ~AddPlayerPacket();

View file

@ -28,7 +28,7 @@ void KickPlayerPacket::read(DataInputStream *dis) //throws IOException
void KickPlayerPacket::write(DataOutputStream *dos) //throws IOException void KickPlayerPacket::write(DataOutputStream *dos) //throws IOException
{ {
dos->writeByte((uint8_t)m_networkSmallId); dos->writeByte((std::uint8_t)m_networkSmallId);
} }
int KickPlayerPacket::getEstimatedSize() int KickPlayerPacket::getEstimatedSize()

View file

@ -146,18 +146,18 @@ void LoginPacket::write(DataOutputStream *dos) //throws IOException
} }
dos->writeLong(seed); dos->writeLong(seed);
dos->writeInt(gameType); dos->writeInt(gameType);
dos->writeByte((uint8_t)dimension); dos->writeByte((std::uint8_t)dimension);
dos->writeByte((uint8_t)mapHeight); dos->writeByte((std::uint8_t)mapHeight);
dos->writeByte((uint8_t)maxPlayers); dos->writeByte((std::uint8_t)maxPlayers);
dos->writePlayerUID(m_offlineXuid); dos->writePlayerUID(m_offlineXuid);
dos->writePlayerUID(m_onlineXuid); dos->writePlayerUID(m_onlineXuid);
dos->writeBoolean(m_friendsOnlyUGC); dos->writeBoolean(m_friendsOnlyUGC);
int ugcPlayersVersion = 0; int ugcPlayersVersion = 0;
std::memcpy(&ugcPlayersVersion, &m_ugcPlayersVersion, sizeof(m_ugcPlayersVersion)); std::memcpy(&ugcPlayersVersion, &m_ugcPlayersVersion, sizeof(m_ugcPlayersVersion));
dos->writeInt(ugcPlayersVersion); dos->writeInt(ugcPlayersVersion);
dos->writeByte((uint8_t)difficulty); dos->writeByte((std::uint8_t)difficulty);
dos->writeInt(m_multiplayerInstanceId); dos->writeInt(m_multiplayerInstanceId);
dos->writeByte((uint8_t)m_playerIndex); dos->writeByte((std::uint8_t)m_playerIndex);
int skinId = 0; int skinId = 0;
std::memcpy(&skinId, &m_playerSkinId, sizeof(m_playerSkinId)); std::memcpy(&skinId, &m_playerSkinId, sizeof(m_playerSkinId));
dos->writeInt(skinId); dos->writeInt(skinId);

View file

@ -96,7 +96,7 @@ void PreLoginPacket::write(DataOutputStream *dos) //throws IOException
std::int32_t ugcPlayersVersion = 0; std::int32_t ugcPlayersVersion = 0;
std::memcpy(&ugcPlayersVersion, &m_ugcPlayersVersion, sizeof(m_ugcPlayersVersion)); std::memcpy(&ugcPlayersVersion, &m_ugcPlayersVersion, sizeof(m_ugcPlayersVersion));
dos->writeInt(ugcPlayersVersion); dos->writeInt(ugcPlayersVersion);
dos->writeByte((uint8_t)m_dwPlayerCount); dos->writeByte((std::uint8_t)m_dwPlayerCount);
for(std::uint32_t i = 0; i < m_dwPlayerCount; ++i) for(std::uint32_t i = 0; i < m_dwPlayerCount; ++i)
{ {
dos->writePlayerUID( m_playerXuids[i] ); dos->writePlayerUID( m_playerXuids[i] );

View file

@ -11,7 +11,7 @@
// link, the end (0 or 1) is passed as a parameter to the ctor. // link, the end (0 or 1) is passed as a parameter to the ctor.
CRITICAL_SECTION Socket::s_hostQueueLock[2]; CRITICAL_SECTION Socket::s_hostQueueLock[2];
std::queue<uint8_t> Socket::s_hostQueue[2]; std::queue<std::uint8_t> Socket::s_hostQueue[2];
Socket::SocketOutputStreamLocal *Socket::s_hostOutStream[2]; Socket::SocketOutputStreamLocal *Socket::s_hostOutStream[2];
Socket::SocketInputStreamLocal *Socket::s_hostInStream[2]; Socket::SocketInputStreamLocal *Socket::s_hostInStream[2];
ServerConnection *Socket::s_serverConnection = NULL; ServerConnection *Socket::s_serverConnection = NULL;
@ -49,7 +49,7 @@ void Socket::Initialise(ServerConnection *serverConnection)
if(TryEnterCriticalSection(&s_hostQueueLock[i])) if(TryEnterCriticalSection(&s_hostQueueLock[i]))
{ {
// Clear the queue // Clear the queue
std::queue<uint8_t> empty; std::queue<std::uint8_t> empty;
std::swap( s_hostQueue[i], empty ); std::swap( s_hostQueue[i], empty );
LeaveCriticalSection(&s_hostQueueLock[i]); LeaveCriticalSection(&s_hostQueueLock[i]);
} }
@ -298,7 +298,7 @@ int Socket::SocketInputStreamLocal::read()
{ {
if( s_hostQueue[m_queueIdx].size() ) if( s_hostQueue[m_queueIdx].size() )
{ {
uint8_t retval = s_hostQueue[m_queueIdx].front(); std::uint8_t retval = s_hostQueue[m_queueIdx].front();
s_hostQueue[m_queueIdx].pop(); s_hostQueue[m_queueIdx].pop();
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
return retval; return retval;
@ -344,7 +344,7 @@ void Socket::SocketInputStreamLocal::close()
{ {
m_streamOpen = false; m_streamOpen = false;
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]); EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
std::queue<uint8_t>().swap(s_hostQueue[m_queueIdx]); std::queue<std::uint8_t>().swap(s_hostQueue[m_queueIdx]);
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
} }
@ -363,7 +363,7 @@ void Socket::SocketOutputStreamLocal::write(unsigned int b)
return; return;
} }
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]); EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
s_hostQueue[m_queueIdx].push((uint8_t)b); s_hostQueue[m_queueIdx].push((std::uint8_t)b);
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
} }
@ -392,7 +392,7 @@ void Socket::SocketOutputStreamLocal::close()
{ {
m_streamOpen = false; m_streamOpen = false;
EnterCriticalSection(&s_hostQueueLock[m_queueIdx]); EnterCriticalSection(&s_hostQueueLock[m_queueIdx]);
std::queue<uint8_t>().swap(s_hostQueue[m_queueIdx]); std::queue<std::uint8_t>().swap(s_hostQueue[m_queueIdx]);
LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]);
} }
@ -414,7 +414,7 @@ int Socket::SocketInputStreamNetwork::read()
{ {
if( m_socket->m_queueNetwork[m_queueIdx].size() ) if( m_socket->m_queueNetwork[m_queueIdx].size() )
{ {
uint8_t retval = m_socket->m_queueNetwork[m_queueIdx].front(); std::uint8_t retval = m_socket->m_queueNetwork[m_queueIdx].front();
m_socket->m_queueNetwork[m_queueIdx].pop(); m_socket->m_queueNetwork[m_queueIdx].pop();
LeaveCriticalSection(&m_socket->m_queueLockNetwork[m_queueIdx]); LeaveCriticalSection(&m_socket->m_queueLockNetwork[m_queueIdx]);
return retval; return retval;
@ -474,8 +474,8 @@ void Socket::SocketOutputStreamNetwork::write(unsigned int b)
{ {
if( m_streamOpen != true ) return; if( m_streamOpen != true ) return;
byteArray barray; byteArray barray;
uint8_t bb; std::uint8_t bb;
bb = (uint8_t)b; bb = (std::uint8_t)b;
barray.data = &bb; barray.data = &bb;
barray.length = 1; barray.length = 1;
write(barray, 0, 1); write(barray, 0, 1);

View file

@ -97,12 +97,12 @@ private:
// For local connections between the host player and the server // For local connections between the host player and the server
static CRITICAL_SECTION s_hostQueueLock[2]; static CRITICAL_SECTION s_hostQueueLock[2];
static std::queue<uint8_t> s_hostQueue[2]; static std::queue<std::uint8_t> s_hostQueue[2];
static SocketOutputStreamLocal *s_hostOutStream[2]; static SocketOutputStreamLocal *s_hostOutStream[2];
static SocketInputStreamLocal *s_hostInStream[2]; static SocketInputStreamLocal *s_hostInStream[2];
// For network connections // For network connections
std::queue<uint8_t> m_queueNetwork[2]; // For input data std::queue<std::uint8_t> m_queueNetwork[2]; // For input data
CRITICAL_SECTION m_queueLockNetwork[2]; // For input data CRITICAL_SECTION m_queueLockNetwork[2]; // For input data
SocketInputStreamNetwork *m_inputStream[2]; SocketInputStreamNetwork *m_inputStream[2];
SocketOutputStreamNetwork *m_outputStream[2]; SocketOutputStreamNetwork *m_outputStream[2];

View file

@ -183,8 +183,8 @@ void Player::defineSynchedData()
{ {
this->Mob::defineSynchedData(); this->Mob::defineSynchedData();
entityData->define(DATA_PLAYER_FLAGS_ID, (uint8_t) 0); entityData->define(DATA_PLAYER_FLAGS_ID, (std::uint8_t) 0);
entityData->define(DATA_PLAYER_RUNNING_ID, (uint8_t) 0); entityData->define(DATA_PLAYER_RUNNING_ID, (std::uint8_t) 0);
} }
std::shared_ptr<ItemInstance> Player::getUseItem() std::shared_ptr<ItemInstance> Player::getUseItem()
@ -572,7 +572,7 @@ void Player::completeUsingItem()
} }
} }
void Player::handleEntityEvent(uint8_t id) void Player::handleEntityEvent(std::uint8_t id)
{ {
if (id == EntityEvent::USE_ITEM_COMPLETE) if (id == EntityEvent::USE_ITEM_COMPLETE)
{ {
@ -1979,14 +1979,14 @@ bool Player::getPlayerFlag(int flag)
void Player::setPlayerFlag(int flag, bool value) void Player::setPlayerFlag(int flag, bool value)
{ {
uint8_t currentValue = entityData->getByte(DATA_PLAYER_FLAGS_ID); std::uint8_t currentValue = entityData->getByte(DATA_PLAYER_FLAGS_ID);
if (value) if (value)
{ {
entityData->set(DATA_PLAYER_FLAGS_ID, (uint8_t) (currentValue | (1 << flag))); entityData->set(DATA_PLAYER_FLAGS_ID, (std::uint8_t) (currentValue | (1 << flag)));
} }
else else
{ {
entityData->set(DATA_PLAYER_FLAGS_ID, (uint8_t) (currentValue & ~(1 << flag))); entityData->set(DATA_PLAYER_FLAGS_ID, (std::uint8_t) (currentValue & ~(1 << flag)));
} }
} }

View file

@ -161,7 +161,7 @@ protected:
virtual void completeUsingItem(); virtual void completeUsingItem();
public: public:
virtual void handleEntityEvent(uint8_t id); virtual void handleEntityEvent(std::uint8_t id);
protected: protected:
bool isImmobile(); bool isImmobile();