From 0ab0fd9209aefe367fb9b93dbc70010606a8d91c Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Tue, 10 Mar 2026 19:14:32 +1100 Subject: [PATCH] Standardise fixed-width integer usage in touched files --- Minecraft.Client/Network/PlayerConnection.cpp | 2 +- Minecraft.Client/Network/PlayerList.cpp | 2 +- Minecraft.Client/Network/ServerChunkCache.cpp | 2 +- .../Platform/Common/DLC/DLCAudioFile.cpp | 8 +-- .../Platform/Common/DLC/DLCAudioFile.h | 8 +-- .../Platform/Common/DLC/DLCCapeFile.cpp | 2 +- .../Platform/Common/DLC/DLCCapeFile.h | 2 +- .../Common/DLC/DLCColourTableFile.cpp | 2 +- .../Platform/Common/DLC/DLCColourTableFile.h | 2 +- .../Platform/Common/DLC/DLCFile.h | 4 +- .../Platform/Common/DLC/DLCGameRulesFile.cpp | 4 +- .../Platform/Common/DLC/DLCGameRulesFile.h | 6 +-- .../Common/DLC/DLCGameRulesHeader.cpp | 6 +-- .../Platform/Common/DLC/DLCGameRulesHeader.h | 8 +-- .../Common/DLC/DLCLocalisationFile.cpp | 2 +- .../Platform/Common/DLC/DLCLocalisationFile.h | 4 +- .../Platform/Common/DLC/DLCManager.cpp | 14 ++--- .../Platform/Common/DLC/DLCManager.h | 4 +- .../Platform/Common/DLC/DLCPack.h | 4 +- .../Platform/Common/DLC/DLCSkinFile.cpp | 2 +- .../Platform/Common/DLC/DLCSkinFile.h | 2 +- .../Platform/Common/DLC/DLCTextureFile.cpp | 4 +- .../Platform/Common/DLC/DLCTextureFile.h | 6 +-- .../Platform/Common/DLC/DLCUIDataFile.cpp | 4 +- .../Platform/Common/DLC/DLCUIDataFile.h | 6 +-- .../Platform/Common/UI/IUIScene_StartGame.cpp | 4 +- .../Common/UI/UIScene_CreateWorldMenu.cpp | 24 ++++----- .../Platform/Common/UI/UIScene_LoadMenu.cpp | 18 +++---- .../Common/UI/UIScene_LoadOrJoinMenu.cpp | 22 ++++---- .../Platform/Common/XUI/XUI_LoadSettings.cpp | 8 +-- .../Common/XUI/XUI_MultiGameCreate.cpp | 6 +-- .../Common/XUI/XUI_MultiGameJoinLoad.cpp | 4 +- .../PS3/Network/SonyRemoteStorage_PS3.cpp | 6 +-- .../PSVita/Network/SonyRemoteStorage_Vita.cpp | 4 +- Minecraft.Client/Rendering/GameRenderer.cpp | 34 ++++++------ Minecraft.Client/Rendering/GameRenderer.h | 4 +- Minecraft.Client/Rendering/Tesselator.cpp | 52 +++++++++---------- Minecraft.Client/Rendering/Tesselator.h | 2 +- .../Textures/Packs/AbstractTexturePack.cpp | 4 +- .../Textures/Packs/AbstractTexturePack.h | 8 +-- Minecraft.Client/Textures/Packs/TexturePack.h | 4 +- Minecraft.Client/Utils/ArchiveFile.cpp | 4 +- Minecraft.Client/Utils/ArchiveFile.h | 2 +- Minecraft.Client/Utils/StringTable.cpp | 4 +- Minecraft.Client/Utils/StringTable.h | 4 +- .../IO/Files/ConsoleSaveFileConverter.cpp | 2 +- .../IO/Files/ConsoleSaveFileInputStream.cpp | 2 +- .../IO/Files/ConsoleSaveFileOutputStream.cpp | 2 +- Minecraft.World/IO/Files/File.cpp | 4 +- Minecraft.World/IO/Files/FileInputStream.cpp | 2 +- Minecraft.World/IO/Files/FileOutputStream.cpp | 2 +- Minecraft.World/IO/Streams/Compression.cpp | 8 +-- Minecraft.World/Level/CustomLevelSource.cpp | 20 +++---- .../Level/Storage/DirectoryLevelStorage.cpp | 4 +- Minecraft.World/Level/Storage/RegionFile.cpp | 16 +++--- .../Network/Packets/AddPlayerPacket.cpp | 16 +++--- .../Network/Packets/AddPlayerPacket.h | 2 +- .../Network/Packets/KickPlayerPacket.cpp | 2 +- .../Network/Packets/LoginPacket.cpp | 10 ++-- .../Network/Packets/PreLoginPacket.cpp | 2 +- Minecraft.World/Network/Socket.cpp | 18 +++---- Minecraft.World/Network/Socket.h | 4 +- Minecraft.World/Player/Player.cpp | 12 ++--- Minecraft.World/Player/Player.h | 2 +- 64 files changed, 229 insertions(+), 229 deletions(-) diff --git a/Minecraft.Client/Network/PlayerConnection.cpp b/Minecraft.Client/Network/PlayerConnection.cpp index 636ea6560..8669e1b91 100644 --- a/Minecraft.Client/Network/PlayerConnection.cpp +++ b/Minecraft.Client/Network/PlayerConnection.cpp @@ -1205,7 +1205,7 @@ void PlayerConnection::handleSetCreativeModeSlot(std::shared_ptrx = centreXC; data->z = centreZC; - data->dimension = (uint8_t) player->level->dimension->id; + data->dimension = (std::uint8_t) player->level->dimension->id; data->setDirty(); } diff --git a/Minecraft.Client/Network/PlayerList.cpp b/Minecraft.Client/Network/PlayerList.cpp index e56efca60..1f48183c8 100644 --- a/Minecraft.Client/Network/PlayerList.cpp +++ b/Minecraft.Client/Network/PlayerList.cpp @@ -211,7 +211,7 @@ void PlayerList::placeNewPlayer(Connection *connection, std::shared_ptrsend( std::shared_ptr( 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->getLevelData()->getXZSize(), level->getLevelData()->getHellScale() ) ) ); playerConnection->send( std::shared_ptr( new SetSpawnPositionPacket(spawnPos->x, spawnPos->y, spawnPos->z) ) ); diff --git a/Minecraft.Client/Network/ServerChunkCache.cpp b/Minecraft.Client/Network/ServerChunkCache.cpp index b479f49b2..2814d5f88 100644 --- a/Minecraft.Client/Network/ServerChunkCache.cpp +++ b/Minecraft.Client/Network/ServerChunkCache.cpp @@ -687,7 +687,7 @@ bool ServerChunkCache::save(bool force, ProgressListener *progressListener) } LevelChunk *chunk = NULL; - uint8_t workingThreads; + std::uint8_t workingThreads; bool chunkSet = false; // Created a roughly sorted list to match the order that the files were created in McRegionChunkStorage::McRegionChunkStorage. diff --git a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp index b25c0bec2..f5926fbbc 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCAudioFile.cpp @@ -12,7 +12,7 @@ DLCAudioFile::DLCAudioFile(const std::wstring &path) : DLCFile(DLCManager::e_DLC m_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_dataBytes = dataBytes; @@ -20,7 +20,7 @@ void DLCAudioFile::addData(uint8_t *pbData, std::uint32_t dataBytes) processDLCDataFile(pbData,dataBytes); } -uint8_t *DLCAudioFile::getData(std::uint32_t &dataBytes) +std::uint8_t *DLCAudioFile::getData(std::uint32_t &dataBytes) { dataBytes = m_dataBytes; 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 parameterMapping; 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); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; } - uint8_t *pbTemp = reinterpret_cast(pFile); + std::uint8_t *pbTemp = reinterpret_cast(pFile); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; for(unsigned int i=0;i m_parameters; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp index da72eec4b..a9edb92e8 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.cpp @@ -6,7 +6,7 @@ DLCCapeFile::DLCCapeFile(const std::wstring &path) : DLCFile(DLCManager::e_DLCTy { } -void DLCCapeFile::addData(uint8_t *pbData, std::uint32_t dataBytes) +void DLCCapeFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes) { app.AddMemoryTextureFile(m_path,pbData,dataBytes); } diff --git a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h b/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h index df7e51ca8..406ac3dc4 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCCapeFile.h @@ -6,5 +6,5 @@ class DLCCapeFile : public DLCFile public: DLCCapeFile(const std::wstring &path); - virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); + virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes); }; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp index 3922bae69..fed962a75 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp @@ -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(); m_colourTable = new ColourTable(defaultColourTable, pbData, dataBytes); diff --git a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h b/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h index 8ae18dcad..d75fec458 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.h @@ -12,7 +12,7 @@ public: DLCColourTableFile(const std::wstring &path); ~DLCColourTableFile(); - virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); + virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes); ColourTable *getColourTable() { return m_colourTable; } }; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCFile.h b/Minecraft.Client/Platform/Common/DLC/DLCFile.h index 9e6482250..3c0da1855 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCFile.h @@ -17,8 +17,8 @@ public: std::wstring getPath() { return m_path; } DWORD getSkinID() { return m_dwSkinId; } - virtual void addData(uint8_t *pbData, std::uint32_t dataBytes) {} - virtual uint8_t *getData(std::uint32_t &dataBytes) { dataBytes = 0; return NULL; } + virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes) {} + virtual std::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""; } diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp index 754aca694..1c91a39e3 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.cpp @@ -8,13 +8,13 @@ DLCGameRulesFile::DLCGameRulesFile(const std::wstring &path) : DLCGameRules(DLCM 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_dataBytes = dataBytes; } -uint8_t *DLCGameRulesFile::getData(std::uint32_t &dataBytes) +std::uint8_t *DLCGameRulesFile::getData(std::uint32_t &dataBytes) { dataBytes = m_dataBytes; return m_pbData; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h index 8e3ff0abf..56af6cd8c 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesFile.h @@ -4,12 +4,12 @@ class DLCGameRulesFile : public DLCGameRules { private: - uint8_t *m_pbData; + std::uint8_t *m_pbData; std::uint32_t m_dataBytes; public: DLCGameRulesFile(const std::wstring &path); - virtual void addData(uint8_t *pbData, std::uint32_t dataBytes); - virtual uint8_t *getData(std::uint32_t &dataBytes); + virtual void addData(std::uint8_t *pbData, std::uint32_t dataBytes); + virtual std::uint8_t *getData(std::uint32_t &dataBytes); }; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp index a9c4805d9..09afd4783 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.cpp @@ -21,7 +21,7 @@ DLCGameRulesHeader::DLCGameRulesHeader(const std::wstring &path) : DLCGameRules( lgo = NULL; } -void DLCGameRulesHeader::addData(uint8_t *pbData, std::uint32_t dataBytes) +void DLCGameRulesHeader::addData(std::uint8_t *pbData, std::uint32_t dataBytes) { m_pbData = pbData; m_dataBytes = dataBytes; @@ -73,13 +73,13 @@ void DLCGameRulesHeader::addData(uint8_t *pbData, std::uint32_t dataBytes) #endif } -uint8_t *DLCGameRulesHeader::getData(std::uint32_t &dataBytes) +std::uint8_t *DLCGameRulesHeader::getData(std::uint32_t &dataBytes) { dataBytes = m_dataBytes; 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) { diff --git a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h index 294180e9f..a947ece81 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCGameRulesHeader.h @@ -8,7 +8,7 @@ class DLCGameRulesHeader : public DLCGameRules, public JustGrSource private: // GR-Header - uint8_t *m_pbData; + std::uint8_t *m_pbData; 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, std::uint32_t dataBytes); - virtual uint8_t *getData(std::uint32_t &dataBytes); + virtual void addData(std::uint8_t *pbData, 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; } }; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp b/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp index 1c53207ff..c1f9c9e30 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.cpp @@ -8,7 +8,7 @@ DLCLocalisationFile::DLCLocalisationFile(const std::wstring &path) : DLCFile(DLC m_strings = NULL; } -void DLCLocalisationFile::addData(uint8_t *pbData, std::uint32_t dataBytes) +void DLCLocalisationFile::addData(std::uint8_t *pbData, std::uint32_t dataBytes) { m_strings = new StringTable(pbData, dataBytes); } diff --git a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h b/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h index 77e160cce..46f5782d4 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h +++ b/Minecraft.Client/Platform/Common/DLC/DLCLocalisationFile.h @@ -10,9 +10,9 @@ private: public: DLCLocalisationFile(const std::wstring &path); - DLCLocalisationFile(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; } }; diff --git a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp b/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp index 3f9311ce5..ff26b88c9 100644 --- a/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Platform/Common/DLC/DLCManager.cpp @@ -12,7 +12,7 @@ static const size_t DLC_WCHAR_BINARY = 2; 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; while (*p) s += (wchar_t)*p++; return s; @@ -363,7 +363,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const std::string &pat } 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); if(bSuccess==FALSE) { @@ -385,7 +385,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const std::string &pat return processDLCDataFile(dwFilesProcessed, pbData, bytesRead, pack); } -bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, uint8_t *pbData, DWORD dwLength, DLCPack *pack) +bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, std::uint8_t *pbData, DWORD dwLength, DLCPack *pack) { std::unordered_map parameterMapping; unsigned int uiCurrentByte=0; @@ -439,7 +439,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, uint8_t *pbData, DW dwTemp+=DLC_DETAIL_ADV(pFile->dwWchCount); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; } - uint8_t *pbTemp = reinterpret_cast(pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount; + std::uint8_t *pbTemp = reinterpret_cast(pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount; pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; for(unsigned int i=0;idwWchCount); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; } - uint8_t *pbTemp = reinterpret_cast(pFile); + std::uint8_t *pbTemp = reinterpret_cast(pFile); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; for(unsigned int i=0;iskins->getTexturePackByIndex(i); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { @@ -181,7 +181,7 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index) m_labelTexturePackDescription.setLabel(tp->getDesc1()); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); //if(imageBytes > 0 && imageData) //{ diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp index efa2cae05..83cf1d1cf 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp @@ -168,7 +168,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); 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 if (bRes) { - uint16_t pchText[128]; - ZeroMemory(pchText, 128 * sizeof(uint16_t) ); + std::uint16_t pchText[128]; + ZeroMemory(pchText, 128 * sizeof(std::uint16_t) ); InputManager.GetText(pchText); if(pchText[0]!=0) @@ -783,11 +783,11 @@ int UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,bool bR { #ifdef __PSVITA__ //CD - Changed to 2048 [SCE_IME_MAX_TEXT_LENGTH] - uint16_t pchText[2048]; - ZeroMemory(pchText, 2048 * sizeof(uint16_t) ); + std::uint16_t pchText[2048]; + ZeroMemory(pchText, 2048 * sizeof(std::uint16_t) ); #else - uint16_t pchText[128]; - ZeroMemory(pchText, 128 * sizeof(uint16_t) ); + std::uint16_t pchText[128]; + ZeroMemory(pchText, 128 * sizeof(std::uint16_t) ); #endif InputManager.GetText(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! // upsell psplus - int32_t iResult=sceNpCommerceDialogInitialize(); + std::int32_t iResult=sceNpCommerceDialogInitialize(); SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); @@ -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! // upsell psplus - int32_t iResult=sceNpCommerceDialogInitialize(); + std::int32_t iResult=sceNpCommerceDialogInitialize(); SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); @@ -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! // upsell psplus - int32_t iResult=sceNpCommerceDialogInitialize(); + std::int32_t iResult=sceNpCommerceDialogInitialize(); SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); @@ -1421,14 +1421,14 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor // int UIScene_CreateWorldMenu::PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) // { -// int32_t iResult; +// std::int32_t iResult; // UIScene_CreateWorldMenu *pClass = (UIScene_CreateWorldMenu *)pParam; // // // continue offline, or upsell PS Plus? // if(result==C4JStorage::EMessage_ResultDecline) // { // // upsell psplus -// int32_t iResult=sceNpCommerceDialogInitialize(); +// std::int32_t iResult=sceNpCommerceDialogInitialize(); // // SceNpCommerceDialogParam param; // sceNpCommerceDialogParamInitialize(¶m); diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp index 9febff710..09ecfe9c6 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_LoadMenu.cpp @@ -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 TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); 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__) // convert to utf16 - uint16_t u16Message[MAX_SAVEFILENAME_LENGTH]; + std::uint16_t u16Message[MAX_SAVEFILENAME_LENGTH]; size_t srclen,dstlen; srclen=MAX_SAVEFILENAME_LENGTH; dstlen=MAX_SAVEFILENAME_LENGTH; #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) // Already utf16 on durango memcpy(u16Message,params->saveDetails->UTF16SaveFilename, MAX_SAVEFILENAME_LENGTH); @@ -206,8 +206,8 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye { SceCesUcsContext Context; sceCesUcsContextInit( &Context ); - uint32_t utf8Len, utf16Len; - sceCesUtf8StrToUtf16Str(&Context, (uint8_t *)params->saveDetails->UTF8SaveFilename, srclen, &utf8Len, u16Message, dstlen, &utf16Len); + std::uint32_t utf8Len, utf16Len; + sceCesUtf8StrToUtf16Str(&Context, (std::uint8_t *)params->saveDetails->UTF8SaveFilename, srclen, &utf8Len, u16Message, dstlen, &utf16Len); } #endif 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); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); 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! // upsell psplus - int32_t iResult=sceNpCommerceDialogInitialize(); + std::int32_t iResult=sceNpCommerceDialogInitialize(); SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); @@ -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! // upsell psplus - int32_t iResult=sceNpCommerceDialogInitialize(); + std::int32_t iResult=sceNpCommerceDialogInitialize(); SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); @@ -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) // { -// int32_t iResult; +// std::int32_t iResult; // UIScene_LoadMenu *pClass = (UIScene_LoadMenu *)pParam; // // // continue offline, or upsell PS Plus? diff --git a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp index bbfd4ed0d..4c02e5be4 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -657,7 +657,7 @@ void UIScene_LoadOrJoinMenu::tick() if(!m_bExitScene) { // convert to utf16 - uint16_t u16Message[MAX_SAVEFILENAME_LENGTH]; + std::uint16_t u16Message[MAX_SAVEFILENAME_LENGTH]; #ifdef _DURANGO // Already utf16 on durango memcpy(u16Message, m_saveDetails[m_iRequestingThumbnailId].UTF16SaveFilename, MAX_SAVEFILENAME_LENGTH); @@ -675,19 +675,19 @@ void UIScene_LoadOrJoinMenu::tick() #ifdef __PS3 size_t srcmax,dstmax; #else - uint32_t srcmax,dstmax; - uint32_t srclen,dstlen; + std::uint32_t srcmax,dstmax; + std::uint32_t srclen,dstlen; #endif srcmax=MAX_SAVEFILENAME_LENGTH; dstmax=MAX_SAVEFILENAME_LENGTH; #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 SceCesUcsContext 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 if( m_saveDetails[m_iRequestingThumbnailId].pbThumbnailData ) @@ -928,7 +928,7 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons() m_iMashUpButtonsC++; TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId()); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { @@ -1172,8 +1172,8 @@ int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,boo pClass->m_bIgnoreInput=false; if (bRes) { - uint16_t ui16Text[128]; - ZeroMemory(ui16Text, 128 * sizeof(uint16_t) ); + std::uint16_t ui16Text[128]; + ZeroMemory(ui16Text, 128 * sizeof(std::uint16_t) ); InputManager.GetText(ui16Text); // check the name is valid @@ -1453,7 +1453,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) // PS Plus upsell // 4J-PB - we're not allowed to show the text Playstation Plus - have to call the upsell all the time! // upsell psplus - int32_t iResult=sceNpCommerceDialogInitialize(); + std::int32_t iResult=sceNpCommerceDialogInitialize(); SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); @@ -1692,7 +1692,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() HRESULT hr; std::uint32_t imageBytes = 0; - uint8_t *imageData = NULL; + std::uint8_t *imageData = NULL; if(tp==NULL) { @@ -1727,7 +1727,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(0); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp index 4695a769a..c9c590485 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_LoadSettings.cpp @@ -131,7 +131,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl // retrieve the save icon from the texture pack, if there is one TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { @@ -271,7 +271,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { @@ -1281,7 +1281,7 @@ void CScene_LoadGameSettings::UpdateTexturePackDescription(int index) m_texturePackDescription.SetText(tp->getDesc1().c_str()); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { @@ -1533,7 +1533,7 @@ HRESULT CScene_LoadGameSettings::OnCustomMessage_DLCMountingComplete() ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp index 253f33807..b51ef1a79 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameCreate.cpp @@ -185,7 +185,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { @@ -1139,7 +1139,7 @@ void CScene_MultiGameCreate::UpdateTexturePackDescription(int index) m_texturePackDescription.SetText(tp->getDesc1().c_str()); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { @@ -1288,7 +1288,7 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); if(imageBytes > 0 && imageData) { diff --git a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp index f60944386..79c0d87eb 100644 --- a/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp +++ b/Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp @@ -296,7 +296,7 @@ void CScene_MultiGameJoinLoad::AddDefaultButtons() m_iMashUpButtonsC++; TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId()); std::uint32_t imageBytes = 0; - uint8_t *imageData = tp->getPackIcon(imageBytes); + std::uint8_t *imageData = tp->getPackIcon(imageBytes); HXUIBRUSH hXuiBrush; if(imageBytes > 0 && imageData) @@ -1271,7 +1271,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() HRESULT hr; std::uint32_t imageBytes = 0; - uint8_t *imageData = NULL; + std::uint8_t *imageData = NULL; if(tp==NULL) { diff --git a/Minecraft.Client/Platform/PS3/Network/SonyRemoteStorage_PS3.cpp b/Minecraft.Client/Platform/PS3/Network/SonyRemoteStorage_PS3.cpp index c40bc20bd..ab16c7b71 100644 --- a/Minecraft.Client/Platform/PS3/Network/SonyRemoteStorage_PS3.cpp +++ b/Minecraft.Client/Platform/PS3/Network/SonyRemoteStorage_PS3.cpp @@ -85,12 +85,12 @@ int SonyRemoteStorage_PS3::initPreconditions() 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); } -void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, int32_t retCode) +void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, std::int32_t 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 // And another 4 bytes to store the decompressed data size unsigned int compLength = origFilesize+8; - uint8_t *compData = (uint8_t *)malloc( compLength ); + std::uint8_t *compData = (std::uint8_t *)malloc( compLength ); Compression::UseDefaultThreadStorage(); Compression::getCompression()->Compress(compData+8,&compLength,pOrigSaveData,origFilesize); ZeroMemory(compData,8); diff --git a/Minecraft.Client/Platform/PSVita/Network/SonyRemoteStorage_Vita.cpp b/Minecraft.Client/Platform/PSVita/Network/SonyRemoteStorage_Vita.cpp index 1d7a22d42..70117ffce 100644 --- a/Minecraft.Client/Platform/PSVita/Network/SonyRemoteStorage_Vita.cpp +++ b/Minecraft.Client/Platform/PSVita/Network/SonyRemoteStorage_Vita.cpp @@ -25,12 +25,12 @@ 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); } -void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, int32_t retCode) +void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, std::int32_t retCode) { m_lastErrorCode = retCode; diff --git a/Minecraft.Client/Rendering/GameRenderer.cpp b/Minecraft.Client/Rendering/GameRenderer.cpp index 70cb0f521..ac338e36f 100644 --- a/Minecraft.Client/Rendering/GameRenderer.cpp +++ b/Minecraft.Client/Rendering/GameRenderer.cpp @@ -57,7 +57,7 @@ C4JThread* GameRenderer::m_updateThread; C4JThread::EventArray* GameRenderer::m_updateEvents; bool GameRenderer::nearThingsToDo = false; bool GameRenderer::updateRunning = false; -std::vector GameRenderer::m_deleteStackByte; +std::vector GameRenderer::m_deleteStackByte; std::vector GameRenderer::m_deleteStackSparseLightStorage; std::vector GameRenderer::m_deleteStackCompressedTileStorage; std::vector GameRenderer::m_deleteStackSparseDataStorage; @@ -1129,7 +1129,7 @@ void GameRenderer::renderLevel(float a) #ifdef MULTITHREAD_ENABLE // 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); 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 ); - uint8_t redComponent = ((colour>>16)&0xFF); - uint8_t greenComponent = ((colour>>8)&0xFF); - uint8_t blueComponent = ((colour)&0xFF); + std::uint8_t redComponent = ((colour>>16)&0xFF); + std::uint8_t greenComponent = ((colour>>8)&0xFF); + std::uint8_t blueComponent = ((colour)&0xFF); fr = (float)redComponent/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 ); - uint8_t redComponent = ((colour>>16)&0xFF); - uint8_t greenComponent = ((colour>>8)&0xFF); - uint8_t blueComponent = ((colour)&0xFF); + std::uint8_t redComponent = ((colour>>16)&0xFF); + std::uint8_t greenComponent = ((colour>>8)&0xFF); + std::uint8_t blueComponent = ((colour)&0xFF); fr = (float)redComponent/256;//0.6f; 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 unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_In_Cloud_Fog_Colour ); - uint8_t redComponent = ((colour>>16)&0xFF); - uint8_t greenComponent = ((colour>>8)&0xFF); - uint8_t blueComponent = ((colour)&0xFF); + std::uint8_t redComponent = ((colour>>16)&0xFF); + std::uint8_t greenComponent = ((colour>>8)&0xFF); + std::uint8_t blueComponent = ((colour)&0xFF); float rr = (float)redComponent/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 ); - uint8_t redComponent = ((colour>>16)&0xFF); - uint8_t greenComponent = ((colour>>8)&0xFF); - uint8_t blueComponent = ((colour)&0xFF); + std::uint8_t redComponent = ((colour>>16)&0xFF); + std::uint8_t greenComponent = ((colour>>8)&0xFF); + std::uint8_t blueComponent = ((colour)&0xFF); float rr = (float)redComponent/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 unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Fog_Colour ); - uint8_t redComponent = ((colour>>16)&0xFF); - uint8_t greenComponent = ((colour>>8)&0xFF); - uint8_t blueComponent = ((colour)&0xFF); + std::uint8_t redComponent = ((colour>>16)&0xFF); + std::uint8_t greenComponent = ((colour>>8)&0xFF); + std::uint8_t blueComponent = ((colour)&0xFF); float rr = (float)redComponent/256;//0.4f; float gg = (float)greenComponent/256;//0.3f; diff --git a/Minecraft.Client/Rendering/GameRenderer.h b/Minecraft.Client/Rendering/GameRenderer.h index 57c32f696..3f1dc26fd 100644 --- a/Minecraft.Client/Rendering/GameRenderer.h +++ b/Minecraft.Client/Rendering/GameRenderer.h @@ -156,12 +156,12 @@ public: static bool nearThingsToDo; static bool updateRunning; #endif - static std::vector m_deleteStackByte; + static std::vector m_deleteStackByte; static std::vector m_deleteStackSparseLightStorage; static std::vector m_deleteStackCompressedTileStorage; static std::vector m_deleteStackSparseDataStorage; 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(CompressedTileStorage *deleteThis); static void AddForDelete(SparseDataStorage *deleteThis); diff --git a/Minecraft.Client/Rendering/Tesselator.cpp b/Minecraft.Client/Rendering/Tesselator.cpp index f4b12390c..cb48ee3c3 100644 --- a/Minecraft.Client/Rendering/Tesselator.cpp +++ b/Minecraft.Client/Rendering/Tesselator.cpp @@ -329,7 +329,7 @@ void Tesselator::color(int r, int g, int b, int 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); } @@ -510,16 +510,16 @@ void Tesselator::tileQuad(float x1, float y1, float z1, float u1, float v1, floa count+=4; // 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 ) { - pShortData = (int16_t*)&_array->data[p]; + pShortData = (std::int16_t*)&_array->data[p]; p += 16; vertices+=4; } else { - pShortData = (int16_t*)&_array2->data[p2]; + pShortData = (std::int16_t*)&_array2->data[p2]; p2 += 16; vertices2+=4; } @@ -784,25 +784,25 @@ void Tesselator::vertex(float x, float y, float z) #ifdef __PSVITA__ // 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 ) { - pShortData = (int16_t*)&_array->data[p]; + pShortData = (std::int16_t*)&_array->data[p]; } else { - pShortData = (int16_t*)&_array2->data[p2]; + pShortData = (std::int16_t*)&_array2->data[p2]; } #else - int16_t* pShortData = (int16_t*)&_array->data[p]; + std::int16_t* pShortData = (std::int16_t*)&_array->data[p]; #endif #ifdef __PS3__ - float tex2U = ((int16_t*)&_tex2)[1] + 8; - float tex2V = ((int16_t*)&_tex2)[0] + 8; + float tex2U = ((std::int16_t*)&_tex2)[1] + 8; + float tex2V = ((std::int16_t*)&_tex2)[0] + 8; float colVal1 = ((col&0xff000000)>>24)/256.0f; float colVal2 = ((col&0x00ff0000)>>16)/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[4] = (((int)(uu * 8192.0f))&0xffff); pShortData[5] = (((int)(v * 8192.0f))&0xffff); - int16_t u2 = ((int16_t*)&_tex2)[0]; - int16_t v2 = ((int16_t*)&_tex2)[1]; + std::int16_t u2 = ((std::int16_t*)&_tex2)[0]; + std::int16_t v2 = ((std::int16_t*)&_tex2)[1]; #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. // 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 ); #else #ifdef __PS3__ - int16_t tex2U = ((int16_t*)&_tex2)[1] + 8; - int16_t tex2V = ((int16_t*)&_tex2)[0] + 8; - int16_t* pShortArray = (int16_t*)&_array->data[p + 7]; + std::int16_t tex2U = ((std::int16_t*)&_tex2)[1] + 8; + std::int16_t tex2V = ((std::int16_t*)&_tex2)[0] + 8; + std::int16_t* pShortArray = (std::int16_t*)&_array->data[p + 7]; pShortArray[0] = tex2U; pShortArray[1] = tex2V; #else @@ -997,7 +997,7 @@ void Tesselator::noColor() } #ifdef __PS3__ -uint32_t _ConvertF32toX11Y11Z10N(float x, float y, float z) +std::uint32_t _ConvertF32toX11Y11Z10N(float x, float y, float z) { // 11111111111 X 0x000007FF // 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); } #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 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 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 uint32_t xyz = uX | uY | uZ; + 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 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 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 std::uint32_t xyz = uX | uY | uZ; return xyz; } #endif // __PS3__ @@ -1038,14 +1038,14 @@ void Tesselator::normal(float x, float y, float z) _normal = _ConvertF32toX11Y11Z10N(x,y,z); #elif __PSVITA__ // 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); - int8_t yy = (int8_t) (y * 127); - int8_t zz = (int8_t) (z * 127); + std::int8_t xx = (std::int8_t) (x * 127); + std::int8_t yy = (std::int8_t) (y * 127); + std::int8_t zz = (std::int8_t) (z * 127); _normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16); #else - uint8_t xx = (uint8_t) (x * 127); - uint8_t yy = (uint8_t) (y * 127); - uint8_t zz = (uint8_t) (z * 127); + std::uint8_t xx = (std::uint8_t) (x * 127); + std::uint8_t yy = (std::uint8_t) (y * 127); + std::uint8_t zz = (std::uint8_t) (z * 127); _normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16); #endif } diff --git a/Minecraft.Client/Rendering/Tesselator.h b/Minecraft.Client/Rendering/Tesselator.h index 59960873c..eefeaa73a 100644 --- a/Minecraft.Client/Rendering/Tesselator.h +++ b/Minecraft.Client/Rendering/Tesselator.h @@ -138,7 +138,7 @@ public: 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, 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 vertex(float x, float y, float z); void color(int c); diff --git a/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp b/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp index 4a8aa44e0..1ca33c9af 100644 --- a/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp +++ b/Minecraft.Client/Textures/Packs/AbstractTexturePack.cpp @@ -373,14 +373,14 @@ std::wstring AbstractTexturePack::getXuiRootPath() 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(); imageBytes = m_iconSize; 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(); diff --git a/Minecraft.Client/Textures/Packs/AbstractTexturePack.h b/Minecraft.Client/Textures/Packs/AbstractTexturePack.h index 3c2176622..d9cbd8222 100644 --- a/Minecraft.Client/Textures/Packs/AbstractTexturePack.h +++ b/Minecraft.Client/Textures/Packs/AbstractTexturePack.h @@ -19,10 +19,10 @@ protected: std::wstring desc1; std::wstring desc2; - uint8_t *m_iconData; + std::uint8_t *m_iconData; std::uint32_t m_iconSize; - uint8_t *m_comparisonData; + std::uint8_t *m_comparisonData; std::uint32_t m_comparisonSize; TexturePack *fallback; @@ -84,8 +84,8 @@ public: virtual void loadUI(); virtual void unloadUI(); virtual std::wstring getXuiRootPath(); - virtual uint8_t *getPackIcon(std::uint32_t &imageBytes); - virtual uint8_t *getPackComparison(std::uint32_t &imageBytes); + virtual std::uint8_t *getPackIcon(std::uint32_t &imageBytes); + virtual std::uint8_t *getPackComparison(std::uint32_t &imageBytes); virtual unsigned int getDLCParentPackId(); virtual unsigned char getDLCSubPackId(); virtual ColourTable *getColourTable() { return m_colourTable; } diff --git a/Minecraft.Client/Textures/Packs/TexturePack.h b/Minecraft.Client/Textures/Packs/TexturePack.h index ed36f63dd..045659ac5 100644 --- a/Minecraft.Client/Textures/Packs/TexturePack.h +++ b/Minecraft.Client/Textures/Packs/TexturePack.h @@ -47,8 +47,8 @@ public: virtual void loadUI() = 0; virtual void unloadUI() = 0; virtual std::wstring getXuiRootPath() = 0; - virtual uint8_t *getPackIcon(std::uint32_t &imageBytes) = 0; - virtual uint8_t *getPackComparison(std::uint32_t &imageBytes) = 0; + virtual std::uint8_t *getPackIcon(std::uint32_t &imageBytes) = 0; + virtual std::uint8_t *getPackComparison(std::uint32_t &imageBytes) = 0; virtual unsigned int getDLCParentPackId() = 0; virtual unsigned char getDLCSubPackId() = 0; virtual ColourTable *getColourTable() = 0; diff --git a/Minecraft.Client/Utils/ArchiveFile.cpp b/Minecraft.Client/Utils/ArchiveFile.cpp index eddd8a7fa..d39e38591 100644 --- a/Minecraft.Client/Utils/ArchiveFile.cpp +++ b/Minecraft.Client/Utils/ArchiveFile.cpp @@ -122,7 +122,7 @@ byteArray ArchiveFile::getFile(const std::wstring &filename) memcpy( out.data, m_cachedData + data->ptr, data->filesize ); #else const unsigned int fileSize = static_cast(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); const PortableFileIO::BinaryReadResult readResult = PortableFileIO::ReadBinaryFileSegment( m_sourcefile.getPath(), @@ -151,7 +151,7 @@ byteArray ArchiveFile::getFile(const std::wstring &filename) unsigned int decompressedSize = dis.readInt(); 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); delete [] out.data; diff --git a/Minecraft.Client/Utils/ArchiveFile.h b/Minecraft.Client/Utils/ArchiveFile.h index ac2fe84d9..d3f34e8be 100644 --- a/Minecraft.Client/Utils/ArchiveFile.h +++ b/Minecraft.Client/Utils/ArchiveFile.h @@ -13,7 +13,7 @@ class ArchiveFile { protected: File m_sourcefile; - uint8_t *m_cachedData; + std::uint8_t *m_cachedData; typedef struct _MetaData { diff --git a/Minecraft.Client/Utils/StringTable.cpp b/Minecraft.Client/Utils/StringTable.cpp index c86166750..2a675e707 100644 --- a/Minecraft.Client/Utils/StringTable.cpp +++ b/Minecraft.Client/Utils/StringTable.cpp @@ -7,7 +7,7 @@ StringTable::StringTable(void) } // 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); @@ -119,7 +119,7 @@ StringTable::~StringTable(void) // 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; *pSize = src.length; diff --git a/Minecraft.Client/Utils/StringTable.h b/Minecraft.Client/Utils/StringTable.h index 8a66ffdac..c3ce4bccb 100644 --- a/Minecraft.Client/Utils/StringTable.h +++ b/Minecraft.Client/Utils/StringTable.h @@ -61,10 +61,10 @@ public: // }; StringTable(void); - StringTable(uint8_t *pbData, unsigned int dataSize); + StringTable(std::uint8_t *pbData, unsigned int dataSize); ~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(int id); diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp index e208e1953..819156385 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp @@ -10,7 +10,7 @@ void ConsoleSaveFileConverter::ProcessSimpleFile(ConsoleSaveFile *sourceSave, Fi unsigned int numberOfBytesRead = 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 sourceSave->readFile(sourceFileEntry, data, sourceFileEntry->getFileSize(), &numberOfBytesRead); diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp index 36d34e9a9..7f60b210e 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp @@ -25,7 +25,7 @@ ConsoleSaveFileInputStream::ConsoleSaveFileInputStream(ConsoleSaveFile *saveFile //the next byte of data, or -1 if the end of the file is reached. int ConsoleSaveFileInputStream::read() { - uint8_t byteRead = static_cast(0); + std::uint8_t byteRead = static_cast(0); unsigned int numberOfBytesRead; bool result = m_saveFile->readFile( diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp index e2e8b68c9..93a42efb7 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp @@ -38,7 +38,7 @@ void ConsoleSaveFileOutputStream::write(unsigned int b) { unsigned int numberOfBytesWritten; - uint8_t value = (uint8_t) b; + std::uint8_t value = (std::uint8_t) b; bool result = m_saveFile->writeFile( m_file, diff --git a/Minecraft.World/IO/Files/File.cpp b/Minecraft.World/IO/Files/File.cpp index aa789546a..c3cdc9598 100644 --- a/Minecraft.World/IO/Files/File.cpp +++ b/Minecraft.World/IO/Files/File.cpp @@ -410,7 +410,7 @@ std::vector *File::listFiles() const CellFsErrno err = cellFsOpendir(filePath , &fd); CellFsDirectoryEntry de; - uint32_t count = 0; + std::uint32_t count = 0; err = cellFsGetDirectoryEntries(fd, &de, sizeof(CellFsDirectoryEntry), &count); if(count != 0) { @@ -572,7 +572,7 @@ std::vector *File::listFiles(FileFilter *filter) const CellFsErrno err = cellFsOpendir(filePath, &fd); CellFsDirectoryEntry de; - uint32_t count = 0; + std::uint32_t count = 0; err = cellFsGetDirectoryEntries(fd, &de, sizeof(CellFsDirectoryEntry), &count); if(count != 0) { diff --git a/Minecraft.World/IO/Files/FileInputStream.cpp b/Minecraft.World/IO/Files/FileInputStream.cpp index 14d91f8b2..f3abe198c 100644 --- a/Minecraft.World/IO/Files/FileInputStream.cpp +++ b/Minecraft.World/IO/Files/FileInputStream.cpp @@ -75,7 +75,7 @@ int FileInputStream::read() return -1; } - uint8_t byteRead = static_cast(0); + std::uint8_t byteRead = static_cast(0); const size_t numberOfBytesRead = std::fread(&byteRead, 1, 1, m_fileHandle); if( std::ferror(m_fileHandle) != 0 ) diff --git a/Minecraft.World/IO/Files/FileOutputStream.cpp b/Minecraft.World/IO/Files/FileOutputStream.cpp index 904f6fca7..699f75101 100644 --- a/Minecraft.World/IO/Files/FileOutputStream.cpp +++ b/Minecraft.World/IO/Files/FileOutputStream.cpp @@ -51,7 +51,7 @@ void FileOutputStream::write(unsigned int b) 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 int result = std::ferror(m_fileHandle); diff --git a/Minecraft.World/IO/Streams/Compression.cpp b/Minecraft.World/IO/Streams/Compression.cpp index c38bf096e..2f0947191 100644 --- a/Minecraft.World/IO/Streams/Compression.cpp +++ b/Minecraft.World/IO/Streams/Compression.cpp @@ -312,7 +312,7 @@ HRESULT Compression::Compress(void *pDestination, unsigned int *pDestSize, void *pDestSize = (unsigned int)destSize; return ( ( res == Z_OK ) ? S_OK : -1 ); #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); *pDestSize = (unsigned int)destSize; return ( ( res ) ? S_OK : -1 ); @@ -340,7 +340,7 @@ HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, voi *pDestSize = (unsigned int)destSize; return ( ( res == Z_OK ) ? S_OK : -1 ); #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); *pDestSize = (unsigned int)destSize; return ( ( res ) ? S_OK : -1 ); @@ -356,11 +356,11 @@ HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, voi #ifndef _XBOX 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 Page = 0; int Index = 0; - uint8_t* Data = (uint8_t*)pDestination; + std::uint8_t* Data = (std::uint8_t*)pDestination; while( Index != SrcSize ) { // is this a normal value diff --git a/Minecraft.World/Level/CustomLevelSource.cpp b/Minecraft.World/Level/CustomLevelSource.cpp index d31aed6b2..a0d4fd057 100644 --- a/Minecraft.World/Level/CustomLevelSource.cpp +++ b/Minecraft.World/Level/CustomLevelSource.cpp @@ -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 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) { - 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 @@ -226,8 +226,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi int run = -1; - uint8_t top = b->topMaterial; - uint8_t material = b->material; + std::uint8_t top = b->topMaterial; + std::uint8_t material = b->material; LevelGenerationOptions *lgo = app.getLevelGenerationOptions(); 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 <= 0 + random->nextInt(5)) { - blocks[offs] = (uint8_t) Tile::unbreakable_Id; + blocks[offs] = (std::uint8_t) Tile::unbreakable_Id; } else { @@ -267,7 +267,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (runDepth <= 0) { top = 0; - material = (uint8_t) Tile::rock_Id; + material = (std::uint8_t) Tile::rock_Id; } 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 (temp < 0.15f) top = (uint8_t) Tile::ice_Id; - else top = (uint8_t) Tile::calmWater_Id; + if (temp < 0.15f) top = (std::uint8_t) Tile::ice_Id; + else top = (std::uint8_t) Tile::calmWater_Id; } run = runDepth; @@ -299,7 +299,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (run == 0 && material == Tile::sand_Id) { 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 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); byteArray blocks = byteArray(tileData,blocksSize); // byteArray blocks = byteArray(16 * level->depth * 16); diff --git a/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp b/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp index e70c2d49c..eee1b4068 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp +++ b/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp @@ -19,7 +19,7 @@ _MapDataMappings::_MapDataMappings() #ifndef _DURANGO ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA); #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) @@ -84,7 +84,7 @@ _MapDataMappings_old::_MapDataMappings_old() #ifndef _DURANGO ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA); #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) diff --git a/Minecraft.World/Level/Storage/RegionFile.cpp b/Minecraft.World/Level/Storage/RegionFile.cpp index 03e59f4bd..d47a0eddf 100644 --- a/Minecraft.World/Level/Storage/RegionFile.cpp +++ b/Minecraft.World/Level/Storage/RegionFile.cpp @@ -57,10 +57,10 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) //if ((GetFileSize(file,NULL) & 0xfff) != 0) if ((fileEntry->getFileSize() & 0xfff) != 0) { - //uint8_t zero = 0; + //std::uint8_t zero = 0; unsigned int numberOfBytesWritten = 0; 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); /* 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); - uint8_t *data = new uint8_t[length]; - uint8_t *decomp = new uint8_t[decompLength]; + std::uint8_t *data = new std::uint8_t[length]; + std::uint8_t *decomp = new std::uint8_t[decompLength]; MemSect(0); readDecompLength = decompLength; 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 */ -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 - 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; 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 */ -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; //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); @@ -451,7 +451,7 @@ void RegionFile::insertInitialSectors() { m_saveFile->setFilePointer( fileEntry, 0, SaveFileSeekOrigin::Begin ); unsigned int numberOfBytesWritten = 0; - uint8_t zeroBytes[ SECTOR_BYTES ]; + std::uint8_t zeroBytes[ SECTOR_BYTES ]; ZeroMemory(zeroBytes, SECTOR_BYTES); /* we need to write the chunk offset table */ diff --git a/Minecraft.World/Network/Packets/AddPlayerPacket.cpp b/Minecraft.World/Network/Packets/AddPlayerPacket.cpp index f1c32d19b..fe5a40516 100644 --- a/Minecraft.World/Network/Packets/AddPlayerPacket.cpp +++ b/Minecraft.World/Network/Packets/AddPlayerPacket.cpp @@ -45,9 +45,9 @@ AddPlayerPacket::AddPlayerPacket(std::shared_ptr player, PlayerUID xuid, // 4J - changed - send current "previously sent" value of rotations to put this in sync with other clients yRot = yRotp; xRot = xRotp; - yHeadRot = static_cast(yHeadRotp); // 4J Added - // yRot = (uint8_t) (player->yRot * 256 / 360); - // xRot = (uint8_t) (player->xRot * 256 / 360); + yHeadRot = static_cast(yHeadRotp); // 4J Added + // yRot = (std::uint8_t) (player->yRot * 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); @@ -97,13 +97,13 @@ void AddPlayerPacket::write(DataOutputStream *dos) //throws IOException dos->writeInt(x); dos->writeInt(y); dos->writeInt(z); - dos->writeByte(static_cast(yRot)); - dos->writeByte(static_cast(xRot)); - dos->writeByte(static_cast(m_playerIndex)); // 4J Added + dos->writeByte(static_cast(yRot)); + dos->writeByte(static_cast(xRot)); + dos->writeByte(static_cast(m_playerIndex)); // 4J Added dos->writeShort(carriedItem); dos->writePlayerUID(xuid); dos->writePlayerUID(OnlineXuid); - dos->writeByte(static_cast(m_playerIndex)); // 4J Added + dos->writeByte(static_cast(m_playerIndex)); // 4J Added int skinId = 0; std::memcpy(&skinId, &m_skinId, sizeof(m_skinId)); dos->writeInt(skinId); @@ -122,7 +122,7 @@ void AddPlayerPacket::handle(PacketListener *listener) 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 ) { diff --git a/Minecraft.World/Network/Packets/AddPlayerPacket.h b/Minecraft.World/Network/Packets/AddPlayerPacket.h index 43b86165f..1cef92752 100644 --- a/Minecraft.World/Network/Packets/AddPlayerPacket.h +++ b/Minecraft.World/Network/Packets/AddPlayerPacket.h @@ -26,7 +26,7 @@ public: std::uint32_t m_skinId; // 4J Added std::uint32_t m_capeId; // 4J Added unsigned int m_uiGamePrivileges; // 4J Added - uint8_t yHeadRot; // 4J Added + std::uint8_t yHeadRot; // 4J Added AddPlayerPacket(); ~AddPlayerPacket(); diff --git a/Minecraft.World/Network/Packets/KickPlayerPacket.cpp b/Minecraft.World/Network/Packets/KickPlayerPacket.cpp index fcbdce6bc..afb1666cf 100644 --- a/Minecraft.World/Network/Packets/KickPlayerPacket.cpp +++ b/Minecraft.World/Network/Packets/KickPlayerPacket.cpp @@ -28,7 +28,7 @@ void KickPlayerPacket::read(DataInputStream *dis) //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() diff --git a/Minecraft.World/Network/Packets/LoginPacket.cpp b/Minecraft.World/Network/Packets/LoginPacket.cpp index 83b04924a..9eafe5cc5 100644 --- a/Minecraft.World/Network/Packets/LoginPacket.cpp +++ b/Minecraft.World/Network/Packets/LoginPacket.cpp @@ -146,18 +146,18 @@ void LoginPacket::write(DataOutputStream *dos) //throws IOException } dos->writeLong(seed); dos->writeInt(gameType); - dos->writeByte((uint8_t)dimension); - dos->writeByte((uint8_t)mapHeight); - dos->writeByte((uint8_t)maxPlayers); + dos->writeByte((std::uint8_t)dimension); + dos->writeByte((std::uint8_t)mapHeight); + dos->writeByte((std::uint8_t)maxPlayers); dos->writePlayerUID(m_offlineXuid); dos->writePlayerUID(m_onlineXuid); dos->writeBoolean(m_friendsOnlyUGC); int ugcPlayersVersion = 0; std::memcpy(&ugcPlayersVersion, &m_ugcPlayersVersion, sizeof(m_ugcPlayersVersion)); dos->writeInt(ugcPlayersVersion); - dos->writeByte((uint8_t)difficulty); + dos->writeByte((std::uint8_t)difficulty); dos->writeInt(m_multiplayerInstanceId); - dos->writeByte((uint8_t)m_playerIndex); + dos->writeByte((std::uint8_t)m_playerIndex); int skinId = 0; std::memcpy(&skinId, &m_playerSkinId, sizeof(m_playerSkinId)); dos->writeInt(skinId); diff --git a/Minecraft.World/Network/Packets/PreLoginPacket.cpp b/Minecraft.World/Network/Packets/PreLoginPacket.cpp index 030c3e88e..d3e746e1a 100644 --- a/Minecraft.World/Network/Packets/PreLoginPacket.cpp +++ b/Minecraft.World/Network/Packets/PreLoginPacket.cpp @@ -96,7 +96,7 @@ void PreLoginPacket::write(DataOutputStream *dos) //throws IOException std::int32_t ugcPlayersVersion = 0; std::memcpy(&ugcPlayersVersion, &m_ugcPlayersVersion, sizeof(m_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) { dos->writePlayerUID( m_playerXuids[i] ); diff --git a/Minecraft.World/Network/Socket.cpp b/Minecraft.World/Network/Socket.cpp index b6d252532..010b29dfe 100644 --- a/Minecraft.World/Network/Socket.cpp +++ b/Minecraft.World/Network/Socket.cpp @@ -11,7 +11,7 @@ // link, the end (0 or 1) is passed as a parameter to the ctor. CRITICAL_SECTION Socket::s_hostQueueLock[2]; -std::queue Socket::s_hostQueue[2]; +std::queue Socket::s_hostQueue[2]; Socket::SocketOutputStreamLocal *Socket::s_hostOutStream[2]; Socket::SocketInputStreamLocal *Socket::s_hostInStream[2]; ServerConnection *Socket::s_serverConnection = NULL; @@ -49,7 +49,7 @@ void Socket::Initialise(ServerConnection *serverConnection) if(TryEnterCriticalSection(&s_hostQueueLock[i])) { // Clear the queue - std::queue empty; + std::queue empty; std::swap( s_hostQueue[i], empty ); LeaveCriticalSection(&s_hostQueueLock[i]); } @@ -298,7 +298,7 @@ int Socket::SocketInputStreamLocal::read() { 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(); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); return retval; @@ -344,7 +344,7 @@ void Socket::SocketInputStreamLocal::close() { m_streamOpen = false; EnterCriticalSection(&s_hostQueueLock[m_queueIdx]); - std::queue().swap(s_hostQueue[m_queueIdx]); + std::queue().swap(s_hostQueue[m_queueIdx]); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); } @@ -363,7 +363,7 @@ void Socket::SocketOutputStreamLocal::write(unsigned int b) return; } 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]); } @@ -392,7 +392,7 @@ void Socket::SocketOutputStreamLocal::close() { m_streamOpen = false; EnterCriticalSection(&s_hostQueueLock[m_queueIdx]); - std::queue().swap(s_hostQueue[m_queueIdx]); + std::queue().swap(s_hostQueue[m_queueIdx]); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); } @@ -414,7 +414,7 @@ int Socket::SocketInputStreamNetwork::read() { 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(); LeaveCriticalSection(&m_socket->m_queueLockNetwork[m_queueIdx]); return retval; @@ -474,8 +474,8 @@ void Socket::SocketOutputStreamNetwork::write(unsigned int b) { if( m_streamOpen != true ) return; byteArray barray; - uint8_t bb; - bb = (uint8_t)b; + std::uint8_t bb; + bb = (std::uint8_t)b; barray.data = &bb; barray.length = 1; write(barray, 0, 1); diff --git a/Minecraft.World/Network/Socket.h b/Minecraft.World/Network/Socket.h index aed12b0b7..293f9dd4a 100644 --- a/Minecraft.World/Network/Socket.h +++ b/Minecraft.World/Network/Socket.h @@ -97,12 +97,12 @@ private: // For local connections between the host player and the server static CRITICAL_SECTION s_hostQueueLock[2]; - static std::queue s_hostQueue[2]; + static std::queue s_hostQueue[2]; static SocketOutputStreamLocal *s_hostOutStream[2]; static SocketInputStreamLocal *s_hostInStream[2]; // For network connections - std::queue m_queueNetwork[2]; // For input data + std::queue m_queueNetwork[2]; // For input data CRITICAL_SECTION m_queueLockNetwork[2]; // For input data SocketInputStreamNetwork *m_inputStream[2]; SocketOutputStreamNetwork *m_outputStream[2]; diff --git a/Minecraft.World/Player/Player.cpp b/Minecraft.World/Player/Player.cpp index d842e6ea5..5a1361d04 100644 --- a/Minecraft.World/Player/Player.cpp +++ b/Minecraft.World/Player/Player.cpp @@ -183,8 +183,8 @@ void Player::defineSynchedData() { this->Mob::defineSynchedData(); - entityData->define(DATA_PLAYER_FLAGS_ID, (uint8_t) 0); - entityData->define(DATA_PLAYER_RUNNING_ID, (uint8_t) 0); + entityData->define(DATA_PLAYER_FLAGS_ID, (std::uint8_t) 0); + entityData->define(DATA_PLAYER_RUNNING_ID, (std::uint8_t) 0); } std::shared_ptr 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) { @@ -1979,14 +1979,14 @@ bool Player::getPlayerFlag(int flag) 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) { - entityData->set(DATA_PLAYER_FLAGS_ID, (uint8_t) (currentValue | (1 << flag))); + entityData->set(DATA_PLAYER_FLAGS_ID, (std::uint8_t) (currentValue | (1 << flag))); } else { - entityData->set(DATA_PLAYER_FLAGS_ID, (uint8_t) (currentValue & ~(1 << flag))); + entityData->set(DATA_PLAYER_FLAGS_ID, (std::uint8_t) (currentValue & ~(1 << flag))); } } diff --git a/Minecraft.World/Player/Player.h b/Minecraft.World/Player/Player.h index 04cce224b..62f0a018d 100644 --- a/Minecraft.World/Player/Player.h +++ b/Minecraft.World/Player/Player.h @@ -161,7 +161,7 @@ protected: virtual void completeUsingItem(); public: - virtual void handleEntityEvent(uint8_t id); + virtual void handleEntityEvent(std::uint8_t id); protected: bool isImmobile();