diff --git a/Minecraft.Client/AchievementScreen.cpp b/Minecraft.Client/AchievementScreen.cpp index 902aed174..f6960e3ed 100644 --- a/Minecraft.Client/AchievementScreen.cpp +++ b/Minecraft.Client/AchievementScreen.cpp @@ -264,13 +264,13 @@ void AchievementScreen::renderBg(int xm, int ym, float a) for ( Achievement *ach : *Achievements::achievements ) { - if ( ach == nullptr || ach->requires == nullptr) continue; + if ( ach == nullptr || ach->requirements == nullptr) continue; int x1 = ach->x * ACHIEVEMENT_COORD_SCALE - (int) xScroll + 11 + xBigMap; int y1 = ach->y * ACHIEVEMENT_COORD_SCALE - (int) yScroll + 11 + yBigMap; - int x2 = ach->requires->x * ACHIEVEMENT_COORD_SCALE - (int) xScroll + 11 + xBigMap; - int y2 = ach->requires->y * ACHIEVEMENT_COORD_SCALE - (int) yScroll + 11 + yBigMap; + int x2 = ach->requirements->x * ACHIEVEMENT_COORD_SCALE - (int) xScroll + 11 + xBigMap; + int y2 = ach->requirements->y * ACHIEVEMENT_COORD_SCALE - (int) yScroll + 11 + yBigMap; int color = 0; @@ -400,7 +400,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a) else { int width = Math::_max(font->width(name), 120); - wstring msg = I18n::get(L"achievement.requires", ach->requires->name); + wstring msg = I18n::get(L"achievement.requires", ach->requirements->name); int height = font->wordWrapHeight(msg, width); fillGradient(x - 3, y - 3, x + width + 3, y + height + 12 + 3, 0xc0000000, 0xc0000000); font->drawWordWrap(msg, x, y + 12, width, 0xff705050); diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index 13826da35..4b8f5f5ba 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -103,7 +103,7 @@ char SoundEngine::m_szRedistName[]={"redist"}; #endif -char *SoundEngine::m_szStreamFileA[eStream_Max]= +const char *SoundEngine::m_szStreamFileA[eStream_Max]= { "calm1", "calm2", diff --git a/Minecraft.Client/Common/Audio/SoundEngine.h b/Minecraft.Client/Common/Audio/SoundEngine.h index 5bd2fe4b9..5417dcec9 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.h +++ b/Minecraft.Client/Common/Audio/SoundEngine.h @@ -151,7 +151,7 @@ class SoundEngine : public ConsoleSoundEngine static char m_szSoundPath[]; static char m_szMusicPath[]; static char m_szRedistName[]; - static char *m_szStreamFileA[eStream_Max]; + static const char *m_szStreamFileA[eStream_Max]; AUDIO_LISTENER m_ListenerA[MAX_LOCAL_PLAYERS]; int m_validListenerCount; diff --git a/Minecraft.Client/Common/Audio/miniaudio.h b/Minecraft.Client/Common/Audio/miniaudio.h index 01e270401..b4fa9af73 100644 --- a/Minecraft.Client/Common/Audio/miniaudio.h +++ b/Minecraft.Client/Common/Audio/miniaudio.h @@ -18,7 +18,7 @@ any other library. Note that ABI compatibility is not guaranteed between version fix releases, so take care if compiling as a shared object. miniaudio includes both low level and high level APIs. The low level API is good for those who want -to do all of their mixing themselves and only require a light weight interface to the underlying +to do all of their mixing themselves and only require a light weight interface to the underlying1 uint8_t audio device. The high level API is good for those who have complex mixing and effect requirements. In miniaudio, objects are transparent structures. Unlike many other libraries, there are no handles @@ -11981,7 +11981,7 @@ static MA_INLINE ma_uint32 ma_swap_endian_uint32(ma_uint32 n) return __builtin_bswap32(n); #endif #else - #error "This compiler does not support the byte swap intrinsic." + #error "This compiler does not support the uint8_t swap intrinsic." #endif #else return ((n & 0xFF000000) >> 24) | @@ -80011,7 +80011,7 @@ static MA_INLINE ma_uint16 ma_dr_wav__bswap16(ma_uint16 n) #elif defined(__GNUC__) || defined(__clang__) return __builtin_bswap16(n); #else - #error "This compiler does not support the byte swap intrinsic." + #error "This compiler does not support the uint8_t swap intrinsic." #endif #else return ((n & 0xFF00) >> 8) | @@ -80038,7 +80038,7 @@ static MA_INLINE ma_uint32 ma_dr_wav__bswap32(ma_uint32 n) return __builtin_bswap32(n); #endif #else - #error "This compiler does not support the byte swap intrinsic." + #error "This compiler does not support the uint8_t swap intrinsic." #endif #else return ((n & 0xFF000000) >> 24) | @@ -80055,7 +80055,7 @@ static MA_INLINE ma_uint64 ma_dr_wav__bswap64(ma_uint64 n) #elif defined(__GNUC__) || defined(__clang__) return __builtin_bswap64(n); #else - #error "This compiler does not support the byte swap intrinsic." + #error "This compiler does not support the uint8_t swap intrinsic." #endif #else return ((n & ((ma_uint64)0xFF000000 << 32)) >> 56) | @@ -81733,11 +81733,11 @@ MA_PRIVATE size_t ma_dr_wav__write(ma_dr_wav* pWav, const void* pData, size_t da MA_DR_WAV_ASSERT(pWav->onWrite != NULL); return pWav->onWrite(pWav->pUserData, pData, dataSize); } -MA_PRIVATE size_t ma_dr_wav__write_byte(ma_dr_wav* pWav, ma_uint8 byte) +MA_PRIVATE size_t ma_dr_wav__write_byte(ma_dr_wav* pWav, ma_uint8 uint8_t) { MA_DR_WAV_ASSERT(pWav != NULL); MA_DR_WAV_ASSERT(pWav->onWrite != NULL); - return pWav->onWrite(pWav->pUserData, &byte, 1); + return pWav->onWrite(pWav->pUserData, &uint8_t, 1); } MA_PRIVATE size_t ma_dr_wav__write_u16ne_to_le(ma_dr_wav* pWav, ma_uint16 value) { @@ -81787,12 +81787,12 @@ MA_PRIVATE size_t ma_dr_wav__write_or_count(ma_dr_wav* pWav, const void* pData, } return ma_dr_wav__write(pWav, pData, dataSize); } -MA_PRIVATE size_t ma_dr_wav__write_or_count_byte(ma_dr_wav* pWav, ma_uint8 byte) +MA_PRIVATE size_t ma_dr_wav__write_or_count_byte(ma_dr_wav* pWav, ma_uint8 uint8_t) { if (pWav == NULL) { return 1; } - return ma_dr_wav__write_byte(pWav, byte); + return ma_dr_wav__write_byte(pWav, uint8_t); } MA_PRIVATE size_t ma_dr_wav__write_or_count_u16ne_to_le(ma_dr_wav* pWav, ma_uint16 value) { @@ -85149,7 +85149,7 @@ static MA_INLINE ma_uint16 ma_dr_flac__swap_endian_uint16(ma_uint16 n) #elif defined(__WATCOMC__) && defined(__386__) return _watcom_bswap16(n); #else - #error "This compiler does not support the byte swap intrinsic." + #error "This compiler does not support the uint8_t swap intrinsic." #endif #else return ((n & 0xFF00) >> 8) | @@ -85178,7 +85178,7 @@ static MA_INLINE ma_uint32 ma_dr_flac__swap_endian_uint32(ma_uint32 n) #elif defined(__WATCOMC__) && defined(__386__) return _watcom_bswap32(n); #else - #error "This compiler does not support the byte swap intrinsic." + #error "This compiler does not support the uint8_t swap intrinsic." #endif #else return ((n & 0xFF000000) >> 24) | @@ -85197,7 +85197,7 @@ static MA_INLINE ma_uint64 ma_dr_flac__swap_endian_uint64(ma_uint64 n) #elif defined(__WATCOMC__) && defined(__386__) return _watcom_bswap64(n); #else - #error "This compiler does not support the byte swap intrinsic." + #error "This compiler does not support the uint8_t swap intrinsic." #endif #else return ((n & ((ma_uint64)0xFF000000 << 32)) >> 56) | diff --git a/Minecraft.Client/Common/Audio/stb_vorbis.h b/Minecraft.Client/Common/Audio/stb_vorbis.h index 9192b162a..b517f1353 100644 --- a/Minecraft.Client/Common/Audio/stb_vorbis.h +++ b/Minecraft.Client/Common/Audio/stb_vorbis.h @@ -453,7 +453,7 @@ enum STBVorbisError // STB_VORBIS_MAX_CHANNELS [number] // globally define this to the maximum number of channels you need. // The spec does not put a restriction on channels except that -// the count is stored in a byte, so 255 is the hard limit. +// the count is stored in a uint8_t, so 255 is the hard limit. // Reducing this saves about 16 bytes per value, so using 16 saves // (255-16)*16 or around 4KB. Plus anything other memory usage // I forgot to account for. Can probably go as low as 8 (7.1 audio), @@ -996,9 +996,9 @@ static void crc32_init(void) } } -static __forceinline uint32 crc32_update(uint32 crc, uint8 byte) +static __forceinline uint32 crc32_update(uint32 crc, uint8 uint8_t) { - return (crc << 8) ^ crc_table[byte ^ (crc >> 24)]; + return (crc << 8) ^ crc_table[uint8_t ^ (crc >> 24)]; } @@ -4356,7 +4356,7 @@ static int vorbis_search_for_page_pushdata(vorb *f, uint8 *data, int data_len) // they may cause us to stop early if their header is incomplete if (f->page_crc_tests < STB_VORBIS_PUSHDATA_CRC_COUNT) { if (data_len < 4) return 0; - data_len -= 3; // need to look for 4-byte sequence, so don't miss + data_len -= 3; // need to look for 4-uint8_t sequence, so don't miss // one that straddles a boundary for (i=0; i < data_len; ++i) { if (data[i] == 0x4f) { diff --git a/Minecraft.Client/Common/C4JMemoryPool.h b/Minecraft.Client/Common/C4JMemoryPool.h index e1e795ec2..78f5629de 100644 --- a/Minecraft.Client/Common/C4JMemoryPool.h +++ b/Minecraft.Client/Common/C4JMemoryPool.h @@ -153,7 +153,7 @@ class C4JMemoryPoolGrow : public C4JMemoryPool virtual void* Alloc(size_t size) { - size = Align(size, 4); // 4 byte align the memory + size = Align(size, 4); // 4 uint8_t align the memory assert((m_currentOffset + size) < m_totalSize); // make sure we haven't ran out of space void* returnMem = &m_pMemory[m_currentOffset]; // grab the return memory m_currentOffset += size; diff --git a/Minecraft.Client/Common/Colours/ColourTable.cpp b/Minecraft.Client/Common/Colours/ColourTable.cpp index e4bfe7327..fa1e9d691 100644 --- a/Minecraft.Client/Common/Colours/ColourTable.cpp +++ b/Minecraft.Client/Common/Colours/ColourTable.cpp @@ -4,7 +4,7 @@ unordered_map ColourTable::s_colourNamesMap; -wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] = +const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] = { L"NOTSET", diff --git a/Minecraft.Client/Common/Colours/ColourTable.h b/Minecraft.Client/Common/Colours/ColourTable.h index 8e0a348c0..af99a8ed5 100644 --- a/Minecraft.Client/Common/Colours/ColourTable.h +++ b/Minecraft.Client/Common/Colours/ColourTable.h @@ -5,7 +5,7 @@ class ColourTable private: unsigned int m_colourValues[eMinecraftColour_COUNT]; - static wchar_t *ColourTableElements[eMinecraftColour_COUNT]; + static const wchar_t *ColourTableElements[eMinecraftColour_COUNT]; static unordered_map s_colourNamesMap; public: diff --git a/Minecraft.Client/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Common/DLC/DLCAudioFile.cpp index 6faf0c3b3..7116f62d8 100644 --- a/Minecraft.Client/Common/DLC/DLCAudioFile.cpp +++ b/Minecraft.Client/Common/DLC/DLCAudioFile.cpp @@ -26,7 +26,7 @@ PBYTE DLCAudioFile::getData(DWORD &dwBytes) return m_pbData; } -WCHAR *DLCAudioFile::wchTypeNamesA[]= +const WCHAR *DLCAudioFile::wchTypeNamesA[]= { L"CUENAME", L"CREDIT", diff --git a/Minecraft.Client/Common/DLC/DLCAudioFile.h b/Minecraft.Client/Common/DLC/DLCAudioFile.h index 728512d76..f1a356fe9 100644 --- a/Minecraft.Client/Common/DLC/DLCAudioFile.h +++ b/Minecraft.Client/Common/DLC/DLCAudioFile.h @@ -28,7 +28,7 @@ class DLCAudioFile : public DLCFile e_AudioParamType_Max, }; - static WCHAR *wchTypeNamesA[e_AudioParamType_Max]; + static const WCHAR *wchTypeNamesA[e_AudioParamType_Max]; DLCAudioFile(const wstring &path); diff --git a/Minecraft.Client/Common/DLC/DLCGameRulesHeader.cpp b/Minecraft.Client/Common/DLC/DLCGameRulesHeader.cpp index 39b852190..44b78549e 100644 --- a/Minecraft.Client/Common/DLC/DLCGameRulesHeader.cpp +++ b/Minecraft.Client/Common/DLC/DLCGameRulesHeader.cpp @@ -34,7 +34,7 @@ void DLCGameRulesHeader::addData(PBYTE pbData, DWORD dwBytes) // Init values. int version_number; - byte compression_type; + uint8_t compression_type; wstring texturepackid; // Read Datastream. diff --git a/Minecraft.Client/Common/DLC/DLCManager.cpp b/Minecraft.Client/Common/DLC/DLCManager.cpp index 36f4d7f7e..dd34e67f9 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Common/DLC/DLCManager.cpp @@ -7,7 +7,7 @@ #include "..\..\Minecraft.h" #include "..\..\TexturePackRepository.h" -WCHAR *DLCManager::wchTypeNamesA[]= +const WCHAR *DLCManager::wchTypeNamesA[]= { L"DISPLAYNAME", L"THEMENAME", diff --git a/Minecraft.Client/Common/DLC/DLCManager.h b/Minecraft.Client/Common/DLC/DLCManager.h index 277652329..d4dd2508e 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.h +++ b/Minecraft.Client/Common/DLC/DLCManager.h @@ -48,7 +48,7 @@ class DLCManager e_DLCParamType_Max, }; - static WCHAR *wchTypeNamesA[e_DLCParamType_Max]; + static const WCHAR *wchTypeNamesA[e_DLCParamType_Max]; private: vector m_packs; diff --git a/Minecraft.Client/Common/GameRules/GameRuleManager.cpp b/Minecraft.Client/Common/GameRules/GameRuleManager.cpp index 8f172443b..3091b8acd 100644 --- a/Minecraft.Client/Common/GameRules/GameRuleManager.cpp +++ b/Minecraft.Client/Common/GameRules/GameRuleManager.cpp @@ -12,7 +12,7 @@ #include "ConsoleGameRules.h" #include "GameRuleManager.h" -WCHAR *GameRuleManager::wchTagNameA[] = +const WCHAR *GameRuleManager::wchTagNameA[] = { L"", // eGameRuleType_Root L"MapOptions", // eGameRuleType_LevelGenerationOptions @@ -34,7 +34,7 @@ WCHAR *GameRuleManager::wchTagNameA[] = L"UpdatePlayer", // eGameRuleType_UpdatePlayerRule }; -WCHAR *GameRuleManager::wchAttrNameA[] = +const WCHAR *GameRuleManager::wchAttrNameA[] = { L"descriptionName", // eGameRuleAttr_descriptionName L"promptName", // eGameRuleAttr_promptName @@ -104,7 +104,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack) { DLCGameRulesHeader *dlcHeader = (DLCGameRulesHeader *)pack->getFile(DLCManager::e_DLCType_GameRulesHeader, i); DWORD dSize; - byte *dData = dlcHeader->getData(dSize); + uint8_t *dData = dlcHeader->getData(dSize); LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions(pack); // = loadGameRules(dData, dSize); //, strings); @@ -123,7 +123,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack) DLCGameRulesFile *dlcFile = (DLCGameRulesFile *)pack->getFile(DLCManager::e_DLCType_GameRules, i); DWORD dSize; - byte *dData = dlcFile->getData(dSize); + uint8_t *dData = dlcFile->getData(dSize); LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions(pack); // = loadGameRules(dData, dSize); //, strings); @@ -137,7 +137,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack) } } -LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, UINT dSize) +LevelGenerationOptions *GameRuleManager::loadGameRules(uint8_t *dIn, UINT dSize) { LevelGenerationOptions *lgo = new LevelGenerationOptions(); lgo->setGrSource( new JustGrSource() ); @@ -148,7 +148,7 @@ LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, UINT dSize) } // 4J-JEV: Reverse of saveGameRules. -void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT dSize) +void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize) { app.DebugPrintf("GameRuleManager::LoadingGameRules:\n"); @@ -235,7 +235,7 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT } // 4J-JEV: Reverse of loadGameRules. -void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize) +void GameRuleManager::saveGameRules(uint8_t **dOut, UINT *dSize) { if (m_currentGameRuleDefinitions == NULL && m_currentLevelGenerationOptions == NULL) @@ -367,7 +367,7 @@ void GameRuleManager::writeRuleFile(DataOutputStream *dos) m_currentGameRuleDefinitions->write(dos); } -bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT dSize, StringTable *strings) //(DLCGameRulesFile *dlcFile, StringTable *strings) +bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize, StringTable *strings) //(DLCGameRulesFile *dlcFile, StringTable *strings) { bool levelGenAdded = false; bool gameRulesAdded = false; diff --git a/Minecraft.Client/Common/GameRules/GameRuleManager.h b/Minecraft.Client/Common/GameRules/GameRuleManager.h index e9e983b85..481fc723d 100644 --- a/Minecraft.Client/Common/GameRules/GameRuleManager.h +++ b/Minecraft.Client/Common/GameRules/GameRuleManager.h @@ -24,8 +24,8 @@ class WstringLookup; class GameRuleManager { public: - static WCHAR *wchTagNameA[ConsoleGameRules::eGameRuleType_Count]; - static WCHAR *wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count]; + static const WCHAR *wchTagNameA[ConsoleGameRules::eGameRuleType_Count]; + static const WCHAR *wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count]; static const short version_number = 2; @@ -40,10 +40,10 @@ class GameRuleManager void loadGameRules(DLCPack *); - LevelGenerationOptions *loadGameRules(byte *dIn, UINT dSize); - void loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT dSize); + LevelGenerationOptions *loadGameRules(uint8_t *dIn, UINT dSize); + void loadGameRules(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize); - void saveGameRules(byte **dOut, UINT *dSize); + void saveGameRules(uint8_t **dOut, UINT *dSize); private: LevelGenerationOptions *readHeader(DLCGameRulesHeader *grh); @@ -51,7 +51,7 @@ class GameRuleManager void writeRuleFile(DataOutputStream *dos); public: - bool readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings); + bool readRuleFile(LevelGenerationOptions *lgo, uint8_t *dIn, UINT dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings); private: void readAttributes(DataInputStream *dis, vector *tagsAndAtts, GameRuleDefinition *rule); diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index 56aaf2591..1020e1e09 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -1297,7 +1297,7 @@ bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer, return _override; } -void IUIScene_CreativeMenu::BuildFirework(vector > *list, byte type, int color, int sulphur, bool flicker, bool trail, int fadeColor/*= -1*/) +void IUIScene_CreativeMenu::BuildFirework(vector > *list, uint8_t type, int color, int sulphur, bool flicker, bool trail, int fadeColor/*= -1*/) { ///////////////////////////////// // Create firecharge @@ -1358,7 +1358,7 @@ void IUIScene_CreativeMenu::BuildFirework(vector > *lis expTags->add(expTag); fireTag->put(FireworksItem::TAG_EXPLOSIONS, expTags); - fireTag->putByte(FireworksItem::TAG_FLIGHT, (byte) sulphur); + fireTag->putByte(FireworksItem::TAG_FLIGHT, (uint8_t) sulphur); itemTag->put(FireworksItem::TAG_FIREWORKS, fireTag); diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h index 64b78029b..7cb8a12b8 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h @@ -137,5 +137,5 @@ class IUIScene_CreativeMenu : public virtual IUIScene_AbstractContainerMenu EToolTipItem &buttonBack ); - static void BuildFirework(vector > *list, byte type, int color, int sulphur, bool flicker, bool trail, int fadeColor = -1); + static void BuildFirework(vector > *list, uint8_t type, int color, int sulphur, bool flicker, bool trail, int fadeColor = -1); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.h b/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.h index 464c83a06..87369cee6 100644 --- a/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.h @@ -13,7 +13,7 @@ class UIScene_InGameInfoMenu : public UIScene typedef struct _PlayerInfo { - byte m_smallId; + uint8_t m_smallId; char m_voiceStatus; short m_colorState; wstring m_name; diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index a2ab17a8c..856d1c447 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -117,7 +117,7 @@ static wstring ReadLevelNameFromSaveFile(const wstring& filePath) if (off >= 12 && off + len <= saveSize && len > 0 && len < 4 * 1024 * 1024) { byteArray ba; - ba.data = (byte*)(saveData + off); + ba.data = (uint8_t*)(saveData + off); ba.length = len; CompoundTag *root = NbtIo::decompress(ba); if (root != NULL) @@ -1051,7 +1051,7 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo() m_pSaveDetails=StorageManager.ReturnSavesInfo(); if(m_pSaveDetails==NULL) { - C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save"); + C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,const_cast("save")); } #if TO_BE_IMPLEMENTED @@ -2889,7 +2889,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter case eSaveTransfer_CreateDummyFile: { StorageManager.ResetSaveData(); - byte *compData = (byte *)StorageManager.AllocateSaveData( app.getRemoteStorage()->getSaveFilesize() ); + uint8_t *compData = (uint8_t *)StorageManager.AllocateSaveData( app.getRemoteStorage()->getSaveFilesize() ); // Make our next save default to the name of the level const char* pNameUTF8 = app.getRemoteStorage()->getSaveNameUTF8(); mbstowcs(wSaveName, pNameUTF8, strlen(pNameUTF8)+1); // plus null diff --git a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp index d4f26ae71..9e0059f3b 100644 --- a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp @@ -13,7 +13,7 @@ //#define SKIN_SELECT_PACK_PLAYER_CUSTOM 1 #define SKIN_SELECT_MAX_DEFAULTS 2 -WCHAR *UIScene_SkinSelectMenu::wchDefaultNamesA[]= +const WCHAR *UIScene_SkinSelectMenu::wchDefaultNamesA[]= { L"USE LOCALISED VERSION", // Server selected L"Steve", diff --git a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h index e8d760967..60579ac60 100644 --- a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h @@ -6,7 +6,7 @@ class UIScene_SkinSelectMenu : public UIScene { private: - static WCHAR *wchDefaultNamesA[eDefaultSkins_Count]; + static const WCHAR *wchDefaultNamesA[eDefaultSkins_Count]; // 4J Stu - How many to show on each side of the main control static const BYTE sidePreviewControls = 4; diff --git a/Minecraft.Client/Common/XUI/XUI_SkinSelect.cpp b/Minecraft.Client/Common/XUI/XUI_SkinSelect.cpp index ee7066108..daf13eb87 100644 --- a/Minecraft.Client/Common/XUI/XUI_SkinSelect.cpp +++ b/Minecraft.Client/Common/XUI/XUI_SkinSelect.cpp @@ -7,7 +7,7 @@ //#define SKIN_SELECT_PACK_PLAYER_CUSTOM 1 #define SKIN_SELECT_MAX_DEFAULTS 2 -WCHAR *CScene_SkinSelect::wchDefaultNamesA[]= +const WCHAR *CScene_SkinSelect::wchDefaultNamesA[]= { L"USE LOCALISED VERSION", // Server selected L"Steve", diff --git a/Minecraft.Client/Common/XUI/XUI_SkinSelect.h b/Minecraft.Client/Common/XUI/XUI_SkinSelect.h index dbbb388ce..cea08314c 100644 --- a/Minecraft.Client/Common/XUI/XUI_SkinSelect.h +++ b/Minecraft.Client/Common/XUI/XUI_SkinSelect.h @@ -12,7 +12,7 @@ class CXuiCtrlMinecraftSkinPreview; class CScene_SkinSelect : public CXuiSceneImpl { private: - static WCHAR *wchDefaultNamesA[eDefaultSkins_Count]; + static const WCHAR *wchDefaultNamesA[eDefaultSkins_Count]; // 4J Stu - How many to show on each side of the main control static const BYTE sidePreviewControls = 4; diff --git a/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.cpp b/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.cpp index 511210999..3b2e2cbc5 100644 --- a/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.cpp +++ b/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.cpp @@ -2,7 +2,7 @@ #include "XUI_TrialExitUpsell.h" // wchImages[TRIAL_EXIT_UPSELL_IMAGE_COUNT] -WCHAR *CScene_TrialExitUpsell::wchImages[]= +const WCHAR *CScene_TrialExitUpsell::wchImages[]= { L"Graphics/UpsellScreenshots/Screenshot1.png", L"Graphics/UpsellScreenshots/Screenshot2.png", diff --git a/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.h b/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.h index 748b36a2b..94800dc0e 100644 --- a/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.h +++ b/Minecraft.Client/Common/XUI/XUI_TrialExitUpsell.h @@ -9,7 +9,7 @@ class CScene_TrialExitUpsell : public CXuiSceneImpl { private: - static WCHAR *wchImages[TRIAL_EXIT_UPSELL_IMAGE_COUNT]; + static const WCHAR *wchImages[TRIAL_EXIT_UPSELL_IMAGE_COUNT]; protected: CXuiImageElement m_image1, m_image2; diff --git a/Minecraft.Client/Common/zlib/zlib.h b/Minecraft.Client/Common/zlib/zlib.h index 3e0c7672a..7162d30a0 100644 --- a/Minecraft.Client/Common/zlib/zlib.h +++ b/Minecraft.Client/Common/zlib/zlib.h @@ -429,10 +429,10 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); The Z_BLOCK option assists in appending to or combining deflate streams. Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if + number of unused bits in the last uint8_t taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate + decoding the complete header up to just before the first uint8_t of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of @@ -588,7 +588,7 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* - Initializes the compression dictionary from the given byte sequence + Initializes the compression dictionary from the given uint8_t sequence without producing any compressed output. When using the zlib format, this function must be called immediately after deflateInit, deflateInit2 or deflateReset, and before any call of deflate. When doing raw deflate, this @@ -599,7 +599,7 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). - The dictionary should consist of strings (byte sequences) that are likely + The dictionary should consist of strings (uint8_t sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be @@ -718,7 +718,7 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they - await more bits to join them in order to fill out a full byte. If pending + await more bits to join them in order to fill out a full uint8_t. If pending or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source @@ -752,7 +752,7 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + a zero uint8_t, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part @@ -820,7 +820,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* - Initializes the decompression dictionary from the given uncompressed byte + Initializes the decompression dictionary from the given uncompressed uint8_t sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the adler32 value returned by that call of inflate. @@ -917,7 +917,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used + middle of a uint8_t. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the @@ -1011,7 +1011,7 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general + and a 32K uint8_t window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. @@ -1161,7 +1161,7 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size + the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. @@ -1176,7 +1176,7 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, int level)); /* Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte + parameter has the same meaning as in deflateInit. sourceLen is the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the @@ -1198,7 +1198,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size + the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some @@ -1252,7 +1252,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. When reading, this will be detected automatically by looking for the magic two- - byte gzip header. + uint8_t gzip header. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was @@ -1390,7 +1390,7 @@ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* - Reads one byte from the compressed file. gzgetc returns this byte or -1 + Reads one uint8_t from the compressed file. gzgetc returns this uint8_t or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file diff --git a/Minecraft.Client/DirtyChunkSorter.h b/Minecraft.Client/DirtyChunkSorter.h index 1bf8b61f7..2c34d4bff 100644 --- a/Minecraft.Client/DirtyChunkSorter.h +++ b/Minecraft.Client/DirtyChunkSorter.h @@ -2,7 +2,7 @@ class Chunk; class Mob; -class DirtyChunkSorter : public std::binary_function +class DirtyChunkSorter { private: shared_ptr cameraEntity; diff --git a/Minecraft.Client/DistanceChunkSorter.h b/Minecraft.Client/DistanceChunkSorter.h index 4789070d0..224737ab6 100644 --- a/Minecraft.Client/DistanceChunkSorter.h +++ b/Minecraft.Client/DistanceChunkSorter.h @@ -2,7 +2,7 @@ class Entity; class Chunk; -class DistanceChunkSorter : public std::binary_function +class DistanceChunkSorter { private: double ix, iy, iz; diff --git a/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h b/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h index 737caa98b..5e6087eb0 100644 --- a/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Durango/4JLibs/inc/4J_Render.h @@ -74,7 +74,7 @@ class C4JRender // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl index 1ab1f13f7..5435c30bb 100644 --- a/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl +++ b/Minecraft.Client/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -200,7 +200,7 @@ static void safe_release(T *&p) } } -static void report_d3d_error(HRESULT hr, char *call, char *context) +static void report_d3d_error(HRESULT hr, const char *call, const char *context) { if (hr == E_OUTOFMEMORY) IggyGDrawSendWarning(NULL, "GDraw D3D out of memory in %s%s", call, context); @@ -478,7 +478,7 @@ static GDrawTexture * RADLINK gdraw_MakeTextureEnd(GDraw_MakeTexture_ProcessingI D3D1X_(SUBRESOURCE_DATA) mipdata[24]; S32 i, w, h, nmips, bpp; HRESULT hr = S_OK; - char *failed_call; + const char *failed_call; U8 *ptr; // generate mip maps and set up descriptors for them @@ -700,7 +700,7 @@ static void RADLINK gdraw_DescribeVertexBuffer(GDrawVertexBuffer *vbuf, GDraw_Ve static GDrawHandle *get_color_rendertarget(GDrawStats *stats) { - char *failed_call; + const char *failed_call; // try to recycle LRU rendertarget GDrawHandle *t = gdraw_HandleCacheGetLRU(&gdraw->rendertargets); @@ -762,7 +762,7 @@ static GDrawHandle *get_color_rendertarget(GDrawStats *stats) static ID3D1X(DepthStencilView) *get_rendertarget_depthbuffer(GDrawStats *stats) { if (!gdraw->depth_buffer[1]) { - char *failed_call; + const char *failed_call; assert(!gdraw->rt_depth_buffer); D3D1X_(TEXTURE2D_DESC) desc = { gdraw->frametex_width, gdraw->frametex_height, 1, 1, DXGI_FORMAT_D24_UNORM_S8_UINT, { 1, 0 }, @@ -2381,7 +2381,7 @@ static S32 num_pixels(S32 w, S32 h, S32 mipmaps) GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, S32 /*len*/, IggyFileTextureRaw *texture) { - char *failed_call=""; + const char *failed_call=""; U8 *free_data = 0; GDrawTexture *t=0; S32 width, height, mipmaps, size, blk; diff --git a/Minecraft.Client/Durango/Iggy/include/gdraw.h b/Minecraft.Client/Durango/Iggy/include/gdraw.h index 404a2642b..607843266 100644 --- a/Minecraft.Client/Durango/Iggy/include/gdraw.h +++ b/Minecraft.Client/Durango/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) diff --git a/Minecraft.Client/Durango/Iggy/include/iggy.h b/Minecraft.Client/Durango/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/Durango/Iggy/include/iggy.h +++ b/Minecraft.Client/Durango/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp index caa5857e9..7dfe8f679 100644 --- a/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp +++ b/Minecraft.Client/Durango/Leaderboards/DurangoStatsDebugger.cpp @@ -386,8 +386,8 @@ void DurangoStatsDebugger::retrieveStats(int iPad) // ----------------------------------------- // - byte runningThreads = 0; - byte *r_runningThreads = &runningThreads; + uint8_t runningThreads = 0; + uint8_t *r_runningThreads = &runningThreads; if (xuid.toString().compare(L"") == 0) { diff --git a/Minecraft.Client/Durango/Miles/include/mss.h b/Minecraft.Client/Durango/Miles/include/mss.h index 8fe0a74d2..61e628ad0 100644 --- a/Minecraft.Client/Durango/Miles/include/mss.h +++ b/Minecraft.Client/Durango/Miles/include/mss.h @@ -4872,7 +4872,7 @@ typedef struct U8 *ID3v1; // ID3v1 tag, if not NULL (always 128 bytes long if present) U8 *start_MP3_data; // Pointer to start of data area in file (not necessarily first valid frame) - U8 *end_MP3_data; // Pointer to last valid byte in MP3 data area (before ID3v1 tag, if any) + U8 *end_MP3_data; // Pointer to last valid uint8_t in MP3 data area (before ID3v1 tag, if any) // // Information about current frame being inspected, valid if AIL_enumerate_MP3_frames() returns @@ -4959,7 +4959,7 @@ typedef struct S32 Ogg_image_size; // Originally passed to AIL_inspect_Ogg() U8 *start_Ogg_data; // Pointer to start of data area in file - U8 *end_Ogg_data; // Pointer to last valid byte in data area + U8 *end_Ogg_data; // Pointer to last valid uint8_t in data area // Information lifted from the header after AIL_inspect_Ogg() is called. S32 channel_count; @@ -4970,7 +4970,7 @@ typedef struct // TRUE // - S32 page_num; // 32-bit page sequence number from OggS header at byte offset 16 + S32 page_num; // 32-bit page sequence number from OggS header at uint8_t offset 16 S32 sample_count; // Total # of samples already generated by encoder at the time the current page was written @@ -5005,7 +5005,7 @@ typedef struct const char* current_frame; - // output data - byte offset for current frame. + // output data - uint8_t offset for current frame. S32 byte_offset; } BINKA_INFO; @@ -5756,7 +5756,7 @@ EXPTYPE typedef struct _MILESBANKSOUNDINFO $:ChannelCount The number of channels the sound assets contains. $:ChannelMask The channel mask for the sound asset. $:Rate The sample rate for the sound asset. - $:DataLen The byte count the asset requires if fully loaded. + $:DataLen The uint8_t count the asset requires if fully loaded. $:SoundLimit The maximum number of instances of this sound that is allowed to play at once. $:IsExternal Nonzero if the sound is stored external to the sound bank. See the eventexternal sample. $:DurationMs The length of the sound asset, in milliseconds. @@ -5801,13 +5801,13 @@ DXDEC EXPAPI SINTa AILCALL AIL_get_marker_list(HMSOUNDBANK bank, char const* sou DXDEC EXPAPI S32 AILCALL AIL_find_marker_in_list(SINTa marker_list, char const * marker_name, S32* is_samples); /* - Returns the byte offset into a sample corresponding to the given marker name. + Returns the uint8_t offset into a sample corresponding to the given marker name. $:marker_list The marker list returned from $AIL_get_marker_list. $:marker_name The name of the marker to look up. - $:is_samples returns whether the marker is at a sample location instead of a byte location. + $:is_samples returns whether the marker is at a sample location instead of a uint8_t location. - $:return -1 if the marker was not found, or the byte offset of the marker. + $:return -1 if the marker was not found, or the uint8_t offset of the marker. Looks up an offset to use in functions such as $AIL_set_sample_position. marker_list can be retrieved with $AIL_get_marker_list. diff --git a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp index 232b4dd3e..669065b99 100644 --- a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp +++ b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp @@ -282,7 +282,7 @@ void ChatIntegrationLayer::OnOutgoingChatPacketReady( __in Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args ) { - byte *bytes; + uint8_t *bytes; int byteCount; GetBufferBytes(args->PacketBuffer, &bytes); @@ -300,7 +300,7 @@ void ChatIntegrationLayer::OnOutgoingChatPacketReady( void ChatIntegrationLayer::OnIncomingChatMessage( unsigned int sessionAddress, - Platform::Array^ message + Platform::Array^ message ) { // To integrate the Chat DLL in your game, change the following code to use your game's network layer. @@ -312,10 +312,10 @@ void ChatIntegrationLayer::OnIncomingChatMessage( // What exactly you use doesn't matter, but optimally it would be something that uniquely identifies a console on in the session. // A Windows::Xbox::Networking::SecureDeviceAssociation^ is perfect to use if you have access to it. - // This is how you would convert from byte array to a IBuffer^ + // This is how you would convert from uint8_t array to a IBuffer^ // // Windows::Storage::Streams::IBuffer^ destBuffer = ref new Windows::Storage::Streams::Buffer( sourceByteBufferSize ); - // byte* destBufferBytes = nullptr; + // uint8_t* destBufferBytes = nullptr; // GetBufferBytes( destBuffer, &destBufferBytes ); // errno_t err = memcpy_s( destBufferBytes, destBuffer->Capacity, sourceByteBuffer, sourceByteBufferSize ); // THROW_HR_IF(err != 0, E_FAIL); @@ -782,7 +782,7 @@ void ChatIntegrationLayer::ToggleRenderTargetVolume() } -void ChatIntegrationLayer::GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out byte** ppOut ) +void ChatIntegrationLayer::GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out uint8_t** ppOut ) { if ( ppOut == nullptr || buffer == nullptr ) { @@ -797,7 +797,7 @@ void ChatIntegrationLayer::GetBufferBytes( __in Windows::Storage::Streams::IBuff srcBufferByteAccess->Buffer(ppOut); } -Windows::Storage::Streams::IBuffer^ ChatIntegrationLayer::ArrayToBuffer( __in Platform::Array^ array ) +Windows::Storage::Streams::IBuffer^ ChatIntegrationLayer::ArrayToBuffer( __in Platform::Array^ array ) { Windows::Storage::Streams::DataWriter^ writer = ref new Windows::Storage::Streams::DataWriter(); writer->WriteBytes(array); diff --git a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h index 80b4e10a3..84b6f4961 100644 --- a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h +++ b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h @@ -94,7 +94,7 @@ class ChatIntegrationLayer /// A unique ID for the remote console void OnIncomingChatMessage( unsigned int sessionAddress, - Platform::Array^ message + Platform::Array^ message ); /// @@ -216,8 +216,8 @@ class ChatIntegrationLayer void ToggleRenderTargetVolume(); private: - void GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out byte** ppOut ); - Windows::Storage::Streams::IBuffer^ ArrayToBuffer( __in Platform::Array^ array ); + void GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out uint8_t** ppOut ); + Windows::Storage::Streams::IBuffer^ ArrayToBuffer( __in Platform::Array^ array ); Concurrency::critical_section m_lock; Microsoft::Xbox::GameChat::ChatManager^ m_chatManager; diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp index 39dc53a93..917fb34ee 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp @@ -1639,8 +1639,8 @@ void DQRNetworkManager::SendRoomSyncInfo() EnterCriticalSection(&m_csRoomSyncData); // Calculate the size of data we are going to be sending. This is composed of: - // (1) 2 byte general header - // (2) A single byte internal data tag + // (1) 2 uint8_t general header + // (2) A single uint8_t internal data tag // (3) An unsigned int encoding the size of the combined size of all the strings in stage (5) // (4) The RoomSyncData structure itself // (5) A wchar NULL terminated string for every active player to encode the XUID @@ -1686,8 +1686,8 @@ void DQRNetworkManager::SendAddPlayerFailed(Platform::String^ xuid) if( m_isOfflineGame ) return; // Calculate the size of data we are going to be sending. This is composed of: - // (1) 2 byte general header - // (2) A single byte internal data tag + // (1) 2 uint8_t general header + // (2) A single uint8_t internal data tag // (3) An unsigned int encoding the size size of the string // (5) A wchar NULL terminated string storing the xuid of the player which has failed to join diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp index 9232d0959..e5644da67 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager_SendReceive.cpp @@ -51,11 +51,11 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, do { - BYTE byte = *pNextByte; + BYTE uint8_t = *pNextByte; switch( connectionInfo->m_internalDataState ) { case DQRConnectionInfo::ConnectionState_InternalHeaderByte: - switch( byte ) + switch( uint8_t ) { case DQR_INTERNAL_ASSIGN_SMALL_IDS: connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAssignSmallIdMask; @@ -93,14 +93,14 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, pNextByte++; break; case DQRConnectionInfo::ConnectionState_InternalAssignSmallIdMask: - // Up to 4 smallIds are assigned at once, with the ones that are being assigned dictated by a mask byte which is passed in first. + // Up to 4 smallIds are assigned at once, with the ones that are being assigned dictated by a mask uint8_t which is passed in first. // The small Ids themselves follow, always 4 bytes, and any that are masked as being assigned are processed, the other bytes ignored. // In order work around a bug with the networking library, this particular packet (being the first this that is sent from a client) // is at first sent unreliably, with retries, until a message is received back to the client, or it times out. We therefore have to be able // to handle (and ignore) this being received more than once DQRNetworkManager::LogCommentFormat(L"Small Ids being received"); - connectionInfo->m_smallIdReadMask = byte; - // Create a uniquely allocated byte to which names have been resolved, as another one of these packets could be received whilst that asyncronous process is going o n + connectionInfo->m_smallIdReadMask = uint8_t; + // Create a uniquely allocated uint8_t to which names have been resolved, as another one of these packets could be received whilst that asyncronous process is going o n connectionInfo->m_pucsmallIdReadMaskResolved = new unsigned char; *connectionInfo->m_pucsmallIdReadMaskResolved = 0; connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalAssignSmallId0; @@ -123,20 +123,20 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, // We therefore have to be able to handle (and ignore) this being received more than once - hence the check of the bool above. // At this point, the connection is considered properly active from the point of view of the host. - int sessionIndex = GetSessionIndexForSmallId(byte); + int sessionIndex = GetSessionIndexForSmallId(uint8_t); if( sessionIndex != -1 ) { connectionInfo->m_channelActive[channel] = true; - connectionInfo->m_smallId[channel] = byte; + connectionInfo->m_smallId[channel] = uint8_t; - m_sessionAddressFromSmallId[byte] = sessionAddress; - m_channelFromSmallId[byte] = channel; + m_sessionAddressFromSmallId[uint8_t] = sessionAddress; + m_channelFromSmallId[uint8_t] = channel; auto pAsyncOp = m_primaryUserXboxLiveContext->ProfileService->GetUserProfileAsync(m_multiplayerSession->Members->GetAt(sessionIndex)->XboxUserId); - DQRNetworkManager::LogCommentFormat(L"Session index of %d found for player with small id %d - attempting to resolve display name\n",sessionIndex,byte); + DQRNetworkManager::LogCommentFormat(L"Session index of %d found for player with small id %d - attempting to resolve display name\n",sessionIndex,uint8_t); DQRNetworkPlayer *pPlayer = new DQRNetworkPlayer(this, DQRNetworkPlayer::DNP_TYPE_REMOTE, true, 0, sessionAddress); - pPlayer->SetSmallId(byte); + pPlayer->SetSmallId(uint8_t); pPlayer->SetUID(PlayerUID(m_multiplayerSession->Members->GetAt(sessionIndex)->XboxUserId->Data())); HostGamertagResolveDetails *resolveDetails = new HostGamertagResolveDetails(); @@ -208,7 +208,7 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, pNextByte++; break; case DQRConnectionInfo::ConnectionState_InternalRoomSyncData: - connectionInfo->m_pucRoomSyncData[connectionInfo->m_roomSyncDataBytesRead++] = byte; + connectionInfo->m_pucRoomSyncData[connectionInfo->m_roomSyncDataBytesRead++] = uint8_t; // The room sync info is sent as a 4 byte count of the length of XUID strings, then the RoomSyncData, then the XUID strings if( connectionInfo->m_roomSyncDataBytesToRead == 0 ) { @@ -289,7 +289,7 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, pNextByte++; break; case DQRConnectionInfo::ConnectionState_InternalAddPlayerFailedData: - connectionInfo->m_pucAddFailedPlayerData[connectionInfo->m_addFailedPlayerDataBytesRead++] = byte; + connectionInfo->m_pucAddFailedPlayerData[connectionInfo->m_addFailedPlayerDataBytesRead++] = uint8_t; // The failed player info is sent as a 4 byte count of the length of XUID string, then the string itself if( connectionInfo->m_addFailedPlayerDataBytesToRead == 0 ) { diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp index c985a191f..2daa902d6 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp @@ -281,24 +281,24 @@ void DQRNetworkManager::Process_RTS_MESSAGE_DATA_RECEIVED(RTS_Message &message) BYTE *pEndByte = pNextByte + message.m_dataSize; do { - BYTE byte = *pNextByte; + BYTE uint8_t = *pNextByte; switch( connectionInfo->m_state ) { case DQRConnectionInfo::ConnectionState_HeaderByte0: - connectionInfo->m_currentChannel = ( byte >> 5 ) & 3; - connectionInfo->m_internalFlag = ( ( byte & 0x80 ) == 0x80 ); + connectionInfo->m_currentChannel = ( uint8_t >> 5 ) & 3; + connectionInfo->m_internalFlag = ( ( uint8_t & 0x80 ) == 0x80 ); - // Byte transfer mode. Bits 0-4 of this byte represent the upper 5 bits of our count of bytes to transfer... lower 8-bits will follow - connectionInfo->m_bytesRemaining = ((int)( byte & 0x1f )) << 8; + // Byte transfer mode. Bits 0-4 of this uint8_t represent the upper 5 bits of our count of bytes to transfer... lower 8-bits will follow + connectionInfo->m_bytesRemaining = ((int)( uint8_t & 0x1f )) << 8; connectionInfo->m_state = DQRConnectionInfo::ConnectionState_HeaderByte1; connectionInfo->m_internalDataState = DQRConnectionInfo::ConnectionState_InternalHeaderByte; pNextByte++; break; case DQRConnectionInfo::ConnectionState_HeaderByte1: - // Add in the lower 8 bits of our byte count, the upper 5 were obtained from the first header byte. - connectionInfo->m_bytesRemaining |= byte; + // Add in the lower 8 bits of our uint8_t count, the upper 5 were obtained from the first header uint8_t. + connectionInfo->m_bytesRemaining |= uint8_t; - // If there isn't any data following, then just go back to the initial state expecting another header byte. + // If there isn't any data following, then just go back to the initial state expecting another header uint8_t. if( connectionInfo->m_bytesRemaining == 0 ) { connectionInfo->m_state = DQRConnectionInfo::ConnectionState_HeaderByte0; diff --git a/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h b/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Durango/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ class MinecraftDynamicConfigurations static size_t s_currentConfigSize; static size_t s_dataWrittenSize; - static byte *s_dataWritten; + static uint8_t *s_dataWritten; public: static void Tick(); diff --git a/Minecraft.Client/Durango/Sentient/TelemetryEnum.h b/Minecraft.Client/Durango/Sentient/TelemetryEnum.h index 3148f33d7..2f226b336 100644 --- a/Minecraft.Client/Durango/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/Durango/Sentient/TelemetryEnum.h @@ -225,5 +225,5 @@ enum ETelemetryChallenges eTelemetryTutorial_TradingMenu, eTelemetryTutorial_Enderchest, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/Extrax64Stubs.cpp b/Minecraft.Client/Extrax64Stubs.cpp index 9e693d1a0..703be8900 100644 --- a/Minecraft.Client/Extrax64Stubs.cpp +++ b/Minecraft.Client/Extrax64Stubs.cpp @@ -69,10 +69,10 @@ void XShowAchievementsUI(int i) {} DWORD XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; } #ifndef _DURANGO -void PIXAddNamedCounter(int a, char* b, ...) {} +void PIXAddNamedCounter(int a, const char* b, ...) {} //#define PS3_USE_PIX_EVENTS //#define PS4_USE_PIX_EVENTS -void PIXBeginNamedEvent(int a, char* b, ...) +void PIXBeginNamedEvent(int a, const char* b, ...) { #ifdef PS4_USE_PIX_EVENTS char buf[512]; @@ -125,7 +125,7 @@ void PIXEndNamedEvent() PixDepth -= 1; #endif } -void PIXSetMarkerDeprecated(int a, char* b, ...) {} +void PIXSetMarkerDeprecated(int a, const char* b, ...) {} #else // 4J Stu - Removed this implementation in favour of a macro that will convert our string format // conversion at compile time rather than at runtime @@ -524,8 +524,8 @@ void C_4JProfile::Initialise(DWORD dwTitleID, { for (int i = 0; i < 4; i++) { - profileData[i] = new byte[iGameDefinedDataSizeX4 / 4]; - ZeroMemory(profileData[i], sizeof(byte) * iGameDefinedDataSizeX4 / 4); + profileData[i] = new uint8_t[iGameDefinedDataSizeX4 / 4]; + ZeroMemory(profileData[i], sizeof(uint8_t) * iGameDefinedDataSizeX4 / 4); // Set some sane initial values! GAME_SETTINGS* pGameSettings = (GAME_SETTINGS*)profileData[i]; diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 5790bea26..58bde2925 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -61,7 +61,7 @@ C4JThread* GameRenderer::m_updateThread; C4JThread::EventArray* GameRenderer::m_updateEvents; bool GameRenderer::nearThingsToDo = false; bool GameRenderer::updateRunning = false; -vector GameRenderer::m_deleteStackByte; +vector GameRenderer::m_deleteStackByte; vector GameRenderer::m_deleteStackSparseLightStorage; vector GameRenderer::m_deleteStackCompressedTileStorage; vector GameRenderer::m_deleteStackSparseDataStorage; @@ -1226,7 +1226,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(byte *deleteThis) +void GameRenderer::AddForDelete(uint8_t *deleteThis) { EnterCriticalSection(&m_csDeleteStack); m_deleteStackByte.push_back(deleteThis); @@ -2008,9 +2008,9 @@ void GameRenderer::setupClearColor(float a) float clearness = EnchantmentHelper::getOxygenBonus(player) * 0.2f; unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Clear_Colour ); - byte redComponent = ((colour>>16)&0xFF); - byte greenComponent = ((colour>>8)&0xFF); - byte blueComponent = ((colour)&0xFF); + uint8_t redComponent = ((colour>>16)&0xFF); + uint8_t greenComponent = ((colour>>8)&0xFF); + uint8_t blueComponent = ((colour)&0xFF); fr = (float)redComponent/256 + clearness;//0.02f; fg = (float)greenComponent/256 + clearness;//0.02f; @@ -2019,9 +2019,9 @@ void GameRenderer::setupClearColor(float a) else if (t != 0 && Tile::tiles[t]->material == Material::lava) { unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Clear_Colour ); - byte redComponent = ((colour>>16)&0xFF); - byte greenComponent = ((colour>>8)&0xFF); - byte blueComponent = ((colour)&0xFF); + uint8_t redComponent = ((colour>>16)&0xFF); + uint8_t greenComponent = ((colour>>8)&0xFF); + uint8_t blueComponent = ((colour)&0xFF); fr = (float)redComponent/256;//0.6f; fg = (float)greenComponent/256;//0.1f; diff --git a/Minecraft.Client/GameRenderer.h b/Minecraft.Client/GameRenderer.h index c379106e0..333710060 100644 --- a/Minecraft.Client/GameRenderer.h +++ b/Minecraft.Client/GameRenderer.h @@ -180,12 +180,12 @@ class GameRenderer static bool nearThingsToDo; static bool updateRunning; #endif - static vector m_deleteStackByte; + static vector m_deleteStackByte; static vector m_deleteStackSparseLightStorage; static vector m_deleteStackCompressedTileStorage; static vector m_deleteStackSparseDataStorage; static CRITICAL_SECTION m_csDeleteStack; - static void AddForDelete(byte *deleteThis); + static void AddForDelete(uint8_t *deleteThis); static void AddForDelete(SparseLightStorage *deleteThis); static void AddForDelete(CompressedTileStorage *deleteThis); static void AddForDelete(SparseDataStorage *deleteThis); diff --git a/Minecraft.Client/LevelRenderer.h b/Minecraft.Client/LevelRenderer.h index 37e0b813d..16d11705e 100644 --- a/Minecraft.Client/LevelRenderer.h +++ b/Minecraft.Client/LevelRenderer.h @@ -240,7 +240,7 @@ class LevelRenderer : public LevelListener void setGlobalChunkFlag(int index, unsigned char flag, unsigned char shift = 0); void clearGlobalChunkFlag(int x, int y, int z, Level *level, unsigned char flag, unsigned char shift = 0); - // Get/set whole byte of flags + // Get/set whole uint8_t of flags unsigned char getGlobalChunkFlags(int x, int y, int z, Level *level); void setGlobalChunkFlags(int x, int y, int z, Level *level, unsigned char flags); diff --git a/Minecraft.Client/Minecraft.Client.vcxproj b/Minecraft.Client/Minecraft.Client.vcxproj index 4d86f0365..f1e71848d 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj +++ b/Minecraft.Client/Minecraft.Client.vcxproj @@ -235,6 +235,7 @@ SAK Xbox360Proj title + 10.0 @@ -288,65 +289,65 @@ Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application Unicode - v143 + v145 false Application MultiByte - v143 + v145 true Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application MultiByte - v143 + v145 Application Unicode - v143 + v145 true Application Unicode - v143 + v145 true @@ -422,97 +423,97 @@ Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application Unicode true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application MultiByte true - v143 + v145 Application @@ -1567,6 +1568,8 @@ if not exist "$(TargetDir)\savedata" mkdir "$(TargetDir)\savedata" Default false /FS %(AdditionalOptions) + stdcpplatest + stdclatest true @@ -1796,6 +1799,8 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUtrue true /FS /Ob3 %(AdditionalOptions) + stdcpplatest + stdclatest true diff --git a/Minecraft.Client/Minimap.cpp b/Minecraft.Client/Minimap.cpp index 65c6d5f2c..ec86d05ae 100644 --- a/Minecraft.Client/Minimap.cpp +++ b/Minecraft.Client/Minimap.cpp @@ -52,12 +52,12 @@ Minimap::Minimap(Font *font, Options *options, Textures *textures, bool optimise void Minimap::reloadColours() { ColourTable *colourTable = Minecraft::GetInstance()->getColourTable(); - // 4J note that this code has been extracted pretty much as it was in Minimap::render, although with some byte order changes + // 4J note that this code has been extracted pretty much as it was in Minimap::render, although with some uint8_t order changes for( int i = 0; i < (14 * 4); i++ ) // 14 material colours currently, 4 brightnesses of each { if (i / 4 == 0) { - // 4J - changed byte order to save having to reorder later + // 4J - changed uint8_t order to save having to reorder later #ifdef __ORBIS__ LUT[i] = 0; #else @@ -78,7 +78,7 @@ void Minimap::reloadColours() int g = ((color >> 8) & 0xff) * br / 255; int b = ((color) & 0xff) * br / 255; - // 4J - changed byte order to save having to reorder later + // 4J - changed uint8_t order to save having to reorder later #if ( defined _DURANGO || defined _WIN64 || __PSVITA__ ) LUT[i] = 255 << 24 | b << 16 | g << 8 | r; #elif defined _XBOX diff --git a/Minecraft.Client/MultiPlayerChunkCache.cpp b/Minecraft.Client/MultiPlayerChunkCache.cpp index a4c200bed..b43a6801b 100644 --- a/Minecraft.Client/MultiPlayerChunkCache.cpp +++ b/Minecraft.Client/MultiPlayerChunkCache.cpp @@ -196,7 +196,7 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z) // 4J - changed to use new methods for lighting chunk->setSkyLightDataAllBright(); - // Arrays::fill(chunk->skyLight->data, (byte) 255); + // Arrays::fill(chunk->skyLight->data, (uint8_t) 255); } chunk->loaded = true; diff --git a/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h b/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h index 6083654d2..18e035282 100644 --- a/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h @@ -77,7 +77,7 @@ class C4JRender // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp index 122333607..60c861e55 100644 --- a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp +++ b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp @@ -93,7 +93,7 @@ struct ShaderCode struct GDraw { - // 16-byte aligned! + // 16-uint8_t aligned! F32 projection[4]; // always 2D scale+2D translate. first two are scale, last two are translate. // scale factor converting worldspace to viewspace <0,0>.. diff --git a/Minecraft.Client/Orbis/Iggy/include/gdraw.h b/Minecraft.Client/Orbis/Iggy/include/gdraw.h index 404a2642b..607843266 100644 --- a/Minecraft.Client/Orbis/Iggy/include/gdraw.h +++ b/Minecraft.Client/Orbis/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) diff --git a/Minecraft.Client/Orbis/Iggy/include/iggy.h b/Minecraft.Client/Orbis/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/Orbis/Iggy/include/iggy.h +++ b/Minecraft.Client/Orbis/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/Orbis/Miles/include/mss.h b/Minecraft.Client/Orbis/Miles/include/mss.h index 8fe0a74d2..61e628ad0 100644 --- a/Minecraft.Client/Orbis/Miles/include/mss.h +++ b/Minecraft.Client/Orbis/Miles/include/mss.h @@ -4872,7 +4872,7 @@ typedef struct U8 *ID3v1; // ID3v1 tag, if not NULL (always 128 bytes long if present) U8 *start_MP3_data; // Pointer to start of data area in file (not necessarily first valid frame) - U8 *end_MP3_data; // Pointer to last valid byte in MP3 data area (before ID3v1 tag, if any) + U8 *end_MP3_data; // Pointer to last valid uint8_t in MP3 data area (before ID3v1 tag, if any) // // Information about current frame being inspected, valid if AIL_enumerate_MP3_frames() returns @@ -4959,7 +4959,7 @@ typedef struct S32 Ogg_image_size; // Originally passed to AIL_inspect_Ogg() U8 *start_Ogg_data; // Pointer to start of data area in file - U8 *end_Ogg_data; // Pointer to last valid byte in data area + U8 *end_Ogg_data; // Pointer to last valid uint8_t in data area // Information lifted from the header after AIL_inspect_Ogg() is called. S32 channel_count; @@ -4970,7 +4970,7 @@ typedef struct // TRUE // - S32 page_num; // 32-bit page sequence number from OggS header at byte offset 16 + S32 page_num; // 32-bit page sequence number from OggS header at uint8_t offset 16 S32 sample_count; // Total # of samples already generated by encoder at the time the current page was written @@ -5005,7 +5005,7 @@ typedef struct const char* current_frame; - // output data - byte offset for current frame. + // output data - uint8_t offset for current frame. S32 byte_offset; } BINKA_INFO; @@ -5756,7 +5756,7 @@ EXPTYPE typedef struct _MILESBANKSOUNDINFO $:ChannelCount The number of channels the sound assets contains. $:ChannelMask The channel mask for the sound asset. $:Rate The sample rate for the sound asset. - $:DataLen The byte count the asset requires if fully loaded. + $:DataLen The uint8_t count the asset requires if fully loaded. $:SoundLimit The maximum number of instances of this sound that is allowed to play at once. $:IsExternal Nonzero if the sound is stored external to the sound bank. See the eventexternal sample. $:DurationMs The length of the sound asset, in milliseconds. @@ -5801,13 +5801,13 @@ DXDEC EXPAPI SINTa AILCALL AIL_get_marker_list(HMSOUNDBANK bank, char const* sou DXDEC EXPAPI S32 AILCALL AIL_find_marker_in_list(SINTa marker_list, char const * marker_name, S32* is_samples); /* - Returns the byte offset into a sample corresponding to the given marker name. + Returns the uint8_t offset into a sample corresponding to the given marker name. $:marker_list The marker list returned from $AIL_get_marker_list. $:marker_name The name of the marker to look up. - $:is_samples returns whether the marker is at a sample location instead of a byte location. + $:is_samples returns whether the marker is at a sample location instead of a uint8_t location. - $:return -1 if the marker was not found, or the byte offset of the marker. + $:return -1 if the marker was not found, or the uint8_t offset of the marker. Looks up an offset to use in functions such as $AIL_set_sample_position. marker_list can be retrieved with $AIL_get_marker_list. diff --git a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp index 1b32bce2a..a3139adf6 100644 --- a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp +++ b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp @@ -3525,7 +3525,7 @@ void SQRNetworkManager_Orbis::RudpContextCallback(int ctx_id, int event_id, int else { unsigned int dataSize = sceRudpGetSizeReadable(ctx_id); - // If we're the host, and this player hasn't yet had its small id confirmed, then the first byte sent to us should be this id + // If we're the host, and this player hasn't yet had its small id confirmed, then the first uint8_t sent to us should be this id if( manager->m_isHosting ) { SQRNetworkPlayer *playerFrom = manager->GetPlayerFromRudpCtx( ctx_id ); diff --git a/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h b/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h index 79fb10bf5..108a385a5 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h +++ b/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h @@ -59,7 +59,7 @@ typedef WCHAR *LPWSTR, *PWSTR; typedef CONST WCHAR *LPCWSTR, *PCWSTR; // -// ANSI (Multi-byte Character) types +// ANSI (Multi-uint8_t Character) types // typedef CHAR *PCHAR; typedef CHAR *LPCH, *PCH; diff --git a/Minecraft.Client/Orbis/OrbisExtras/winerror.h b/Minecraft.Client/Orbis/OrbisExtras/winerror.h index 6956d8de0..80c7a7e9c 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/winerror.h +++ b/Minecraft.Client/Orbis/OrbisExtras/winerror.h @@ -2495,7 +2495,7 @@ // // MessageText: // -// No mapping for the Unicode character exists in the target multi-byte code page. +// No mapping for the Unicode character exists in the target multi-uint8_t code page. // #define ERROR_NO_UNICODE_TRANSLATION 1113L @@ -6117,7 +6117,7 @@ // // MessageText: // -// The byte count is too small. +// The uint8_t count is too small. // #define RPC_X_BYTE_COUNT_TOO_SMALL 1782L diff --git a/Minecraft.Client/Orbis/Sentient/DynamicConfigurations.h b/Minecraft.Client/Orbis/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Orbis/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Orbis/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ class MinecraftDynamicConfigurations static size_t s_currentConfigSize; static size_t s_dataWrittenSize; - static byte *s_dataWritten; + static uint8_t *s_dataWritten; public: static void Tick(); diff --git a/Minecraft.Client/Orbis/Sentient/TelemetryEnum.h b/Minecraft.Client/Orbis/Sentient/TelemetryEnum.h index 77d39a39f..613cd8391 100644 --- a/Minecraft.Client/Orbis/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/Orbis/Sentient/TelemetryEnum.h @@ -225,5 +225,5 @@ enum ETelemetryChallenges eTelemetryTutorial_TradingMenu, eTelemetryTutorial_Enderchest, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp b/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp index f3d2729f0..58a15bbb8 100644 --- a/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp +++ b/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp @@ -33,7 +33,7 @@ int32_t CTSS::TssSizeCheck(size_t size) if (size == 0) { - printf("Tss File size is 0 byte. Maybe, data isn't set on the server.\n\n"); + printf("Tss File size is 0 uint8_t. Maybe, data isn't set on the server.\n\n"); printf("\tThe data is set with scp. The account is generable in PS3 Developer Network.\n"); printf("\tThere are three server environments. for development, environment for test, and product.\n"); } diff --git a/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h b/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h index d55f440bf..ceb20304b 100644 --- a/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h @@ -75,7 +75,7 @@ class C4JRender // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp index 997e8d837..c75e34781 100644 --- a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp +++ b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp @@ -615,7 +615,7 @@ static void swizzle_subrect_32bpp_small(U8 * RADRESTRICT dest, U32 dx, U32 dy, U { // determine morton-order stepping constants U32 minor = RR_MIN(dw, dh); - S64 xinc = (S32) rsx_morton_encode(-1, 0, minor) * 4; // *4 since we work with byte offsets + S64 xinc = (S32) rsx_morton_encode(-1, 0, minor) * 4; // *4 since we work with uint8_t offsets S64 yinc = (S32) rsx_morton_encode(-1, 1, minor) * 4; // determine start offsets along x/y axis @@ -705,7 +705,7 @@ static void swizzle_subrect_32bpp(U8 * RADRESTRICT dest, U32 dx, U32 dy, U32 dw, // main part: go through image in blocks of 8x4 pixels. (8x4 since that's one full cache line, // so we write pixels one cache line at a time) minor = RR_MIN(dw, dh); - incx = (S32) rsx_morton_encode(-8, 0, minor) * 4; // *4 since it's all byte offsets + incx = (S32) rsx_morton_encode(-8, 0, minor) * 4; // *4 since it's all uint8_t offsets incy = (S32) rsx_morton_encode(-4, 1, minor) * 4; outx0 = rsx_morton_encode(dx0, 0, minor) * 4; outy = rsx_morton_encode(dy0, 1, minor) * 4; diff --git a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h index f8ec8705e..8829ed48a 100644 --- a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h +++ b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h @@ -43,7 +43,7 @@ IDOC extern int gdraw_GCM_SetRendertargetMemory(void *ptr, S32 num_bytes, S32 wi All render targets allocated by GDraw have the same size (width x height pixels) and will use the same pitch; thus you can pack them all into one tile region, which is recommended from a performance perspective. - Pitch must allow for 4-byte-per-pixel rendertargets (so pitch must be at least width*4). + Pitch must allow for 4-uint8_t-per-pixel rendertargets (so pitch must be at least width*4). On other platforms, Iggy does not require you to correctly specify the width and height of the rendertargets; the size you specify is a hint, and GDraw will detect the actual diff --git a/Minecraft.Client/PS3/Iggy/include/gdraw.h b/Minecraft.Client/PS3/Iggy/include/gdraw.h index 404a2642b..607843266 100644 --- a/Minecraft.Client/PS3/Iggy/include/gdraw.h +++ b/Minecraft.Client/PS3/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) diff --git a/Minecraft.Client/PS3/Iggy/include/iggy.h b/Minecraft.Client/PS3/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/PS3/Iggy/include/iggy.h +++ b/Minecraft.Client/PS3/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/PS3/Miles/include/mss.h b/Minecraft.Client/PS3/Miles/include/mss.h index 8fe0a74d2..61e628ad0 100644 --- a/Minecraft.Client/PS3/Miles/include/mss.h +++ b/Minecraft.Client/PS3/Miles/include/mss.h @@ -4872,7 +4872,7 @@ typedef struct U8 *ID3v1; // ID3v1 tag, if not NULL (always 128 bytes long if present) U8 *start_MP3_data; // Pointer to start of data area in file (not necessarily first valid frame) - U8 *end_MP3_data; // Pointer to last valid byte in MP3 data area (before ID3v1 tag, if any) + U8 *end_MP3_data; // Pointer to last valid uint8_t in MP3 data area (before ID3v1 tag, if any) // // Information about current frame being inspected, valid if AIL_enumerate_MP3_frames() returns @@ -4959,7 +4959,7 @@ typedef struct S32 Ogg_image_size; // Originally passed to AIL_inspect_Ogg() U8 *start_Ogg_data; // Pointer to start of data area in file - U8 *end_Ogg_data; // Pointer to last valid byte in data area + U8 *end_Ogg_data; // Pointer to last valid uint8_t in data area // Information lifted from the header after AIL_inspect_Ogg() is called. S32 channel_count; @@ -4970,7 +4970,7 @@ typedef struct // TRUE // - S32 page_num; // 32-bit page sequence number from OggS header at byte offset 16 + S32 page_num; // 32-bit page sequence number from OggS header at uint8_t offset 16 S32 sample_count; // Total # of samples already generated by encoder at the time the current page was written @@ -5005,7 +5005,7 @@ typedef struct const char* current_frame; - // output data - byte offset for current frame. + // output data - uint8_t offset for current frame. S32 byte_offset; } BINKA_INFO; @@ -5756,7 +5756,7 @@ EXPTYPE typedef struct _MILESBANKSOUNDINFO $:ChannelCount The number of channels the sound assets contains. $:ChannelMask The channel mask for the sound asset. $:Rate The sample rate for the sound asset. - $:DataLen The byte count the asset requires if fully loaded. + $:DataLen The uint8_t count the asset requires if fully loaded. $:SoundLimit The maximum number of instances of this sound that is allowed to play at once. $:IsExternal Nonzero if the sound is stored external to the sound bank. See the eventexternal sample. $:DurationMs The length of the sound asset, in milliseconds. @@ -5801,13 +5801,13 @@ DXDEC EXPAPI SINTa AILCALL AIL_get_marker_list(HMSOUNDBANK bank, char const* sou DXDEC EXPAPI S32 AILCALL AIL_find_marker_in_list(SINTa marker_list, char const * marker_name, S32* is_samples); /* - Returns the byte offset into a sample corresponding to the given marker name. + Returns the uint8_t offset into a sample corresponding to the given marker name. $:marker_list The marker list returned from $AIL_get_marker_list. $:marker_name The name of the marker to look up. - $:is_samples returns whether the marker is at a sample location instead of a byte location. + $:is_samples returns whether the marker is at a sample location instead of a uint8_t location. - $:return -1 if the marker was not found, or the byte offset of the marker. + $:return -1 if the marker was not found, or the uint8_t offset of the marker. Looks up an offset to use in functions such as $AIL_set_sample_position. marker_list can be retrieved with $AIL_get_marker_list. diff --git a/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp b/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp index 8ab30bebd..13fab9404 100644 --- a/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp +++ b/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp @@ -3195,7 +3195,7 @@ void SQRNetworkManager_PS3::RudpContextCallback(int ctx_id, int event_id, int er if( manager->m_listener ) { unsigned int dataSize = cellRudpGetSizeReadable(ctx_id); - // If we're the host, and this player hasn't yet had its small id confirmed, then the first byte sent to us should be this id + // If we're the host, and this player hasn't yet had its small id confirmed, then the first uint8_t sent to us should be this id if( manager->m_isHosting ) { SQRNetworkPlayer *playerFrom = manager->GetPlayerFromRudpCtx( ctx_id ); diff --git a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp index e1d8dffae..d52d68a5f 100644 --- a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp +++ b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp @@ -451,7 +451,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; - byte *compData = (byte *)malloc( compLength ); + uint8_t *compData = (uint8_t *)malloc( compLength ); Compression::UseDefaultThreadStorage(); Compression::getCompression()->Compress(compData+8,&compLength,pOrigSaveData,origFilesize); ZeroMemory(compData,8); diff --git a/Minecraft.Client/PS3/PS3Extras/DirectX/DirectXMath.h b/Minecraft.Client/PS3/PS3Extras/DirectX/DirectXMath.h index c79ef233c..b9a566a1e 100644 --- a/Minecraft.Client/PS3/PS3Extras/DirectX/DirectXMath.h +++ b/Minecraft.Client/PS3/PS3Extras/DirectX/DirectXMath.h @@ -230,7 +230,7 @@ typedef __declspec(align(16)) uint32_t __vector4i[4]; #endif //------------------------------------------------------------------------------ -// Vector intrinsic: Four 32 bit floating point components aligned on a 16 byte +// Vector intrinsic: Four 32 bit floating point components aligned on a 16 uint8_t // boundary and mapped to hardware vector registers #if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) typedef __m128 XMVECTOR; @@ -346,7 +346,7 @@ XMVECTOR operator/ (FXMVECTOR V, float S); //------------------------------------------------------------------------------ // Matrix type: Sixteen 32 bit floating point components aligned on a -// 16 byte boundary and mapped to four hardware vector registers +// 16 uint8_t boundary and mapped to four hardware vector registers struct XMMATRIX; @@ -427,7 +427,7 @@ struct XMFLOAT2 XMFLOAT2& operator= (const XMFLOAT2& Float2) { x = Float2.x; y = Float2.y; return *this; } }; -// 2D Vector; 32 bit floating point components aligned on a 16 byte boundary +// 2D Vector; 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT2A : public XMFLOAT2 { XMFLOAT2A() : XMFLOAT2() {} @@ -479,7 +479,7 @@ struct XMFLOAT3 XMFLOAT3& operator= (const XMFLOAT3& Float3) { x = Float3.x; y = Float3.y; z = Float3.z; return *this; } }; -// 3D Vector; 32 bit floating point components aligned on a 16 byte boundary +// 3D Vector; 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT3A : public XMFLOAT3 { XMFLOAT3A() : XMFLOAT3() {} @@ -534,7 +534,7 @@ struct XMFLOAT4 XMFLOAT4& operator= (const XMFLOAT4& Float4) { x = Float4.x; y = Float4.y; z = Float4.z; w = Float4.w; return *this; } }; -// 4D Vector; 32 bit floating point components aligned on a 16 byte boundary +// 4D Vector; 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT4A : public XMFLOAT4 { XMFLOAT4A() : XMFLOAT4() {} @@ -632,7 +632,7 @@ struct XMFLOAT4X3 }; -// 4x3 Matrix: 32 bit floating point components aligned on a 16 byte boundary +// 4x3 Matrix: 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT4X3A : public XMFLOAT4X3 { XMFLOAT4X3A() : XMFLOAT4X3() {} @@ -678,7 +678,7 @@ struct XMFLOAT4X4 XMFLOAT4X4& operator= (const XMFLOAT4X4& Float4x4); }; -// 4x4 Matrix: 32 bit floating point components aligned on a 16 byte boundary +// 4x4 Matrix: 32 bit floating point components aligned on a 16 uint8_t boundary __declspec(align(16)) struct XMFLOAT4X4A : public XMFLOAT4X4 { XMFLOAT4X4A() : XMFLOAT4X4() {} diff --git a/Minecraft.Client/PS3/PS3Extras/DirectX/sal.h b/Minecraft.Client/PS3/PS3Extras/DirectX/sal.h index 3576d7ed0..614462c13 100644 --- a/Minecraft.Client/PS3/PS3Extras/DirectX/sal.h +++ b/Minecraft.Client/PS3/PS3Extras/DirectX/sal.h @@ -41,8 +41,8 @@ | Usage | Nullness | ZeroTerminated | Extent | |--------------|----------|----------------|-----------------------------| | _In_ | <> | <> | <> | - | _Out_ | opt_ | z_ | [byte]cap_[c_|x_]( size ) | - | _Inout_ | | | [byte]count_[c_|x_]( size ) | + | _Out_ | opt_ | z_ | [uint8_t]cap_[c_|x_]( size ) | + | _Inout_ | | | [uint8_t]count_[c_|x_]( size ) | | _Deref_out_ | | | ptrdiff_cap_( ptr ) | |--------------| | | ptrdiff_count_( ptr ) | | _Ret_ | | | | @@ -77,7 +77,7 @@ | Unit | Writ\Readable | Argument Type | |------|---------------|---------------| | <> | cap_ | <> | - | byte | count_ | c_ | + | uint8_t | count_ | c_ | | | | x_ | |------|---------------|---------------| @@ -1355,7 +1355,7 @@ typedef struct _$M _$M; with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one element long. Must be used with _in, _out, or _inout. _ecount : The buffer size is an explicit element count. - _bcount : The buffer size is an explicit byte count. + _bcount : The buffer size is an explicit uint8_t count. Output: Describes how much of the buffer will be initialized by the function. For _inout buffers, this also describes how much is initialized at entry. Omit this diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h index fe003c4a3..5be31127a 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h @@ -2,6 +2,8 @@ #pragma once +#include + #define BOOST_NO_CXX11_NULLPTR #define BOOST_ENABLE_ASSERT_HANDLER @@ -136,7 +138,7 @@ typedef WCHAR *LPWSTR, *PWSTR; typedef CONST WCHAR *LPCWSTR, *PCWSTR; // -// ANSI (Multi-byte Character) types +// ANSI (Multi-uint8_t Character) types // typedef CHAR *PCHAR; typedef CHAR *LPCH, *PCH; diff --git a/Minecraft.Client/PS3/PS3Extras/winerror.h b/Minecraft.Client/PS3/PS3Extras/winerror.h index 88763467a..de7314335 100644 --- a/Minecraft.Client/PS3/PS3Extras/winerror.h +++ b/Minecraft.Client/PS3/PS3Extras/winerror.h @@ -2495,7 +2495,7 @@ // // MessageText: // -// No mapping for the Unicode character exists in the target multi-byte code page. +// No mapping for the Unicode character exists in the target multi-uint8_t code page. // #define ERROR_NO_UNICODE_TRANSLATION 1113L @@ -6117,7 +6117,7 @@ // // MessageText: // -// The byte count is too small. +// The uint8_t count is too small. // #define RPC_X_BYTE_COUNT_TOO_SMALL 1782L diff --git a/Minecraft.Client/PS3/PS3_App.cpp b/Minecraft.Client/PS3/PS3_App.cpp index 780ab03c8..2c98b5786 100644 --- a/Minecraft.Client/PS3/PS3_App.cpp +++ b/Minecraft.Client/PS3/PS3_App.cpp @@ -1154,7 +1154,7 @@ char * CConsoleMinecraftApp::GetDiscPatchUsrDir() return m_usrdirPathBDPatch; } -char *PatchFilelist[] = +const char *PatchFilelist[] = { "PS3/PS3ProductCodes.bin", "Common/Media/MediaPS3.arc", diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.h index c733a9285..b4239d699 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.h @@ -34,7 +34,7 @@ class ChunkRebuildData // private: static const int sc_size = 20; - unsigned char m_tileIds[sc_size*sc_size*sc_size]; // byte + unsigned char m_tileIds[sc_size*sc_size*sc_size]; // uint8_t unsigned char m_brightness[sc_size*sc_size*sc_size]; // 2x 4bit unsigned char m_data_flags[sc_size*sc_size*sc_size]; // 2x 4bit int m_grassColor[sc_size*sc_size]; @@ -59,7 +59,7 @@ class ChunkRebuildData int m_lastHitBlockX; int m_lastHitBlockY; int m_lastHitBlockZ; - unsigned int m_pad[3];// padding to 16 byte alignment + unsigned int m_pad[3];// padding to 16 uint8_t alignment int getTileIdx(int x, int y, int z) { return (( x - m_x0 )*sc_size*sc_size) + (( y - m_y0 )*sc_size) + ( z - m_z0 ); } diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h index 89cd3739c..b6fa2445e 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h @@ -20,9 +20,9 @@ class StemTile_SPU : public Bush_SPU unsigned int minColour = ms_pTileData->stemTile_minColour; unsigned int maxColour = ms_pTileData->stemTile_maxColour; - byte redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( data/7.0f)); - byte greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( data/7.0f)); - byte blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( data/7.0f)); + uint8_t redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( data/7.0f)); + uint8_t greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( data/7.0f)); + uint8_t blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( data/7.0f)); colour = redComponent<<16 | greenComponent<<8 | blueComponent; return colour; diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp index 3d1007af1..2fc0c73ee 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp @@ -360,7 +360,7 @@ void Tesselator_SPU::color(int r, int g, int b, int a) col = (r << 24) | (g << 16) | (b << 8) | (a); } -void Tesselator_SPU::color(byte r, byte g, byte b) +void Tesselator_SPU::color(uint8_t r, uint8_t g, uint8_t b) { color(r & 0xff, g & 0xff, b & 0xff); } @@ -396,7 +396,7 @@ void Tesselator_SPU::vertexUV(float x, float y, float z, float u, float v) // 4 - not axis aligned, use uv stored in the vertex data 4 on from this one // ll is an 8-bit (4 bit per u/v) index into the current lighting texture // -// For quads that don't have axis aligned UVs (ie have a code for 4 in i as described above) the 8 byte vertex +// For quads that don't have axis aligned UVs (ie have a code for 4 in i as described above) the 8 uint8_t vertex // is followed by a further 8 bytes which have explicit UVs defined for each vertex: // // 0000 0000 uuuu vvvv (vertex 0) @@ -723,9 +723,9 @@ void Tesselator_SPU::noColor() void Tesselator_SPU::normal(float x, float y, float z) { hasNormal = true; - byte xx = (byte) (x * 127); - byte yy = (byte) (y * 127); - byte zz = (byte) (z * 127); + uint8_t xx = (uint8_t) (x * 127); + uint8_t yy = (uint8_t) (y * 127); + uint8_t zz = (uint8_t) (z * 127); _normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16); } diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h index 66e8424ea..d8365b40d 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h @@ -3,7 +3,7 @@ #ifdef __PS3__ #ifdef SN_TARGET_PS3_SPU typedef unsigned int DWORD; -typedef unsigned char byte; +#include #include #else #include "..\..\..\stdafx.h" @@ -154,7 +154,7 @@ class Tesselator_SPU 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(byte r, byte g, byte b); + void color(uint8_t r, uint8_t g, 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/PS3/SPU_Tasks/Common/DmaData.h b/Minecraft.Client/PS3/SPU_Tasks/Common/DmaData.h index 959ec09c6..31e224135 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/Common/DmaData.h +++ b/Minecraft.Client/PS3/SPU_Tasks/Common/DmaData.h @@ -23,8 +23,8 @@ class DmaData_SPU static void get(void* dest, uintptr_t ea, unsigned int dmaSize) { - spu_assert((ea % 0x10) == 0); // make sure we're 16 byte aligned - spu_assert((uint32_t(dest) % 0x10) == 0); // make sure we're 16 byte aligned + spu_assert((ea % 0x10) == 0); // make sure we're 16 uint8_t aligned + spu_assert((uint32_t(dest) % 0x10) == 0); // make sure we're 16 uint8_t aligned spu_assert((dmaSize % 0x10) == 0); // and that the transfer is a multiple of 16 bytes spu_assert(ea >256*1024); // and that we're not targetting SPU memory // start memory transfer @@ -82,8 +82,8 @@ class DmaData_SPU { if(sc_verbose) spu_print("DMA SPU->PPU start: 0x%08x -> 0x%08x : size : %d bytes .... ", (unsigned int)src, (unsigned int)ea, dmaSize); - spu_assert((ea % 0x10) == 0); // make sure we're 16 byte aligned - spu_assert((uint32_t(src) % 0x10) == 0); // make sure we're 16 byte aligned + spu_assert((ea % 0x10) == 0); // make sure we're 16 uint8_t aligned + spu_assert((uint32_t(src) % 0x10) == 0); // make sure we're 16 uint8_t aligned spu_assert((dmaSize % 0x10) == 0); // and that the transfer is a multiple of 16 bytes spu_assert(ea >256*1024); // and that we're not targetting SPU memory cellDmaLargePut(src, ea, dmaSize, g_pSpursJobContext->dmaTag, 0, 0); @@ -98,8 +98,8 @@ class DmaData_SPU { if(sc_verbose) spu_print("DMA SPU->PPU : 0x%08x -> 0x%08x : size : %d bytes\n", (unsigned int)src, (unsigned int)ea, dmaSize); - spu_assert((ea % 0x10) == 0); // make sure we're 16 byte aligned - spu_assert((uint32_t(src) % 0x10) == 0); // make sure we're 16 byte aligned + spu_assert((ea % 0x10) == 0); // make sure we're 16 uint8_t aligned + spu_assert((uint32_t(src) % 0x10) == 0); // make sure we're 16 uint8_t aligned spu_assert((dmaSize % 0x10) == 0); // and that the transfer is a multiple of 16 bytes spu_assert(ea >256*1024); // and that we're not targetting SPU memory cellDmaUnalignedPut(src, ea, dmaSize, g_pSpursJobContext->dmaTag, 0, 0); diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.h index 51937a873..eab370291 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.h @@ -36,8 +36,8 @@ // Some notes on the logic of all of this... // (1) Large numbers of blocks in the world really don't need to be stored at a full 8 bits per tile. // In a worst-case scenario, all planes would be 256 bytes and we'd have to store offsets of up to 32704 ( 64 x 511). This would require 15 bits per offset to store, but since in all cases -// the data can be stored with a 2 byte alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have -// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-byte aligned, and +// the data can be stored with a 2 uint8_t alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have +// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-uint8_t aligned, and // then use the extra bit to determine whether its a 0 or 8-bit per tile index. In the 0 bit case, we can use the bits used for the offset to store the actual tile value represented throughout the plane. // (2) The compression is done per 4x4x4 block rather than planes like the lighting, as that gives many more regions that have a small number of tile types than per plane, and can therefore // be compressed using less bits per tile. This is at the expense of a larger index, and more overhead from storing the tile types in each block (since there are more blocks than planes). However @@ -136,7 +136,7 @@ class TileCompressData_SPU class OutputData { public: - unsigned char m_tileIds[sc_size*sc_size*sc_size]; // byte + unsigned char m_tileIds[sc_size*sc_size*sc_size]; // uint8_t unsigned char m_brightness[sc_size*sc_size*sc_size]; // 2x 4bit unsigned char m_data_flags[sc_size*sc_size*sc_size]; // 2x 4bit }; diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h index 3b7ae2c8b..ad351948b 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h @@ -57,8 +57,8 @@ class SparseDataStorage_SPU else { int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int retval = ( data[ planeIndices[y] * 128 + byteIndex ] >> shift ) & 15; return retval; diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h index 728d1fe53..d2a87ba02 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h @@ -64,8 +64,8 @@ class SparseLightStorage_SPU else { int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int retval = ( data[ planeIndices[y] * 128 + byteIndex ] >> shift ) & 15; return retval; diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTileStorage_compress/CompressedTileStorage_compress.cpp b/Minecraft.Client/PS3/SPU_Tasks/CompressedTileStorage_compress/CompressedTileStorage_compress.cpp index 7a05169a9..8dfcaf268 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTileStorage_compress/CompressedTileStorage_compress.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTileStorage_compress/CompressedTileStorage_compress.cpp @@ -161,7 +161,7 @@ bool CCompressedTileStorage_compress::compress(int upgradeBlock/*=-1*/) else { _blockIndices[i] = INDEX_TYPE_0_OR_8_BIT; - memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-byte aligned for 8-bit storage + memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-uint8_t aligned for 8-bit storage memToAlloc += 64; } } @@ -202,7 +202,7 @@ bool CCompressedTileStorage_compress::compress(int upgradeBlock/*=-1*/) memToAlloc += 48; break; case INDEX_TYPE_0_OR_8_BIT: - memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-byte aligned for 8-bit storage + memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-uint8_t aligned for 8-bit storage memToAlloc += 64; break; // Note that INDEX_TYPE_8_BIT|INDEX_TYPE_0_BIT_FLAG not in here as it doesn't need any further allocation @@ -320,7 +320,7 @@ bool CCompressedTileStorage_compress::compress(int upgradeBlock/*=-1*/) } else { - usDataOffset = (usDataOffset + 3 ) & 0xfffc; // Make sure offset is 4 byte aligned + usDataOffset = (usDataOffset + 3 ) & 0xfffc; // Make sure offset is 4 uint8_t aligned memcpy( pucData + usDataOffset, unpacked_data, 64 ); newIndices[i] |= ( usDataOffset & INDEX_OFFSET_MASK) << INDEX_OFFSET_SHIFT; usDataOffset += 64; diff --git a/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp b/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp index 0912e33ae..bcde1e18e 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp @@ -132,7 +132,7 @@ bool LevelRenderer_FindNearestChunk_DataIn::MultiplayerChunkCache::getChunkEmpty } -bool LevelRenderer_FindNearestChunk_DataIn::CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 byte range) +bool LevelRenderer_FindNearestChunk_DataIn::CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 uint8_t range) { int blockIdx; unsigned short *blockIndices = (unsigned short *)indicesAndData; diff --git a/Minecraft.Client/PS3/SPU_Tasks/PerlinNoise/PerlinNoiseJob.h b/Minecraft.Client/PS3/SPU_Tasks/PerlinNoise/PerlinNoiseJob.h index b45763a55..f0e084444 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/PerlinNoise/PerlinNoiseJob.h +++ b/Minecraft.Client/PS3/SPU_Tasks/PerlinNoise/PerlinNoiseJob.h @@ -13,7 +13,7 @@ class PerlinNoise_DataIn void set(PerlinNoise* pNoise, doubleArray& buffer, int x, int y, int z, int xSize, int ySize, int zSize, double xScale, double yScale, double zScale) { int arraySize = xSize * ySize * zSize; - // make sure it's 16 byte aligned + // make sure it's 16 uint8_t aligned if(arraySize & 1) arraySize++; if (buffer.data == NULL) diff --git a/Minecraft.Client/PS3/SPU_Tasks/RLECompress/RLECompress.cpp b/Minecraft.Client/PS3/SPU_Tasks/RLECompress/RLECompress.cpp index 63259d33e..11bc8fe97 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/RLECompress/RLECompress.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/RLECompress/RLECompress.cpp @@ -123,9 +123,9 @@ void RLECompress(void *pPPUSrc, int srcSize, void* pPPUDst, int* pDstSize) int endPos = srcSize-1; // Compress with RLE first: - // 0 - 254 - encodes a single byte + // 0 - 254 - encodes a single uint8_t // 255 followed by 0, 1, 2 - encodes a 1, 2, or 3 255s - // 255 followed by 3-255, followed by a byte - encodes a run of n + 1 bytes + // 255 followed by 3-255, followed by a uint8_t - encodes a run of n + 1 bytes do { unsigned char thisOne = srcBuffer.getCurrent(); diff --git a/Minecraft.Client/PS3/SPU_Tasks/RecalcHeightmapOnly/CompressedTileStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/RecalcHeightmapOnly/CompressedTileStorage_SPU.h index 46876c53d..5f06f1fd1 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/RecalcHeightmapOnly/CompressedTileStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/RecalcHeightmapOnly/CompressedTileStorage_SPU.h @@ -34,8 +34,8 @@ // Some notes on the logic of all of this... // (1) Large numbers of blocks in the world really don't need to be stored at a full 8 bits per tile. // In a worst-case scenario, all planes would be 256 bytes and we'd have to store offsets of up to 32704 ( 64 x 511). This would require 15 bits per offset to store, but since in all cases -// the data can be stored with a 2 byte alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have -// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-byte aligned, and +// the data can be stored with a 2 uint8_t alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have +// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-uint8_t aligned, and // then use the extra bit to determine whether its a 0 or 8-bit per tile index. In the 0 bit case, we can use the bits used for the offset to store the actual tile value represented throughout the plane. // (2) The compression is done per 4x4x4 block rather than planes like the lighting, as that gives many more regions that have a small number of tile types than per plane, and can therefore // be compressed using less bits per tile. This is at the expense of a larger index, and more overhead from storing the tile types in each block (since there are more blocks than planes). However @@ -134,7 +134,7 @@ class TileCompressData_SPU class OutputData { public: - unsigned char m_tileIds[16*16*256]; // byte + unsigned char m_tileIds[16*16*256]; // uint8_t }; static OutputData m_OutputData; diff --git a/Minecraft.Client/PS3/Sentient/DynamicConfigurations.h b/Minecraft.Client/PS3/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/PS3/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/PS3/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ class MinecraftDynamicConfigurations static size_t s_currentConfigSize; static size_t s_dataWrittenSize; - static byte *s_dataWritten; + static uint8_t *s_dataWritten; public: static void Tick(); diff --git a/Minecraft.Client/PS3/Sentient/TelemetryEnum.h b/Minecraft.Client/PS3/Sentient/TelemetryEnum.h index 77d39a39f..613cd8391 100644 --- a/Minecraft.Client/PS3/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/PS3/Sentient/TelemetryEnum.h @@ -225,5 +225,5 @@ enum ETelemetryChallenges eTelemetryTutorial_TradingMenu, eTelemetryTutorial_Enderchest, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/PSVita/4JLibs/inc/4J_Render.h b/Minecraft.Client/PSVita/4JLibs/inc/4J_Render.h index b08c9fba6..b44f2b845 100644 --- a/Minecraft.Client/PSVita/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/PSVita/4JLibs/inc/4J_Render.h @@ -77,7 +77,7 @@ class C4JRender // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.cpp b/Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.cpp index fc5b190ad..c170b6098 100644 --- a/Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.cpp +++ b/Minecraft.Client/PSVita/Iggy/gdraw/gdraw_psp2.cpp @@ -91,7 +91,7 @@ enum gdraw_outstanding_transfer struct GDraw { - // 16-byte aligned! + // 16-uint8_t aligned! F32 projection[4]; // always 2D scale+2D translate. first two are scale, last two are translate. // scale factor converting worldspace to viewspace <0,0>.. @@ -366,7 +366,7 @@ static void gdraw_gpu_memcpy(GDrawHandleCache *c, void *dst, void *src, U32 num_ } // handle the rest - // NOTE: our 16-byte alignment guarantees that despite rounding up, we're not going + // NOTE: our 16-uint8_t alignment guarantees that despite rounding up, we're not going // to overwrite memory belonging to another resource. if (offs < num_bytes) { U32 remaining_pixels = (num_bytes - offs + GPU_MEMCPY_ALIGN - 1) / GPU_MEMCPY_ALIGN; diff --git a/Minecraft.Client/PSVita/Iggy/include/gdraw.h b/Minecraft.Client/PSVita/Iggy/include/gdraw.h index 404a2642b..607843266 100644 --- a/Minecraft.Client/PSVita/Iggy/include/gdraw.h +++ b/Minecraft.Client/PSVita/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) diff --git a/Minecraft.Client/PSVita/Iggy/include/iggy.h b/Minecraft.Client/PSVita/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/PSVita/Iggy/include/iggy.h +++ b/Minecraft.Client/PSVita/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/PSVita/Miles/include/mss.h b/Minecraft.Client/PSVita/Miles/include/mss.h index 8fe0a74d2..61e628ad0 100644 --- a/Minecraft.Client/PSVita/Miles/include/mss.h +++ b/Minecraft.Client/PSVita/Miles/include/mss.h @@ -4872,7 +4872,7 @@ typedef struct U8 *ID3v1; // ID3v1 tag, if not NULL (always 128 bytes long if present) U8 *start_MP3_data; // Pointer to start of data area in file (not necessarily first valid frame) - U8 *end_MP3_data; // Pointer to last valid byte in MP3 data area (before ID3v1 tag, if any) + U8 *end_MP3_data; // Pointer to last valid uint8_t in MP3 data area (before ID3v1 tag, if any) // // Information about current frame being inspected, valid if AIL_enumerate_MP3_frames() returns @@ -4959,7 +4959,7 @@ typedef struct S32 Ogg_image_size; // Originally passed to AIL_inspect_Ogg() U8 *start_Ogg_data; // Pointer to start of data area in file - U8 *end_Ogg_data; // Pointer to last valid byte in data area + U8 *end_Ogg_data; // Pointer to last valid uint8_t in data area // Information lifted from the header after AIL_inspect_Ogg() is called. S32 channel_count; @@ -4970,7 +4970,7 @@ typedef struct // TRUE // - S32 page_num; // 32-bit page sequence number from OggS header at byte offset 16 + S32 page_num; // 32-bit page sequence number from OggS header at uint8_t offset 16 S32 sample_count; // Total # of samples already generated by encoder at the time the current page was written @@ -5005,7 +5005,7 @@ typedef struct const char* current_frame; - // output data - byte offset for current frame. + // output data - uint8_t offset for current frame. S32 byte_offset; } BINKA_INFO; @@ -5756,7 +5756,7 @@ EXPTYPE typedef struct _MILESBANKSOUNDINFO $:ChannelCount The number of channels the sound assets contains. $:ChannelMask The channel mask for the sound asset. $:Rate The sample rate for the sound asset. - $:DataLen The byte count the asset requires if fully loaded. + $:DataLen The uint8_t count the asset requires if fully loaded. $:SoundLimit The maximum number of instances of this sound that is allowed to play at once. $:IsExternal Nonzero if the sound is stored external to the sound bank. See the eventexternal sample. $:DurationMs The length of the sound asset, in milliseconds. @@ -5801,13 +5801,13 @@ DXDEC EXPAPI SINTa AILCALL AIL_get_marker_list(HMSOUNDBANK bank, char const* sou DXDEC EXPAPI S32 AILCALL AIL_find_marker_in_list(SINTa marker_list, char const * marker_name, S32* is_samples); /* - Returns the byte offset into a sample corresponding to the given marker name. + Returns the uint8_t offset into a sample corresponding to the given marker name. $:marker_list The marker list returned from $AIL_get_marker_list. $:marker_name The name of the marker to look up. - $:is_samples returns whether the marker is at a sample location instead of a byte location. + $:is_samples returns whether the marker is at a sample location instead of a uint8_t location. - $:return -1 if the marker was not found, or the byte offset of the marker. + $:return -1 if the marker was not found, or the uint8_t offset of the marker. Looks up an offset to use in functions such as $AIL_set_sample_position. marker_list can be retrieved with $AIL_get_marker_list. diff --git a/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp b/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp index dc9ad61e6..a677da124 100644 --- a/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp +++ b/Minecraft.Client/PSVita/Network/SQRNetworkManager_AdHoc_Vita.cpp @@ -2652,7 +2652,7 @@ void SQRNetworkManager_AdHoc_Vita::RudpContextCallback(int ctx_id, int event_id, { SQRNetworkPlayer *playerIncomingData = manager->GetPlayerFromRudpCtx( ctx_id ); unsigned int dataSize = playerIncomingData->GetPacketDataSize(); - // If we're the host, and this player hasn't yet had its small id confirmed, then the first byte sent to us should be this id + // If we're the host, and this player hasn't yet had its small id confirmed, then the first uint8_t sent to us should be this id if( manager->m_isHosting ) { SQRNetworkPlayer *playerFrom = manager->GetPlayerFromRudpCtx( ctx_id ); diff --git a/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp b/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp index a1534f541..414628d27 100644 --- a/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp +++ b/Minecraft.Client/PSVita/Network/SQRNetworkManager_Vita.cpp @@ -3565,7 +3565,7 @@ void SQRNetworkManager_Vita::RudpContextCallback(int ctx_id, int event_id, int e { SQRNetworkPlayer *playerIncomingData = manager->GetPlayerFromRudpCtx( ctx_id ); unsigned int dataSize = playerIncomingData->GetPacketDataSize(); - // If we're the host, and this player hasn't yet had its small id confirmed, then the first byte sent to us should be this id + // If we're the host, and this player hasn't yet had its small id confirmed, then the first uint8_t sent to us should be this id if( manager->m_isHosting ) { SQRNetworkPlayer *playerFrom = manager->GetPlayerFromRudpCtx( ctx_id ); diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h index ee5666eb6..458923e68 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h @@ -59,7 +59,7 @@ typedef WCHAR *LPWSTR, *PWSTR; typedef CONST WCHAR *LPCWSTR, *PCWSTR; // -// ANSI (Multi-byte Character) types +// ANSI (Multi-uint8_t Character) types // typedef CHAR *PCHAR; typedef CHAR *LPCH, *PCH; diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp b/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp index 2f5e4d842..d1af4b247 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp +++ b/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp @@ -338,7 +338,7 @@ VOID VirtualMemset(LPVOID lpDestOffset, int val, SIZE_T dwSize) int DestOffset = ((int)(lpDestOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int StartPage = DestOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on int EndPage = (DestOffset + dwSize) / VIRTUAL_PAGE_SIZE; // which 1MB page do we end on - int Offset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int Offset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page if( StartPage == EndPage ) // early out if we're on the same page { uint8_t* Dest = (uint8_t*)VirtualAllocs[StartPage] + Offset; @@ -376,7 +376,7 @@ VOID VirtualCopyTo(LPVOID lpDestOffset, LPVOID lpSrc, SIZE_T dwSize) int DestOffset = ((int)(lpDestOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int StartPage = DestOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on int EndPage = (DestOffset + dwSize) / VIRTUAL_PAGE_SIZE; // which 1MB page do we end on - int Offset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int Offset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page if( StartPage == EndPage ) // early out if we're on the same page { uint8_t* Dest = (uint8_t*)VirtualAllocs[StartPage] + Offset; @@ -415,7 +415,7 @@ VOID VirtualCopyFrom(LPVOID lpDest, LPVOID lpSrcOffset, SIZE_T dwSize) int SrcOffset = ((int)(lpSrcOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int StartPage = SrcOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on int EndPage = (SrcOffset + dwSize) / VIRTUAL_PAGE_SIZE; // which 1MB page do we end on - int Offset = SrcOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int Offset = SrcOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page if( StartPage == EndPage ) // early out if we're on the same page { uint8_t* Src = (uint8_t*)VirtualAllocs[StartPage] + Offset; @@ -452,11 +452,11 @@ VOID VirtualCopyFrom(LPVOID lpDest, LPVOID lpSrcOffset, SIZE_T dwSize) VOID VirtualMove(LPVOID lpDestOffset, LPVOID lpSrcOffset, SIZE_T dwSize) { int DestOffset = ((int)(lpDestOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset - int DestChunkOffset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int DestChunkOffset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page int DestPage = DestOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on int SrcOffset = ((int)(lpSrcOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset - int SrcChunkOffset = SrcOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page + int SrcChunkOffset = SrcOffset % VIRTUAL_PAGE_SIZE; // what is the uint8_t offset within the current 1MB page int SrcPage = SrcOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on while( dwSize ) { diff --git a/Minecraft.Client/PSVita/PSVitaExtras/zlib.h b/Minecraft.Client/PSVita/PSVitaExtras/zlib.h index 3e0c7672a..7162d30a0 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/zlib.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/zlib.h @@ -429,10 +429,10 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); The Z_BLOCK option assists in appending to or combining deflate streams. Also to assist in this, on return inflate() will set strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if + number of unused bits in the last uint8_t taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate + decoding the complete header up to just before the first uint8_t of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of @@ -588,7 +588,7 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* - Initializes the compression dictionary from the given byte sequence + Initializes the compression dictionary from the given uint8_t sequence without producing any compressed output. When using the zlib format, this function must be called immediately after deflateInit, deflateInit2 or deflateReset, and before any call of deflate. When doing raw deflate, this @@ -599,7 +599,7 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). - The dictionary should consist of strings (byte sequences) that are likely + The dictionary should consist of strings (uint8_t sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be @@ -718,7 +718,7 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, been generated, but not yet provided in the available output. The bytes not provided would be due to the available output space having being consumed. The number of bits of output not provided are between 0 and 7, where they - await more bits to join them in order to fill out a full byte. If pending + await more bits to join them in order to fill out a full uint8_t. If pending or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source @@ -752,7 +752,7 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + a zero uint8_t, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part @@ -820,7 +820,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* - Initializes the decompression dictionary from the given uncompressed byte + Initializes the decompression dictionary from the given uncompressed uint8_t sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the adler32 value returned by that call of inflate. @@ -917,7 +917,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used + middle of a uint8_t. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the @@ -1011,7 +1011,7 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general + and a 32K uint8_t window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. @@ -1161,7 +1161,7 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size + the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. @@ -1176,7 +1176,7 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, int level)); /* Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte + parameter has the same meaning as in deflateInit. sourceLen is the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the @@ -1198,7 +1198,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size + the uint8_t length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some @@ -1252,7 +1252,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. When reading, this will be detected automatically by looking for the magic two- - byte gzip header. + uint8_t gzip header. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was @@ -1390,7 +1390,7 @@ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* - Reads one byte from the compressed file. gzgetc returns this byte or -1 + Reads one uint8_t from the compressed file. gzgetc returns this uint8_t or -1 in case of end of file or error. This is implemented as a macro for speed. As such, it does not do all of the checking the other functions do. I.e. it does not check to see if file is NULL, nor whether the structure file diff --git a/Minecraft.Client/PSVita/Sentient/DynamicConfigurations.h b/Minecraft.Client/PSVita/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/PSVita/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/PSVita/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ class MinecraftDynamicConfigurations static size_t s_currentConfigSize; static size_t s_dataWrittenSize; - static byte *s_dataWritten; + static uint8_t *s_dataWritten; public: static void Tick(); diff --git a/Minecraft.Client/PSVita/Sentient/TelemetryEnum.h b/Minecraft.Client/PSVita/Sentient/TelemetryEnum.h index 3c120f13d..721e9a4cb 100644 --- a/Minecraft.Client/PSVita/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/PSVita/Sentient/TelemetryEnum.h @@ -234,5 +234,5 @@ enum ETelemetryChallenges eTelemetryTutorial_Hopper, eTelemetryTutorial_HopperMenu, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/PlayerChunkMap.cpp b/Minecraft.Client/PlayerChunkMap.cpp index 42df6284a..bbf8355d3 100644 --- a/Minecraft.Client/PlayerChunkMap.cpp +++ b/Minecraft.Client/PlayerChunkMap.cpp @@ -312,8 +312,8 @@ bool PlayerChunkMap::PlayerChunk::broadcastChanges(bool allowRegionUpdate) } else { - // 4J As we only get here if changes is less than MAX_CHANGES_BEFORE_RESEND (10) we only need to send a byte value in the packet - broadcast( shared_ptr( new ChunkTilesUpdatePacket(pos.x, pos.z, changedTiles, (byte)changes, level) ) ); + // 4J As we only get here if changes is less than MAX_CHANGES_BEFORE_RESEND (10) we only need to send a uint8_t value in the packet + broadcast( shared_ptr( new ChunkTilesUpdatePacket(pos.x, pos.z, changedTiles, (uint8_t)changes, level) ) ); for (int i = 0; i < changes; i++) { int x = pos.x * 16 + ((changedTiles[i] >> 12) & 15); diff --git a/Minecraft.Client/PlayerConnection.cpp b/Minecraft.Client/PlayerConnection.cpp index 9404a5d68..970218104 100644 --- a/Minecraft.Client/PlayerConnection.cpp +++ b/Minecraft.Client/PlayerConnection.cpp @@ -1204,7 +1204,7 @@ void PlayerConnection::handleSetCreativeModeSlot(shared_ptrx = centreXC; data->z = centreZC; - data->dimension = (byte) player->level->dimension->id; + data->dimension = (uint8_t) player->level->dimension->id; data->setDirty(); } diff --git a/Minecraft.Client/PlayerList.cpp b/Minecraft.Client/PlayerList.cpp index 1742756ec..a70efebe5 100644 --- a/Minecraft.Client/PlayerList.cpp +++ b/Minecraft.Client/PlayerList.cpp @@ -238,7 +238,7 @@ bool PlayerList::placeNewPlayer(Connection *connection, shared_ptr int maxPlayersForPacket = getMaxPlayers() > 255 ? 255 : getMaxPlayers(); playerConnection->send( shared_ptr( new LoginPacket(L"", player->entityId, level->getLevelData()->getGenerator(), level->getSeed(), player->gameMode->getGameModeForPlayer()->getId(), - (byte) level->dimension->id, (byte) level->getMaxBuildHeight(), (byte) maxPlayersForPacket, + (uint8_t) level->dimension->id, (uint8_t) level->getMaxBuildHeight(), (uint8_t) maxPlayersForPacket, level->difficulty, TelemetryManager->GetMultiplayerInstanceID(), (BYTE)playerIndex, level->useNewSeaLevel(), player->getAllPlayerGamePrivileges(), level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale() ) ) ); playerConnection->send( shared_ptr( new SetSpawnPositionPacket(spawnPos->x, spawnPos->y, spawnPos->z) ) ); diff --git a/Minecraft.Client/ServerChunkCache.cpp b/Minecraft.Client/ServerChunkCache.cpp index 3af98ca66..2f554ce20 100644 --- a/Minecraft.Client/ServerChunkCache.cpp +++ b/Minecraft.Client/ServerChunkCache.cpp @@ -756,7 +756,7 @@ bool ServerChunkCache::save(bool force, ProgressListener *progressListener) } LevelChunk *chunk = NULL; - byte workingThreads; + 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/ServerLevel.cpp b/Minecraft.Client/ServerLevel.cpp index 242a0df91..8fae81c86 100644 --- a/Minecraft.Client/ServerLevel.cpp +++ b/Minecraft.Client/ServerLevel.cpp @@ -1091,7 +1091,7 @@ bool ServerLevel::addGlobalEntity(shared_ptr e) return false; } -void ServerLevel::broadcastEntityEvent(shared_ptr e, byte event) +void ServerLevel::broadcastEntityEvent(shared_ptr e, uint8_t event) { shared_ptr p = shared_ptr( new EntityEventPacket(e->entityId, event) ); server->getLevel(dimension->id)->getTracker()->broadcastAndSend(e, p); diff --git a/Minecraft.Client/ServerLevel.h b/Minecraft.Client/ServerLevel.h index 77a5cb782..baf07084e 100644 --- a/Minecraft.Client/ServerLevel.h +++ b/Minecraft.Client/ServerLevel.h @@ -106,7 +106,7 @@ class ServerLevel : public Level public: shared_ptr getEntity(int id); virtual bool addGlobalEntity(shared_ptr e); - void broadcastEntityEvent(shared_ptr e, byte event); + void broadcastEntityEvent(shared_ptr e, uint8_t event); virtual shared_ptr explode(shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks); virtual void tileEvent(int x, int y, int z, int tile, int b0, int b1); diff --git a/Minecraft.Client/Tesselator.cpp b/Minecraft.Client/Tesselator.cpp index 7bae7aca9..87214d0d4 100644 --- a/Minecraft.Client/Tesselator.cpp +++ b/Minecraft.Client/Tesselator.cpp @@ -326,7 +326,7 @@ void Tesselator::color(int r, int g, int b, int a) col = (r << 24) | (g << 16) | (b << 8) | (a); } -void Tesselator::color(byte r, byte g, byte b) +void Tesselator::color(uint8_t r, uint8_t g, uint8_t b) { color(r & 0xff, g & 0xff, b & 0xff); } @@ -362,7 +362,7 @@ void Tesselator::vertexUV(float x, float y, float z, float u, float v) // 4 - not axis aligned, use uv stored in the vertex data 4 on from this one // ll is an 8-bit (4 bit per u/v) index into the current lighting texture // -// For quads that don't have axis aligned UVs (ie have a code for 4 in i as described above) the 8 byte vertex +// For quads that don't have axis aligned UVs (ie have a code for 4 in i as described above) the 8 uint8_t vertex // is followed by a further 8 bytes which have explicit UVs defined for each vertex: // // 0000 0000 uuuu vvvv (vertex 0) @@ -833,7 +833,7 @@ void Tesselator::vertex(float x, float y, float z) int16_t u2 = ((int16_t*)&_tex2)[0]; int16_t v2 = ((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. + // Optimisation - pack the second UVs into a single short (they could actually go in a uint8_t), 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. pShortData[6] = ( u2 << 8 ) | v2; pShortData[7] = -xoo; @@ -1034,15 +1034,15 @@ void Tesselator::normal(float x, float y, float z) #ifdef __PS3__ _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 + // AP - casting a negative value to 'uint8_t' 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); _normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16); #else - byte xx = (byte) (x * 127); - byte yy = (byte) (y * 127); - byte zz = (byte) (z * 127); + uint8_t xx = (uint8_t) (x * 127); + uint8_t yy = (uint8_t) (y * 127); + uint8_t zz = (uint8_t) (z * 127); _normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16); #endif } diff --git a/Minecraft.Client/Tesselator.h b/Minecraft.Client/Tesselator.h index 72a458c22..6c0f30a23 100644 --- a/Minecraft.Client/Tesselator.h +++ b/Minecraft.Client/Tesselator.h @@ -138,7 +138,7 @@ class Tesselator { 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(byte r, byte g, byte b); + void color(uint8_t r, uint8_t g, 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/Texture.cpp b/Minecraft.Client/Texture.cpp index 809f606aa..082035c4c 100644 --- a/Minecraft.Client/Texture.cpp +++ b/Minecraft.Client/Texture.cpp @@ -270,10 +270,10 @@ void Texture::writeAsBMP(const wstring &name) // Write the header outStream->writeShort((short)0x424d); // 0x0000: ID - 'BM' int byteSize = width * height * 4 + 54; - outStream->writeByte((byte)(byteSize >> 0)); // 0x0002: Raw file size - outStream->writeByte((byte)(byteSize >> 8)); - outStream->writeByte((byte)(byteSize >> 16)); - outStream->writeByte((byte)(byteSize >> 24)); + outStream->writeByte((uint8_t)(byteSize >> 0)); // 0x0002: Raw file size + outStream->writeByte((uint8_t)(byteSize >> 8)); + outStream->writeByte((uint8_t)(byteSize >> 16)); + outStream->writeByte((uint8_t)(byteSize >> 24)); outStream->writeInt(0); // 0x0006: Reserved outStream->writeByte(54); // 0x000A: Start of pixel data outStream->writeByte(0); @@ -283,31 +283,31 @@ void Texture::writeAsBMP(const wstring &name) outStream->writeByte(0); outStream->writeByte(0); outStream->writeByte(0); - outStream->writeByte((byte)(width >> 0)); // 0x0012: Image width, in pixels - outStream->writeByte((byte)(width >> 8)); - outStream->writeByte((byte)(width >> 16)); - outStream->writeByte((byte)(width >> 24)); - outStream->writeByte((byte)(height >> 0)); // 0x0016: Image height, in pixels - outStream->writeByte((byte)(height >> 8)); - outStream->writeByte((byte)(height >> 16)); - outStream->writeByte((byte)(height >> 24)); + outStream->writeByte((uint8_t)(width >> 0)); // 0x0012: Image width, in pixels + outStream->writeByte((uint8_t)(width >> 8)); + outStream->writeByte((uint8_t)(width >> 16)); + outStream->writeByte((uint8_t)(width >> 24)); + outStream->writeByte((uint8_t)(height >> 0)); // 0x0016: Image height, in pixels + outStream->writeByte((uint8_t)(height >> 8)); + outStream->writeByte((uint8_t)(height >> 16)); + outStream->writeByte((uint8_t)(height >> 24)); outStream->writeByte(1); // 0x001A: Number of color planes, must be 1 outStream->writeByte(0); outStream->writeByte(32); // 0x001C: Bit depth (32bpp) outStream->writeByte(0); outStream->writeInt(0); // 0x001E: Compression mode (BI_RGB, uncompressed) int bufSize = width * height * 4; - outStream->writeInt((byte)(bufSize >> 0)); // 0x0022: Raw size of bitmap data - outStream->writeInt((byte)(bufSize >> 8)); - outStream->writeInt((byte)(bufSize >> 16)); - outStream->writeInt((byte)(bufSize >> 24)); + outStream->writeInt((uint8_t)(bufSize >> 0)); // 0x0022: Raw size of bitmap data + outStream->writeInt((uint8_t)(bufSize >> 8)); + outStream->writeInt((uint8_t)(bufSize >> 16)); + outStream->writeInt((uint8_t)(bufSize >> 24)); outStream->writeInt(0); // 0x0026: Horizontal resolution in ppm outStream->writeInt(0); // 0x002A: Vertical resolution in ppm outStream->writeInt(0); // 0x002E: Palette size (0 to match bit depth) outStream->writeInt(0); // 0x0032: Number of important colors, 0 for all // Pixels follow in inverted Y order - byte[] bytes = new byte[width * height * 4]; + uint8_t[] bytes = new uint8_t[width * height * 4]; data.position(0); data.get(bytes); for (int y = height - 1; y >= 0; y--) @@ -336,7 +336,7 @@ void Texture::writeAsPNG(const wstring &filename) #if 0 BufferedImage *image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); ByteBuffer *buffer = this->getData(); - byte[] bytes = new byte[width * height * 4]; + uint8_t[] bytes = new uint8_t[width * height * 4]; buffer.position(0); buffer.get(bytes); @@ -530,10 +530,10 @@ void Texture::transferFromBuffer(intArray buffer) { int texel = column + x * 4; data[0]->position(0); - data[0]->put(texel + byteRemap[0], (byte)((buffer[texel >> 2] >> 24) & 0xff)); - data[0]->put(texel + byteRemap[1], (byte)((buffer[texel >> 2] >> 16) & 0xff)); - data[0]->put(texel + byteRemap[2], (byte)((buffer[texel >> 2] >> 8) & 0xff)); - data[0]->put(texel + byteRemap[3], (byte)((buffer[texel >> 2] >> 0) & 0xff)); + data[0]->put(texel + byteRemap[0], (uint8_t)((buffer[texel >> 2] >> 24) & 0xff)); + data[0]->put(texel + byteRemap[1], (uint8_t)((buffer[texel >> 2] >> 16) & 0xff)); + data[0]->put(texel + byteRemap[2], (uint8_t)((buffer[texel >> 2] >> 8) & 0xff)); + data[0]->put(texel + byteRemap[3], (uint8_t)((buffer[texel >> 2] >> 0) & 0xff)); } } } @@ -589,10 +589,10 @@ void Texture::transferFromImage(BufferedImage *image) // Pull ARGB bytes into either RGBA or BGRA depending on format - tempBytes[byteIndex + byteRemap[0]] = (byte)((tempPixels[intIndex] >> 24) & 0xff); - tempBytes[byteIndex + byteRemap[1]] = (byte)((tempPixels[intIndex] >> 16) & 0xff); - tempBytes[byteIndex + byteRemap[2]] = (byte)((tempPixels[intIndex] >> 8) & 0xff); - tempBytes[byteIndex + byteRemap[3]] = (byte)((tempPixels[intIndex] >> 0) & 0xff); + tempBytes[byteIndex + byteRemap[0]] = (uint8_t)((tempPixels[intIndex] >> 24) & 0xff); + tempBytes[byteIndex + byteRemap[1]] = (uint8_t)((tempPixels[intIndex] >> 16) & 0xff); + tempBytes[byteIndex + byteRemap[2]] = (uint8_t)((tempPixels[intIndex] >> 8) & 0xff); + tempBytes[byteIndex + byteRemap[3]] = (uint8_t)((tempPixels[intIndex] >> 0) & 0xff); } } @@ -641,10 +641,10 @@ void Texture::transferFromImage(BufferedImage *image) // Pull ARGB bytes into either RGBA or BGRA depending on format - tempBytes[byteIndex + byteRemap[0]] = (byte)((tempData[intIndex] >> 24) & 0xff); - tempBytes[byteIndex + byteRemap[1]] = (byte)((tempData[intIndex] >> 16) & 0xff); - tempBytes[byteIndex + byteRemap[2]] = (byte)((tempData[intIndex] >> 8) & 0xff); - tempBytes[byteIndex + byteRemap[3]] = (byte)((tempData[intIndex] >> 0) & 0xff); + tempBytes[byteIndex + byteRemap[0]] = (uint8_t)((tempData[intIndex] >> 24) & 0xff); + tempBytes[byteIndex + byteRemap[1]] = (uint8_t)((tempData[intIndex] >> 16) & 0xff); + tempBytes[byteIndex + byteRemap[2]] = (uint8_t)((tempData[intIndex] >> 8) & 0xff); + tempBytes[byteIndex + byteRemap[3]] = (uint8_t)((tempData[intIndex] >> 0) & 0xff); } } } @@ -676,10 +676,10 @@ void Texture::transferFromImage(BufferedImage *image) // Pull ARGB bytes into either RGBA or BGRA depending on format - tempBytes[byteIndex + byteRemap[0]] = (byte)((col >> 24) & 0xff); - tempBytes[byteIndex + byteRemap[1]] = (byte)((col >> 16) & 0xff); - tempBytes[byteIndex + byteRemap[2]] = (byte)((col >> 8) & 0xff); - tempBytes[byteIndex + byteRemap[3]] = (byte)((col >> 0) & 0xff); + tempBytes[byteIndex + byteRemap[0]] = (uint8_t)((col >> 24) & 0xff); + tempBytes[byteIndex + byteRemap[1]] = (uint8_t)((col >> 16) & 0xff); + tempBytes[byteIndex + byteRemap[2]] = (uint8_t)((col >> 8) & 0xff); + tempBytes[byteIndex + byteRemap[3]] = (uint8_t)((col >> 0) & 0xff); } } @@ -829,7 +829,7 @@ void Texture::updateOnGPU() // the ram based buffer to it any more inside RenderManager.TextureDataUpdate unsigned char *newData = RenderManager.TextureData(width,height,data[0]->getBuffer(),0,C4JRender::TEXTURE_FORMAT_RxGyBzAw); ByteBuffer *oldBuffer = data[0]; - data[0] = new ByteBuffer(data[0]->getSize(), (byte*) newData); + data[0] = new ByteBuffer(data[0]->getSize(), (uint8_t*) newData); delete oldBuffer; newData += width * height * 4; #else @@ -848,7 +848,7 @@ void Texture::updateOnGPU() // the ram based buffer to it any more inside RenderManager.TextureDataUpdate RenderManager.TextureDataUpdate(0, 0,levelWidth,levelHeight,data[level]->getBuffer(),level); ByteBuffer *oldBuffer = data[level]; - data[level] = new ByteBuffer(data[level]->getSize(), (byte*) newData); + data[level] = new ByteBuffer(data[level]->getSize(), (uint8_t*) newData); delete oldBuffer; newData += levelWidth * levelHeight * 4; #else diff --git a/Minecraft.Client/TexturePack.cpp b/Minecraft.Client/TexturePack.cpp index 7ed208ae3..5bb32af8d 100644 --- a/Minecraft.Client/TexturePack.cpp +++ b/Minecraft.Client/TexturePack.cpp @@ -58,7 +58,7 @@ wstring TexturePack::getPath(bool bTitleUpdateTexture /*= false*/,const char *pc } #elif __PSVITA__ - char *pchUsrDir="";//getUsrDirPath(); + const char *pchUsrDir="";//getUsrDirPath(); wstring wstr (pchUsrDir, pchUsrDir+strlen(pchUsrDir)); if(bTitleUpdateTexture) diff --git a/Minecraft.Client/Textures.cpp b/Minecraft.Client/Textures.cpp index cd6e0bae1..f3d7719e8 100644 --- a/Minecraft.Client/Textures.cpp +++ b/Minecraft.Client/Textures.cpp @@ -24,7 +24,7 @@ bool Textures::MIPMAP = true; C4JRender::eTextureFormat Textures::TEXTURE_FORMAT = C4JRender::TEXTURE_FORMAT_RxGyBzAw; int Textures::preLoadedIdx[TN_COUNT]; -wchar_t *Textures::preLoaded[TN_COUNT] = +const wchar_t *Textures::preLoaded[TN_COUNT] = { L"%blur%misc/pumpkinblur", // L"%blur%/misc/vignette", // Not currently used @@ -725,15 +725,15 @@ void Textures::loadTexture(BufferedImage *img, int id, bool blur, bool clamp) int b = (rawPixels[i]) & 0xff; #ifdef _XBOX - newPixels[i * 4 + 0] = (byte) a; - newPixels[i * 4 + 1] = (byte) r; - newPixels[i * 4 + 2] = (byte) g; - newPixels[i * 4 + 3] = (byte) b; + newPixels[i * 4 + 0] = (uint8_t) a; + newPixels[i * 4 + 1] = (uint8_t) r; + newPixels[i * 4 + 2] = (uint8_t) g; + newPixels[i * 4 + 3] = (uint8_t) b; #else - newPixels[i * 4 + 0] = (byte) r; - newPixels[i * 4 + 1] = (byte) g; - newPixels[i * 4 + 2] = (byte) b; - newPixels[i * 4 + 3] = (byte) a; + newPixels[i * 4 + 0] = (uint8_t) r; + newPixels[i * 4 + 1] = (uint8_t) g; + newPixels[i * 4 + 2] = (uint8_t) b; + newPixels[i * 4 + 3] = (uint8_t) a; #endif } // 4J - now creating a buffer of the size we require dynamically @@ -901,10 +901,10 @@ void Textures::replaceTexture(intArray rawPixels, int w, int h, int id) b = bb; } - newPixels[i * 4 + 0] = (byte) r; - newPixels[i * 4 + 1] = (byte) g; - newPixels[i * 4 + 2] = (byte) b; - newPixels[i * 4 + 3] = (byte) a; + newPixels[i * 4 + 0] = (uint8_t) r; + newPixels[i * 4 + 1] = (uint8_t) g; + newPixels[i * 4 + 2] = (uint8_t) b; + newPixels[i * 4 + 3] = (uint8_t) a; } ByteBuffer *pixels = MemoryTracker::createByteBuffer(w * h * 4); // 4J - now creating dynamically pixels->put(newPixels); @@ -1520,7 +1520,7 @@ TEXTURE_NAME TUImages[] = }; // This is for any TU textures that aren't part of our enum indexed preload set -wchar_t *TUImagePaths[] = +const wchar_t *TUImagePaths[] = { L"font/Default", L"font/Mojangles_7", @@ -1579,7 +1579,7 @@ TEXTURE_NAME OriginalImages[] = TN_COUNT }; -wchar_t *OriginalImagesPaths[] = +const wchar_t *OriginalImagesPaths[] = { L"misc/watercolor.png", diff --git a/Minecraft.Client/Textures.h b/Minecraft.Client/Textures.h index eb3d2f6d2..1fca56106 100644 --- a/Minecraft.Client/Textures.h +++ b/Minecraft.Client/Textures.h @@ -243,7 +243,7 @@ class Textures static C4JRender::eTextureFormat TEXTURE_FORMAT; private: - static wchar_t *preLoaded[TN_COUNT]; + static const wchar_t *preLoaded[TN_COUNT]; static int preLoadedIdx[TN_COUNT]; unordered_map idMap; diff --git a/Minecraft.Client/TileRenderer.cpp b/Minecraft.Client/TileRenderer.cpp index 4735b9416..f7c03225c 100644 --- a/Minecraft.Client/TileRenderer.cpp +++ b/Minecraft.Client/TileRenderer.cpp @@ -2771,9 +2771,9 @@ bool TileRenderer::tesselateDustInWorld( Tile* tt, int x, int y, int z ) unsigned int minColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_RedstoneDustLitMin ); unsigned int maxColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_RedstoneDustLitMax ); - byte redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( (data-1)/14.0f)); - byte greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( (data-1)/14.0f)); - byte blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( (data-1)/14.0f)); + uint8_t redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( (data-1)/14.0f)); + uint8_t greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( (data-1)/14.0f)); + uint8_t blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( (data-1)/14.0f)); colour = redComponent<<16 | greenComponent<<8 | blueComponent; } diff --git a/Minecraft.Client/TrackedEntity.cpp b/Minecraft.Client/TrackedEntity.cpp index 0a5a02bff..e800e5988 100644 --- a/Minecraft.Client/TrackedEntity.cpp +++ b/Minecraft.Client/TrackedEntity.cpp @@ -152,7 +152,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl ) { teleportDelay = 0; - packet = shared_ptr( new TeleportEntityPacket(e->entityId, xn, yn, zn, (byte) yRotn, (byte) xRotn) ); + packet = shared_ptr( new TeleportEntityPacket(e->entityId, xn, yn, zn, (uint8_t) yRotn, (uint8_t) xRotn) ); // printf("%d: New teleport rot %d\n",e->entityId,yRotn); yRotp = yRotn; xRotp = xRotn; @@ -205,7 +205,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl ( za >= -16 ) && ( za <= 15 ) && ( ya >= -32 ) && ( ya <= 31 ) ) { - // use the packet with small packet with rotation if we can - 5 bits each for x & z, and 6 for y - still a byte less than the alternative + // use the packet with small packet with rotation if we can - 5 bits each for x & z, and 6 for y - still a uint8_t less than the alternative packet = shared_ptr( new MoveEntityPacketSmall::PosRot(e->entityId, (char) xa, (char) ya, (char) za, 0, 0 )); c1b++; } @@ -291,7 +291,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl if (rot) { // 4J: Changed this to use deltas - broadcast( shared_ptr( new MoveEntityPacket::Rot(e->entityId, (byte) yRota, (byte) xRota)) ); + broadcast( shared_ptr( new MoveEntityPacket::Rot(e->entityId, (uint8_t) yRota, (uint8_t) xRota)) ); yRotp = yRotn; xRotp = xRotn; } @@ -308,7 +308,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl int yHeadRot = Mth::floor(e->getYHeadRot() * 256 / 360); if (abs(yHeadRot - yHeadRotp) >= TOLERANCE_LEVEL) { - broadcast(shared_ptr( new RotateHeadPacket(e->entityId, (byte) yHeadRot))); + broadcast(shared_ptr( new RotateHeadPacket(e->entityId, (uint8_t) yHeadRot))); yHeadRotp = yHeadRot; } diff --git a/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h b/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h index 737caa98b..5e6087eb0 100644 --- a/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h @@ -74,7 +74,7 @@ class C4JRender // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp index dea9e3155..9ebf6c5d9 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp @@ -56,7 +56,7 @@ typedef ID3D11DeviceContext ID3D1XContext; typedef F32 ViewCoord; typedef gdraw_d3d11_resourcetype gdraw_resourcetype; -static void report_d3d_error(HRESULT hr, char *call, char *context); +static void report_d3d_error(HRESULT hr, const char *call, const char *context); static void *map_buffer(ID3D1XContext *ctx, ID3D11Buffer *buf, bool discard) { diff --git a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl index df42488c6..812c32927 100644 --- a/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl +++ b/Minecraft.Client/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -200,7 +200,7 @@ static void safe_release(T *&p) } } -static void report_d3d_error(HRESULT hr, char *call, char *context) +static void report_d3d_error(HRESULT hr, const char *call, const char *context) { if (hr == E_OUTOFMEMORY) IggyGDrawSendWarning(NULL, "GDraw D3D out of memory in %s%s", call, context); @@ -478,7 +478,7 @@ static GDrawTexture * RADLINK gdraw_MakeTextureEnd(GDraw_MakeTexture_ProcessingI D3D1X_(SUBRESOURCE_DATA) mipdata[24]; S32 i, w, h, nmips, bpp; HRESULT hr = S_OK; - char *failed_call; + const char *failed_call; U8 *ptr; // generate mip maps and set up descriptors for them @@ -700,7 +700,7 @@ static void RADLINK gdraw_DescribeVertexBuffer(GDrawVertexBuffer *vbuf, GDraw_Ve static GDrawHandle *get_color_rendertarget(GDrawStats *stats) { - char *failed_call; + const char *failed_call; // try to recycle LRU rendertarget GDrawHandle *t = gdraw_HandleCacheGetLRU(&gdraw->rendertargets); @@ -762,7 +762,7 @@ static GDrawHandle *get_color_rendertarget(GDrawStats *stats) static ID3D1X(DepthStencilView) *get_rendertarget_depthbuffer(GDrawStats *stats) { if (!gdraw->depth_buffer[1]) { - char *failed_call; + const char *failed_call; assert(!gdraw->rt_depth_buffer); D3D1X_(TEXTURE2D_DESC) desc = { static_cast(gdraw->frametex_width), static_cast(gdraw->frametex_height), 1U, 1U, DXGI_FORMAT_D24_UNORM_S8_UINT, { 1, 0 }, @@ -2382,9 +2382,8 @@ static S32 num_pixels(S32 w, S32 h, S32 mipmaps) return pixels; } -GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, S32 /*len*/, IggyFileTextureRaw *texture) -{ - char *failed_call=""; +GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, S32 /*len*/, IggyFileTextureRaw *texture){ + const char *failed_call = ""; U8 *free_data = 0; GDrawTexture *t=0; S32 width, height, mipmaps, size, blk; @@ -2412,7 +2411,7 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, case IFT_FORMAT_DXT5 : size=16; d3dfmt = DXGI_FORMAT_BC3_UNORM; blk = 4; break; default: { IggyGDrawSendWarning(NULL, "GDraw .iggytex raw texture format %d not supported by hardware", texture->format); - goto done; + return 0; } } @@ -2428,7 +2427,7 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, free_data = (U8 *) IggyGDrawMalloc(total_size); if (!free_data) { IggyGDrawSendWarning(NULL, "GDraw out of memory to store texture data to pass to D3D for %d x %d texture", width, height); - goto done; + return 0; } U8 *cur = free_data; @@ -2457,21 +2456,23 @@ GDrawTexture * RADLINK gdraw_D3D1X_(MakeTextureFromResource)(U8 *resource_file, failed_call = "CreateTexture2D"; hr = gdraw->d3d_device->CreateTexture2D(&desc, mipdata, &tex); - if (FAILED(hr)) goto done; - - failed_call = "CreateShaderResourceView for texture creation"; - hr = gdraw->d3d_device->CreateShaderResourceView(tex, NULL, &view); - if (FAILED(hr)) goto done; - - t = gdraw_D3D1X_(WrappedTextureCreate)(view); + + if (SUCCEEDED(hr)) { + failed_call = "CreateShaderResourceView for texture creation"; + hr = gdraw->d3d_device->CreateShaderResourceView(tex, NULL, &view); + + if (SUCCEEDED(hr)) { + t = gdraw_D3D1X_(WrappedTextureCreate)(view); + } + } -done: if (FAILED(hr)) { report_d3d_error(hr, failed_call, ""); } - if (free_data) + if (free_data) { IggyGDrawFree(free_data); + } if (!t) { if (view) @@ -2481,6 +2482,7 @@ done: } else { ((GDrawHandle *) t)->handle.tex.d3d = tex; } + return t; } diff --git a/Minecraft.Client/Windows64/Iggy/include/gdraw.h b/Minecraft.Client/Windows64/Iggy/include/gdraw.h index 404a2642b..607843266 100644 --- a/Minecraft.Client/Windows64/Iggy/include/gdraw.h +++ b/Minecraft.Client/Windows64/Iggy/include/gdraw.h @@ -257,7 +257,7 @@ typedef struct GDrawRenderState U8 stencil_test; // Only draw if these stencil bits are "set" U8 stencil_set; // "Set" these stencil bits (note that actual implementation initializes stencil to 1, and "set" makes them 0) - U8 reserved[2]; // Currently unused (used to make padding to 4/8-byte boundary for following pointer explicit) + U8 reserved[2]; // Currently unused (used to make padding to 4/8-uint8_t boundary for following pointer explicit) S32 blur_passes; // For filters that include blurring, this is the number of box filter passes to run //align 0 mod 8 @@ -371,7 +371,7 @@ IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDra IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); /* Specifies the 1D texture data to be used for the antialiasing gradients. - 'rgba' specifies the pixel values in rgba byte order. This will only be called + 'rgba' specifies the pixel values in rgba uint8_t order. This will only be called once during initialization. */ //////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ IDOC typedef void RADLINK gdraw_set_antialias_texture(S32 width, U8 *rgba); IDOC typedef enum gdraw_texture_format { // Platform-independent formats - GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred byte order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) + GDRAW_TEXTURE_FORMAT_rgba32, // 32bpp RGBA data in platform-preferred uint8_t order (returned by $gdraw_make_texture_begin as $gdraw_texture_type) GDRAW_TEXTURE_FORMAT_font, // Alpha-only data with at least 4 bits/pixel. Data is submitted as 8 bits/pixel, conversion (if necessary) done by GDraw. // First platform-specific format index (for reference) diff --git a/Minecraft.Client/Windows64/Iggy/include/iggy.h b/Minecraft.Client/Windows64/Iggy/include/iggy.h index 56638a321..2427a14d3 100644 --- a/Minecraft.Client/Windows64/Iggy/include/iggy.h +++ b/Minecraft.Client/Windows64/Iggy/include/iggy.h @@ -172,7 +172,7 @@ typedef struct IggyAllocator Iggy_AllocateFunction *mem_alloc; Iggy_DeallocateFunction *mem_free; #ifndef __RAD64__ - void *struct_padding; // pad to 8-byte boundary + void *struct_padding; // pad to 8-uint8_t boundary #endif } IggyAllocator; diff --git a/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h b/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ class MinecraftDynamicConfigurations static size_t s_currentConfigSize; static size_t s_dataWrittenSize; - static byte *s_dataWritten; + static uint8_t *s_dataWritten; public: static void Tick(); diff --git a/Minecraft.Client/Windows64/Sentient/TelemetryEnum.h b/Minecraft.Client/Windows64/Sentient/TelemetryEnum.h index 5a5a709f0..b4f3f968c 100644 --- a/Minecraft.Client/Windows64/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/Windows64/Sentient/TelemetryEnum.h @@ -231,5 +231,5 @@ enum ETelemetryChallenges eTelemetryTutorial_FireworksMenu, eTelemetryTutorial_BeaconMenu - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/Xbox/4JLibs/inc/4J_Render.h b/Minecraft.Client/Xbox/4JLibs/inc/4J_Render.h index 5f113d5d7..41ef4dce4 100644 --- a/Minecraft.Client/Xbox/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Xbox/4JLibs/inc/4J_Render.h @@ -130,8 +130,8 @@ class C4JRender // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD - VERTEX_TYPE_PS3_TS2_CS1, // Position 3 x short, texture 2 x short, colour 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x uint8_t, normal 4 x uint8_t, padding 1 DWORD + VERTEX_TYPE_PS3_TS2_CS1, // Position 3 x short, texture 2 x short, colour 4 x uint8_t, padding 1 DWORD VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen VERTEX_TYPE_COUNT diff --git a/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.cpp b/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.cpp index 5d2b97631..330a812b4 100644 --- a/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.cpp +++ b/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.cpp @@ -11,7 +11,7 @@ bool MinecraftDynamicConfigurations::s_bUpdatedConfigs[MinecraftDynamicConfigura MinecraftDynamicConfigurations::EDynamic_Configs MinecraftDynamicConfigurations::s_eCurrentConfig = MinecraftDynamicConfigurations::eDynamic_Config_Max; size_t MinecraftDynamicConfigurations::s_currentConfigSize = 0; size_t MinecraftDynamicConfigurations::s_dataWrittenSize = 0; -byte *MinecraftDynamicConfigurations::s_dataWritten = NULL; +uint8_t *MinecraftDynamicConfigurations::s_dataWritten = NULL; void MinecraftDynamicConfigurations::Tick() { @@ -90,7 +90,7 @@ void MinecraftDynamicConfigurations::GetSizeCompletedCallback(HRESULT taskResult { if( HRESULT_SUCCEEDED(taskResult) ) { - s_dataWritten = new byte[s_currentConfigSize]; + s_dataWritten = new uint8_t[s_currentConfigSize]; HRESULT hr = Sentient::SenDynamicConfigGetBytes( s_eCurrentConfig, s_currentConfigSize, diff --git a/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.h b/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Xbox/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ class MinecraftDynamicConfigurations static size_t s_currentConfigSize; static size_t s_dataWrittenSize; - static byte *s_dataWritten; + static uint8_t *s_dataWritten; public: static void Tick(); diff --git a/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h b/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h index da1b1f65d..33c24fd9b 100644 --- a/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h +++ b/Minecraft.Client/Xbox/Sentient/Include/SenClientUGC.h @@ -1,4 +1,4 @@ -/******************************************************** +/******************************************************** * * * Copyright (C) Microsoft. All rights reserved. * * * @@ -474,7 +474,7 @@ namespace Sentient // Parameter: SenSysCompletedCallback userCallback // Parameter: void * userCallbackData // Download a single blob of UGC data - // note that zero byte downloads will fail. + // note that zero uint8_t downloads will fail. // ID, blobVersion, and bufferSize should be coming // from SenUGCDownloadedMetaData. // outBuffer should be an preallocated array of bufferSize bytes. @@ -519,7 +519,7 @@ namespace Sentient // Parameter: SenSysCompletedCallback userCallback // Parameter: void * userCallbackData // Download a single blob of UGC data - // NOTE: zero byte downloads will fail. + // NOTE: zero uint8_t downloads will fail. // ID, mainDataRevision and bufferSize should be coming from a // SenUGCDownloadedMetaData2 (where bufferSize comes from // SenUGCDownloadedMetaData2's BlobInfo[mainDataBlobID].Size). diff --git a/Minecraft.Client/Xbox/Sentient/TelemetryEnum.h b/Minecraft.Client/Xbox/Sentient/TelemetryEnum.h index 77d39a39f..613cd8391 100644 --- a/Minecraft.Client/Xbox/Sentient/TelemetryEnum.h +++ b/Minecraft.Client/Xbox/Sentient/TelemetryEnum.h @@ -225,5 +225,5 @@ enum ETelemetryChallenges eTelemetryTutorial_TradingMenu, eTelemetryTutorial_Enderchest, - // Sent over network as a byte + // Sent over network as a uint8_t }; \ No newline at end of file diff --git a/Minecraft.Client/Xbox/XUI_SkinSelect.cpp b/Minecraft.Client/Xbox/XUI_SkinSelect.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Minecraft.Client/Xbox/XUI_SkinSelect.h b/Minecraft.Client/Xbox/XUI_SkinSelect.h new file mode 100644 index 000000000..e69de29bb diff --git a/Minecraft.Client/Xbox/Xbox_App.cpp b/Minecraft.Client/Xbox/Xbox_App.cpp index eebeb827f..97a127f9d 100644 --- a/Minecraft.Client/Xbox/Xbox_App.cpp +++ b/Minecraft.Client/Xbox/Xbox_App.cpp @@ -190,7 +190,7 @@ LPCWSTR apwstrLocale[10] = L"pt-PT" // Portuguese }; -WCHAR *CConsoleMinecraftApp::wchTypefaceA[]= +const WCHAR *CConsoleMinecraftApp::wchTypefaceA[]= { L"Mojangles", L"SDBookM", @@ -198,7 +198,7 @@ WCHAR *CConsoleMinecraftApp::wchTypefaceA[]= L"DFHeiMedium-B5", }; -WCHAR *CConsoleMinecraftApp::wchTypefaceLocatorA[]= +const WCHAR *CConsoleMinecraftApp::wchTypefaceLocatorA[]= { L"media/font/Mojangles.ttf", L"media/font/KOR/BOKMSD.ttf", @@ -206,7 +206,7 @@ WCHAR *CConsoleMinecraftApp::wchTypefaceLocatorA[]= L"media/font/CHT/DFHeiMedium-B5.ttf", }; -WCHAR *CConsoleMinecraftApp::wchSceneA[]= +const WCHAR *CConsoleMinecraftApp::wchSceneA[]= { L"xuiscene_partnernetpassword", L"xuiscene_intro", @@ -2695,7 +2695,7 @@ void CConsoleMinecraftApp::FatalLoadError(void) ExitGame(); } -WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]= +const WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]= { L"png", L"inf", diff --git a/Minecraft.Client/Xbox/Xbox_App.h b/Minecraft.Client/Xbox/Xbox_App.h index f64e71423..fd3b59777 100644 --- a/Minecraft.Client/Xbox/Xbox_App.h +++ b/Minecraft.Client/Xbox/Xbox_App.h @@ -29,9 +29,9 @@ class CConsoleMinecraftApp : public CMinecraftApp std::list< SceneStackPair > m_sceneStack[XUSER_MAX_COUNT]; // XUI scene names - static WCHAR *wchSceneA[eUIScene_COUNT]; - static WCHAR *wchTypefaceA[4]; - static WCHAR *wchTypefaceLocatorA[4]; + static const WCHAR *wchSceneA[eUIScene_COUNT]; + static const WCHAR *wchTypefaceA[4]; + static const WCHAR *wchTypefaceLocatorA[4]; WCHAR m_SceneName[50]; public: @@ -189,7 +189,7 @@ class CConsoleMinecraftApp : public CMinecraftApp private: static WCHAR m_wchTMSXZP[]; - static WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]; + static const WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]; }; diff --git a/Minecraft.World/Achievement.cpp b/Minecraft.World/Achievement.cpp index a0dfd5332..65049dfe9 100644 --- a/Minecraft.World/Achievement.cpp +++ b/Minecraft.World/Achievement.cpp @@ -15,18 +15,18 @@ void Achievement::_init() if (y > Achievements::yMax) Achievements::yMax = y; } -Achievement::Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requires) - : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requires(requires) +Achievement::Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requirements) + : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requirements(requirements) { } -Achievement::Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requires) - : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requires(requires) +Achievement::Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requirements) + : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon( new ItemInstance(icon) ), x(x), y(y), requirements(requirements) { } -Achievement::Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requires) - : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon(icon), x(x), y(y), requires(requires) +Achievement::Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requirements) + : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon(icon), x(x), y(y), requirements(requirements) { } diff --git a/Minecraft.World/Achievement.h b/Minecraft.World/Achievement.h index b39c44b31..8b33815eb 100644 --- a/Minecraft.World/Achievement.h +++ b/Minecraft.World/Achievement.h @@ -9,23 +9,23 @@ class Achievement : public Stat { public: const int x, y; - Achievement *requires; + Achievement *requirements; private: const wstring desc; - DescFormatter *descFormatter; + DescFormatter *descFormatter; public: const shared_ptr icon; private: - bool isGoldenVar; + bool isGoldenVar; void _init(); public: - Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requires); - Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requires); - Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requires); + Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requirements); + Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requirements); + Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requirements); Achievement *setAwardLocallyOnly(); Achievement *setGolden(); diff --git a/Minecraft.World/AddEntityPacket.h b/Minecraft.World/AddEntityPacket.h index 293964796..121d3bd8f 100644 --- a/Minecraft.World/AddEntityPacket.h +++ b/Minecraft.World/AddEntityPacket.h @@ -36,7 +36,7 @@ class AddEntityPacket : public Packet, public enable_shared_from_this e, int type, int data, int xp, int yp, int zp, int yRotp, int xRotp ); diff --git a/Minecraft.World/AddMobPacket.cpp b/Minecraft.World/AddMobPacket.cpp index 878e2ee72..a64337cea 100644 --- a/Minecraft.World/AddMobPacket.cpp +++ b/Minecraft.World/AddMobPacket.cpp @@ -29,7 +29,7 @@ AddMobPacket::AddMobPacket(shared_ptr mob, int yRotp, int xRotp, i { id = mob->entityId; - type = (byte) EntityIO::getId(mob); + type = (uint8_t) EntityIO::getId(mob); // 4J Stu - We should add entities at their "last sent" position so that the relative update packets // put them in the correct place x = xp;//Mth::floor(mob->x * 32); @@ -39,9 +39,9 @@ AddMobPacket::AddMobPacket(shared_ptr mob, int yRotp, int xRotp, i yRot = yRotp; xRot = xRotp; yHeadRot = yHeadRotp; - // yRot = (byte) (mob->yRot * 256 / 360); - // xRot = (byte) (mob->xRot * 256 / 360); - // yHeadRot = (byte) (mob->yHeadRot * 256 / 360); + // yRot = (uint8_t) (mob->yRot * 256 / 360); + // xRot = (uint8_t) (mob->xRot * 256 / 360); + // yHeadRot = (uint8_t) (mob->yHeadRot * 256 / 360); // From SetEntityMotionpacket double m = 3.9; diff --git a/Minecraft.World/AddMobPacket.h b/Minecraft.World/AddMobPacket.h index 6af72655e..3d1e19185 100644 --- a/Minecraft.World/AddMobPacket.h +++ b/Minecraft.World/AddMobPacket.h @@ -13,7 +13,7 @@ class AddMobPacket : public Packet, public enable_shared_from_this int type; int x, y, z; int xd, yd, zd; - byte yRot, xRot, yHeadRot; + uint8_t yRot, xRot, yHeadRot; private: shared_ptr entityData; diff --git a/Minecraft.World/AddPlayerPacket.cpp b/Minecraft.World/AddPlayerPacket.cpp index 939843679..11208d0b9 100644 --- a/Minecraft.World/AddPlayerPacket.cpp +++ b/Minecraft.World/AddPlayerPacket.cpp @@ -45,8 +45,8 @@ AddPlayerPacket::AddPlayerPacket(shared_ptr player, PlayerUID xuid, Play yRot = yRotp; xRot = xRotp; yHeadRot = yHeadRotp; // 4J Added - // yRot = (byte) (player->yRot * 256 / 360); - // xRot = (byte) (player->xRot * 256 / 360); + // yRot = (uint8_t) (player->yRot * 256 / 360); + // xRot = (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); @@ -117,7 +117,7 @@ void AddPlayerPacket::handle(PacketListener *listener) int AddPlayerPacket::getEstimatedSize() { - int iSize= sizeof(int) + Player::MAX_NAME_LENGTH + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(BYTE) + sizeof(BYTE) +sizeof(short) + sizeof(PlayerUID) + sizeof(PlayerUID) + sizeof(int) + sizeof(BYTE) + sizeof(unsigned int) + sizeof(byte); + int iSize= sizeof(int) + Player::MAX_NAME_LENGTH + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(BYTE) + sizeof(BYTE) +sizeof(short) + sizeof(PlayerUID) + sizeof(PlayerUID) + sizeof(int) + sizeof(BYTE) + sizeof(unsigned int) + sizeof(uint8_t); if( entityData != NULL ) { diff --git a/Minecraft.World/AddPlayerPacket.h b/Minecraft.World/AddPlayerPacket.h index 30f6bcdda..f381a422d 100644 --- a/Minecraft.World/AddPlayerPacket.h +++ b/Minecraft.World/AddPlayerPacket.h @@ -25,7 +25,7 @@ class AddPlayerPacket : public Packet, public enable_shared_from_this partner) return isInLove() && partner->isInLove(); } -void Animal::handleEntityEvent(byte id) +void Animal::handleEntityEvent(uint8_t id) { if (id == EntityEvent::IN_LOVE_HEARTS) { diff --git a/Minecraft.World/Animal.h b/Minecraft.World/Animal.h index 85a20439f..67c392704 100644 --- a/Minecraft.World/Animal.h +++ b/Minecraft.World/Animal.h @@ -65,7 +65,7 @@ class Animal : public AgableMob, public Creature bool isInLove(); void resetLove(); virtual bool canMate(shared_ptr partner); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); // 4J added for determining whether animals are enclosed or not private: diff --git a/Minecraft.World/ArmorDyeRecipe.cpp b/Minecraft.World/ArmorDyeRecipe.cpp index c2f681fa9..9b05987cf 100644 --- a/Minecraft.World/ArmorDyeRecipe.cpp +++ b/Minecraft.World/ArmorDyeRecipe.cpp @@ -147,12 +147,12 @@ const int ArmorDyeRecipe::getGroup() } // 4J-PB -bool ArmorDyeRecipe::requires(int iRecipe) +bool ArmorDyeRecipe::requirements(int iRecipe) { return false; } -void ArmorDyeRecipe::requires(INGREDIENTS_REQUIRED *pIngReq) +void ArmorDyeRecipe::requirements(INGREDIENTS_REQUIRED *pIngReq) { //int iCount=0; //bool bFound; diff --git a/Minecraft.World/ArmorDyeRecipe.h b/Minecraft.World/ArmorDyeRecipe.h index b983ba7b2..586428277 100644 --- a/Minecraft.World/ArmorDyeRecipe.h +++ b/Minecraft.World/ArmorDyeRecipe.h @@ -18,6 +18,6 @@ class ArmorDyeRecipe : public Recipy virtual const int getGroup(); // 4J-PB - virtual bool requires(int iRecipe); - virtual void requires(INGREDIENTS_REQUIRED *pIngReq); + virtual bool requirements(int iRecipe); + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq); }; \ No newline at end of file diff --git a/Minecraft.World/ArrayWithLength.h b/Minecraft.World/ArrayWithLength.h index e22724c6a..d8df5bfea 100644 --- a/Minecraft.World/ArrayWithLength.h +++ b/Minecraft.World/ArrayWithLength.h @@ -84,7 +84,7 @@ class ClipChunk; typedef arrayWithLength doubleArray; typedef array2DWithLength coords2DArray; -typedef arrayWithLength byteArray; +typedef arrayWithLength byteArray; typedef arrayWithLength charArray; typedef arrayWithLength shortArray; typedef arrayWithLength intArray; diff --git a/Minecraft.World/Arrays.h b/Minecraft.World/Arrays.h index 6241a9841..f13cfdab2 100644 --- a/Minecraft.World/Arrays.h +++ b/Minecraft.World/Arrays.h @@ -15,9 +15,9 @@ class Arrays static void fill(BiomeArray arr, unsigned int from, unsigned int to, Biome *value) { assert(from >=0); assert( from <= to ); assert( to <= arr.length ); std::fill( arr.data+from, arr.data+to, value ); } - static void fill(byteArray arr, unsigned int from, unsigned int to, byte value) + static void fill(byteArray arr, unsigned int from, unsigned int to, uint8_t value) { assert(from >=0); assert( from <= to ); assert( to <= arr.length ); std::fill( arr.data+from, arr.data+to, value ); } - static void fill(byteArray arr, byte value) + static void fill(byteArray arr, uint8_t value) { std::fill( arr.data, arr.data+arr.length, value ); } }; diff --git a/Minecraft.World/Arrow.cpp b/Minecraft.World/Arrow.cpp index ab942aac6..3198a1717 100644 --- a/Minecraft.World/Arrow.cpp +++ b/Minecraft.World/Arrow.cpp @@ -123,7 +123,7 @@ Arrow::Arrow(Level *level, shared_ptr mob, float power) : Entity( void Arrow::defineSynchedData() { - entityData->define(ID_FLAGS, (byte) 0); + entityData->define(ID_FLAGS, (uint8_t) 0); } @@ -459,11 +459,11 @@ void Arrow::addAdditonalSaveData(CompoundTag *tag) tag->putShort(L"xTile", (short) xTile); tag->putShort(L"yTile", (short) yTile); tag->putShort(L"zTile", (short) zTile); - tag->putByte(L"inTile", (byte) lastTile); - tag->putByte(L"inData", (byte) lastData); - tag->putByte(L"shake", (byte) shakeTime); - tag->putByte(L"inGround", (byte) (inGround ? 1 : 0)); - tag->putByte(L"pickup", (byte) pickup); + tag->putByte(L"inTile", (uint8_t) lastTile); + tag->putByte(L"inData", (uint8_t) lastData); + tag->putByte(L"shake", (uint8_t) shakeTime); + tag->putByte(L"inGround", (uint8_t) (inGround ? 1 : 0)); + tag->putByte(L"pickup", (uint8_t) pickup); tag->putDouble(L"damage", baseDamage); } @@ -545,19 +545,19 @@ bool Arrow::isAttackable() void Arrow::setCritArrow(bool critArrow) { - byte flags = entityData->getByte(ID_FLAGS); + uint8_t flags = entityData->getByte(ID_FLAGS); if (critArrow) { - entityData->set(ID_FLAGS, (byte) (flags | FLAG_CRIT)); + entityData->set(ID_FLAGS, (uint8_t) (flags | FLAG_CRIT)); } else { - entityData->set(ID_FLAGS, (byte) (flags & ~FLAG_CRIT)); + entityData->set(ID_FLAGS, (uint8_t) (flags & ~FLAG_CRIT)); } } bool Arrow::isCritArrow() { - byte flags = entityData->getByte(ID_FLAGS); + uint8_t flags = entityData->getByte(ID_FLAGS); return (flags & FLAG_CRIT) != 0; } diff --git a/Minecraft.World/AwardStatPacket.cpp b/Minecraft.World/AwardStatPacket.cpp index 43328794c..bcd9d9677 100644 --- a/Minecraft.World/AwardStatPacket.cpp +++ b/Minecraft.World/AwardStatPacket.cpp @@ -16,7 +16,7 @@ AwardStatPacket::AwardStatPacket(int statId, int count) { this->statId = statId; - this->m_paramData.data = (byte *) new int(count); + this->m_paramData.data = (uint8_t *) new int(count); this->m_paramData.length = sizeof(int); } diff --git a/Minecraft.World/BasicTree.cpp b/Minecraft.World/BasicTree.cpp index c1c922877..2c06fb69c 100644 --- a/Minecraft.World/BasicTree.cpp +++ b/Minecraft.World/BasicTree.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.tile.h" #include "BasicTree.h" -byte BasicTree::axisConversionArray[] = { 2, 0, 0, 1, 2, 1 }; +uint8_t BasicTree::axisConversionArray[] = { 2, 0, 0, 1, 2, 1 }; BasicTree::~BasicTree() { @@ -134,7 +134,7 @@ void BasicTree::prepare() } -void BasicTree::crossection(int x, int y, int z, float radius, byte direction, int material) +void BasicTree::crossection(int x, int y, int z, float radius, uint8_t direction, int material) { PIXBeginNamedEvent(0, "BasicTree crossection"); // Create a circular cross section. @@ -148,8 +148,8 @@ void BasicTree::crossection(int x, int y, int z, float radius, byte direction, i // direction is the direction the cross section is pointed, 0 for x, 1 for y, 2 for z // material is the index number for the material to use int rad = (int) (radius + 0.618); - byte secidx1 = axisConversionArray[direction]; - byte secidx2 = axisConversionArray[direction + 3]; + uint8_t secidx1 = axisConversionArray[direction]; + uint8_t secidx2 = axisConversionArray[direction + 3]; int center[] = { x, y, z }; int position[] = { 0, 0, 0 }; int offset1 = -rad; @@ -234,7 +234,7 @@ void BasicTree::foliageCluster(int x, int y, int z) while (cury >= y) { radius = foliageShape(cury - y); - crossection(x, cury, z, radius, (byte) 1, Tile::leaves_Id); + crossection(x, cury, z, radius, (uint8_t) 1, Tile::leaves_Id); cury--; } PIXEndNamedEvent(); @@ -248,8 +248,8 @@ void BasicTree::limb(int *start, int *end, int material) // Populate delta, the difference between start and end for all three axies. // Set primidx to the index with the largest overall distance traveled. int delta[] = { 0, 0, 0 }; - byte idx = 0; - byte primidx = 0; + uint8_t idx = 0; + uint8_t primidx = 0; while (idx < 3) { delta[idx] = end[idx] - start[idx]; @@ -262,8 +262,8 @@ void BasicTree::limb(int *start, int *end, int material) // If the largest distance is zero, don't bother to do anything else. if (delta[primidx] == 0) return; // set up the other two axis indices. - byte secidx1 = axisConversionArray[primidx]; - byte secidx2 = axisConversionArray[primidx + 3]; + uint8_t secidx1 = axisConversionArray[primidx]; + uint8_t secidx2 = axisConversionArray[primidx + 3]; // primsign is digit 1 or -1 depending on whether the limb is headed // along the positive or negative primidx axis. char primsign; @@ -389,8 +389,8 @@ int BasicTree::checkLine(int *start, int *end) // If the first block searched is lava, return 0 int delta[] = { 0, 0, 0 }; - byte idx = 0; - byte primidx = 0; + uint8_t idx = 0; + uint8_t primidx = 0; while (idx < 3) { delta[idx] = end[idx] - start[idx]; @@ -403,11 +403,11 @@ int BasicTree::checkLine(int *start, int *end) // If the largest distance is zero, don't bother to do anything else. if (delta[primidx] == 0) return -1; // set up the other two axis indices. - byte secidx1 = axisConversionArray[primidx]; - byte secidx2 = axisConversionArray[primidx + 3]; + uint8_t secidx1 = axisConversionArray[primidx]; + uint8_t secidx2 = axisConversionArray[primidx + 3]; // primsign is digit 1 or -1 depending on whether the limb is headed // along the positive or negative primidx axis. - char primsign; // 4J Stu - Was byte, but we use in a sum below and byte=unsigned char so we were setting endoffset incorrectly + char primsign; // 4J Stu - Was uint8_t, but we use in a sum below and uint8_t=unsigned char so we were setting endoffset incorrectly if (delta[primidx] > 0) primsign = 1; else primsign = -1; // Initilize the per-step movement for the non-primary axies. diff --git a/Minecraft.World/BasicTree.h b/Minecraft.World/BasicTree.h index feb145815..7bc085270 100644 --- a/Minecraft.World/BasicTree.h +++ b/Minecraft.World/BasicTree.h @@ -23,7 +23,7 @@ class BasicTree : public Feature // the index for the y axis. // Using this method, the secondary axis will always be horizontal (x or z), // and the tertiary always vertical (y), if possible. - static byte axisConversionArray[]; + static uint8_t axisConversionArray[]; // Set up the pseudorandom number generator Random *rnd; @@ -49,7 +49,7 @@ class BasicTree : public Feature int **foliageCoords; int foliageCoordsLength; void prepare(); - void crossection(int x, int y, int z, float radius, byte direction, int material); + void crossection(int x, int y, int z, float radius, uint8_t direction, int material); float treeShape(int y); float foliageShape(int y); void foliageCluster(int x, int y, int z); diff --git a/Minecraft.World/BeachBiome.cpp b/Minecraft.World/BeachBiome.cpp index 50e7cc1ca..800a005b2 100644 --- a/Minecraft.World/BeachBiome.cpp +++ b/Minecraft.World/BeachBiome.cpp @@ -8,8 +8,8 @@ BeachBiome::BeachBiome(int id) : Biome(id) // remove default mob spawn settings friendlies.clear(); friendlies_chicken.clear(); // 4J added - topMaterial = (byte) Tile::sand_Id; - material = (byte) Tile::sand_Id; + topMaterial = (uint8_t) Tile::sand_Id; + material = (uint8_t) Tile::sand_Id; decorator->treeCount = -999; decorator->deadBushCount = 0; diff --git a/Minecraft.World/Biome.cpp b/Minecraft.World/Biome.cpp index 169db77e6..3af3d3874 100644 --- a/Minecraft.World/Biome.cpp +++ b/Minecraft.World/Biome.cpp @@ -86,8 +86,8 @@ Biome::Biome(int id) : id(id) color = 0; // snowCovered = false; // 4J - this isn't set by the java game any more so removing to save confusion - topMaterial = (byte) Tile::grass_Id; - material = (byte) Tile::dirt_Id; + topMaterial = (uint8_t) Tile::grass_Id; + material = (uint8_t) Tile::dirt_Id; leafColor = 0x4EE031; _hasRain = true; depth = 0.1f; diff --git a/Minecraft.World/Biome.h b/Minecraft.World/Biome.h index f7de31662..a535c2617 100644 --- a/Minecraft.World/Biome.h +++ b/Minecraft.World/Biome.h @@ -52,8 +52,8 @@ class Biome public: wstring m_name; int color; - byte topMaterial; - byte material; + uint8_t topMaterial; + uint8_t material; int leafColor; float depth; float scale; diff --git a/Minecraft.World/BiomeSource.cpp b/Minecraft.World/BiomeSource.cpp index 2ab6182e6..dd8cab7c4 100644 --- a/Minecraft.World/BiomeSource.cpp +++ b/Minecraft.World/BiomeSource.cpp @@ -264,7 +264,7 @@ void BiomeSource::getBiomeIndexBlock(byteArray& biomeIndices, int x, int z, int intArray result = zoomedLayer->getArea(x, z, w, h); for (int i = 0; i < w * h; i++) { - biomeIndices[i] = (byte)result[i]; + biomeIndices[i] = (uint8_t)result[i]; } } diff --git a/Minecraft.World/Blaze.cpp b/Minecraft.World/Blaze.cpp index d87a83b2d..ab6e60f23 100644 --- a/Minecraft.World/Blaze.cpp +++ b/Minecraft.World/Blaze.cpp @@ -42,7 +42,7 @@ void Blaze::defineSynchedData() { Monster::defineSynchedData(); - entityData->define(DATA_FLAGS_ID, (byte) 0); + entityData->define(DATA_FLAGS_ID, (uint8_t) 0); } int Blaze::getAmbientSound() @@ -207,7 +207,7 @@ bool Blaze::isCharged() void Blaze::setCharged(bool value) { - byte flags = entityData->getByte(DATA_FLAGS_ID); + uint8_t flags = entityData->getByte(DATA_FLAGS_ID); if (value) { flags |= 0x1; diff --git a/Minecraft.World/BlockRegionUpdatePacket.cpp b/Minecraft.World/BlockRegionUpdatePacket.cpp index bec943d8d..291e01394 100644 --- a/Minecraft.World/BlockRegionUpdatePacket.cpp +++ b/Minecraft.World/BlockRegionUpdatePacket.cpp @@ -12,7 +12,7 @@ #define BLOCK_REGION_UPDATE_FULLCHUNK 0x01 -#define BLOCK_REGION_UPDATE_ZEROHEIGHT 0x02 // added so we can still send a byte for ys, which really needs the range 0-256 +#define BLOCK_REGION_UPDATE_ZEROHEIGHT 0x02 // added so we can still send a uint8_t for ys, which really needs the range 0-256 BlockRegionUpdatePacket::~BlockRegionUpdatePacket() { @@ -87,7 +87,7 @@ BlockRegionUpdatePacket::BlockRegionUpdatePacket(int x, int y, int z, int xs, in void BlockRegionUpdatePacket::read(DataInputStream *dis) //throws IOException { - byte chunkFlags = dis->readByte(); + uint8_t chunkFlags = dis->readByte(); x = dis->readInt(); y = dis->readShort(); z = dis->readInt(); @@ -137,7 +137,7 @@ void BlockRegionUpdatePacket::read(DataInputStream *dis) //throws IOException void BlockRegionUpdatePacket::write(DataOutputStream *dos) // throws IOException { - byte chunkFlags = 0; + uint8_t chunkFlags = 0; if(bIsFullChunk) chunkFlags |= BLOCK_REGION_UPDATE_FULLCHUNK; if(ys == 0) chunkFlags |= BLOCK_REGION_UPDATE_ZEROHEIGHT; diff --git a/Minecraft.World/BlockReplacements.cpp b/Minecraft.World/BlockReplacements.cpp index 7b8aee511..6ab5d7466 100644 --- a/Minecraft.World/BlockReplacements.cpp +++ b/Minecraft.World/BlockReplacements.cpp @@ -8,7 +8,7 @@ void BlockReplacements::staticCtor() { for (int i = 0; i < 256; i++) { - byte b = (byte) i; + uint8_t b = (uint8_t) i; if (b != 0 && Tile::tiles[b & 0xff] == NULL) { b = 0; diff --git a/Minecraft.World/BrewingStandTileEntity.cpp b/Minecraft.World/BrewingStandTileEntity.cpp index 5bc6fd27d..c2c78a0f6 100644 --- a/Minecraft.World/BrewingStandTileEntity.cpp +++ b/Minecraft.World/BrewingStandTileEntity.cpp @@ -330,7 +330,7 @@ void BrewingStandTileEntity::save(CompoundTag *base) if (items[i] != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) i); + tag->putByte(L"Slot", (uint8_t) i); items[i]->save(tag); listTag->add(tag); } diff --git a/Minecraft.World/BufferedOutputStream.cpp b/Minecraft.World/BufferedOutputStream.cpp index 19fc95aff..ac022d7cb 100644 --- a/Minecraft.World/BufferedOutputStream.cpp +++ b/Minecraft.World/BufferedOutputStream.cpp @@ -34,7 +34,7 @@ void BufferedOutputStream::close() stream->close(); } -//Writes len bytes from the specified byte array starting at offset off to this buffered output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to this buffered output stream. //Ordinarily this method stores bytes from the given array into this stream's buffer, flushing the buffer to the //underlying output stream as needed. If the requested length is at least as large as this stream's buffer, however, //then this method will flush the buffer and write the bytes directly to the underlying output stream. @@ -72,14 +72,14 @@ void BufferedOutputStream::write(byteArray b) write( b, 0, b.length ); } -//Writes the specified byte to this buffered output stream. +//Writes the specified uint8_t to this buffered output stream. //Overrides: //write in class FilterOutputStream //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. void BufferedOutputStream::write(unsigned int b) { - buf[count++] = (byte) b; + buf[count++] = (uint8_t) b; if( count == buf.length ) { flush(); diff --git a/Minecraft.World/ByteArrayInputStream.cpp b/Minecraft.World/ByteArrayInputStream.cpp index b01673002..b42a85fab 100644 --- a/Minecraft.World/ByteArrayInputStream.cpp +++ b/Minecraft.World/ByteArrayInputStream.cpp @@ -7,7 +7,7 @@ //The buffer's mark is set to the specified offset. //Parameters: //buf - the input buffer. -//offset - the offset in the buffer of the first byte to read. +//offset - the offset in the buffer of the first uint8_t to read. //length - the maximum number of bytes to read from the buffer. ByteArrayInputStream::ByteArrayInputStream(byteArray buf, unsigned int offset, unsigned int length) : pos( offset ), count( min( offset+length, buf.length ) ), mark( offset ) @@ -25,8 +25,8 @@ ByteArrayInputStream::ByteArrayInputStream(byteArray buf) this->buf = buf; } -//Reads the next byte of data from this input stream. The value byte is returned as an int in the range 0 to 255. -//If no byte is available because the end of the stream has been reached, the value -1 is returned. +//Reads the next byte of data from this input stream. The value uint8_t is returned as an int in the range 0 to 255. +//If no uint8_t is available because the end of the stream has been reached, the value -1 is returned. //This read method cannot block. //Returns: //the next byte of data, or -1 if the end of the stream has been reached. @@ -41,11 +41,11 @@ int ByteArrayInputStream::read() //Reads some number of bytes from the input stream and stores them into the buffer array b. //The number of bytes actually read is returned as an integer. This method blocks until input data is available, //end of file is detected, or an exception is thrown. -//If the length of b is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one byte. -//If no byte is available because the stream is at the end of the file, the value -1 is returned; otherwise, -//at least one byte is read and stored into b. +//If the length of b is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one uint8_t. +//If no uint8_t is available because the stream is at the end of the file, the value -1 is returned; otherwise, +//at least one uint8_t is read and stored into b. // -//The first byte read is stored into element b[0], the next one into b[1], and so on. The number of bytes read is, +//The first uint8_t read is stored into element b[0], the next one into b[1], and so on. The number of bytes read is, //at most, equal to the length of b. Let k be the number of bytes actually read; these bytes will be stored in elements b[0] through b[k-1], //leaving elements b[k] through b[b.length-1] unaffected. // diff --git a/Minecraft.World/ByteArrayOutputStream.cpp b/Minecraft.World/ByteArrayOutputStream.cpp index 9296fe5ea..b61aaafc5 100644 --- a/Minecraft.World/ByteArrayOutputStream.cpp +++ b/Minecraft.World/ByteArrayOutputStream.cpp @@ -2,14 +2,14 @@ #include "ByteArrayOutputStream.h" -// Creates a new byte array output stream. The buffer capacity is initially 32 bytes, though its size increases if necessary. +// Creates a new uint8_t array output stream. The buffer capacity is initially 32 bytes, though its size increases if necessary. ByteArrayOutputStream::ByteArrayOutputStream() { count = 0; buf = byteArray( 32 ); } -//Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes. +//Creates a new uint8_t array output stream, with a buffer capacity of the specified size, in bytes. //Parameters: //size - the initial size. ByteArrayOutputStream::ByteArrayOutputStream(unsigned int size) @@ -24,27 +24,27 @@ ByteArrayOutputStream::~ByteArrayOutputStream() delete[] buf.data; } -//Writes the specified byte to this byte array output stream. +//Writes the specified uint8_t to this uint8_t array output stream. //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. void ByteArrayOutputStream::write(unsigned int b) { // If we will fill the buffer we need to make it bigger if( count + 1 >= buf.length ) buf.resize( buf.length * 2 ); - buf[count] = (byte) b; + buf[count] = (uint8_t) b; count++; } -// Writes b.length bytes from the specified byte array to this output stream. +// Writes b.length bytes from the specified uint8_t array to this output stream. //The general contract for write(b) is that it should have exactly the same effect as the call write(b, 0, b.length). void ByteArrayOutputStream::write(byteArray b) { write(b, 0, b.length); } -//Writes len bytes from the specified byte array starting at offset off to this byte array output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to this uint8_t array output stream. //Parameters: //b - the data. //off - the start offset in the data. @@ -69,9 +69,9 @@ void ByteArrayOutputStream::close() { } -//Creates a newly allocated byte array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it. +//Creates a newly allocated uint8_t array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it. //Returns: -//the current contents of this output stream, as a byte array. +//the current contents of this output stream, as a uint8_t array. byteArray ByteArrayOutputStream::toByteArray() { byteArray out(count); diff --git a/Minecraft.World/ByteArrayTag.h b/Minecraft.World/ByteArrayTag.h index 598515ac8..f14eef6ae 100644 --- a/Minecraft.World/ByteArrayTag.h +++ b/Minecraft.World/ByteArrayTag.h @@ -27,7 +27,7 @@ class ByteArrayTag : public Tag dis->readFully(data); } - byte getId() { return TAG_Byte_Array; } + uint8_t getId() { return TAG_Byte_Array; } wstring toString() { diff --git a/Minecraft.World/ByteBuffer.cpp b/Minecraft.World/ByteBuffer.cpp index 57b30dbd3..cd4a9ec10 100644 --- a/Minecraft.World/ByteBuffer.cpp +++ b/Minecraft.World/ByteBuffer.cpp @@ -7,25 +7,25 @@ ByteBuffer::ByteBuffer( unsigned int capacity ) : Buffer( capacity ) { hasBackingArray = false; - buffer = new byte[capacity]; - memset( buffer,0,sizeof(byte)*capacity); + buffer = new uint8_t[capacity]; + memset( buffer,0,sizeof(uint8_t)*capacity); byteOrder = BIGENDIAN; } -//Allocates a new direct byte buffer. +//Allocates a new direct uint8_t buffer. //The new buffer's position will be zero, its limit will be its capacity, and its mark will be undefined. Whether or not it has a backing array is unspecified. // //Parameters: //capacity - The new buffer's capacity, in bytes //Returns: -//The new byte buffer +//The new uint8_t buffer ByteBuffer *ByteBuffer::allocateDirect(int capacity) { return new ByteBuffer(capacity); } -ByteBuffer::ByteBuffer( unsigned int capacity, byte *backingArray ) : Buffer( capacity ) +ByteBuffer::ByteBuffer( unsigned int capacity, uint8_t *backingArray ) : Buffer( capacity ) { hasBackingArray = true; buffer = backingArray; @@ -37,36 +37,36 @@ ByteBuffer::~ByteBuffer() delete[] buffer; } -//Wraps a byte array into a buffer. -//The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array +//Wraps a uint8_t array into a buffer. +//The new buffer will be backed by the given uint8_t array; that is, modifications to the buffer will cause the array //to be modified and vice versa. The new buffer's capacity and limit will be array.length, its position will be zero, //and its mark will be undefined. Its backing array will be the given array, and its array offset will be zero. // //Parameters: //array - The array that will back this buffer //Returns: -//The new byte buffer +//The new uint8_t buffer ByteBuffer *ByteBuffer::wrap(byteArray &b) { return new ByteBuffer( b.length, b.data ); } -//Allocates a new byte buffer. +//Allocates a new uint8_t buffer. //The new buffer's position will be zero, its limit will be its capacity, and its mark will be undefined. //It will have a backing array, and its array offset will be zero. // //Parameters: //capacity - The new buffer's capacity, in bytes //Returns: -//The new byte buffer +//The new uint8_t buffer ByteBuffer *ByteBuffer::allocate(unsigned int capacity) { return new ByteBuffer( capacity ); } -//Modifies this buffer's byte order. +//Modifies this buffer's uint8_t order. //Parameters: -//bo - The new byte order, either BIGENDIAN or LITTLEENDIAN +//bo - The new uint8_t order, either BIGENDIAN or LITTLEENDIAN void ByteBuffer::order(ByteOrder bo) { byteOrder = bo; @@ -85,7 +85,7 @@ ByteBuffer *ByteBuffer::flip() } // 4J Added so we can write this to a file -byte *ByteBuffer::getBuffer() +uint8_t *ByteBuffer::getBuffer() { return buffer; } @@ -97,11 +97,11 @@ int ByteBuffer::getSize() } // End 4J -//Absolute get method. Reads the byte at the given index. +//Absolute get method. Reads the uint8_t at the given index. //Parameters: -//index - The index from which the byte will be read +//index - The index from which the uint8_t will be read //Returns: -//The byte at the given index +//The uint8_t at the given index //Throws: //IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit BYTE ByteBuffer::get(int index) @@ -114,7 +114,7 @@ BYTE ByteBuffer::get(int index) //Relative get method for reading an int value. //Reads the next four bytes at this buffer's current position, composing them into an int value according to the -//current byte order, and then increments the position by four. +//current uint8_t order, and then increments the position by four. // //Returns: //The int value at the buffer's current position @@ -143,7 +143,7 @@ int ByteBuffer::getInt() } //Absolute get method for reading an int value. -//Reads four bytes at the given index, composing them into a int value according to the current byte order. +//Reads four bytes at the given index, composing them into a int value according to the current uint8_t order. // //Parameters: //index - The index from which the bytes will be read @@ -171,7 +171,7 @@ int ByteBuffer::getInt(unsigned int index) } //Relative get method for reading a long value. -//Reads the next eight bytes at this buffer's current position, composing them into a long value according to the current byte order, +//Reads the next eight bytes at this buffer's current position, composing them into a long value according to the current uint8_t order, //and then increments the position by eight. // //Returns: @@ -206,7 +206,7 @@ int64_t ByteBuffer::getLong() //Relative get method for reading a short value. //Reads the next two bytes at this buffer's current position, composing them into a short value according to the current -//byte order, and then increments the position by two. +//uint8_t order, and then increments the position by two. // //Returns: //The short value at the buffer's current position @@ -243,17 +243,17 @@ void ByteBuffer::getShortArray(shortArray &s) } //Absolute put method (optional operation). -//Writes the given byte into this buffer at the given index. +//Writes the given uint8_t into this buffer at the given index. // //Parameters: -//index - The index at which the byte will be written -//b - The byte value to be written +//index - The index at which the uint8_t will be written +//b - The uint8_t value to be written //Returns: //This buffer //Throws: //IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit //ReadOnlyBufferException - If this buffer is read-only -ByteBuffer *ByteBuffer::put(int index, byte b) +ByteBuffer *ByteBuffer::put(int index, uint8_t b) { assert( index < m_limit ); assert( index >= 0 ); @@ -264,7 +264,7 @@ ByteBuffer *ByteBuffer::put(int index, byte b) //Relative put method for writing an int value (optional operation). -//Writes four bytes containing the given int value, in the current byte order, into this buffer at the current position, +//Writes four bytes containing the given int value, in the current uint8_t order, into this buffer at the current position, //and then increments the position by four. // //Parameters: @@ -296,7 +296,7 @@ ByteBuffer *ByteBuffer::putInt(int value) } //Absolute put method for writing an int value (optional operation). -//Writes four bytes containing the given int value, in the current byte order, into this buffer at the given index. +//Writes four bytes containing the given int value, in the current uint8_t order, into this buffer at the given index. // //Parameters: //index - The index at which the bytes will be written @@ -326,7 +326,7 @@ ByteBuffer *ByteBuffer::putInt(unsigned int index, int value) } //Relative put method for writing a short value (optional operation). -//Writes two bytes containing the given short value, in the current byte order, into this buffer at the current position, +//Writes two bytes containing the given short value, in the current uint8_t order, into this buffer at the current position, //and then increments the position by two. // //Parameters: @@ -366,7 +366,7 @@ ByteBuffer *ByteBuffer::putShortArray(shortArray &s) } //Relative put method for writing a long value (optional operation). -//Writes eight bytes containing the given long value, in the current byte order, into this buffer at the current position, +//Writes eight bytes containing the given long value, in the current uint8_t order, into this buffer at the current position, //and then increments the position by eight. // //Parameters: @@ -404,7 +404,7 @@ ByteBuffer *ByteBuffer::putLong(int64_t value) } //Relative bulk put method (optional operation). -//This method transfers the entire content of the given source byte array into this buffer. +//This method transfers the entire content of the given source uint8_t array into this buffer. //An invocation of this method of the form dst.put(a) behaves in exactly the same way as the invocation // // dst.put(a, 0, a.length) @@ -427,7 +427,7 @@ byteArray ByteBuffer::array() return byteArray( buffer, m_capacity ); } -//Creates a view of this byte buffer as an int buffer. +//Creates a view of this uint8_t buffer as an int buffer. //The content of the new buffer will start at this buffer's current position. Changes to this buffer's content //will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent. // @@ -439,11 +439,11 @@ byteArray ByteBuffer::array() //A new int buffer IntBuffer *ByteBuffer::asIntBuffer() { - // TODO 4J Stu - Is it safe to just cast our byte array pointer to another type? + // TODO 4J Stu - Is it safe to just cast our uint8_t array pointer to another type? return new IntBuffer( (m_limit-m_position)/4, (int *) (buffer+m_position) ); } -//Creates a view of this byte buffer as a float buffer. +//Creates a view of this uint8_t buffer as a float buffer. //The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be //visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent. // @@ -455,7 +455,7 @@ IntBuffer *ByteBuffer::asIntBuffer() //A new float buffer FloatBuffer *ByteBuffer::asFloatBuffer() { - // TODO 4J Stu - Is it safe to just cast our byte array pointer to another type? + // TODO 4J Stu - Is it safe to just cast our uint8_t array pointer to another type? return new FloatBuffer( (m_limit-m_position)/4, (float *) (buffer+m_position) ); } @@ -464,9 +464,9 @@ FloatBuffer *ByteBuffer::asFloatBuffer() #ifdef __PS3__ // we're using the RSX now to upload textures to vram, so we need th main ram textures allocated from io space ByteBuffer_IO::ByteBuffer_IO( unsigned int capacity ) - : ByteBuffer(capacity, (byte*)RenderManager.allocIOMem(capacity, 64)) + : ByteBuffer(capacity, (uint8_t*)RenderManager.allocIOMem(capacity, 64)) { - memset( buffer,0,sizeof(byte)*capacity); + memset( buffer,0,sizeof(uint8_t)*capacity); byteOrder = BIGENDIAN; } diff --git a/Minecraft.World/ByteBuffer.h b/Minecraft.World/ByteBuffer.h index 56ac0b960..07d35974e 100644 --- a/Minecraft.World/ByteBuffer.h +++ b/Minecraft.World/ByteBuffer.h @@ -9,29 +9,29 @@ class FloatBuffer; class ByteBuffer : public Buffer { protected: - byte *buffer; + uint8_t *buffer; ByteOrder byteOrder; public: ByteBuffer(unsigned int capacity); static ByteBuffer *allocateDirect(int capacity); - ByteBuffer( unsigned int capacity, byte *backingArray ); + ByteBuffer( unsigned int capacity, uint8_t *backingArray ); virtual ~ByteBuffer(); static ByteBuffer *wrap(byteArray &b); static ByteBuffer *allocate(unsigned int capacity); void order(ByteOrder a); ByteBuffer *flip(); - byte *getBuffer(); + uint8_t *getBuffer(); int getSize(); int getInt(); int getInt(unsigned int index); void get(byteArray) {} // 4J - TODO - byte get(int index); + uint8_t get(int index); int64_t getLong(); short getShort(); void getShortArray(shortArray &s); - ByteBuffer *put(int index, byte b); + ByteBuffer *put(int index, uint8_t b); ByteBuffer *putInt(int value); ByteBuffer *putInt(unsigned int index, int value); ByteBuffer *putShort(short value); diff --git a/Minecraft.World/ByteTag.h b/Minecraft.World/ByteTag.h index 6b319c0bb..313b41c67 100644 --- a/Minecraft.World/ByteTag.h +++ b/Minecraft.World/ByteTag.h @@ -4,14 +4,14 @@ class ByteTag : public Tag { public: - byte data; + uint8_t data; ByteTag(const wstring &name) : Tag(name) {} - ByteTag(const wstring &name, byte data) : Tag(name) {this->data = data; } + ByteTag(const wstring &name, uint8_t data) : Tag(name) {this->data = data; } void write(DataOutput *dos) { dos->writeByte(data); } void load(DataInput *dis, int tagDepth) { data = dis->readByte(); } - byte getId() { return TAG_Byte; } + uint8_t getId() { return TAG_Byte; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/CanyonFeature.cpp b/Minecraft.World/CanyonFeature.cpp index a375db7d3..b2a396e2d 100644 --- a/Minecraft.World/CanyonFeature.cpp +++ b/Minecraft.World/CanyonFeature.cpp @@ -141,12 +141,12 @@ void CanyonFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray bloc { if (yy < 10) { - blocks[p] = (byte) Tile::lava_Id; + blocks[p] = (uint8_t) Tile::lava_Id; } else { - blocks[p] = (byte) 0; - if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (byte) level->getBiome(xx + xOffs * 16, zz + zOffs * 16)->topMaterial; + blocks[p] = (uint8_t) 0; + if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (uint8_t) level->getBiome(xx + xOffs * 16, zz + zOffs * 16)->topMaterial; } } } diff --git a/Minecraft.World/ChestTileEntity.cpp b/Minecraft.World/ChestTileEntity.cpp index b8f323f4f..4ed6fb726 100644 --- a/Minecraft.World/ChestTileEntity.cpp +++ b/Minecraft.World/ChestTileEntity.cpp @@ -157,7 +157,7 @@ void ChestTileEntity::save(CompoundTag *base) if (items->data[i] != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) i); + tag->putByte(L"Slot", (uint8_t) i); items->data[i]->save(tag); listTag->add(tag); } diff --git a/Minecraft.World/ChunkTilesUpdatePacket.cpp b/Minecraft.World/ChunkTilesUpdatePacket.cpp index d90e6b2f0..f9f083094 100644 --- a/Minecraft.World/ChunkTilesUpdatePacket.cpp +++ b/Minecraft.World/ChunkTilesUpdatePacket.cpp @@ -24,7 +24,7 @@ ChunkTilesUpdatePacket::ChunkTilesUpdatePacket() count = 0; } -ChunkTilesUpdatePacket::ChunkTilesUpdatePacket(int xc, int zc, shortArray positions, byte count, Level *level) +ChunkTilesUpdatePacket::ChunkTilesUpdatePacket(int xc, int zc, shortArray positions, uint8_t count, Level *level) { shouldDelay = true; this->xc = xc; @@ -42,8 +42,8 @@ ChunkTilesUpdatePacket::ChunkTilesUpdatePacket(int xc, int zc, shortArray positi int y = (positions[i]) & 255; this->positions[i] = positions[i]; - blocks[i] = (byte) levelChunk->getTile(x, y, z); - data[i] = (byte) levelChunk->getData(x, y, z); + blocks[i] = (uint8_t) levelChunk->getTile(x, y, z); + data[i] = (uint8_t) levelChunk->getData(x, y, z); } levelIdx = ( ( level->dimension->id == 0 ) ? 0 : ( (level->dimension->id == -1) ? 1 : 2 ) ); } diff --git a/Minecraft.World/ChunkTilesUpdatePacket.h b/Minecraft.World/ChunkTilesUpdatePacket.h index a97f49a39..67fa10a43 100644 --- a/Minecraft.World/ChunkTilesUpdatePacket.h +++ b/Minecraft.World/ChunkTilesUpdatePacket.h @@ -12,12 +12,12 @@ class ChunkTilesUpdatePacket : public Packet, public enable_shared_from_thiswriteShort(itemId); dos->writeUnsignedShort(data.length); - byteArray ba( (byte*)data.data, data.length ); + byteArray ba( (uint8_t*)data.data, data.length ); dos->write(ba); } diff --git a/Minecraft.World/CompoundTag.h b/Minecraft.World/CompoundTag.h index 83a6108f0..ce1f39938 100644 --- a/Minecraft.World/CompoundTag.h +++ b/Minecraft.World/CompoundTag.h @@ -61,7 +61,7 @@ class CompoundTag : public Tag return ret; } - byte getId() + uint8_t getId() { return TAG_Compound; } @@ -71,7 +71,7 @@ class CompoundTag : public Tag tags[name] = tag->setName(name); } - void putByte(const wstring &name, byte value) + void putByte(const wstring &name, uint8_t value) { tags[name] = (new ByteTag(name,value)); } @@ -123,7 +123,7 @@ class CompoundTag : public Tag void putBoolean(const wstring &name, bool val) { - putByte(name, val?(byte)1:0); + putByte(name, val?(uint8_t)1:0); } Tag *get(const wstring &name) @@ -138,9 +138,9 @@ class CompoundTag : public Tag return tags.find(name) != tags.end(); } - byte getByte(const wstring &name) + uint8_t getByte(const wstring &name) { - if (tags.find(name) == tags.end()) return (byte)0; + if (tags.find(name) == tags.end()) return (uint8_t)0; return ((ByteTag *) tags[name])->data; } diff --git a/Minecraft.World/CompressedTileStorage.cpp b/Minecraft.World/CompressedTileStorage.cpp index eb1b784a0..11c5490ea 100644 --- a/Minecraft.World/CompressedTileStorage.cpp +++ b/Minecraft.World/CompressedTileStorage.cpp @@ -168,7 +168,7 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other) return false; } - // Attempt to compare as much as we can in 64-byte chunks (8 groups of 8 bytes) + // Attempt to compare as much as we can in 64-uint8_t chunks (8 groups of 8 bytes) int quickCount = allocatedSize / 64; int64_t *pOld = (int64_t *)indicesAndData; int64_t *pNew = (int64_t *)other->indicesAndData; @@ -197,7 +197,7 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other) pNew += 8; } - // Now test anything remaining just byte at a time + // Now test anything remaining just uint8_t at a time unsigned char *pucOld = (unsigned char *)pOld; unsigned char *pucNew = (unsigned char *)pNew; for( int i = 0; i < allocatedSize - (quickCount * 64); i++ ) @@ -376,7 +376,7 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset) else { _blockIndices[i] = INDEX_TYPE_0_OR_8_BIT; - memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-byte aligned for 8-bit storage + memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-uint8_t aligned for 8-bit storage memToAlloc += 64; // type8++; } @@ -996,7 +996,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) else { _blockIndices[i] = INDEX_TYPE_0_OR_8_BIT; - memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-byte aligned for 8-bit storage + memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-uint8_t aligned for 8-bit storage memToAlloc += 64; } } @@ -1037,7 +1037,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) memToAlloc += 48; break; case INDEX_TYPE_0_OR_8_BIT: - memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-byte aligned for 8-bit storage + memToAlloc = ( memToAlloc + 3 ) & 0xfffc; // Make sure we are 4-uint8_t aligned for 8-bit storage memToAlloc += 64; break; // Note that INDEX_TYPE_8_BIT|INDEX_TYPE_0_BIT_FLAG not in here as it doesn't need any further allocation diff --git a/Minecraft.World/CompressedTileStorage.h b/Minecraft.World/CompressedTileStorage.h index 3d4335477..7e7b5e469 100644 --- a/Minecraft.World/CompressedTileStorage.h +++ b/Minecraft.World/CompressedTileStorage.h @@ -25,8 +25,8 @@ // Some notes on the logic of all of this... // (1) Large numbers of blocks in the world really don't need to be stored at a full 8 bits per tile. // In a worst-case scenario, all planes would be 256 bytes and we'd have to store offsets of up to 32704 ( 64 x 511). This would require 15 bits per offset to store, but since in all cases -// the data can be stored with a 2 byte alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have -// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-byte aligned, and +// the data can be stored with a 2 uint8_t alignment, we can store offsets divided by 2, freeing up 2 bits to store the type of index for each plane. This allows us to encode 4 types, but we really have +// 5 types (0, 1, 2, 4 or 8 bits per tile). Since the 8-bit per tile planes are likely to be very rare, we can free up an extra bit in those by making their offset 4-uint8_t aligned, and // then use the extra bit to determine whether its a 0 or 8-bit per tile index. In the 0 bit case, we can use the bits used for the offset to store the actual tile value represented throughout the plane. // (2) The compression is done per 4x4x4 block rather than planes like the lighting, as that gives many more regions that have a small number of tile types than per plane, and can therefore // be compressed using less bits per tile. This is at the expense of a larger index, and more overhead from storing the tile types in each block (since there are more blocks than planes). However diff --git a/Minecraft.World/ConsoleSaveFileConverter.cpp b/Minecraft.World/ConsoleSaveFileConverter.cpp index 21de3cbea..51a6a0700 100644 --- a/Minecraft.World/ConsoleSaveFileConverter.cpp +++ b/Minecraft.World/ConsoleSaveFileConverter.cpp @@ -10,7 +10,7 @@ void ConsoleSaveFileConverter::ProcessSimpleFile(ConsoleSaveFile *sourceSave, Fi DWORD numberOfBytesRead = 0; DWORD numberOfBytesWritten = 0; - byte *data = new byte[sourceFileEntry->getFileSize()]; + uint8_t *data = new uint8_t[sourceFileEntry->getFileSize()]; // Read from source sourceSave->readFile(sourceFileEntry, data, sourceFileEntry->getFileSize(), &numberOfBytesRead); diff --git a/Minecraft.World/ConsoleSaveFileInputStream.cpp b/Minecraft.World/ConsoleSaveFileInputStream.cpp index 93d49956f..7022bfde1 100644 --- a/Minecraft.World/ConsoleSaveFileInputStream.cpp +++ b/Minecraft.World/ConsoleSaveFileInputStream.cpp @@ -20,12 +20,12 @@ ConsoleSaveFileInputStream::ConsoleSaveFileInputStream(ConsoleSaveFile *saveFile m_saveFile->setFilePointer( m_file, 0, NULL, FILE_BEGIN ); } -//Reads a byte of data from this input stream. This method blocks if no input is yet available. +//Reads a uint8_t of data from this input stream. This method blocks if no input is yet available. //Returns: //the next byte of data, or -1 if the end of the file is reached. int ConsoleSaveFileInputStream::read() { - byte byteRead = 0; + uint8_t byteRead = 0; DWORD numberOfBytesRead; BOOL result = m_saveFile->readFile( diff --git a/Minecraft.World/ConsoleSaveFileOriginal.cpp b/Minecraft.World/ConsoleSaveFileOriginal.cpp index 0b7c8d663..0e9e80777 100644 --- a/Minecraft.World/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/ConsoleSaveFileOriginal.cpp @@ -172,7 +172,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID Compression::getCompression()->SetDecompressionType(SAVE_FILE_PLATFORM_LOCAL); // and then set the decompression back to the local machine's standard type } - // Only ReAlloc if we need to (we might already have enough) and align to 512 byte boundaries + // Only ReAlloc if we need to (we might already have enough) and align to 512 uint8_t boundaries DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; DWORD desiredSize = decompSize; @@ -244,7 +244,7 @@ void ConsoleSaveFileOriginal::deleteFile( FileEntry *file ) const int bufferSize = 4096; int amountToRead = bufferSize; - byte buffer[bufferSize]; + uint8_t buffer[bufferSize]; DWORD bufferDataSize = 0; @@ -492,12 +492,12 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt const DWORD bufferSize = 4096; DWORD amountToRead = bufferSize; //assert( nNumberOfBytesToWrite <= bufferSize ); - static byte buffer1[bufferSize]; - static byte buffer2[bufferSize]; + static uint8_t buffer1[bufferSize]; + static uint8_t buffer2[bufferSize]; DWORD buffer1Size = 0; DWORD buffer2Size = 0; - // Only ReAlloc if we need to (we might already have enough) and align to 512 byte boundaries + // Only ReAlloc if we need to (we might already have enough) and align to 512 uint8_t boundaries DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; DWORD desiredSize = header.GetFileSize() + nNumberOfBytesToWrite; @@ -546,7 +546,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt uintptr_t uiFromStart = (uintptr_t)spaceStartOffset; uintptr_t uiFromEnd = (uintptr_t)beginEndOfDataOffset; - // Round both of these values to get 4096 byte chunks that we will need to at least partially move + // Round both of these values to get 4096 uint8_t chunks that we will need to at least partially move uintptr_t uiFromStartChunk = uiFromStart & ~((uintptr_t)4095); uintptr_t uiFromEndChunk = (uiFromEnd - 1 ) & ~((uintptr_t)4095); @@ -684,11 +684,11 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) // On PS3, don't compress the data as we can't really afford the extra memory this requires for the output buffer. Instead we'll be writing // directly from the save data. StorageManager.SetSaveData(pvSaveMem,fileSize); - byte *compData = (byte *)pvSaveMem; + uint8_t *compData = (uint8_t *)pvSaveMem; #else // Attempt to allocate the required memory // We do not own this, it belongs to the StorageManager - byte *compData = (byte *)StorageManager.AllocateSaveData( compLength ); + uint8_t *compData = (uint8_t *)StorageManager.AllocateSaveData( compLength ); #ifdef __PSVITA__ // AP - make sure we always allocate just what is needed so it will only SAVE what is needed. @@ -726,7 +726,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) compLength = compLength+8; // Attempt to allocate the required memory - compData = (byte *)StorageManager.AllocateSaveData( compLength ); + compData = (uint8_t *)StorageManager.AllocateSaveData( compLength ); } #endif diff --git a/Minecraft.World/ConsoleSaveFileOutputStream.cpp b/Minecraft.World/ConsoleSaveFileOutputStream.cpp index 3d8bb3f7c..0c714325f 100644 --- a/Minecraft.World/ConsoleSaveFileOutputStream.cpp +++ b/Minecraft.World/ConsoleSaveFileOutputStream.cpp @@ -31,14 +31,14 @@ ConsoleSaveFileOutputStream::ConsoleSaveFileOutputStream(ConsoleSaveFile *saveFi m_saveFile->setFilePointer( m_file, 0, NULL, FILE_BEGIN ); } -//Writes the specified byte to this file output stream. Implements the write method of OutputStream. +//Writes the specified uint8_t to this file output stream. Implements the write method of OutputStream. //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. void ConsoleSaveFileOutputStream::write(unsigned int b) { DWORD numberOfBytesWritten; - byte value = (byte) b; + uint8_t value = (uint8_t) b; BOOL result = m_saveFile->writeFile( m_file, @@ -57,7 +57,7 @@ void ConsoleSaveFileOutputStream::write(unsigned int b) } } -//Writes b.length bytes from the specified byte array to this file output stream. +//Writes b.length bytes from the specified uint8_t array to this file output stream. //Parameters: //b - the data. void ConsoleSaveFileOutputStream::write(byteArray b) @@ -81,7 +81,7 @@ void ConsoleSaveFileOutputStream::write(byteArray b) } } -//Writes len bytes from the specified byte array starting at offset off to this file output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to this file output stream. //Parameters: //b - the data. //off - the start offset in the data. diff --git a/Minecraft.World/Creeper.cpp b/Minecraft.World/Creeper.cpp index 29be2c0ca..ac8a1d4ac 100644 --- a/Minecraft.World/Creeper.cpp +++ b/Minecraft.World/Creeper.cpp @@ -81,8 +81,8 @@ void Creeper::defineSynchedData() { Monster::defineSynchedData(); - entityData->define(DATA_SWELL_DIR, (byte) -1); - entityData->define(DATA_IS_POWERED, (byte) 0); + entityData->define(DATA_SWELL_DIR, (uint8_t) -1); + entityData->define(DATA_IS_POWERED, (uint8_t) 0); } void Creeper::addAdditonalSaveData(CompoundTag *entityTag) @@ -90,13 +90,13 @@ void Creeper::addAdditonalSaveData(CompoundTag *entityTag) Monster::addAdditonalSaveData(entityTag); if (entityData->getByte(DATA_IS_POWERED) == 1) entityTag->putBoolean(L"powered", true); entityTag->putShort(L"Fuse", (short) maxSwell); - entityTag->putByte(L"ExplosionRadius", (byte) explosionRadius); + entityTag->putByte(L"ExplosionRadius", (uint8_t) explosionRadius); } void Creeper::readAdditionalSaveData(CompoundTag *tag) { Monster::readAdditionalSaveData(tag); - entityData->set(DATA_IS_POWERED, (byte) (tag->getBoolean(L"powered") ? 1 : 0)); + entityData->set(DATA_IS_POWERED, (uint8_t) (tag->getBoolean(L"powered") ? 1 : 0)); if (tag->contains(L"Fuse")) maxSwell = tag->getShort(L"Fuse"); if (tag->contains(L"ExplosionRadius")) explosionRadius = tag->getByte(L"ExplosionRadius"); } @@ -182,11 +182,11 @@ int Creeper::getSwellDir() void Creeper::setSwellDir(int dir) { - entityData->set(DATA_SWELL_DIR, (byte) dir); + entityData->set(DATA_SWELL_DIR, (uint8_t) dir); } void Creeper::thunderHit(const LightningBolt *lightningBolt) { Monster::thunderHit(lightningBolt); - entityData->set(DATA_IS_POWERED, (byte) 1); + entityData->set(DATA_IS_POWERED, (uint8_t) 1); } diff --git a/Minecraft.World/CustomLevelSource.cpp b/Minecraft.World/CustomLevelSource.cpp index 0f4c6479f..50e04e3be 100644 --- a/Minecraft.World/CustomLevelSource.cpp +++ b/Minecraft.World/CustomLevelSource.cpp @@ -204,11 +204,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 = (byte) Tile::stone_Id; + tileId = (uint8_t) Tile::stone_Id; } else if (yc * CHUNK_HEIGHT + y < waterHeight) { - tileId = (byte) Tile::calmWater_Id; + tileId = (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 @@ -266,8 +266,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi int run = -1; - byte top = b->topMaterial; - byte material = b->material; + uint8_t top = b->topMaterial; + uint8_t material = b->material; LevelGenerationOptions *lgo = app.getLevelGenerationOptions(); if(lgo != NULL) @@ -290,7 +290,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] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } else { @@ -307,7 +307,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (runDepth <= 0) { top = 0; - material = (byte) Tile::stone_Id; + material = (uint8_t) Tile::stone_Id; } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { @@ -321,8 +321,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (y < waterHeight && top == 0) { - if (temp < 0.15f) top = (byte) Tile::ice_Id; - else top = (byte) Tile::calmWater_Id; + if (temp < 0.15f) top = (uint8_t) Tile::ice_Id; + else top = (uint8_t) Tile::calmWater_Id; } run = runDepth; @@ -339,7 +339,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (run == 0 && material == Tile::sand_Id) { run = random->nextInt(4); - material = (byte) Tile::sandStone_Id; + material = (uint8_t) Tile::sandStone_Id; } } } @@ -368,7 +368,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; - byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (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/DataInput.h b/Minecraft.World/DataInput.h index f61eceb51..478a5e09e 100644 --- a/Minecraft.World/DataInput.h +++ b/Minecraft.World/DataInput.h @@ -7,7 +7,7 @@ class DataInput virtual int read(byteArray b) = 0; virtual int read(byteArray b, unsigned int offset, unsigned int length) = 0; virtual bool readBoolean() = 0; - virtual byte readByte() = 0; + virtual uint8_t readByte() = 0; virtual unsigned char readUnsignedByte() = 0; virtual bool readFully(byteArray a) = 0; virtual double readDouble() = 0; diff --git a/Minecraft.World/DataInputStream.cpp b/Minecraft.World/DataInputStream.cpp index 18deed397..5eba8e051 100644 --- a/Minecraft.World/DataInputStream.cpp +++ b/Minecraft.World/DataInputStream.cpp @@ -10,8 +10,8 @@ DataInputStream::DataInputStream(InputStream *in) : stream( in ) { } -//Reads the next byte of data from this input stream. The value byte is returned as an int in the range 0 to 255. -//If no byte is available because the end of the stream has been reached, the value -1 is returned. +//Reads the next byte of data from this input stream. The value uint8_t is returned as an int in the range 0 to 255. +//If no uint8_t is available because the end of the stream has been reached, the value -1 is returned. //This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. //This method simply performs in.read() and returns the result. int DataInputStream::read() @@ -23,10 +23,10 @@ int DataInputStream::read() //The number of bytes actually read is returned as an integer. This method blocks until input data is available, //end of file is detected, or an exception is thrown. //If b is null, a NullPointerException is thrown. If the length of b is zero, then no bytes are read and 0 is returned; -//otherwise, there is an attempt to read at least one byte. If no byte is available because the stream is at end of file, -//the value -1 is returned; otherwise, at least one byte is read and stored into b. +//otherwise, there is an attempt to read at least one uint8_t. If no uint8_t is available because the stream is at end of file, +//the value -1 is returned; otherwise, at least one uint8_t is read and stored into b. // -//The first byte read is stored into element b[0], the next one into b[1], and so on. The number of bytes read is, at most, +//The first uint8_t read is stored into element b[0], the next one into b[1], and so on. The number of bytes read is, at most, //equal to the length of b. Let k be the number of bytes actually read; these bytes will be stored in elements b[0] through b[k-1], //leaving elements b[k] through b[b.length-1] unaffected. // @@ -49,10 +49,10 @@ int DataInputStream::read(byteArray b) //but a smaller number may be read, possibly zero. The number of bytes actually read is returned as an integer. //This method blocks until input data is available, end of file is detected, or an exception is thrown. // -//If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one byte. -//If no byte is available because the stream is at end of file, the value -1 is returned; otherwise, at least one byte is read and stored into b. +//If len is zero, then no bytes are read and 0 is returned; otherwise, there is an attempt to read at least one uint8_t. +//If no uint8_t is available because the stream is at end of file, the value -1 is returned; otherwise, at least one uint8_t is read and stored into b. // -//The first byte read is stored into element b[off], the next one into b[off+1], and so on. The number of bytes read is, +//The first uint8_t read is stored into element b[off], the next one into b[off+1], and so on. The number of bytes read is, //at most, equal to len. Let k be the number of bytes actually read; these bytes will be stored in elements b[off] through b[off+k-1], //leaving elements b[off+k] through b[off+len-1] unaffected. // @@ -77,8 +77,8 @@ void DataInputStream::close() stream->close(); } -//Reads one input byte and returns true if that byte is nonzero, false if that byte is zero. This method is suitable for reading -//the byte written by the writeBoolean method of interface DataOutput. +//Reads one input uint8_t and returns true if that uint8_t is nonzero, false if that uint8_t is zero. This method is suitable for reading +//the uint8_t written by the writeBoolean method of interface DataOutput. //Returns: //the boolean value read. bool DataInputStream::readBoolean() @@ -86,13 +86,13 @@ bool DataInputStream::readBoolean() return stream->read() != 0; } -//Reads and returns one input byte. The byte is treated as a signed value in the range -128 through 127, inclusive. -//This method is suitable for reading the byte written by the writeByte method of interface DataOutput. +//Reads and returns one input uint8_t. The uint8_t is treated as a signed value in the range -128 through 127, inclusive. +//This method is suitable for reading the uint8_t written by the writeByte method of interface DataOutput. //Returns: //the 8-bit value read. -byte DataInputStream::readByte() +uint8_t DataInputStream::readByte() { - return (byte) stream->read(); + return (uint8_t) stream->read(); } unsigned char DataInputStream::readUnsignedByte() @@ -100,7 +100,7 @@ unsigned char DataInputStream::readUnsignedByte() return (unsigned char) stream->read(); } -//Reads two input bytes and returns a char value. Let a be the first byte read and b be the second byte. The value returned is: +//Reads two input bytes and returns a char value. Let a be the first uint8_t read and b be the second uint8_t. The value returned is: //(char)((a << 8) | (b & 0xff)) // //This method is suitable for reading bytes written by the writeChar method of interface DataOutput. @@ -119,7 +119,7 @@ wchar_t DataInputStream::readChar() //b.length bytes of input data are available, in which case a normal return is made. //End of file is detected, in which case an EOFException is thrown. //An I/O error occurs, in which case an IOException other than EOFException is thrown. -//If b is null, a NullPointerException is thrown. If b.length is zero, then no bytes are read. Otherwise, the first byte read is +//If b is null, a NullPointerException is thrown. If b.length is zero, then no bytes are read. Otherwise, the first uint8_t read is //stored into element b[0], the next one into b[1], and so on. If an exception is thrown from this method, then it may be that some but //not all bytes of b have been updated with data from the input stream. // @@ -244,7 +244,7 @@ int64_t DataInputStream::readLong() return bits; } -//Reads two input bytes and returns a short value. Let a be the first byte read and b be the second byte. The value returned is: +//Reads two input bytes and returns a short value. Let a be the first uint8_t read and b be the second uint8_t. The value returned is: //(short)((a << 8) | (b & 0xff)) // //This method is suitable for reading the bytes written by the writeShort method of interface DataOutput. @@ -268,14 +268,14 @@ unsigned short DataInputStream::readUnsignedShort() //of a Unicode character string encoded in modified UTF-8 format; this string of characters is then returned as a String. //First, two bytes are read and used to construct an unsigned 16-bit integer in exactly the manner of the readUnsignedShort method . //This integer value is called the UTF length and specifies the number of additional bytes to be read. These bytes are then converted -//to characters by considering them in groups. The length of each group is computed from the value of the first byte of the group. -//The byte following a group, if any, is the first byte of the next group. +//to characters by considering them in groups. The length of each group is computed from the value of the first uint8_t of the group. +//The uint8_t following a group, if any, is the first uint8_t of the next group. // -//If the first byte of a group matches the bit pattern 0xxxxxxx (where x means "may be 0 or 1"), then the group consists of just that byte. -//The byte is zero-extended to form a character. +//If the first uint8_t of a group matches the bit pattern 0xxxxxxx (where x means "may be 0 or 1"), then the group consists of just that uint8_t. +//The uint8_t is zero-extended to form a character. // -//If the first byte of a group matches the bit pattern 110xxxxx, then the group consists of that byte a and a second byte b. -//If there is no byte b (because byte a was the last of the bytes to be read), or if byte b does not match the bit pattern 10xxxxxx, +//If the first uint8_t of a group matches the bit pattern 110xxxxx, then the group consists of that uint8_t a and a second uint8_t b. +//If there is no uint8_t b (because uint8_t a was the last of the bytes to be read), or if uint8_t b does not match the bit pattern 10xxxxxx, //then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character: // //(char)(((a& 0x1F) << 6) | (b & 0x3F)) @@ -330,11 +330,11 @@ wstring DataInputStream::readUTF() // 11110000 = 0xF0 // Match only highest four bits // Matching patterns: - // 10xxxxxx = 0x80 // ERROR, or second/third byte + // 10xxxxxx = 0x80 // ERROR, or second/third uint8_t // 1111xxxx = 0xF0 //ERROR - // 0xxxxxxx = 0x00 // One byte UTF - // 110xxxxx = 0xC0 // Two byte UTF - // 1110xxxx = 0xE0 // Three byte UTF + // 0xxxxxxx = 0x00 // One uint8_t UTF + // 110xxxxx = 0xC0 // Two uint8_t UTF + // 1110xxxx = 0xE0 // Three uint8_t UTF if( ( (firstByte & 0xC0 ) == 0x80 ) || ( (firstByte & 0xF0) == 0xF0) ) { // TODO 4J Stu - UTFDataFormatException @@ -342,14 +342,14 @@ wstring DataInputStream::readUTF() } else if( (firstByte & 0x80) == 0x00 ) { - // One byte UTF + // One uint8_t UTF wchar_t readChar = (wchar_t)firstByte; outputString.push_back( readChar ); continue; } else if( (firstByte & 0xE0) == 0xC0 ) { - // Two byte UTF + // Two uint8_t UTF // No more bytes to read if( !(currentByteIndex < UTFLength) ) @@ -361,13 +361,13 @@ wstring DataInputStream::readUTF() int secondByte = stream->read(); currentByteIndex++; - // No second byte + // No second uint8_t if( secondByte == -1 ) { // TODO 4J Stu - EOFException break; } - // Incorrect second byte pattern + // Incorrect second uint8_t pattern else if( (secondByte & 0xC0 ) != 0x80 ) { // TODO 4J Stu - UTFDataFormatException @@ -380,7 +380,7 @@ wstring DataInputStream::readUTF() } else if( (firstByte & 0xF0) == 0xE0 ) { - // Three byte UTF + // Three uint8_t UTF // No more bytes to read if( !(currentByteIndex < UTFLength) ) @@ -392,7 +392,7 @@ wstring DataInputStream::readUTF() int secondByte = stream->read(); currentByteIndex++; - // No second byte + // No second uint8_t if( secondByte == -1 ) { // TODO 4J Stu - EOFException @@ -409,13 +409,13 @@ wstring DataInputStream::readUTF() int thirdByte = stream->read(); currentByteIndex++; - // No third byte + // No third uint8_t if( thirdByte == -1 ) { // TODO 4J Stu - EOFException break; } - // Incorrect second or third byte pattern + // Incorrect second or third uint8_t pattern else if( ( (secondByte & 0xC0 ) != 0x80 ) || ( (thirdByte & 0xC0 ) != 0x80 ) ) { // TODO 4J Stu - UTFDataFormatException @@ -447,11 +447,11 @@ int DataInputStream::readUTFChar() // 11110000 = 0xF0 // Match only highest four bits // Matching patterns: - // 10xxxxxx = 0x80 // ERROR, or second/third byte + // 10xxxxxx = 0x80 // ERROR, or second/third uint8_t // 1111xxxx = 0xF0 //ERROR - // 0xxxxxxx = 0x00 // One byte UTF - // 110xxxxx = 0xC0 // Two byte UTF - // 1110xxxx = 0xE0 // Three byte UTF + // 0xxxxxxx = 0x00 // One uint8_t UTF + // 110xxxxx = 0xC0 // Two uint8_t UTF + // 1110xxxx = 0xE0 // Three uint8_t UTF if( ( (firstByte & 0xC0 ) == 0x80 ) || ( (firstByte & 0xF0) == 0xF0) ) { // TODO 4J Stu - UTFDataFormatException @@ -459,21 +459,21 @@ int DataInputStream::readUTFChar() } else if( (firstByte & 0x80) == 0x00 ) { - // One byte UTF + // One uint8_t UTF returnValue = firstByte; } else if( (firstByte & 0xE0) == 0xC0 ) { - // Two byte UTF + // Two uint8_t UTF int secondByte = stream->read(); - // No second byte + // No second uint8_t if( secondByte == -1 ) { // TODO 4J Stu - EOFException return returnValue; } - // Incorrect second byte pattern + // Incorrect second uint8_t pattern else if( (secondByte & 0xC0 ) != 0x80 ) { // TODO 4J Stu - UTFDataFormatException @@ -484,11 +484,11 @@ int DataInputStream::readUTFChar() } else if( (firstByte & 0xF0) == 0xE0 ) { - // Three byte UTF + // Three uint8_t UTF int secondByte = stream->read(); - // No second byte + // No second uint8_t if( secondByte == -1 ) { // TODO 4J Stu - EOFException @@ -497,13 +497,13 @@ int DataInputStream::readUTFChar() int thirdByte = stream->read(); - // No third byte + // No third uint8_t if( thirdByte == -1 ) { // TODO 4J Stu - EOFException return returnValue; } - // Incorrect second or third byte pattern + // Incorrect second or third uint8_t pattern else if( ( (secondByte & 0xC0 ) != 0x80 ) || ( (thirdByte & 0xC0 ) != 0x80 ) ) { // TODO 4J Stu - UTFDataFormatException diff --git a/Minecraft.World/DataInputStream.h b/Minecraft.World/DataInputStream.h index 67604c284..6f4d128f1 100644 --- a/Minecraft.World/DataInputStream.h +++ b/Minecraft.World/DataInputStream.h @@ -16,7 +16,7 @@ class DataInputStream : public InputStream, public DataInput virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); virtual bool readBoolean(); - virtual byte readByte(); + virtual uint8_t readByte(); virtual unsigned char readUnsignedByte(); virtual unsigned short readUnsignedShort(); virtual wchar_t readChar(); diff --git a/Minecraft.World/DataLayer.cpp b/Minecraft.World/DataLayer.cpp index a5e7d0881..335f9ca59 100644 --- a/Minecraft.World/DataLayer.cpp +++ b/Minecraft.World/DataLayer.cpp @@ -40,10 +40,10 @@ void DataLayer::set(int x, int y, int z, int val) if (part == 0) { - data[slot] = (byte) ((data[slot] & 0xf0) | (val & 0xf)); + data[slot] = (uint8_t) ((data[slot] & 0xf0) | (val & 0xf)); } else { - data[slot] = (byte) ((data[slot] & 0x0f) | ((val & 0xf) << 4)); + data[slot] = (uint8_t) ((data[slot] & 0x0f) | ((val & 0xf) << 4)); } } @@ -54,7 +54,7 @@ bool DataLayer::isValid() void DataLayer::setAll(int br) { - byte val = (byte) (br & (br << 4)); + uint8_t val = (uint8_t) (br & (br << 4)); for (unsigned int i = 0; i < data.length; i++) { data[i] = val; diff --git a/Minecraft.World/DataOutput.h b/Minecraft.World/DataOutput.h index 7ebf96daf..ad31f29f8 100644 --- a/Minecraft.World/DataOutput.h +++ b/Minecraft.World/DataOutput.h @@ -6,7 +6,7 @@ class DataOutput virtual void write(unsigned int b) = 0; virtual void write(byteArray b) = 0; virtual void write(byteArray b, unsigned int offset, unsigned int length) = 0; - virtual void writeByte(byte a) = 0; + virtual void writeByte(uint8_t a) = 0; virtual void writeDouble(double a) = 0; virtual void writeFloat(float a) = 0; virtual void writeInt(int a) = 0; diff --git a/Minecraft.World/DataOutputStream.cpp b/Minecraft.World/DataOutputStream.cpp index 1a24e31a1..2ef2aad99 100644 --- a/Minecraft.World/DataOutputStream.cpp +++ b/Minecraft.World/DataOutputStream.cpp @@ -17,11 +17,11 @@ void DataOutputStream::deleteChildStream() delete stream; } -//Writes the specified byte (the low eight bits of the argument b) to the underlying output stream. +//Writes the specified uint8_t (the low eight bits of the argument b) to the underlying output stream. //If no exception is thrown, the counter written is incremented by 1. //Implements the write method of OutputStream. //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. void DataOutputStream::write(unsigned int b) { stream->write( b ); @@ -34,7 +34,7 @@ void DataOutputStream::flush() stream->flush(); } -//Writes b.length bytes from the specified byte array to this output stream. +//Writes b.length bytes from the specified uint8_t array to this output stream. //The general contract for write(b) is that it should have exactly the same effect as the call write(b, 0, b.length). //Parameters: //b - the data. @@ -43,7 +43,7 @@ void DataOutputStream::write(byteArray b) write(b, 0, b.length); } -//Writes len bytes from the specified byte array starting at offset off to the underlying output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to the underlying output stream. //If no exception is thrown, the counter written is incremented by len. //Parameters: //b - the data. @@ -63,17 +63,17 @@ void DataOutputStream::close() stream->close(); } -//Writes out a byte to the underlying output stream as a 1-byte value. If no exception is thrown, the counter written is incremented by 1. +//Writes out a uint8_t to the underlying output stream as a 1-uint8_t value. If no exception is thrown, the counter written is incremented by 1. //Parameters: -//v - a byte value to be written. -void DataOutputStream::writeByte(byte a) +//v - a uint8_t value to be written. +void DataOutputStream::writeByte(uint8_t a) { stream->write( a ); } //Converts the double argument to a long using the doubleToLongBits method in class Double, -//and then writes that long value to the underlying output stream as an 8-byte quantity, -//high byte first. If no exception is thrown, the counter written is incremented by 8. +//and then writes that long value to the underlying output stream as an 8-uint8_t quantity, +//high uint8_t first. If no exception is thrown, the counter written is incremented by 8. //Parameters: //v - a double value to be written. void DataOutputStream::writeDouble(double a) @@ -86,7 +86,7 @@ void DataOutputStream::writeDouble(double a) } //Converts the float argument to an int using the floatToIntBits method in class Float, -//and then writes that int value to the underlying output stream as a 4-byte quantity, high byte first. +//and then writes that int value to the underlying output stream as a 4-uint8_t quantity, high uint8_t first. //If no exception is thrown, the counter written is incremented by 4. //Parameters: //v - a float value to be written. @@ -99,7 +99,7 @@ void DataOutputStream::writeFloat(float a) written += 4; } -//Writes an int to the underlying output stream as four bytes, high byte first. If no exception is thrown, the counter written is incremented by 4. +//Writes an int to the underlying output stream as four bytes, high uint8_t first. If no exception is thrown, the counter written is incremented by 4. //Parameters: //v - an int to be written. void DataOutputStream::writeInt(int a) @@ -112,7 +112,7 @@ void DataOutputStream::writeInt(int a) written += 4; } -//Writes a long to the underlying output stream as eight bytes, high byte first. +//Writes a long to the underlying output stream as eight bytes, high uint8_t first. //In no exception is thrown, the counter written is incremented by 8. //Parameters: //v - a long to be written. @@ -130,7 +130,7 @@ void DataOutputStream::writeLong(int64_t a) written += 4; } -//Writes a short to the underlying output stream as two bytes, high byte first. +//Writes a short to the underlying output stream as two bytes, high uint8_t first. //If no exception is thrown, the counter written is incremented by 2. //Parameters: //v - a short to be written. @@ -150,7 +150,7 @@ void DataOutputStream::writeUnsignedShort(unsigned short a) written += 2; } -//Writes a char to the underlying output stream as a 2-byte value, high byte first. +//Writes a char to the underlying output stream as a 2-uint8_t value, high uint8_t first. //If no exception is thrown, the counter written is incremented by 2. //Parameters: //v - a char value to be written. @@ -177,14 +177,14 @@ void DataOutputStream::writeChars(const wstring& str) // Incrementing handled by the writeChar function } -//Writes a boolean to the underlying output stream as a 1-byte value. -//The value true is written out as the value (byte)1; the value false is written out as the value (byte)0. +//Writes a boolean to the underlying output stream as a 1-uint8_t value. +//The value true is written out as the value (uint8_t)1; the value false is written out as the value (uint8_t)0. //If no exception is thrown, the counter written is incremented by 1. //Parameters: //v - a boolean value to be written. void DataOutputStream::writeBoolean(bool b) { - stream->write( b ? (byte)1 : (byte)0 ); + stream->write( b ? (uint8_t)1 : (uint8_t)0 ); // TODO 4J Stu - Error handling? written += 1; } @@ -227,15 +227,15 @@ void DataOutputStream::writeUTF(const wstring& str) byteArray bytearr(utflen+2); - bytearr[count++] = (byte) ((utflen >> 8) & 0xFF); - bytearr[count++] = (byte) ((utflen >> 0) & 0xFF); + bytearr[count++] = (uint8_t) ((utflen >> 8) & 0xFF); + bytearr[count++] = (uint8_t) ((utflen >> 0) & 0xFF); int i=0; for (i=0; i= 0x0001) && (c <= 0x007F))) break; - bytearr[count++] = (byte) c; + bytearr[count++] = (uint8_t) c; } for (;i < strlen; i++) @@ -243,19 +243,19 @@ void DataOutputStream::writeUTF(const wstring& str) c = str.at(i); if ((c >= 0x0001) && (c <= 0x007F)) { - bytearr[count++] = (byte) c; + bytearr[count++] = (uint8_t) c; } else if (c > 0x07FF) { - bytearr[count++] = (byte) (0xE0 | ((c >> 12) & 0x0F)); - bytearr[count++] = (byte) (0x80 | ((c >> 6) & 0x3F)); - bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); + bytearr[count++] = (uint8_t) (0xE0 | ((c >> 12) & 0x0F)); + bytearr[count++] = (uint8_t) (0x80 | ((c >> 6) & 0x3F)); + bytearr[count++] = (uint8_t) (0x80 | ((c >> 0) & 0x3F)); } else { - bytearr[count++] = (byte) (0xC0 | ((c >> 6) & 0x1F)); - bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); + bytearr[count++] = (uint8_t) (0xC0 | ((c >> 6) & 0x1F)); + bytearr[count++] = (uint8_t) (0x80 | ((c >> 0) & 0x3F)); } } write(bytearr, 0, utflen+2); diff --git a/Minecraft.World/DataOutputStream.h b/Minecraft.World/DataOutputStream.h index 7ecfcd44a..e89040d63 100644 --- a/Minecraft.World/DataOutputStream.h +++ b/Minecraft.World/DataOutputStream.h @@ -22,7 +22,7 @@ protected : virtual void write(byteArray b); virtual void write(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual void writeByte(byte a); + virtual void writeByte(uint8_t a); virtual void writeDouble(double a); virtual void writeFloat(float a); virtual void writeInt(int a); diff --git a/Minecraft.World/DirectoryLevelStorage.cpp b/Minecraft.World/DirectoryLevelStorage.cpp index 150df2161..1d37a1822 100644 --- a/Minecraft.World/DirectoryLevelStorage.cpp +++ b/Minecraft.World/DirectoryLevelStorage.cpp @@ -19,7 +19,7 @@ _MapDataMappings::_MapDataMappings() #ifndef _DURANGO ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA); #endif - ZeroMemory(dimensions,sizeof(byte)*(MAXIMUM_MAP_SAVE_DATA/4)); + ZeroMemory(dimensions,sizeof(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(byte)*(MAXIMUM_MAP_SAVE_DATA/8)); + ZeroMemory(dimensions,sizeof(uint8_t)*(MAXIMUM_MAP_SAVE_DATA/8)); } int _MapDataMappings_old::getDimension(int id) diff --git a/Minecraft.World/DirectoryLevelStorage.h b/Minecraft.World/DirectoryLevelStorage.h index 6d305ba3f..d66c55163 100644 --- a/Minecraft.World/DirectoryLevelStorage.h +++ b/Minecraft.World/DirectoryLevelStorage.h @@ -36,7 +36,7 @@ class ConsoleSaveFile; typedef struct _MapDataMappings { PlayerUID xuids[MAXIMUM_MAP_SAVE_DATA]; - byte dimensions[MAXIMUM_MAP_SAVE_DATA/4]; + uint8_t dimensions[MAXIMUM_MAP_SAVE_DATA/4]; _MapDataMappings(); int getDimension(int id); @@ -47,7 +47,7 @@ typedef struct _MapDataMappings typedef struct _MapDataMappings_old { PlayerUID xuids[MAXIMUM_MAP_SAVE_DATA]; - byte dimensions[MAXIMUM_MAP_SAVE_DATA/8]; + uint8_t dimensions[MAXIMUM_MAP_SAVE_DATA/8]; _MapDataMappings_old(); int getDimension(int id); diff --git a/Minecraft.World/DispenserTileEntity.cpp b/Minecraft.World/DispenserTileEntity.cpp index 3e743e22e..685ca4bea 100644 --- a/Minecraft.World/DispenserTileEntity.cpp +++ b/Minecraft.World/DispenserTileEntity.cpp @@ -189,7 +189,7 @@ void DispenserTileEntity::save(CompoundTag *base) if (items[i] != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) i); + tag->putByte(L"Slot", (uint8_t) i); items[i]->save(tag); listTag->add(tag); } diff --git a/Minecraft.World/DoubleTag.h b/Minecraft.World/DoubleTag.h index 1f768d5bf..35bd555e8 100644 --- a/Minecraft.World/DoubleTag.h +++ b/Minecraft.World/DoubleTag.h @@ -12,7 +12,7 @@ class DoubleTag : public Tag void write(DataOutput *dos) { dos->writeDouble(data); } void load(DataInput *dis, int tagDepth) { data = dis->readDouble(); } - byte getId() { return TAG_Double; } + uint8_t getId() { return TAG_Double; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/DungeonFeature.cpp b/Minecraft.World/DungeonFeature.cpp index 6c7dc6733..d8b37cd09 100644 --- a/Minecraft.World/DungeonFeature.cpp +++ b/Minecraft.World/DungeonFeature.cpp @@ -142,12 +142,12 @@ void DungeonFeature::addTunnel(int xOffs, int zOffs, byteArray blocks, double xC { if (yy < 10) { - blocks[p] = (byte) Tile::lava_Id; + blocks[p] = (uint8_t) Tile::lava_Id; } else { - blocks[p] = (byte) 0; - if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (byte) Tile::grass_Id; + blocks[p] = (uint8_t) 0; + if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (uint8_t) Tile::grass_Id; } } } diff --git a/Minecraft.World/DurangoStats.cpp b/Minecraft.World/DurangoStats.cpp index 6e50fd20d..40b8cec70 100644 --- a/Minecraft.World/DurangoStats.cpp +++ b/Minecraft.World/DurangoStats.cpp @@ -193,7 +193,7 @@ byteArray DsItemEvent::createParamBlob(eAcquisitionMethod eMethod, int itemId, i { byteArray output; Param param = { eMethod, itemId, itemAux, itemCount }; - output.data = (byte *) new Param(param); + output.data = (uint8_t *) new Param(param); output.length = sizeof(Param); return output; } @@ -292,7 +292,7 @@ byteArray DsMobKilled::createParamBlob(shared_ptr player, shared_ptrdistanceTo(player->x, player->y, player->z), 0/*not needed*/ }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -307,7 +307,7 @@ byteArray DsMobKilled::createParamBlob(shared_ptr player, shared_ptrdistanceTo(player->x, player->y, player->z), 0/*not needed*/ }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -346,7 +346,7 @@ byteArray DsMobInteract::createParamBlob(eInteract interactionId, int entityId) { byteArray output; Param param = { interactionId, EntityIO::eTypeToIoid((eINSTANCEOF)entityId) }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -394,7 +394,7 @@ byteArray DsTravel::createParamBlob(eMethod method, int distance) { byteArray output; Param param = { method, distance }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -508,7 +508,7 @@ byteArray DsItemUsed::createParamBlob(int itemId, int aux, int count, int health { byteArray output; Param param = { itemId, aux, count, health, hunger }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -595,7 +595,7 @@ byteArray DsAchievement::createSmallParamBlob(eAward award) { byteArray output; SmallParam param = { award }; - output.data = (byte*) new SmallParam(param); + output.data = (uint8_t*) new SmallParam(param); output.length = sizeof(SmallParam); return output; } @@ -604,7 +604,7 @@ byteArray DsAchievement::createLargeParamBlob(eAward award, int count) { byteArray output; LargeParam param = { award, count }; - output.data = (byte*) new LargeParam(param); + output.data = (uint8_t*) new LargeParam(param); output.length = sizeof(LargeParam); return output; } @@ -632,7 +632,7 @@ byteArray DsChangedDimension::createParamBlob(int fromDimId, int toDimId) { byteArray output; Param param = { fromDimId, toDimId }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } @@ -663,7 +663,7 @@ byteArray DsEnteredBiome::createParamBlob(int biomeId) { byteArray output; Param param = { biomeId }; - output.data = (byte*) new Param(param); + output.data = (uint8_t*) new Param(param); output.length = sizeof(Param); return output; } diff --git a/Minecraft.World/EmptyLevelChunk.cpp b/Minecraft.World/EmptyLevelChunk.cpp index 4a19e8750..703ddfb71 100644 --- a/Minecraft.World/EmptyLevelChunk.cpp +++ b/Minecraft.World/EmptyLevelChunk.cpp @@ -189,7 +189,7 @@ int EmptyLevelChunk::getBlocksAndData(byteArray data, int x0, int y0, int z0, in } - Arrays::fill(data, p, p + len, (byte) 0); + Arrays::fill(data, p, p + len, (uint8_t) 0); return len; } diff --git a/Minecraft.World/EmptyMapItem.cpp b/Minecraft.World/EmptyMapItem.cpp index 42adc3048..422a61d6e 100644 --- a/Minecraft.World/EmptyMapItem.cpp +++ b/Minecraft.World/EmptyMapItem.cpp @@ -19,7 +19,7 @@ shared_ptr EmptyMapItem::use(shared_ptr itemInstance //int scale = MapItemSavedData.MAP_SIZE * 2 * (1 << data.scale); //data.x = (int) (Math.round(player.x / scale) * scale); //data.z = (int) (Math.round(player.z / scale) * scale); - //data.dimension = (byte) level.dimension.id; + //data.dimension = (uint8_t) level.dimension.id; //data.setDirty(); diff --git a/Minecraft.World/EndTag.h b/Minecraft.World/EndTag.h index 2815a5770..fb58e3d99 100644 --- a/Minecraft.World/EndTag.h +++ b/Minecraft.World/EndTag.h @@ -10,7 +10,7 @@ class EndTag : public Tag void load(DataInput *dis, int tagDepth) {}; void write(DataOutput *dos) {}; - byte getId() { return TAG_End; } + uint8_t getId() { return TAG_End; } wstring toString() { return wstring( L"END" ); } Tag *copy() diff --git a/Minecraft.World/EnderMan.cpp b/Minecraft.World/EnderMan.cpp index d099911c0..165bf04d5 100644 --- a/Minecraft.World/EnderMan.cpp +++ b/Minecraft.World/EnderMan.cpp @@ -67,9 +67,9 @@ void EnderMan::defineSynchedData() { Monster::defineSynchedData(); - entityData->define(DATA_CARRY_ITEM_ID, (byte) 0); - entityData->define(DATA_CARRY_ITEM_DATA, (byte) 0); - entityData->define(DATA_CREEPY, (byte) 0); + entityData->define(DATA_CARRY_ITEM_ID, (uint8_t) 0); + entityData->define(DATA_CARRY_ITEM_DATA, (uint8_t) 0); + entityData->define(DATA_CREEPY, (uint8_t) 0); } void EnderMan::addAdditonalSaveData(CompoundTag *tag) @@ -385,7 +385,7 @@ void EnderMan::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) // 4J Brought forward from 1.2.3 to help fix Enderman behaviour void EnderMan::setCarryingTile(int carryingTile) { - entityData->set(DATA_CARRY_ITEM_ID, (byte) (carryingTile & 0xff)); + entityData->set(DATA_CARRY_ITEM_ID, (uint8_t) (carryingTile & 0xff)); } int EnderMan::getCarryingTile() @@ -395,7 +395,7 @@ int EnderMan::getCarryingTile() void EnderMan::setCarryingData(int carryingData) { - entityData->set(DATA_CARRY_ITEM_DATA, (byte) (carryingData & 0xff)); + entityData->set(DATA_CARRY_ITEM_DATA, (uint8_t) (carryingData & 0xff)); } int EnderMan::getCarryingData() @@ -435,5 +435,5 @@ bool EnderMan::isCreepy() void EnderMan::setCreepy(bool creepy) { - entityData->set(DATA_CREEPY, (byte)(creepy ? 1 : 0)); + entityData->set(DATA_CREEPY, (uint8_t)(creepy ? 1 : 0)); } \ No newline at end of file diff --git a/Minecraft.World/Entity.cpp b/Minecraft.World/Entity.cpp index e82331402..2d4432fb9 100644 --- a/Minecraft.World/Entity.cpp +++ b/Minecraft.World/Entity.cpp @@ -362,7 +362,7 @@ Entity::Entity(Level *level, bool useSmallId) // 4J - added useSmallId parameter if( entityData ) { - entityData->define(DATA_SHARED_FLAGS_ID, (byte) 0); + entityData->define(DATA_SHARED_FLAGS_ID, (uint8_t) 0); entityData->define(DATA_AIR_SUPPLY_ID, TOTAL_AIR_SUPPLY); // 4J Stu - Brought forward from 1.2.3 to fix 38654 - Gameplay: Player will take damage when air bubbles are present if resuming game from load/autosave underwater. } @@ -1711,7 +1711,7 @@ void Entity::lerpMotion(double xd, double yd, double zd) this->zd = zd; } -void Entity::handleEntityEvent(byte eventId) +void Entity::handleEntityEvent(uint8_t eventId) { } @@ -1820,14 +1820,14 @@ void Entity::setSharedFlag(int flag, bool value) { if( entityData ) { - byte currentValue = entityData->getByte(DATA_SHARED_FLAGS_ID); + uint8_t currentValue = entityData->getByte(DATA_SHARED_FLAGS_ID); if (value) { - entityData->set(DATA_SHARED_FLAGS_ID, (byte) (currentValue | (1 << flag))); + entityData->set(DATA_SHARED_FLAGS_ID, (uint8_t) (currentValue | (1 << flag))); } else { - entityData->set(DATA_SHARED_FLAGS_ID, (byte) (currentValue & ~(1 << flag))); + entityData->set(DATA_SHARED_FLAGS_ID, (uint8_t) (currentValue & ~(1 << flag))); } } } diff --git a/Minecraft.World/Entity.h b/Minecraft.World/Entity.h index a738c2ba7..1d3e5337a 100644 --- a/Minecraft.World/Entity.h +++ b/Minecraft.World/Entity.h @@ -329,7 +329,7 @@ class Entity : public enable_shared_from_this virtual void handleInsidePortal(); virtual int getDimensionChangingDelay(); virtual void lerpMotion(double xd, double yd, double zd); - virtual void handleEntityEvent(byte eventId); + virtual void handleEntityEvent(uint8_t eventId); virtual void animateHurt(); virtual ItemInstanceArray getEquipmentSlots(); // ItemInstance[] virtual void setEquippedSlot(int slot, shared_ptr item); // 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game diff --git a/Minecraft.World/EntityEventPacket.cpp b/Minecraft.World/EntityEventPacket.cpp index e92d76926..fec293898 100644 --- a/Minecraft.World/EntityEventPacket.cpp +++ b/Minecraft.World/EntityEventPacket.cpp @@ -12,7 +12,7 @@ EntityEventPacket::EntityEventPacket() eventId = 0; } -EntityEventPacket::EntityEventPacket(int entityId, byte eventId) +EntityEventPacket::EntityEventPacket(int entityId, uint8_t eventId) { this->entityId = entityId; this->eventId = eventId; diff --git a/Minecraft.World/EntityEventPacket.h b/Minecraft.World/EntityEventPacket.h index a151dbdb4..716be4e4f 100644 --- a/Minecraft.World/EntityEventPacket.h +++ b/Minecraft.World/EntityEventPacket.h @@ -7,10 +7,10 @@ class EntityEventPacket : public Packet, public enable_shared_from_thisdefine(DATA_ID_HORSE_FLAGS, 0); - entityData->define(DATA_ID_TYPE, (byte) 0); + entityData->define(DATA_ID_TYPE, (uint8_t) 0); entityData->define(DATA_ID_TYPE_VARIANT, 0); entityData->define(DATA_ID_OWNER_NAME, L""); entityData->define(DATA_ID_ARMOR, 0); @@ -108,7 +108,7 @@ void EntityHorse::defineSynchedData() void EntityHorse::setType(int i) { - entityData->set(DATA_ID_TYPE, (byte) i); + entityData->set(DATA_ID_TYPE, (uint8_t) i); clearLayeredTextureInfo(); } @@ -1459,7 +1459,7 @@ void EntityHorse::addAdditonalSaveData(CompoundTag *tag) { CompoundTag *compoundTag = new CompoundTag(); - compoundTag->putByte(L"Slot", (byte) i); + compoundTag->putByte(L"Slot", (uint8_t) i); stack->save(compoundTag); listTag->add(compoundTag); @@ -1762,7 +1762,7 @@ void EntityHorse::spawnTamingParticles(bool success) } } -void EntityHorse::handleEntityEvent(byte id) +void EntityHorse::handleEntityEvent(uint8_t id) { if (id == EntityEvent::TAMING_SUCCEEDED) { diff --git a/Minecraft.World/EntityHorse.h b/Minecraft.World/EntityHorse.h index c2784491a..8a7a9ce57 100644 --- a/Minecraft.World/EntityHorse.h +++ b/Minecraft.World/EntityHorse.h @@ -316,7 +316,7 @@ class EntityHorse : public Animal, public net_minecraft_world::ContainerListener virtual void spawnTamingParticles(bool success); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); virtual void positionRider(); private: diff --git a/Minecraft.World/ExperienceOrb.cpp b/Minecraft.World/ExperienceOrb.cpp index 9fed6d71b..55899041e 100644 --- a/Minecraft.World/ExperienceOrb.cpp +++ b/Minecraft.World/ExperienceOrb.cpp @@ -176,7 +176,7 @@ bool ExperienceOrb::hurt(DamageSource *source, float damage) void ExperienceOrb::addAdditonalSaveData(CompoundTag *entityTag) { - entityTag->putShort(L"Health", (byte) health); + entityTag->putShort(L"Health", (uint8_t) health); entityTag->putShort(L"Age", (short) age); entityTag->putShort(L"Value", (short) value); } diff --git a/Minecraft.World/FallingTile.cpp b/Minecraft.World/FallingTile.cpp index c0eb7d226..59c832386 100644 --- a/Minecraft.World/FallingTile.cpp +++ b/Minecraft.World/FallingTile.cpp @@ -212,10 +212,10 @@ void FallingTile::causeFallDamage(float distance) void FallingTile::addAdditonalSaveData(CompoundTag *tag) { - tag->putByte(L"Tile", (byte) tile); + tag->putByte(L"Tile", (uint8_t) tile); tag->putInt(L"TileID", tile); - tag->putByte(L"Data", (byte) data); - tag->putByte(L"Time", (byte) time); + tag->putByte(L"Data", (uint8_t) data); + tag->putByte(L"Time", (uint8_t) time); tag->putBoolean(L"DropItem", dropItem); tag->putBoolean(L"HurtEntities", hurtEntities); tag->putFloat(L"FallHurtAmount", fallDamageAmount); diff --git a/Minecraft.World/FastNoise.cpp b/Minecraft.World/FastNoise.cpp index 91d039b3f..a6c7fbd42 100644 --- a/Minecraft.World/FastNoise.cpp +++ b/Minecraft.World/FastNoise.cpp @@ -15,10 +15,10 @@ FastNoise::FastNoise(Random *random, int levels) void FastNoise::init(Random *random, int levels) { this->levels = levels; - noiseMaps = new byte *[levels]; + noiseMaps = new uint8_t *[levels]; for (int i = 0; i < levels; i++) { - noiseMaps[i] = new byte[0x100000]; + noiseMaps[i] = new uint8_t[0x100000]; random->nextBytes(noiseMaps[i],0x100000); } } @@ -44,7 +44,7 @@ doubleArray FastNoise::getRegion(doubleArray buffer, double x, double y, double int BB = 21771; for (int i = 0; i < levels; i++) { - byte *map = noiseMaps[i]; + uint8_t *map = noiseMaps[i]; int pp = 0; for (int zp = 0; zp < zSize; zp++) diff --git a/Minecraft.World/FastNoise.h b/Minecraft.World/FastNoise.h index f41c32e83..e3bd991b3 100644 --- a/Minecraft.World/FastNoise.h +++ b/Minecraft.World/FastNoise.h @@ -3,7 +3,7 @@ class FastNoise { private: - byte **noiseMaps; + uint8_t **noiseMaps; int levels; public: diff --git a/Minecraft.World/FileInputStream.cpp b/Minecraft.World/FileInputStream.cpp index 5e0f6ca56..6cdf56b9b 100644 --- a/Minecraft.World/FileInputStream.cpp +++ b/Minecraft.World/FileInputStream.cpp @@ -55,12 +55,12 @@ FileInputStream::~FileInputStream() CloseHandle( m_fileHandle ); } -//Reads a byte of data from this input stream. This method blocks if no input is yet available. +//Reads a uint8_t of data from this input stream. This method blocks if no input is yet available. //Returns: //the next byte of data, or -1 if the end of the file is reached. int FileInputStream::read() { - byte byteRead = 0; + uint8_t byteRead = 0; DWORD numberOfBytesRead; BOOL bSuccess = ReadFile( diff --git a/Minecraft.World/FileOutputStream.cpp b/Minecraft.World/FileOutputStream.cpp index 557ba812d..0f07f3c19 100644 --- a/Minecraft.World/FileOutputStream.cpp +++ b/Minecraft.World/FileOutputStream.cpp @@ -54,14 +54,14 @@ FileOutputStream::~FileOutputStream() CloseHandle( m_fileHandle ); } -//Writes the specified byte to this file output stream. Implements the write method of OutputStream. +//Writes the specified uint8_t to this file output stream. Implements the write method of OutputStream. //Parameters: -//b - the byte to be written. +//b - the uint8_t to be written. void FileOutputStream::write(unsigned int b) { DWORD numberOfBytesWritten; - byte value = (byte) b; + uint8_t value = (uint8_t) b; BOOL result = WriteFile( m_fileHandle, // handle to file @@ -81,7 +81,7 @@ void FileOutputStream::write(unsigned int b) } } -//Writes b.length bytes from the specified byte array to this file output stream. +//Writes b.length bytes from the specified uint8_t array to this file output stream. //Parameters: //b - the data. void FileOutputStream::write(byteArray b) @@ -106,7 +106,7 @@ void FileOutputStream::write(byteArray b) } } -//Writes len bytes from the specified byte array starting at offset off to this file output stream. +//Writes len bytes from the specified uint8_t array starting at offset off to this file output stream. //Parameters: //b - the data. //off - the start offset in the data. diff --git a/Minecraft.World/Fireball.cpp b/Minecraft.World/Fireball.cpp index 2a538b064..1adb9b31a 100644 --- a/Minecraft.World/Fireball.cpp +++ b/Minecraft.World/Fireball.cpp @@ -300,8 +300,8 @@ void Fireball::addAdditonalSaveData(CompoundTag *tag) tag->putShort(L"xTile", (short) xTile); tag->putShort(L"yTile", (short) yTile); tag->putShort(L"zTile", (short) zTile); - tag->putByte(L"inTile", (byte) lastTile); - tag->putByte(L"inGround", (byte) (inGround ? 1 : 0)); + tag->putByte(L"inTile", (uint8_t) lastTile); + tag->putByte(L"inGround", (uint8_t) (inGround ? 1 : 0)); tag->put(L"direction", newDoubleList(3, xd, yd, zd)); } diff --git a/Minecraft.World/FireworksChargeItem.cpp b/Minecraft.World/FireworksChargeItem.cpp index 2de2be045..e460a3336 100644 --- a/Minecraft.World/FireworksChargeItem.cpp +++ b/Minecraft.World/FireworksChargeItem.cpp @@ -110,7 +110,7 @@ const unsigned int FIREWORKS_CHARGE_COLOUR_NAME[] = void FireworksChargeItem::appendHoverText(CompoundTag *expTag, vector *lines) { // shape - byte type = expTag->getByte(FireworksItem::TAG_E_TYPE); + uint8_t type = expTag->getByte(FireworksItem::TAG_E_TYPE); if (type >= FireworksItem::TYPE_MIN && type <= FireworksItem::TYPE_MAX) { lines->push_back(HtmlString(app.GetString(FIREWORKS_CHARGE_TYPE_NAME[type]))); diff --git a/Minecraft.World/FireworksItem.h b/Minecraft.World/FireworksItem.h index afc6cb594..d077db5de 100644 --- a/Minecraft.World/FireworksItem.h +++ b/Minecraft.World/FireworksItem.h @@ -15,14 +15,14 @@ class FireworksItem : public Item static const wstring TAG_E_COLORS; static const wstring TAG_E_FADECOLORS; - static const byte TYPE_SMALL = 0; - static const byte TYPE_BIG = 1; - static const byte TYPE_STAR = 2; - static const byte TYPE_CREEPER = 3; - static const byte TYPE_BURST = 4; + static const uint8_t TYPE_SMALL = 0; + static const uint8_t TYPE_BIG = 1; + static const uint8_t TYPE_STAR = 2; + static const uint8_t TYPE_CREEPER = 3; + static const uint8_t TYPE_BURST = 4; - static const byte TYPE_MIN = TYPE_SMALL; - static const byte TYPE_MAX = TYPE_BURST; + static const uint8_t TYPE_MIN = TYPE_SMALL; + static const uint8_t TYPE_MAX = TYPE_BURST; FireworksItem(int id); diff --git a/Minecraft.World/FireworksRecipe.cpp b/Minecraft.World/FireworksRecipe.cpp index a357c9cbc..d431eb058 100644 --- a/Minecraft.World/FireworksRecipe.cpp +++ b/Minecraft.World/FireworksRecipe.cpp @@ -143,7 +143,7 @@ bool FireworksRecipe::matches(shared_ptr craftSlots, Level *l } fireTag->put(FireworksItem::TAG_EXPLOSIONS, expTags); - fireTag->putByte(FireworksItem::TAG_FLIGHT, (byte) sulphurCount); + fireTag->putByte(FireworksItem::TAG_FLIGHT, (uint8_t) sulphurCount); itemTag->put(FireworksItem::TAG_FIREWORKS, fireTag); resultItem->setTag(itemTag); @@ -159,7 +159,7 @@ bool FireworksRecipe::matches(shared_ptr craftSlots, Level *l CompoundTag *itemTag = new CompoundTag(); CompoundTag *expTag = new CompoundTag(FireworksItem::TAG_EXPLOSION); - byte type = 0; + uint8_t type = 0; vector colors; for (int slot = 0; slot < craftSlots->getContainerSize(); slot++) diff --git a/Minecraft.World/FireworksRecipe.h b/Minecraft.World/FireworksRecipe.h index ef2815ea9..d58b594d0 100644 --- a/Minecraft.World/FireworksRecipe.h +++ b/Minecraft.World/FireworksRecipe.h @@ -37,8 +37,8 @@ class FireworksRecipe : public Recipy virtual const int getGroup() { return 0; } // 4J-PB - virtual bool requires(int iRecipe) { return false; }; - virtual void requires(INGREDIENTS_REQUIRED *pIngReq) {}; + virtual bool requirements(int iRecipe) { return false; }; + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq) {}; // 4J Added static void updatePossibleRecipes(shared_ptr craftSlots, bool *firework, bool *charge, bool *fade); diff --git a/Minecraft.World/FireworksRocketEntity.cpp b/Minecraft.World/FireworksRocketEntity.cpp index e84844f12..7c9ebc9ed 100644 --- a/Minecraft.World/FireworksRocketEntity.cpp +++ b/Minecraft.World/FireworksRocketEntity.cpp @@ -115,7 +115,7 @@ void FireworksRocketEntity::tick() } } -void FireworksRocketEntity::handleEntityEvent(byte eventId) +void FireworksRocketEntity::handleEntityEvent(uint8_t eventId) { if (eventId == EntityEvent::FIREWORKS_EXPLODE && level->isClientSide) { diff --git a/Minecraft.World/FireworksRocketEntity.h b/Minecraft.World/FireworksRocketEntity.h index 025a2778f..a28089394 100644 --- a/Minecraft.World/FireworksRocketEntity.h +++ b/Minecraft.World/FireworksRocketEntity.h @@ -28,7 +28,7 @@ class FireworksRocketEntity : public Entity virtual void lerpMotion(double xd, double yd, double zd); virtual void tick(); - virtual void handleEntityEvent(byte eventId); + virtual void handleEntityEvent(uint8_t eventId); virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); virtual float getShadowHeightOffs(); diff --git a/Minecraft.World/FishingHook.cpp b/Minecraft.World/FishingHook.cpp index e38a64b6a..9b496d06a 100644 --- a/Minecraft.World/FishingHook.cpp +++ b/Minecraft.World/FishingHook.cpp @@ -380,9 +380,9 @@ void FishingHook::addAdditonalSaveData(CompoundTag *tag) tag->putShort(L"xTile", (short) xTile); tag->putShort(L"yTile", (short) yTile); tag->putShort(L"zTile", (short) zTile); - tag->putByte(L"inTile", (byte) lastTile); - tag->putByte(L"shake", (byte) shakeTime); - tag->putByte(L"inGround", (byte) (inGround ? 1 : 0)); + tag->putByte(L"inTile", (uint8_t) lastTile); + tag->putByte(L"shake", (uint8_t) shakeTime); + tag->putByte(L"inGround", (uint8_t) (inGround ? 1 : 0)); } void FishingHook::readAdditionalSaveData(CompoundTag *tag) diff --git a/Minecraft.World/FlatLevelSource.cpp b/Minecraft.World/FlatLevelSource.cpp index ec2c0f960..8deb07af5 100644 --- a/Minecraft.World/FlatLevelSource.cpp +++ b/Minecraft.World/FlatLevelSource.cpp @@ -55,7 +55,7 @@ void FlatLevelSource::prepareHeights(byteArray blocks) { block = Tile::grass_Id; } - blocks[xc << 11 | zc << 7 | yc] = (byte) block; + blocks[xc << 11 | zc << 7 | yc] = (uint8_t) block; } } } @@ -70,7 +70,7 @@ LevelChunk *FlatLevelSource::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 chunksSize = Level::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(chunksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (uint8_t *)XPhysicalAlloc(chunksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); XMemSet128(tileData,0,chunksSize); byteArray blocks = byteArray(tileData,chunksSize); // byteArray blocks = byteArray(16 * level->depth * 16); diff --git a/Minecraft.World/FloatTag.h b/Minecraft.World/FloatTag.h index 803016499..c5038f3af 100644 --- a/Minecraft.World/FloatTag.h +++ b/Minecraft.World/FloatTag.h @@ -12,7 +12,7 @@ class FloatTag : public Tag void write(DataOutput *dos) { dos->writeFloat(data); } void load(DataInput *dis, int tagDepth) { data = dis->readFloat(); } - byte getId() { return TAG_Float; } + uint8_t getId() { return TAG_Float; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/FurnaceTileEntity.cpp b/Minecraft.World/FurnaceTileEntity.cpp index 1aa2c3005..05362e8b4 100644 --- a/Minecraft.World/FurnaceTileEntity.cpp +++ b/Minecraft.World/FurnaceTileEntity.cpp @@ -149,7 +149,7 @@ void FurnaceTileEntity::save(CompoundTag *base) if (items[i] != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) i); + tag->putByte(L"Slot", (uint8_t) i); items[i]->save(tag); listTag->add(tag); } diff --git a/Minecraft.World/Ghast.cpp b/Minecraft.World/Ghast.cpp index f0817791c..88d9cda8b 100644 --- a/Minecraft.World/Ghast.cpp +++ b/Minecraft.World/Ghast.cpp @@ -72,7 +72,7 @@ void Ghast::defineSynchedData() { FlyingMob::defineSynchedData(); - entityData->define(DATA_IS_CHARGING, (byte) 0); + entityData->define(DATA_IS_CHARGING, (uint8_t) 0); } void Ghast::registerAttributes() @@ -175,8 +175,8 @@ void Ghast::serverAiStep() if (!level->isClientSide) { - byte old = entityData->getByte(DATA_IS_CHARGING); - byte current = (byte) (charge > 10 ? 1 : 0); + uint8_t old = entityData->getByte(DATA_IS_CHARGING); + uint8_t current = (uint8_t) (charge > 10 ? 1 : 0); if (old != current) { entityData->set(DATA_IS_CHARGING, current); diff --git a/Minecraft.World/HangingEntity.cpp b/Minecraft.World/HangingEntity.cpp index 26261710f..803ab005e 100644 --- a/Minecraft.World/HangingEntity.cpp +++ b/Minecraft.World/HangingEntity.cpp @@ -235,7 +235,7 @@ void HangingEntity::push(double xa, double ya, double za) void HangingEntity::addAdditonalSaveData(CompoundTag *tag) { - tag->putByte(L"Direction", (byte) dir); + tag->putByte(L"Direction", (uint8_t) dir); tag->putInt(L"TileX", xTile); tag->putInt(L"TileY", yTile); tag->putInt(L"TileZ", zTile); @@ -244,16 +244,16 @@ void HangingEntity::addAdditonalSaveData(CompoundTag *tag) switch (dir) { case Direction::NORTH: - tag->putByte(L"Dir", (byte) 0); + tag->putByte(L"Dir", (uint8_t) 0); break; case Direction::WEST: - tag->putByte(L"Dir", (byte) 1); + tag->putByte(L"Dir", (uint8_t) 1); break; case Direction::SOUTH: - tag->putByte(L"Dir", (byte) 2); + tag->putByte(L"Dir", (uint8_t) 2); break; case Direction::EAST: - tag->putByte(L"Dir", (byte) 3); + tag->putByte(L"Dir", (uint8_t) 3); break; } } diff --git a/Minecraft.World/HellDimension.cpp b/Minecraft.World/HellDimension.cpp index 63cb0df78..bddcdd45d 100644 --- a/Minecraft.World/HellDimension.cpp +++ b/Minecraft.World/HellDimension.cpp @@ -19,9 +19,9 @@ void HellDimension::init() Vec3 *HellDimension::getFogColor(float td, float a) const { int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Nether_Fog_Colour ); - byte redComponent = ((colour>>16)&0xFF); - byte greenComponent = ((colour>>8)&0xFF); - byte blueComponent = ((colour)&0xFF); + uint8_t redComponent = ((colour>>16)&0xFF); + uint8_t greenComponent = ((colour>>8)&0xFF); + uint8_t blueComponent = ((colour)&0xFF); float rr = (float)redComponent/256;//0.2f; float gg = (float)greenComponent/256;//0.03f; diff --git a/Minecraft.World/HellFlatLevelSource.cpp b/Minecraft.World/HellFlatLevelSource.cpp index 95144627b..9120cec56 100644 --- a/Minecraft.World/HellFlatLevelSource.cpp +++ b/Minecraft.World/HellFlatLevelSource.cpp @@ -38,7 +38,7 @@ void HellFlatLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks) block = Tile::netherRack_Id; } - blocks[xc << 11 | zc << 7 | yc] = (byte) block; + blocks[xc << 11 | zc << 7 | yc] = (uint8_t) block; } } } @@ -60,7 +60,7 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) { if( z - random->nextInt( 4 ) <= 0 || xOffs < -(m_XZSize/2) ) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -68,7 +68,7 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) { if( x - random->nextInt( 4 ) <= 0 || zOffs < -(m_XZSize/2)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -76,7 +76,7 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) { if( z + random->nextInt(4) >= 15 || xOffs > (m_XZSize/2)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -84,7 +84,7 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) { if( x + random->nextInt(4) >= 15 || zOffs > (m_XZSize/2) ) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -93,11 +93,11 @@ void HellFlatLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks) if (y >= Level::genDepthMinusOne - random->nextInt(5)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } else if (y <= 0 + random->nextInt(5)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } } } @@ -115,7 +115,7 @@ LevelChunk *HellFlatLevelSource::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 chunksSize = Level::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(chunksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (uint8_t *)XPhysicalAlloc(chunksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); XMemSet128(tileData,0,chunksSize); byteArray blocks = byteArray(tileData,chunksSize); // byteArray blocks = byteArray(16 * level->depth * 16); diff --git a/Minecraft.World/HellRandomLevelSource.cpp b/Minecraft.World/HellRandomLevelSource.cpp index 66444d138..7c1786a4f 100644 --- a/Minecraft.World/HellRandomLevelSource.cpp +++ b/Minecraft.World/HellRandomLevelSource.cpp @@ -104,7 +104,7 @@ void HellRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray block tileId = Tile::netherRack_Id; } - blocks[offs] = (byte) tileId; + blocks[offs] = (uint8_t) tileId; offs += step; val += vala; } @@ -147,8 +147,8 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks int run = -1; - byte top = (byte) Tile::netherRack_Id; - byte material = (byte) Tile::netherRack_Id; + uint8_t top = (uint8_t) Tile::netherRack_Id; + uint8_t material = (uint8_t) Tile::netherRack_Id; for (int y = Level::genDepthMinusOne; y >= 0; y--) { @@ -160,7 +160,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks { if( z - random->nextInt( 4 ) <= 0 || xOffs < -(m_XZSize/2) ) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -168,7 +168,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks { if( x - random->nextInt( 4 ) <= 0 || zOffs < -(m_XZSize/2)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -176,7 +176,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks { if( z + random->nextInt(4) >= 15 || xOffs > (m_XZSize/2)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -184,7 +184,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks { if( x + random->nextInt(4) >= 15 || zOffs > (m_XZSize/2) ) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; blockSet = true; } } @@ -193,7 +193,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks if (y >= Level::genDepthMinusOne - random->nextInt(5) || y <= 0 + random->nextInt(5)) { - blocks[offs] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } else { @@ -210,20 +210,20 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks if (runDepth <= 0) { top = 0; - material = (byte) Tile::netherRack_Id; + material = (uint8_t) Tile::netherRack_Id; } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { - top = (byte) Tile::netherRack_Id; - material = (byte) Tile::netherRack_Id; - if (gravel) top = (byte) Tile::gravel_Id; - if (gravel) material = (byte) Tile::netherRack_Id; + top = (uint8_t) Tile::netherRack_Id; + material = (uint8_t) Tile::netherRack_Id; + if (gravel) top = (uint8_t) Tile::gravel_Id; + if (gravel) material = (uint8_t) Tile::netherRack_Id; if (sand) { // 4J Stu - Make some nether wart spawn outside of the nether fortresses if(random->nextInt(16) == 0) { - top = (byte) Tile::netherStalk_Id; + top = (uint8_t) Tile::netherStalk_Id; // Place the nether wart on top of the soul sand y += 1; @@ -234,13 +234,13 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks } else { - top = (byte) Tile::soulsand_Id; + top = (uint8_t) Tile::soulsand_Id; } } - if (sand) material = (byte) Tile::soulsand_Id; + if (sand) material = (uint8_t) Tile::soulsand_Id; } - if (y < waterHeight && top == 0) top = (byte) Tile::calmLava_Id; + if (y < waterHeight && top == 0) top = (uint8_t) Tile::calmLava_Id; run = runDepth; // 4J Stu - If sand, then allow adding nether wart at heights below the water level @@ -273,7 +273,7 @@ LevelChunk *HellRandomLevelSource::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::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (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/HopperTileEntity.cpp b/Minecraft.World/HopperTileEntity.cpp index 38a0e817d..b98c737f3 100644 --- a/Minecraft.World/HopperTileEntity.cpp +++ b/Minecraft.World/HopperTileEntity.cpp @@ -49,7 +49,7 @@ void HopperTileEntity::save(CompoundTag *base) if (items[i] != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) i); + tag->putByte(L"Slot", (uint8_t) i); items[i]->save(tag); listTag->add(tag); } diff --git a/Minecraft.World/IntArrayTag.h b/Minecraft.World/IntArrayTag.h index 48f4ce745..b3fd6cb27 100644 --- a/Minecraft.World/IntArrayTag.h +++ b/Minecraft.World/IntArrayTag.h @@ -44,7 +44,7 @@ class IntArrayTag : public Tag } } - byte getId() { return TAG_Int_Array; } + uint8_t getId() { return TAG_Int_Array; } wstring toString() { diff --git a/Minecraft.World/IntTag.h b/Minecraft.World/IntTag.h index cce87da31..fd5e17742 100644 --- a/Minecraft.World/IntTag.h +++ b/Minecraft.World/IntTag.h @@ -11,7 +11,7 @@ class IntTag : public Tag void write(DataOutput *dos) { dos->writeInt(data); } void load(DataInput *dis, int tagDepth) { data = dis->readInt(); } - byte getId() { return TAG_Int; } + uint8_t getId() { return TAG_Int; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/Inventory.cpp b/Minecraft.World/Inventory.cpp index 4a524bab8..aeed5f9af 100644 --- a/Minecraft.World/Inventory.cpp +++ b/Minecraft.World/Inventory.cpp @@ -515,7 +515,7 @@ ListTag *Inventory::save(ListTag *listTag) if (items[i] != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) i); + tag->putByte(L"Slot", (uint8_t) i); items[i]->save(tag); listTag->add(tag); } @@ -525,7 +525,7 @@ ListTag *Inventory::save(ListTag *listTag) if (armor[i] != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) (i + 100)); + tag->putByte(L"Slot", (uint8_t) (i + 100)); armor[i]->save(tag); listTag->add(tag); } diff --git a/Minecraft.World/ItemEntity.cpp b/Minecraft.World/ItemEntity.cpp index 66d271f72..595b567f8 100644 --- a/Minecraft.World/ItemEntity.cpp +++ b/Minecraft.World/ItemEntity.cpp @@ -204,7 +204,7 @@ bool ItemEntity::hurt(DamageSource *source, float damage) void ItemEntity::addAdditonalSaveData(CompoundTag *entityTag) { - entityTag->putShort(L"Health", (byte) health); + entityTag->putShort(L"Health", (uint8_t) health); entityTag->putShort(L"Age", (short) age); if (getItem() != NULL) entityTag->putCompound(L"Item", getItem()->save(new CompoundTag())); } diff --git a/Minecraft.World/ItemFrame.cpp b/Minecraft.World/ItemFrame.cpp index 0d52b421b..287c6d89e 100644 --- a/Minecraft.World/ItemFrame.cpp +++ b/Minecraft.World/ItemFrame.cpp @@ -38,7 +38,7 @@ ItemFrame::ItemFrame(Level *level, int xTile, int yTile, int zTile, int dir) : H void ItemFrame::defineSynchedData() { getEntityData()->defineNULL(DATA_ITEM, NULL); - getEntityData()->define(DATA_ROTATION, (byte) 0); + getEntityData()->define(DATA_ROTATION, (uint8_t) 0); } bool ItemFrame::shouldRenderAtSqrDistance(double distance) @@ -107,7 +107,7 @@ int ItemFrame::getRotation() void ItemFrame::setRotation(int rotation) { - getEntityData()->set(DATA_ROTATION, (byte) (rotation % 4)); + getEntityData()->set(DATA_ROTATION, (uint8_t) (rotation % 4)); } void ItemFrame::addAdditonalSaveData(CompoundTag *tag) @@ -115,7 +115,7 @@ void ItemFrame::addAdditonalSaveData(CompoundTag *tag) if (getItem() != NULL) { tag->putCompound(L"Item", getItem()->save(new CompoundTag())); - tag->putByte(L"ItemRotation", (byte) getRotation()); + tag->putByte(L"ItemRotation", (uint8_t) getRotation()); tag->putFloat(L"ItemDropChance", dropChance); } HangingEntity::addAdditonalSaveData(tag); diff --git a/Minecraft.World/ItemInstance.cpp b/Minecraft.World/ItemInstance.cpp index 4dcde7aa5..fbfa82f8d 100644 --- a/Minecraft.World/ItemInstance.cpp +++ b/Minecraft.World/ItemInstance.cpp @@ -146,7 +146,7 @@ shared_ptr ItemInstance::useTimeDepleted(Level *level, shared_ptr< CompoundTag *ItemInstance::save(CompoundTag *compoundTag) { compoundTag->putShort(L"id", (short) id); - compoundTag->putByte(L"Count", (byte) count); + compoundTag->putByte(L"Count", (uint8_t) count); compoundTag->putShort(L"Damage", (short) auxValue); if (tag != NULL) compoundTag->put(L"tag", tag->copy()); return compoundTag; @@ -736,7 +736,7 @@ void ItemInstance::enchant(const Enchantment *enchantment, int level) ListTag *list = (ListTag *) tag->get(L"ench"); CompoundTag *ench = new CompoundTag(); ench->putShort((wchar_t *)TAG_ENCH_ID, (short) enchantment->id); - ench->putShort((wchar_t *)TAG_ENCH_LEVEL, (byte) level); + ench->putShort((wchar_t *)TAG_ENCH_LEVEL, (uint8_t) level); list->add(ench); } diff --git a/Minecraft.World/LargeCaveFeature.cpp b/Minecraft.World/LargeCaveFeature.cpp index 5ca539d52..27f0463f1 100644 --- a/Minecraft.World/LargeCaveFeature.cpp +++ b/Minecraft.World/LargeCaveFeature.cpp @@ -144,12 +144,12 @@ void LargeCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray b { if (yy < 10) { - blocks[p] = (byte) Tile::lava_Id; + blocks[p] = (uint8_t) Tile::lava_Id; } else { - blocks[p] = (byte) 0; - if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (byte) level->getBiome(xx + xOffs * 16, zz + zOffs * 16)->topMaterial; + blocks[p] = (uint8_t) 0; + if (hasGrass && blocks[p - 1] == Tile::dirt_Id) blocks[p - 1] = (uint8_t) level->getBiome(xx + xOffs * 16, zz + zOffs * 16)->topMaterial; } } } diff --git a/Minecraft.World/LargeHellCaveFeature.cpp b/Minecraft.World/LargeHellCaveFeature.cpp index 6aa1aec57..e6cce4676 100644 --- a/Minecraft.World/LargeHellCaveFeature.cpp +++ b/Minecraft.World/LargeHellCaveFeature.cpp @@ -138,7 +138,7 @@ void LargeHellCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArr int block = blocks[p]; if (block == Tile::netherRack_Id || block == Tile::dirt_Id || block == Tile::grass_Id) { - blocks[p] = (byte) 0; + blocks[p] = (uint8_t) 0; } } p--; diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp index ef79fb397..64f21caba 100644 --- a/Minecraft.World/Level.cpp +++ b/Minecraft.World/Level.cpp @@ -90,7 +90,7 @@ DWORD Level::tlsIdxLightCache = TlsAlloc(); void Level::enableLightingCache() { - // Allocate 16K (needs 32K for large worlds) for a 16x16x16x4 byte cache of results, plus 128K required for toCheck array. Rounding up to 256 to keep as multiple of alignement - aligning to 128K boundary for possible cache locking. + // Allocate 16K (needs 32K for large worlds) for a 16x16x16x4 uint8_t cache of results, plus 128K required for toCheck array. Rounding up to 256 to keep as multiple of alignement - aligning to 128K boundary for possible cache locking. void *cache = (unsigned char *)XPhysicalAlloc(256 * 1024, MAXULONG_PTR, 128 * 1024, PAGE_READWRITE | MEM_LARGE_PAGES); TlsSetValue(tlsIdxLightCache,cache); } @@ -4377,7 +4377,7 @@ bool Level::mayInteract(shared_ptr player, int xt, int yt, int zt, int c } -void Level::broadcastEntityEvent(shared_ptr e, byte event) +void Level::broadcastEntityEvent(shared_ptr e, uint8_t event) { } diff --git a/Minecraft.World/Level.h b/Minecraft.World/Level.h index 946b21e3b..ffd80cabd 100644 --- a/Minecraft.World/Level.h +++ b/Minecraft.World/Level.h @@ -475,7 +475,7 @@ class Level : public LevelSource void setSpawnPos(Pos *spawnPos); void ensureAdded(shared_ptr entity); virtual bool mayInteract(shared_ptr player, int xt, int yt, int zt, int content); - virtual void broadcastEntityEvent(shared_ptr e, byte event); + virtual void broadcastEntityEvent(shared_ptr e, uint8_t event); ChunkSource *getChunkSource(); virtual void tileEvent(int x, int y, int z, int tile, int b0, int b1); LevelStorage *getLevelStorage(); diff --git a/Minecraft.World/LevelChunk.cpp b/Minecraft.World/LevelChunk.cpp index e4958ecf6..c57c18cdf 100644 --- a/Minecraft.World/LevelChunk.cpp +++ b/Minecraft.World/LevelChunk.cpp @@ -531,7 +531,7 @@ void LevelChunk::recalcHeightmapOnly() blocks = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT?upperBlocks : lowerBlocks; } #endif - heightmap[z << 4 | x] = (byte) y; + heightmap[z << 4 | x] = (uint8_t) y; if (y < min) min = y; } @@ -588,7 +588,7 @@ void LevelChunk::recalcHeightmap() blocks = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT?upperBlocks : lowerBlocks; } #endif - heightmap[z << 4 | x] = (byte) y; + heightmap[z << 4 | x] = (uint8_t) y; if (y < min) min = y; if (y < lowestHeightmap) lowestHeightmap = y; @@ -811,7 +811,7 @@ void LevelChunk::recalcHeight(int x, int yStart, int z) if (y == yOld) return; // level->lightColumnChanged(x, z, y, yOld); // 4J - this call moved below & corrected - see comment further down - heightmap[z << 4 | x] = (byte) y; + heightmap[z << 4 | x] = (uint8_t) y; if (y < minHeight) { @@ -919,7 +919,7 @@ int LevelChunk::getTile(int x, int y, int z) bool LevelChunk::setTileAndData(int x, int y, int z, int _tile, int _data) { - byte tile = (byte) _tile; + uint8_t tile = (uint8_t) _tile; // Optimisation brought forward from 1.8.2, change from int to unsigned char & this special value changed from -999 to 255 int slot = z << 4 | x; @@ -2047,7 +2047,7 @@ void LevelChunk::reloadBiomes() for(unsigned int z = 0; z < 16; ++z) { Biome *biome = biomeSource->getBiome((this->x << 4) + x, (this->z << 4) + z); - biomes[(z << 4) | x] = (byte) ( (biome->id) & 0xff); + biomes[(z << 4) | x] = (uint8_t) ( (biome->id) & 0xff); } } } @@ -2059,7 +2059,7 @@ Biome *LevelChunk::getBiome(int x, int z, BiomeSource *biomeSource) { Biome *biome = biomeSource->getBiome((this->x << 4) + x, (this->z << 4) + z); value = biome->id; - biomes[(z << 4) | x] = (byte) (value & 0xff); + biomes[(z << 4) | x] = (uint8_t) (value & 0xff); } if (Biome::biomes[value] == NULL) { @@ -2146,14 +2146,14 @@ void LevelChunk::updateBiomeFlags(int x, int z) } } -// Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing data. Ordering same as java version if originalOrder set; +// Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing data. Ordering same as java version if originalOrder set; void LevelChunk::getDataData(byteArray data) { lowerData->getData(data,0); if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperData->getData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Set data to data passed in input byte array of length 16384. This data must be in original (java version) order if originalOrder set. +// Set data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order if originalOrder set. void LevelChunk::setDataData(byteArray data) { if( lowerData == NULL ) lowerData = new SparseDataStorage(); @@ -2162,21 +2162,21 @@ void LevelChunk::setDataData(byteArray data) if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperData->setData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version if originalOrder set; +// Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version if originalOrder set; void LevelChunk::getSkyLightData(byteArray data) { lowerSkyLight->getData(data,0); if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperSkyLight->getData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version if originalOrder set; +// Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version if originalOrder set; void LevelChunk::getBlockLightData(byteArray data) { lowerBlockLight->getData(data,0); if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperBlockLight->getData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Set sky light data to data passed in input byte array of length 16384. This data must be in original (java version) order if originalOrder set. +// Set sky light data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order if originalOrder set. void LevelChunk::setSkyLightData(byteArray data) { if( lowerSkyLight == NULL ) lowerSkyLight = new SparseLightStorage(true); @@ -2185,7 +2185,7 @@ void LevelChunk::setSkyLightData(byteArray data) if(data.length > Level::COMPRESSED_CHUNK_SECTION_TILES/2) upperSkyLight->setData(data,Level::COMPRESSED_CHUNK_SECTION_TILES/2); } -// Set block light data to data passed in input byte array of length 16384. This data must be in original (java version) order if originalOrder set. +// Set block light data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order if originalOrder set. void LevelChunk::setBlockLightData(byteArray data) { if( lowerBlockLight == NULL ) lowerBlockLight = new SparseLightStorage(false); diff --git a/Minecraft.World/LevelChunk.h b/Minecraft.World/LevelChunk.h index fdb2ba6c2..0e7ed8939 100644 --- a/Minecraft.World/LevelChunk.h +++ b/Minecraft.World/LevelChunk.h @@ -75,10 +75,10 @@ class LevelChunk SparseLightStorage *lowerBlockLight; // 0 - 127 SparseLightStorage *upperBlockLight; // 128 - 255 public: - void getSkyLightData(byteArray data); // Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version. - void getBlockLightData(byteArray data); // Get a byte array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version. - void setSkyLightData(byteArray data); // Set sky light data to data passed in input byte array of length 16384. This data must be in original (java version) order - void setBlockLightData(byteArray data); // Set block light data to data passed in input byte array of length 16384. This data must be in original (java version) order + void getSkyLightData(byteArray data); // Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing sky light data. Ordering same as java version. + void getBlockLightData(byteArray data); // Get a uint8_t array of length 16384 ( 128 x 16 x 16 x 0.5 ), containing block light data. Ordering same as java version. + void setSkyLightData(byteArray data); // Set sky light data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order + void setBlockLightData(byteArray data); // Set block light data to data passed in input uint8_t array of length 16384. This data must be in original (java version) order void setSkyLightDataAllBright(); // Set sky light data to be all fully lit bool isLowerBlockStorageCompressed(); int isLowerBlockLightStorageCompressed(); diff --git a/Minecraft.World/ListTag.h b/Minecraft.World/ListTag.h index 69e51aee1..bd796b34f 100644 --- a/Minecraft.World/ListTag.h +++ b/Minecraft.World/ListTag.h @@ -6,7 +6,7 @@ template class ListTag : public Tag { private: vector list; - byte type; + uint8_t type; public: ListTag() : Tag(L"") {} @@ -46,7 +46,7 @@ template class ListTag : public Tag } } - byte getId() { return TAG_List; } + uint8_t getId() { return TAG_List; } wstring toString() { diff --git a/Minecraft.World/LivingEntity.cpp b/Minecraft.World/LivingEntity.cpp index ce702676c..50d293d31 100644 --- a/Minecraft.World/LivingEntity.cpp +++ b/Minecraft.World/LivingEntity.cpp @@ -132,8 +132,8 @@ LivingEntity::~LivingEntity() void LivingEntity::defineSynchedData() { entityData->define(DATA_EFFECT_COLOR_ID, 0); - entityData->define(DATA_EFFECT_AMBIENCE_ID, (byte) 0); - entityData->define(DATA_ARROW_COUNT_ID, (byte) 0); + entityData->define(DATA_EFFECT_AMBIENCE_ID, (uint8_t) 0); + entityData->define(DATA_ARROW_COUNT_ID, (uint8_t) 0); entityData->define(DATA_HEALTH_ID, 1.0f); } @@ -512,7 +512,7 @@ void LivingEntity::tickEffects() { if (activeEffects.empty()) { - entityData->set(DATA_EFFECT_AMBIENCE_ID, (byte) 0); + entityData->set(DATA_EFFECT_AMBIENCE_ID, (uint8_t) 0); entityData->set(DATA_EFFECT_COLOR_ID, 0); setInvisible(false); setWeakened(false); @@ -525,7 +525,7 @@ void LivingEntity::tickEffects() values.push_back(it.second); } int colorValue = PotionBrewing::getColorValue(&values); - entityData->set(DATA_EFFECT_AMBIENCE_ID, PotionBrewing::areAllEffectsAmbient(&values) ? (byte) 1 : (byte) 0); + entityData->set(DATA_EFFECT_AMBIENCE_ID, PotionBrewing::areAllEffectsAmbient(&values) ? (uint8_t) 1 : (uint8_t) 0); values.clear(); entityData->set(DATA_EFFECT_COLOR_ID, colorValue); setInvisible(hasEffect(MobEffect::invisibility->id)); @@ -1149,7 +1149,7 @@ int LivingEntity::getArrowCount() void LivingEntity::setArrowCount(int count) { - entityData->set(DATA_ARROW_COUNT_ID, (byte) count); + entityData->set(DATA_ARROW_COUNT_ID, (uint8_t) count); } int LivingEntity::getCurrentSwingDuration() @@ -1179,7 +1179,7 @@ void LivingEntity::swing() } } -void LivingEntity::handleEntityEvent(byte id) +void LivingEntity::handleEntityEvent(uint8_t id) { if (id == EntityEvent::HURT) { diff --git a/Minecraft.World/LivingEntity.h b/Minecraft.World/LivingEntity.h index 5869eeb29..4baa38fa5 100644 --- a/Minecraft.World/LivingEntity.h +++ b/Minecraft.World/LivingEntity.h @@ -218,7 +218,7 @@ class LivingEntity : public Entity public: virtual void swing(); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); protected: virtual void outOfWorld(); diff --git a/Minecraft.World/LongTag.h b/Minecraft.World/LongTag.h index 6a016715c..23a0749d4 100644 --- a/Minecraft.World/LongTag.h +++ b/Minecraft.World/LongTag.h @@ -11,7 +11,7 @@ class LongTag : public Tag void write(DataOutput *dos) { dos->writeLong(data); } void load(DataInput *dis, int tagDepth) { data = dis->readLong(); } - byte getId() { return TAG_Long; } + uint8_t getId() { return TAG_Long; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/MapItem.cpp b/Minecraft.World/MapItem.cpp index 03529c1ad..97ed8b569 100644 --- a/Minecraft.World/MapItem.cpp +++ b/Minecraft.World/MapItem.cpp @@ -74,7 +74,7 @@ shared_ptr MapItem::getSavedData(shared_ptr item mapItemSavedData->x = Math::round((float) level->getLevelData()->getXSpawn() / scale) * scale; mapItemSavedData->z = Math::round(level->getLevelData()->getZSpawn() / scale) * scale; #endif - mapItemSavedData->dimension = (byte) level->dimension->id; + mapItemSavedData->dimension = (uint8_t) level->dimension->id; mapItemSavedData->setDirty(); @@ -236,8 +236,8 @@ void MapItem::update(Level *level, shared_ptr player, shared_ptrcolors[x + z * w]; - byte newColor = (byte) (col * 4 + br); + uint8_t oldColor = data->colors[x + z * w]; + uint8_t newColor = (uint8_t) (col * 4 + br); if (oldColor != newColor) { if (yd0 > z) yd0 = z; @@ -335,7 +335,7 @@ void MapItem::onCraftedBy(shared_ptr itemInstance, Level *level, s // 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->z = centreZC; - data->dimension = (byte) level->dimension->id; + data->dimension = (uint8_t) level->dimension->id; data->setDirty(); } diff --git a/Minecraft.World/MapItemSavedData.cpp b/Minecraft.World/MapItemSavedData.cpp index c06c3facd..98f604460 100644 --- a/Minecraft.World/MapItemSavedData.cpp +++ b/Minecraft.World/MapItemSavedData.cpp @@ -310,10 +310,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr size || yd > size) { - if (xd <= -size) x = (byte) (size * 2 + 2.5); - if (yd <= -size) y = (byte) (size * 2 + 2.5); - if (xd >= size) x = (byte) (size * 2 + 1); - if (yd >= size) y = (byte) (size * 2 + 1); + if (xd <= -size) x = (uint8_t) (size * 2 + 2.5); + if (yd <= -size) y = (uint8_t) (size * 2 + 2.5); + if (xd >= size) x = (uint8_t) (size * 2 + 1); + if (yd >= size) y = (uint8_t) (size * 2 + 1); } #endif //decorations.push_back(new MapDecoration(4, x, y, 0)); @@ -347,10 +347,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr size || yd > size) { - if (xd <= -size) x = (byte) (size * 2 + 2.5); - if (yd <= -size) y = (byte) (size * 2 + 2.5); - if (xd >= size) x = (byte) (size * 2 + 1); - if (yd >= size) y = (byte) (size * 2 + 1); + if (xd <= -size) x = (uint8_t) (size * 2 + 2.5); + if (yd <= -size) y = (uint8_t) (size * 2 + 2.5); + if (xd >= size) x = (uint8_t) (size * 2 + 1); + if (yd >= size) y = (uint8_t) (size * 2 + 1); } #endif //decorations.push_back(new MapDecoration(7, x, y, 0)); @@ -379,10 +379,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr size || yd > size) { - if (xd <= -size) x = (byte) (size * 2 + 2.5); - if (yd <= -size) y = (byte) (size * 2 + 2.5); - if (xd >= size) x = (byte) (size * 2 + 1); - if (yd >= size) y = (byte) (size * 2 + 1); + if (xd <= -size) x = (uint8_t) (size * 2 + 2.5); + if (yd <= -size) y = (uint8_t) (size * 2 + 2.5); + if (xd >= size) x = (uint8_t) (size * 2 + 1); + if (yd >= size) y = (uint8_t) (size * 2 + 1); } #endif //decorations.push_back(new MapDecoration(7, x, y, 0)); @@ -437,10 +437,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr= size) x = (byte) (size * 2 + 1); - if (yd >= size) y = (byte) (size * 2 + 1); + if (xd <= -size) x = (uint8_t) (size * 2 + 2.5); + if (yd <= -size) y = (uint8_t) (size * 2 + 2.5); + if (xd >= size) x = (uint8_t) (size * 2 + 1); + if (yd >= size) y = (uint8_t) (size * 2 + 1); } #endif @@ -572,8 +572,8 @@ void MapItemSavedData::mergeInMapData(shared_ptr dataToAdd) for (int z = 0; z < h; z++) { - byte oldColor = colors[x + z * w]; - byte newColor = dataToAdd->colors[x + z * w]; + uint8_t oldColor = colors[x + z * w]; + uint8_t newColor = dataToAdd->colors[x + z * w]; if (oldColor == 0 && oldColor != newColor) { if (yd0 > z) yd0 = z; diff --git a/Minecraft.World/MapItemSavedData.h b/Minecraft.World/MapItemSavedData.h index 213226447..051f11f45 100644 --- a/Minecraft.World/MapItemSavedData.h +++ b/Minecraft.World/MapItemSavedData.h @@ -61,7 +61,7 @@ class MapItemSavedData : public SavedData public: int x, z; char dimension; - byte scale; + uint8_t scale; byteArray colors; vector > carriedBy; diff --git a/Minecraft.World/MerchantRecipeList.cpp b/Minecraft.World/MerchantRecipeList.cpp index c994081f2..e6c5324a1 100644 --- a/Minecraft.World/MerchantRecipeList.cpp +++ b/Minecraft.World/MerchantRecipeList.cpp @@ -85,7 +85,7 @@ MerchantRecipe *MerchantRecipeList::getMatchingRecipeFor(shared_ptrwriteByte((byte) (m_recipes.size() & 0xff)); + stream->writeByte((uint8_t) (m_recipes.size() & 0xff)); for (int i = 0; i < m_recipes.size(); i++) { MerchantRecipe *r = m_recipes.at(i); diff --git a/Minecraft.World/Minecart.cpp b/Minecraft.World/Minecart.cpp index 4e1419cc4..762d29a2c 100644 --- a/Minecraft.World/Minecart.cpp +++ b/Minecraft.World/Minecart.cpp @@ -95,7 +95,7 @@ void Minecart::defineSynchedData() entityData->define(DATA_ID_DAMAGE, 0.0f); entityData->define(DATA_ID_DISPLAY_TILE, 0); entityData->define(DATA_ID_DISPLAY_OFFSET, 6); - entityData->define(DATA_ID_CUSTOM_DISPLAY, (byte) 0); + entityData->define(DATA_ID_CUSTOM_DISPLAY, (uint8_t) 0); } @@ -1015,7 +1015,7 @@ bool Minecart::hasCustomDisplay() void Minecart::setCustomDisplay(bool value) { - getEntityData()->set(DATA_ID_CUSTOM_DISPLAY, (byte) (value ? 1 : 0)); + getEntityData()->set(DATA_ID_CUSTOM_DISPLAY, (uint8_t) (value ? 1 : 0)); } void Minecart::setCustomName(const wstring &name) diff --git a/Minecraft.World/MinecartContainer.cpp b/Minecraft.World/MinecartContainer.cpp index 20bfc4ea8..fb8022952 100644 --- a/Minecraft.World/MinecartContainer.cpp +++ b/Minecraft.World/MinecartContainer.cpp @@ -188,7 +188,7 @@ void MinecartContainer::addAdditonalSaveData(CompoundTag *base) if (items[i] != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) i); + tag->putByte(L"Slot", (uint8_t) i); items[i]->save(tag); listTag->add(tag); } diff --git a/Minecraft.World/MinecartFurnace.cpp b/Minecraft.World/MinecartFurnace.cpp index 24950d5c1..5ec6df6c7 100644 --- a/Minecraft.World/MinecartFurnace.cpp +++ b/Minecraft.World/MinecartFurnace.cpp @@ -37,7 +37,7 @@ int MinecartFurnace::getType() void MinecartFurnace::defineSynchedData() { Minecart::defineSynchedData(); - entityData->define(DATA_ID_FUEL, (byte) 0); + entityData->define(DATA_ID_FUEL, (uint8_t) 0); } void MinecartFurnace::tick() @@ -160,11 +160,11 @@ void MinecartFurnace::setHasFuel(bool fuel) { if (fuel) { - entityData->set(DATA_ID_FUEL, (byte) (entityData->getByte(DATA_ID_FUEL) | 1)); + entityData->set(DATA_ID_FUEL, (uint8_t) (entityData->getByte(DATA_ID_FUEL) | 1)); } else { - entityData->set(DATA_ID_FUEL, (byte) (entityData->getByte(DATA_ID_FUEL) & ~1)); + entityData->set(DATA_ID_FUEL, (uint8_t) (entityData->getByte(DATA_ID_FUEL) & ~1)); } } diff --git a/Minecraft.World/MinecartSpawner.cpp b/Minecraft.World/MinecartSpawner.cpp index 3fcd4ef08..5b8061c13 100644 --- a/Minecraft.World/MinecartSpawner.cpp +++ b/Minecraft.World/MinecartSpawner.cpp @@ -10,7 +10,7 @@ MinecartSpawner::MinecartMobSpawner::MinecartMobSpawner(MinecartSpawner *parent) void MinecartSpawner::MinecartMobSpawner::broadcastEvent(int id) { - m_parent->level->broadcastEntityEvent(m_parent->shared_from_this(), (byte) id); + m_parent->level->broadcastEntityEvent(m_parent->shared_from_this(), (uint8_t) id); } Level *MinecartSpawner::MinecartMobSpawner::getLevel() @@ -78,7 +78,7 @@ void MinecartSpawner::addAdditonalSaveData(CompoundTag *tag) spawner->save(tag); } -void MinecartSpawner::handleEntityEvent(byte eventId) +void MinecartSpawner::handleEntityEvent(uint8_t eventId) { spawner->onEventTriggered(eventId); } diff --git a/Minecraft.World/MinecartSpawner.h b/Minecraft.World/MinecartSpawner.h index a0b7944f4..ef7d4bee8 100644 --- a/Minecraft.World/MinecartSpawner.h +++ b/Minecraft.World/MinecartSpawner.h @@ -39,7 +39,7 @@ class MinecartSpawner : public Minecart virtual void addAdditonalSaveData(CompoundTag *tag); public: - virtual void handleEntityEvent(byte eventId); + virtual void handleEntityEvent(uint8_t eventId); virtual void tick(); virtual BaseMobSpawner *getSpawner(); }; \ No newline at end of file diff --git a/Minecraft.World/MinecartTNT.cpp b/Minecraft.World/MinecartTNT.cpp index 26cac5cf5..85ef37f2b 100644 --- a/Minecraft.World/MinecartTNT.cpp +++ b/Minecraft.World/MinecartTNT.cpp @@ -105,7 +105,7 @@ void MinecartTNT::activateMinecart(int xt, int yt, int zt, bool state) } } -void MinecartTNT::handleEntityEvent(byte eventId) +void MinecartTNT::handleEntityEvent(uint8_t eventId) { if (eventId == EVENT_PRIME) { diff --git a/Minecraft.World/MinecartTNT.h b/Minecraft.World/MinecartTNT.h index 8637803cd..75e8021d2 100644 --- a/Minecraft.World/MinecartTNT.h +++ b/Minecraft.World/MinecartTNT.h @@ -9,7 +9,7 @@ class MinecartTNT : public Minecart static Entity *create(Level *level) { return new MinecartTNT(level); } private: - static const byte EVENT_PRIME = 10; + static const uint8_t EVENT_PRIME = 10; int fuse; @@ -30,7 +30,7 @@ class MinecartTNT : public Minecart public: virtual void activateMinecart(int xt, int yt, int zt, bool state); - virtual void handleEntityEvent(byte eventId); + virtual void handleEntityEvent(uint8_t eventId); virtual void primeFuse(); virtual int getFuse(); virtual bool isPrimed(); diff --git a/Minecraft.World/Minecraft.World.vcxproj b/Minecraft.World/Minecraft.World.vcxproj index c9191573e..5e63c78e2 100644 --- a/Minecraft.World/Minecraft.World.vcxproj +++ b/Minecraft.World/Minecraft.World.vcxproj @@ -286,63 +286,63 @@ StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary Unicode - v143 + v145 StaticLibrary MultiByte - v143 + v145 true StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary Unicode - v143 + v145 StaticLibrary Unicode - v143 + v145 StaticLibrary @@ -405,82 +405,82 @@ StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary Unicode - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary MultiByte - v143 + v145 StaticLibrary diff --git a/Minecraft.World/Mob.cpp b/Minecraft.World/Mob.cpp index 342400b49..275741f4a 100644 --- a/Minecraft.World/Mob.cpp +++ b/Minecraft.World/Mob.cpp @@ -155,7 +155,7 @@ void Mob::ate() void Mob::defineSynchedData() { LivingEntity::defineSynchedData(); - entityData->define(DATA_CUSTOM_NAME_VISIBLE, (byte) 0); + entityData->define(DATA_CUSTOM_NAME_VISIBLE, (uint8_t) 0); entityData->define(DATA_CUSTOM_NAME, L""); } @@ -865,7 +865,7 @@ bool Mob::hasCustomName() void Mob::setCustomNameVisible(bool visible) { - entityData->set(DATA_CUSTOM_NAME_VISIBLE, visible ? (byte) 1 : (byte) 0); + entityData->set(DATA_CUSTOM_NAME_VISIBLE, visible ? (uint8_t) 1 : (uint8_t) 0); } bool Mob::isCustomNameVisible() diff --git a/Minecraft.World/MobEffectInstance.cpp b/Minecraft.World/MobEffectInstance.cpp index 2ca696f61..c98e83ed7 100644 --- a/Minecraft.World/MobEffectInstance.cpp +++ b/Minecraft.World/MobEffectInstance.cpp @@ -172,8 +172,8 @@ bool MobEffectInstance::equals(MobEffectInstance *instance) CompoundTag *MobEffectInstance::save(CompoundTag *tag) { - tag->putByte(L"Id", (byte) getId()); - tag->putByte(L"Amplifier", (byte) getAmplifier()); + tag->putByte(L"Id", (uint8_t) getId()); + tag->putByte(L"Amplifier", (uint8_t) getAmplifier()); tag->putInt(L"Duration", getDuration()); tag->putBoolean(L"Ambient", isAmbient()); return tag; diff --git a/Minecraft.World/MobEffectInstance.h b/Minecraft.World/MobEffectInstance.h index 5d9e68f6c..9debee3e0 100644 --- a/Minecraft.World/MobEffectInstance.h +++ b/Minecraft.World/MobEffectInstance.h @@ -5,11 +5,11 @@ class Mob; class MobEffectInstance { private: - // sent as byte + // sent as uint8_t int id; // sent as short int duration; - // sent as byte + // sent as uint8_t int amplifier; bool splash; bool ambient; diff --git a/Minecraft.World/MushroomIslandBiome.cpp b/Minecraft.World/MushroomIslandBiome.cpp index fa7eafdbe..3191350dc 100644 --- a/Minecraft.World/MushroomIslandBiome.cpp +++ b/Minecraft.World/MushroomIslandBiome.cpp @@ -13,7 +13,7 @@ MushroomIslandBiome::MushroomIslandBiome(int id) : Biome(id) decorator->mushroomCount = 1; decorator->hugeMushrooms = 1; - topMaterial = (byte) Tile::mycel_Id; + topMaterial = (uint8_t) Tile::mycel_Id; enemies.clear(); friendlies.clear(); diff --git a/Minecraft.World/MusicTileEntity.cpp b/Minecraft.World/MusicTileEntity.cpp index d947cc69e..15c4b0e63 100644 --- a/Minecraft.World/MusicTileEntity.cpp +++ b/Minecraft.World/MusicTileEntity.cpp @@ -33,7 +33,7 @@ void MusicTileEntity::load(CompoundTag *tag) void MusicTileEntity::tune() { - note = (byte) ((note + 1) % 25); + note = (uint8_t) ((note + 1) % 25); setChanged(); } diff --git a/Minecraft.World/MusicTileEntity.h b/Minecraft.World/MusicTileEntity.h index a4941ff11..b5a23be6c 100644 --- a/Minecraft.World/MusicTileEntity.h +++ b/Minecraft.World/MusicTileEntity.h @@ -10,7 +10,7 @@ class MusicTileEntity : public TileEntity static TileEntity *create() { return new MusicTileEntity(); } public: - byte note; + uint8_t note; bool on; diff --git a/Minecraft.World/NbtIo.cpp b/Minecraft.World/NbtIo.cpp index b6c632777..7b59c19c2 100644 --- a/Minecraft.World/NbtIo.cpp +++ b/Minecraft.World/NbtIo.cpp @@ -16,7 +16,7 @@ CompoundTag *NbtIo::readCompressed(InputStream *in) void NbtIo::writeCompressed(CompoundTag *tag, OutputStream *out) { // 4J - this was using a try/finally block - // 4J Stu - Buffer output in 1024 byte chunks so that we can allocate properly in the save file + // 4J Stu - Buffer output in 1024 uint8_t chunks so that we can allocate properly in the save file BufferedOutputStream bos = BufferedOutputStream( out, 1024 ); DataOutputStream dos = DataOutputStream(&bos); // 4J - was new GZIPOutputStream as well NbtIo::write(tag, &dos); diff --git a/Minecraft.World/Ocelot.cpp b/Minecraft.World/Ocelot.cpp index 50285682a..0bc3401a1 100644 --- a/Minecraft.World/Ocelot.cpp +++ b/Minecraft.World/Ocelot.cpp @@ -57,7 +57,7 @@ void Ocelot::defineSynchedData() { TamableAnimal::defineSynchedData(); - entityData->define(DATA_TYPE_ID, (byte) 0); + entityData->define(DATA_TYPE_ID, (uint8_t) 0); } void Ocelot::serverAiMobStep() @@ -279,7 +279,7 @@ int Ocelot::getCatType() void Ocelot::setCatType(int type) { - entityData->set(DATA_TYPE_ID, (byte) type); + entityData->set(DATA_TYPE_ID, (uint8_t) type); } bool Ocelot::canSpawn() @@ -350,12 +350,12 @@ MobGroupData *Ocelot::finalizeMobSpawn(MobGroupData *groupData, int extraData /* void Ocelot::setSittingOnTile(bool val) { - byte current = entityData->getByte(DATA_FLAGS_ID); - entityData->set(DATA_FLAGS_ID, val ? (byte) (current | 0x02) : (byte) (current & ~0x02) ); + uint8_t current = entityData->getByte(DATA_FLAGS_ID); + entityData->set(DATA_FLAGS_ID, val ? (uint8_t) (current | 0x02) : (uint8_t) (current & ~0x02) ); } bool Ocelot::isSittingOnTile() { - byte current = entityData->getByte(DATA_FLAGS_ID); + uint8_t current = entityData->getByte(DATA_FLAGS_ID); return (current & 0x02) > 0; } \ No newline at end of file diff --git a/Minecraft.World/OldChunkStorage.cpp b/Minecraft.World/OldChunkStorage.cpp index 983c517d4..b927a5fef 100644 --- a/Minecraft.World/OldChunkStorage.cpp +++ b/Minecraft.World/OldChunkStorage.cpp @@ -526,10 +526,10 @@ LevelChunk *OldChunkStorage::load(Level *level, CompoundTag *tag) delete [] levelChunk->heightmap.data; levelChunk->heightmap = tag->getByteArray(L"HeightMap"); - // 4J - TerrainPopulated was a bool (java), then changed to be a byte bitfield, then replaced with TerrainPopulatedShort to store a wider bitfield + // 4J - TerrainPopulated was a bool (java), then changed to be a uint8_t bitfield, then replaced with TerrainPopulatedShort to store a wider bitfield if( tag->get(L"TerrainPopulated") ) { - // Java bool type or byte bitfield + // Java bool type or uint8_t bitfield levelChunk->terrainPopulated = tag->getByte(L"TerrainPopulated"); if( levelChunk->terrainPopulated >= 1 ) levelChunk->terrainPopulated = LevelChunk::sTerrainPopulatedAllNeighbours | LevelChunk::sTerrainPostPostProcessed; // Convert from old bool type to new bitfield } diff --git a/Minecraft.World/Ozelot.cpp b/Minecraft.World/Ozelot.cpp index 3c05f3578..4529a8d98 100644 --- a/Minecraft.World/Ozelot.cpp +++ b/Minecraft.World/Ozelot.cpp @@ -60,7 +60,7 @@ void Ozelot::defineSynchedData() { TamableAnimal::defineSynchedData(); - entityData->define(DATA_TYPE_ID, (byte) TYPE_OZELOT); + entityData->define(DATA_TYPE_ID, (uint8_t) TYPE_OZELOT); } void Ozelot::serverAiMobStep() @@ -294,7 +294,7 @@ int Ozelot::getCatType() void Ozelot::setCatType(int type) { - entityData->set(DATA_TYPE_ID, (byte) type); + entityData->set(DATA_TYPE_ID, (uint8_t) type); } bool Ozelot::canSpawn() diff --git a/Minecraft.World/Pig.cpp b/Minecraft.World/Pig.cpp index cc042f586..98a259d0c 100644 --- a/Minecraft.World/Pig.cpp +++ b/Minecraft.World/Pig.cpp @@ -70,7 +70,7 @@ bool Pig::canBeControlledByRider() void Pig::defineSynchedData() { Animal::defineSynchedData(); - entityData->define(DATA_SADDLE_ID, (byte) 0); + entityData->define(DATA_SADDLE_ID, (uint8_t) 0); } void Pig::addAdditonalSaveData(CompoundTag *tag) @@ -153,11 +153,11 @@ void Pig::setSaddle(bool value) { if (value) { - entityData->set(DATA_SADDLE_ID, (byte) 1); + entityData->set(DATA_SADDLE_ID, (uint8_t) 1); } else { - entityData->set(DATA_SADDLE_ID, (byte) 0); + entityData->set(DATA_SADDLE_ID, (uint8_t) 0); } } diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index bd6b68a8e..a587dcc10 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -175,7 +175,7 @@ void Player::defineSynchedData() { LivingEntity::defineSynchedData(); - entityData->define(DATA_PLAYER_FLAGS_ID, (byte) 0); + entityData->define(DATA_PLAYER_FLAGS_ID, (uint8_t) 0); entityData->define(DATA_PLAYER_ABSORPTION_ID, (float) 0); entityData->define(DATA_SCORE_ID, (int) 0); } @@ -591,7 +591,7 @@ void Player::completeUsingItem() } } -void Player::handleEntityEvent(byte id) +void Player::handleEntityEvent(uint8_t id) { if (id == EntityEvent::USE_ITEM_COMPLETE) { @@ -2025,14 +2025,14 @@ bool Player::getPlayerFlag(int flag) void Player::setPlayerFlag(int flag, bool value) { - byte currentValue = entityData->getByte(DATA_PLAYER_FLAGS_ID); + uint8_t currentValue = entityData->getByte(DATA_PLAYER_FLAGS_ID); if (value) { - entityData->set(DATA_PLAYER_FLAGS_ID, (byte) (currentValue | (1 << flag))); + entityData->set(DATA_PLAYER_FLAGS_ID, (uint8_t) (currentValue | (1 << flag))); } else { - entityData->set(DATA_PLAYER_FLAGS_ID, (byte) (currentValue & ~(1 << flag))); + entityData->set(DATA_PLAYER_FLAGS_ID, (uint8_t) (currentValue & ~(1 << flag))); } } diff --git a/Minecraft.World/Player.h b/Minecraft.World/Player.h index 2e223a1e5..aebad5171 100644 --- a/Minecraft.World/Player.h +++ b/Minecraft.World/Player.h @@ -168,7 +168,7 @@ class Player : public LivingEntity, public CommandSender, public ScoreHolder virtual void completeUsingItem(); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); protected: bool isImmobile(); diff --git a/Minecraft.World/PlayerAbilitiesPacket.cpp b/Minecraft.World/PlayerAbilitiesPacket.cpp index d02f164cc..5052b8ab7 100644 --- a/Minecraft.World/PlayerAbilitiesPacket.cpp +++ b/Minecraft.World/PlayerAbilitiesPacket.cpp @@ -25,7 +25,7 @@ PlayerAbilitiesPacket::PlayerAbilitiesPacket(Abilities *abilities) void PlayerAbilitiesPacket::read(DataInputStream *dis) { - byte bitfield = dis->readByte(); + uint8_t bitfield = dis->readByte(); setInvulnerable((bitfield & FLAG_INVULNERABLE) > 0); setFlying((bitfield & FLAG_FLYING) > 0); @@ -37,7 +37,7 @@ void PlayerAbilitiesPacket::read(DataInputStream *dis) void PlayerAbilitiesPacket::write(DataOutputStream *dos) { - byte bitfield = 0; + uint8_t bitfield = 0; if (isInvulnerable()) bitfield |= FLAG_INVULNERABLE; if (isFlying()) bitfield |= FLAG_FLYING; diff --git a/Minecraft.World/PlayerEnderChestContainer.cpp b/Minecraft.World/PlayerEnderChestContainer.cpp index f0a1aaa3f..8d42363f9 100644 --- a/Minecraft.World/PlayerEnderChestContainer.cpp +++ b/Minecraft.World/PlayerEnderChestContainer.cpp @@ -41,7 +41,7 @@ ListTag *PlayerEnderChestContainer::createTag() if (item != NULL) { CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Slot", (byte) i); + tag->putByte(L"Slot", (uint8_t) i); item->save(tag); items->add(tag); } diff --git a/Minecraft.World/PreLoginPacket.cpp b/Minecraft.World/PreLoginPacket.cpp index 4b4742141..5e8729e4f 100644 --- a/Minecraft.World/PreLoginPacket.cpp +++ b/Minecraft.World/PreLoginPacket.cpp @@ -92,7 +92,7 @@ void PreLoginPacket::write(DataOutputStream *dos) //throws IOException dos->writeByte(m_friendsOnlyBits); dos->writeInt(m_ugcPlayersVersion); - dos->writeByte((byte)m_dwPlayerCount); + dos->writeByte((uint8_t)m_dwPlayerCount); for(DWORD i = 0; i < m_dwPlayerCount; ++i) { dos->writePlayerUID( m_playerXuids[i] ); diff --git a/Minecraft.World/PrimedTnt.cpp b/Minecraft.World/PrimedTnt.cpp index 79fd760fb..ba54cf4a6 100644 --- a/Minecraft.World/PrimedTnt.cpp +++ b/Minecraft.World/PrimedTnt.cpp @@ -105,7 +105,7 @@ void PrimedTnt::explode() void PrimedTnt::addAdditonalSaveData(CompoundTag *entityTag) { - entityTag->putByte(L"Fuse", (byte) life); + entityTag->putByte(L"Fuse", (uint8_t) life); } void PrimedTnt::readAdditionalSaveData(CompoundTag *tag) diff --git a/Minecraft.World/Random.cpp b/Minecraft.World/Random.cpp index d4e3a5454..87cb873d3 100644 --- a/Minecraft.World/Random.cpp +++ b/Minecraft.World/Random.cpp @@ -30,11 +30,11 @@ int Random::next(int bits) return (int)(seed >> (48 - bits)); } -void Random::nextBytes(byte *bytes, unsigned int count) +void Random::nextBytes(uint8_t *bytes, unsigned int count) { for(unsigned int i = 0; i < count; i++ ) { - bytes[i] = (byte)next(8); + bytes[i] = (uint8_t)next(8); } } diff --git a/Minecraft.World/Random.h b/Minecraft.World/Random.h index cfb6af26f..39b5d3c87 100644 --- a/Minecraft.World/Random.h +++ b/Minecraft.World/Random.h @@ -12,7 +12,7 @@ class Random Random(); Random(int64_t seed); void setSeed(int64_t s); - void nextBytes(byte *bytes, unsigned int count); + void nextBytes(uint8_t *bytes, unsigned int count); double nextDouble(); double nextGaussian(); int nextInt(); diff --git a/Minecraft.World/RandomLevelSource.cpp b/Minecraft.World/RandomLevelSource.cpp index ae06c1f85..c8b6c050c 100644 --- a/Minecraft.World/RandomLevelSource.cpp +++ b/Minecraft.World/RandomLevelSource.cpp @@ -315,11 +315,11 @@ void RandomLevelSource::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 ((val += vala) > comp) { - tileId = (byte) Tile::stone_Id; + tileId = (uint8_t) Tile::stone_Id; } else if (yc * CHUNK_HEIGHT + y < waterHeight) { - tileId = (byte) Tile::calmWater_Id; + tileId = (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 @@ -381,8 +381,8 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi int run = -1; - byte top = b->topMaterial; - byte material = b->material; + uint8_t top = b->topMaterial; + uint8_t material = b->material; LevelGenerationOptions *lgo = app.getLevelGenerationOptions(); if(lgo != NULL) @@ -397,7 +397,7 @@ void RandomLevelSource::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] = (byte) Tile::unbreakable_Id; + blocks[offs] = (uint8_t) Tile::unbreakable_Id; } else { @@ -414,7 +414,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (runDepth <= 0) { top = 0; - material = (byte) Tile::stone_Id; + material = (uint8_t) Tile::stone_Id; } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { @@ -428,8 +428,8 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (y < waterHeight && top == 0) { - if (temp < 0.15f) top = (byte) Tile::ice_Id; - else top = (byte) Tile::calmWater_Id; + if (temp < 0.15f) top = (uint8_t) Tile::ice_Id; + else top = (uint8_t) Tile::calmWater_Id; } run = runDepth; @@ -445,7 +445,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (run == 0 && material == Tile::sand_Id) { run = random->nextInt(4); - material = (byte) Tile::sandStone_Id; + material = (uint8_t) Tile::sandStone_Id; } } } @@ -469,7 +469,7 @@ LevelChunk *RandomLevelSource::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::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (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/Recipes.cpp b/Minecraft.World/Recipes.cpp index ef2cd7fde..f7ee08b7c 100644 --- a/Minecraft.World/Recipes.cpp +++ b/Minecraft.World/Recipes.cpp @@ -1312,7 +1312,7 @@ void Recipes::buildRecipeIngredientsArray(void) int iCount=0; for (auto& recipe : *recipies) { - recipe->requires(&m_pRecipeIngredientsRequired[iCount++]); + recipe->requirements(&m_pRecipeIngredientsRequired[iCount++]); } //printf("Total recipes in buildRecipeIngredientsArray - %d",iCount); diff --git a/Minecraft.World/Recipy.h b/Minecraft.World/Recipy.h index 88d9640a4..b08931bcb 100644 --- a/Minecraft.World/Recipy.h +++ b/Minecraft.World/Recipy.h @@ -49,7 +49,7 @@ class Recipy virtual const int getGroup() = 0; // 4J-PB - virtual bool requires(int iRecipe) = 0; - virtual void requires(INGREDIENTS_REQUIRED *pIngReq) = 0; + virtual bool requirements(int iRecipe) = 0; + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq) = 0; }; diff --git a/Minecraft.World/RedStoneDustTile.cpp b/Minecraft.World/RedStoneDustTile.cpp index a4577bd32..06a48d11b 100644 --- a/Minecraft.World/RedStoneDustTile.cpp +++ b/Minecraft.World/RedStoneDustTile.cpp @@ -335,9 +335,9 @@ void RedStoneDustTile::animateTick(Level *level, int x, int y, int z, Random *ra unsigned int minColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_RedstoneDustLitMin ); unsigned int maxColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_RedstoneDustLitMax ); - byte redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( (data-1)/14.0f)); - byte greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( (data-1)/14.0f)); - byte blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( (data-1)/14.0f)); + uint8_t redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( (data-1)/14.0f)); + uint8_t greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( (data-1)/14.0f)); + uint8_t blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( (data-1)/14.0f)); colour = redComponent<<16 | greenComponent<<8 | blueComponent; } diff --git a/Minecraft.World/RegionFile.cpp b/Minecraft.World/RegionFile.cpp index 5c29f94e2..68421c902 100644 --- a/Minecraft.World/RegionFile.cpp +++ b/Minecraft.World/RegionFile.cpp @@ -57,10 +57,10 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) //if ((GetFileSize(file,NULL) & 0xfff) != 0) if ((fileEntry->getFileSize() & 0xfff) != 0) { - //byte zero = 0; + //uint8_t zero = 0; DWORD numberOfBytesWritten = 0; DWORD bytesToWrite = 0x1000 - (fileEntry->getFileSize() & 0xfff); - byte *zeroBytes = new byte[ bytesToWrite ]; + uint8_t *zeroBytes = new uint8_t[ bytesToWrite ]; ZeroMemory(zeroBytes, bytesToWrite); /* the file size is not a multiple of 4KB, grow it */ @@ -207,7 +207,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was DWORD numberOfBytesRead = 0; - // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a byte, then length-1 bytes of data + // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a uint8_t, then length-1 bytes of data // We store length and decompression length as ints, then length bytes of xbox LZX compressed data m_saveFile->readFile(fileEntry,&length,4,&numberOfBytesRead); @@ -233,8 +233,8 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was } MemSect(50); - byte *data = new byte[length]; - byte *decomp = new byte[decompLength]; + uint8_t *data = new uint8_t[length]; + uint8_t *decomp = new 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, byte *data, int length) // TODO - was synchronized +void RegionFile::write(int x, int z, 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 - byte *compData = new byte[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. + 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. unsigned int compLength = length; Compression::getCompression()->CompressLZXRLE(compData,&compLength,data,length); @@ -403,13 +403,13 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync } /* write a chunk data to the region file at specified sector number */ -void RegionFile::write(int sectorNumber, byte *data, int length, unsigned int compLength) +void RegionFile::write(int sectorNumber, uint8_t *data, int length, unsigned int compLength) { DWORD numberOfBytesWritten = 0; //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN ); - // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a byte, then length-1 bytes of data + // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a uint8_t, then length-1 bytes of data // We store length and decompression length as ints, then length bytes of xbox LZX compressed data // 4J Stu - We need to do the compression at a level above this, where it is checking for free space @@ -451,7 +451,7 @@ void RegionFile::insertInitialSectors() { m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_BEGIN ); DWORD numberOfBytesWritten = 0; - byte zeroBytes[ SECTOR_BYTES ]; + uint8_t zeroBytes[ SECTOR_BYTES ]; ZeroMemory(zeroBytes, SECTOR_BYTES); /* we need to write the chunk offset table */ diff --git a/Minecraft.World/RegionFile.h b/Minecraft.World/RegionFile.h index 520ca6a19..5ea267d1c 100644 --- a/Minecraft.World/RegionFile.h +++ b/Minecraft.World/RegionFile.h @@ -71,11 +71,11 @@ class RegionFile /* write a chunk at (x,z) with length bytes of data to disk */ protected: - void write(int x, int z, byte *data, int length); + void write(int x, int z, uint8_t *data, int length); /* write a chunk data to the region file at specified sector number */ private: - void write(int sectorNumber, byte *data, int length, unsigned int compLength); + void write(int sectorNumber, uint8_t *data, int length, unsigned int compLength); void zero(int sectorNumber, int length); // 4J added /* is this an invalid chunk coordinate? */ diff --git a/Minecraft.World/RemoveMobEffectPacket.cpp b/Minecraft.World/RemoveMobEffectPacket.cpp index fcda69110..ee6808de2 100644 --- a/Minecraft.World/RemoveMobEffectPacket.cpp +++ b/Minecraft.World/RemoveMobEffectPacket.cpp @@ -13,7 +13,7 @@ RemoveMobEffectPacket::RemoveMobEffectPacket() RemoveMobEffectPacket::RemoveMobEffectPacket(int entityId, MobEffectInstance *effect) { this->entityId = entityId; - this->effectId = (byte) (effect->getId() & 0xff); + this->effectId = (uint8_t) (effect->getId() & 0xff); } void RemoveMobEffectPacket::read(DataInputStream *dis) diff --git a/Minecraft.World/ServerAuthDataPacket.h b/Minecraft.World/ServerAuthDataPacket.h index c56844d10..8857f4203 100644 --- a/Minecraft.World/ServerAuthDataPacket.h +++ b/Minecraft.World/ServerAuthDataPacket.h @@ -7,13 +7,13 @@ class ServerAuthDataPacket : public Packet #if 0 private String serverId; private PublicKey publicKey; - private byte[] nonce = new byte[]{}; + private uint8_t[] nonce = new uint8_t[]{}; public ServerAuthDataPacket() { // Needed } - public ServerAuthDataPacket(final String serverId, final PublicKey publicKey, final byte[] nonce) { + public ServerAuthDataPacket(final String serverId, final PublicKey publicKey, final uint8_t[] nonce) { this.serverId = serverId; this.publicKey = publicKey; this.nonce = nonce; @@ -51,7 +51,7 @@ class ServerAuthDataPacket : public Packet return publicKey; } - public byte[] getNonce() { + public uint8_t[] getNonce() { return nonce; } #endif diff --git a/Minecraft.World/ShapedRecipy.cpp b/Minecraft.World/ShapedRecipy.cpp index 15ccca2de..01fd1d09d 100644 --- a/Minecraft.World/ShapedRecipy.cpp +++ b/Minecraft.World/ShapedRecipy.cpp @@ -106,7 +106,7 @@ int ShapedRecipy::size() } // 4J-PB -bool ShapedRecipy::requires(int iRecipe) +bool ShapedRecipy::requirements(int iRecipe) { app.DebugPrintf("ShapedRecipy %d\n",iRecipe); int iCount=0; @@ -130,7 +130,7 @@ bool ShapedRecipy::requires(int iRecipe) return false; } -void ShapedRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) +void ShapedRecipy::requirements(INGREDIENTS_REQUIRED *pIngReq) { //printf("ShapedRecipy %d\n",iRecipe); diff --git a/Minecraft.World/ShapedRecipy.h b/Minecraft.World/ShapedRecipy.h index 56cae3fd7..e89e62893 100644 --- a/Minecraft.World/ShapedRecipy.h +++ b/Minecraft.World/ShapedRecipy.h @@ -26,7 +26,7 @@ class ShapedRecipy : public Recipy ShapedRecipy *keepTag(); // 4J-PB - to return the items required to make a recipe - virtual bool requires(int iRecipe); - virtual void requires(INGREDIENTS_REQUIRED *pIngReq); + virtual bool requirements(int iRecipe); + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq); }; diff --git a/Minecraft.World/ShapelessRecipy.cpp b/Minecraft.World/ShapelessRecipy.cpp index 44bf6a54f..1b81640d6 100644 --- a/Minecraft.World/ShapelessRecipy.cpp +++ b/Minecraft.World/ShapelessRecipy.cpp @@ -77,7 +77,7 @@ int ShapelessRecipy::size() } // 4J-PB -bool ShapelessRecipy::requires(int iRecipe) +bool ShapelessRecipy::requirements(int iRecipe) { vector *tempList = new vector; @@ -97,7 +97,7 @@ bool ShapelessRecipy::requires(int iRecipe) return false; } -void ShapelessRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) +void ShapelessRecipy::requirements(INGREDIENTS_REQUIRED *pIngReq) { int iCount=0; bool bFound; diff --git a/Minecraft.World/ShapelessRecipy.h b/Minecraft.World/ShapelessRecipy.h index 5f7f60765..58c7cb04b 100644 --- a/Minecraft.World/ShapelessRecipy.h +++ b/Minecraft.World/ShapelessRecipy.h @@ -17,7 +17,7 @@ class ShapelessRecipy : public Recipy virtual int size(); // 4J-PB - to return the items required to make a recipe - virtual bool requires(int iRecipe); - virtual void requires(INGREDIENTS_REQUIRED *pIngReq); + virtual bool requirements(int iRecipe); + virtual void requirements(INGREDIENTS_REQUIRED *pIngReq); }; diff --git a/Minecraft.World/SharedKeyPacket.h b/Minecraft.World/SharedKeyPacket.h index 4f50ad5c6..054b01c3b 100644 --- a/Minecraft.World/SharedKeyPacket.h +++ b/Minecraft.World/SharedKeyPacket.h @@ -5,8 +5,8 @@ class SharedKeyPacket : public Packet { #if 0 - private byte[] keybytes = new byte[]{}; - private byte[] nonce = new byte[]{}; + private uint8_t[] keybytes = new uint8_t[]{}; + private uint8_t[] nonce = new uint8_t[]{}; private SecretKey secretKey; @@ -14,7 +14,7 @@ class SharedKeyPacket : public Packet // Needed } - public SharedKeyPacket(final SecretKey secretKey, final PublicKey publicKey, final byte[] nonce) { + public SharedKeyPacket(final SecretKey secretKey, final PublicKey publicKey, final uint8_t[] nonce) { this.secretKey = secretKey; this.keybytes = Crypt.encryptUsingKey(publicKey, secretKey.getEncoded()); this.nonce = Crypt.encryptUsingKey(publicKey, nonce); @@ -53,7 +53,7 @@ class SharedKeyPacket : public Packet return getSecretKey(null); } - public byte[] getNonce(PrivateKey privateKey) { + public uint8_t[] getNonce(PrivateKey privateKey) { if (privateKey == null) { return nonce; } diff --git a/Minecraft.World/Sheep.cpp b/Minecraft.World/Sheep.cpp index 32379c2a1..0dbf3676a 100644 --- a/Minecraft.World/Sheep.cpp +++ b/Minecraft.World/Sheep.cpp @@ -99,8 +99,8 @@ void Sheep::defineSynchedData() { Animal::defineSynchedData(); - // sheared and color share a byte - entityData->define(DATA_WOOL_ID, ((byte) 0)); //was new Byte((byte), 0) + // sheared and color share a uint8_t + entityData->define(DATA_WOOL_ID, ((uint8_t) 0)); //was new Byte((uint8_t), 0) } void Sheep::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) @@ -117,7 +117,7 @@ int Sheep::getDeathLoot() return Tile::wool_Id; } -void Sheep::handleEntityEvent(byte id) +void Sheep::handleEntityEvent(uint8_t id) { if (id == EntityEvent::EAT_GRASS) { @@ -196,7 +196,7 @@ void Sheep::addAdditonalSaveData(CompoundTag *tag) { Animal::addAdditonalSaveData(tag); tag->putBoolean(L"Sheared", isSheared()); - tag->putByte(L"Color", (byte) getColor()); + tag->putByte(L"Color", (uint8_t) getColor()); } void Sheep::readAdditionalSaveData(CompoundTag *tag) @@ -233,8 +233,8 @@ int Sheep::getColor() void Sheep::setColor(int color) { - byte current = entityData->getByte(DATA_WOOL_ID); - entityData->set(DATA_WOOL_ID, (byte) ((current & 0xf0) | (color & 0x0f))); + uint8_t current = entityData->getByte(DATA_WOOL_ID); + entityData->set(DATA_WOOL_ID, (uint8_t) ((current & 0xf0) | (color & 0x0f))); } bool Sheep::isSheared() @@ -244,14 +244,14 @@ bool Sheep::isSheared() void Sheep::setSheared(bool value) { - byte current = entityData->getByte(DATA_WOOL_ID); + uint8_t current = entityData->getByte(DATA_WOOL_ID); if (value) { - entityData->set(DATA_WOOL_ID, (byte) (current | 0x10)); + entityData->set(DATA_WOOL_ID, (uint8_t) (current | 0x10)); } else { - entityData->set(DATA_WOOL_ID, (byte) (current & ~0x10)); + entityData->set(DATA_WOOL_ID, (uint8_t) (current & ~0x10)); } } diff --git a/Minecraft.World/Sheep.h b/Minecraft.World/Sheep.h index 16ecfb4cf..db42cceb2 100644 --- a/Minecraft.World/Sheep.h +++ b/Minecraft.World/Sheep.h @@ -53,7 +53,7 @@ class Sheep : public Animal virtual int getDeathLoot(); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); public: float getHeadEatPositionScale(float a); diff --git a/Minecraft.World/ShortTag.h b/Minecraft.World/ShortTag.h index 989e1fb14..57870c694 100644 --- a/Minecraft.World/ShortTag.h +++ b/Minecraft.World/ShortTag.h @@ -11,7 +11,7 @@ class ShortTag : public Tag void write(DataOutput *dos) { dos->writeShort(data); } void load(DataInput *dis, int tagDepth) { data = dis->readShort(); } - byte getId() { return TAG_Short; } + uint8_t getId() { return TAG_Short; } wstring toString() { static wchar_t buf[32]; diff --git a/Minecraft.World/SignUpdatePacket.cpp b/Minecraft.World/SignUpdatePacket.cpp index 7b3a32179..cf2211008 100644 --- a/Minecraft.World/SignUpdatePacket.cpp +++ b/Minecraft.World/SignUpdatePacket.cpp @@ -62,8 +62,8 @@ int SignUpdatePacket::getEstimatedSize() l+=sizeof(int); l+=sizeof(short); l+=sizeof(int); - l+=sizeof(byte); - l+=sizeof(byte); + l+=sizeof(uint8_t); + l+=sizeof(uint8_t); for (int i = 0; i < MAX_SIGN_LINES; i++) l += (int)lines[i].length(); diff --git a/Minecraft.World/Skeleton.cpp b/Minecraft.World/Skeleton.cpp index 9afb95c6b..71f5c1dcd 100644 --- a/Minecraft.World/Skeleton.cpp +++ b/Minecraft.World/Skeleton.cpp @@ -63,7 +63,7 @@ void Skeleton::defineSynchedData() { Monster::defineSynchedData(); - entityData->define(DATA_TYPE_ID, (byte) TYPE_DEFAULT); + entityData->define(DATA_TYPE_ID, (uint8_t) TYPE_DEFAULT); } bool Skeleton::useNewAi() @@ -311,7 +311,7 @@ int Skeleton::getSkeletonType() void Skeleton::setSkeletonType(int type) { - entityData->set(DATA_TYPE_ID, (byte) type); + entityData->set(DATA_TYPE_ID, (uint8_t) type); fireImmune = type == TYPE_WITHER; if (type == TYPE_WITHER) @@ -340,7 +340,7 @@ void Skeleton::readAdditionalSaveData(CompoundTag *tag) void Skeleton::addAdditonalSaveData(CompoundTag *entityTag) { Monster::addAdditonalSaveData(entityTag); - entityTag->putByte(L"SkeletonType", (byte) getSkeletonType()); + entityTag->putByte(L"SkeletonType", (uint8_t) getSkeletonType()); } void Skeleton::setEquippedSlot(int slot, shared_ptr item) diff --git a/Minecraft.World/Slime.cpp b/Minecraft.World/Slime.cpp index eaeea25ad..7e012daa5 100644 --- a/Minecraft.World/Slime.cpp +++ b/Minecraft.World/Slime.cpp @@ -47,12 +47,12 @@ void Slime::defineSynchedData() { Mob::defineSynchedData(); - entityData->define(ID_SIZE, (byte) 1); + entityData->define(ID_SIZE, (uint8_t) 1); } void Slime::setSize(int size) { - entityData->set(ID_SIZE, (byte) size); + entityData->set(ID_SIZE, (uint8_t) size); setSize(0.6f * size, 0.6f * size); setPos(x, y, z); getAttribute(SharedMonsterAttributes::MAX_HEALTH)->setBaseValue(size * size); diff --git a/Minecraft.World/Socket.cpp b/Minecraft.World/Socket.cpp index bd0c2032f..4aff17511 100644 --- a/Minecraft.World/Socket.cpp +++ b/Minecraft.World/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; @@ -29,7 +29,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]); } @@ -256,7 +256,7 @@ Socket::SocketInputStreamLocal::SocketInputStreamLocal(int queueIdx) m_queueIdx = queueIdx; } -// Try and get an input byte, blocking until one is available +// Try and get an input uint8_t, blocking until one is available int Socket::SocketInputStreamLocal::read() { while(m_streamOpen && ShutdownManager::ShouldRun(ShutdownManager::eConnectionReadThreads)) @@ -265,7 +265,7 @@ int Socket::SocketInputStreamLocal::read() { if( s_hostQueue[m_queueIdx].size() ) { - byte retval = s_hostQueue[m_queueIdx].front(); + uint8_t retval = s_hostQueue[m_queueIdx].front(); s_hostQueue[m_queueIdx].pop(); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); return retval; @@ -330,7 +330,7 @@ void Socket::SocketOutputStreamLocal::write(unsigned int b) return; } EnterCriticalSection(&s_hostQueueLock[m_queueIdx]); - s_hostQueue[m_queueIdx].push((byte)b); + s_hostQueue[m_queueIdx].push((uint8_t)b); LeaveCriticalSection(&s_hostQueueLock[m_queueIdx]); } @@ -372,7 +372,7 @@ Socket::SocketInputStreamNetwork::SocketInputStreamNetwork(Socket *socket, int q m_socket = socket; } -// Try and get an input byte, blocking until one is available +// Try and get an input uint8_t, blocking until one is available int Socket::SocketInputStreamNetwork::read() { while(m_streamOpen && ShutdownManager::ShouldRun(ShutdownManager::eConnectionReadThreads)) @@ -381,7 +381,7 @@ int Socket::SocketInputStreamNetwork::read() { if( m_socket->m_queueNetwork[m_queueIdx].size() ) { - byte retval = m_socket->m_queueNetwork[m_queueIdx].front(); + 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; @@ -441,8 +441,8 @@ void Socket::SocketOutputStreamNetwork::write(unsigned int b) { if( m_streamOpen != true ) return; byteArray barray; - byte bb; - bb = (byte)b; + uint8_t bb; + bb = (uint8_t)b; barray.data = &bb; barray.length = 1; write(barray, 0, 1); diff --git a/Minecraft.World/Socket.h b/Minecraft.World/Socket.h index c4ec9fc8c..c0692a92f 100644 --- a/Minecraft.World/Socket.h +++ b/Minecraft.World/Socket.h @@ -93,12 +93,12 @@ class Socket // 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/SparseDataStorage.cpp b/Minecraft.World/SparseDataStorage.cpp index 780c9819d..327930d5e 100644 --- a/Minecraft.World/SparseDataStorage.cpp +++ b/Minecraft.World/SparseDataStorage.cpp @@ -162,7 +162,7 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset) //int shift = 4 * part; unsigned char *pucIn = &dataIn[ (y >> 1) + inOffset]; - for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination byte + for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination uint8_t { *pucOut = ( ( *pucIn ) >> ( part * 4 ) ) & 15; pucIn += 64; @@ -209,7 +209,7 @@ void SparseDataStorage::getData(byteArray retArray, unsigned int retOffset) int shift = 4 * part; unsigned char *pucOut = &retArray.data[ (y >> 1) + + retOffset]; unsigned char *pucIn = &data[ planeIndices[ y ] * 128 ]; - for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same byte + for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same uint8_t { unsigned char value = (*pucIn) & 15; *pucOut |= ( value << shift ); @@ -238,8 +238,8 @@ int SparseDataStorage::get(int x, int y, int z) else { int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int retval = ( data[ planeIndices[y] * 128 + byteIndex ] >> shift ) & 15; return retval; @@ -271,8 +271,8 @@ void SparseDataStorage::set(int x, int y, int z, int val) // Either data was already allocated, or we've just done that. Now store our value into the right place. int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int mask = 0xf0 >> shift; int idx = planeIndices[y] * 128 + byteIndex; diff --git a/Minecraft.World/SparseLightStorage.cpp b/Minecraft.World/SparseLightStorage.cpp index a0ba41b14..531448f11 100644 --- a/Minecraft.World/SparseLightStorage.cpp +++ b/Minecraft.World/SparseLightStorage.cpp @@ -166,7 +166,7 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset) //int shift = 4 * part; unsigned char *pucIn = &dataIn[ (y >> 1) + inOffset]; - for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination byte + for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination uint8_t { *pucOut = ( ( *pucIn ) >> ( part * 4 ) ) & 15; pucIn += 64; @@ -224,7 +224,7 @@ void SparseLightStorage::getData(byteArray retArray, unsigned int retOffset) int shift = 4 * part; unsigned char *pucOut = &retArray.data[ (y >> 1) + retOffset]; unsigned char *pucIn = &data[ planeIndices[ y ] * 128 ]; - for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same byte + for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same uint8_t { unsigned char value = (*pucIn) & 15; *pucOut |= ( value << shift ); @@ -257,8 +257,8 @@ int SparseLightStorage::get(int x, int y, int z) else { int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int retval = ( data[ planeIndices[y] * 128 + byteIndex ] >> shift ) & 15; return retval; @@ -294,8 +294,8 @@ void SparseLightStorage::set(int x, int y, int z, int val) // Either data was already allocated, or we've just done that. Now store our value into the right place. int planeIndex = x * 16 + z; // Index within this xz plane - int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte) - int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte + int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per uint8_t) + int shift = ( planeIndex & 1 ) * 4; // Bit shift within the uint8_t int mask = 0xf0 >> shift; int idx = planeIndices[y] * 128 + byteIndex; diff --git a/Minecraft.World/Spider.cpp b/Minecraft.World/Spider.cpp index 49997db39..65396e12d 100644 --- a/Minecraft.World/Spider.cpp +++ b/Minecraft.World/Spider.cpp @@ -31,7 +31,7 @@ void Spider::defineSynchedData() { Monster::defineSynchedData(); - entityData->define(DATA_FLAGS_ID, (byte) 0); + entityData->define(DATA_FLAGS_ID, (uint8_t) 0); } void Spider::tick() @@ -172,7 +172,7 @@ bool Spider::isClimbing() void Spider::setClimbing(bool value) { - byte flags = entityData->getByte(DATA_FLAGS_ID); + uint8_t flags = entityData->getByte(DATA_FLAGS_ID); if (value) { flags |= 0x1; diff --git a/Minecraft.World/StemTile.cpp b/Minecraft.World/StemTile.cpp index 62b0d57bb..571110af6 100644 --- a/Minecraft.World/StemTile.cpp +++ b/Minecraft.World/StemTile.cpp @@ -128,9 +128,9 @@ int StemTile::getColor(int data) unsigned int minColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_StemMin ); unsigned int maxColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Tile_StemMax ); - byte redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( data/7.0f)); - byte greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( data/7.0f)); - byte blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( data/7.0f)); + uint8_t redComponent = ((minColour>>16)&0xFF) + (( (maxColour>>16)&0xFF - (minColour>>16)&0xFF)*( data/7.0f)); + uint8_t greenComponent = ((minColour>>8)&0xFF) + (( (maxColour>>8)&0xFF - (minColour>>8)&0xFF)*( data/7.0f)); + uint8_t blueComponent = ((minColour)&0xFF) + (( (maxColour)&0xFF - (minColour)&0xFF)*( data/7.0f)); colour = redComponent<<16 | greenComponent<<8 | blueComponent; return colour; diff --git a/Minecraft.World/StringTag.h b/Minecraft.World/StringTag.h index 8eb0eb7fd..a926e4b03 100644 --- a/Minecraft.World/StringTag.h +++ b/Minecraft.World/StringTag.h @@ -18,7 +18,7 @@ class StringTag : public Tag data = dis->readUTF(); } - byte getId() { return TAG_String; } + uint8_t getId() { return TAG_String; } wstring toString() { diff --git a/Minecraft.World/SynchedEntityData.cpp b/Minecraft.World/SynchedEntityData.cpp index 655fa0c30..e53b9b391 100644 --- a/Minecraft.World/SynchedEntityData.cpp +++ b/Minecraft.World/SynchedEntityData.cpp @@ -25,7 +25,7 @@ void SynchedEntityData::define(int id, int value) m_isEmpty = false; } -void SynchedEntityData::define(int id, byte value) +void SynchedEntityData::define(int id, uint8_t value) { MemSect(17); checkId(id); @@ -94,7 +94,7 @@ void SynchedEntityData::checkId(int id) #endif } -byte SynchedEntityData::getByte(int id) +uint8_t SynchedEntityData::getByte(int id) { return itemsById[id]->getValue_byte(); } @@ -144,7 +144,7 @@ void SynchedEntityData::set(int id, int value) } } -void SynchedEntityData::set(int id, byte value) +void SynchedEntityData::set(int id, uint8_t value) { shared_ptr dataItem = itemsById[id]; @@ -359,7 +359,7 @@ vector > *SynchedEntityData::unpack(Data { case TYPE_BYTE: { - byte dataRead = input->readByte(); + uint8_t dataRead = input->readByte(); item = shared_ptr( new DataItem(itemType, itemId, dataRead) ); } break; @@ -488,7 +488,7 @@ int SynchedEntityData::getSizeInBytes() size += (int)dataItem->getValue_wstring().length() + 2; // Estimate, assuming all ascii chars break; case TYPE_ITEMINSTANCE: - // short + byte + short + // short + uint8_t + short size += 2 + 1 + 2; // Estimate, assuming all ascii chars break; default: @@ -510,7 +510,7 @@ SynchedEntityData::DataItem::DataItem(int type, int id, int value) : type( type this->dirty = true; } -SynchedEntityData::DataItem::DataItem(int type, int id, byte value) : type( type ), id( id ) +SynchedEntityData::DataItem::DataItem(int type, int id, uint8_t value) : type( type ), id( id ) { this->value_byte = value; this->dirty = true; @@ -550,7 +550,7 @@ void SynchedEntityData::DataItem::setValue(int value) this->value_int = value; } -void SynchedEntityData::DataItem::setValue(byte value) +void SynchedEntityData::DataItem::setValue(uint8_t value) { this->value_byte = value; } @@ -590,7 +590,7 @@ float SynchedEntityData::DataItem::getValue_float() return value_float; } -byte SynchedEntityData::DataItem::getValue_byte() +uint8_t SynchedEntityData::DataItem::getValue_byte() { return value_byte; } diff --git a/Minecraft.World/SynchedEntityData.h b/Minecraft.World/SynchedEntityData.h index 69d0f2487..b8141f899 100644 --- a/Minecraft.World/SynchedEntityData.h +++ b/Minecraft.World/SynchedEntityData.h @@ -16,7 +16,7 @@ class SynchedEntityData // 4J - there used to be one "value" type here of general type Object, just storing the different (used) varieties // here separately for us union { - byte value_byte; + uint8_t value_byte; int value_int; short value_short; float value_float; @@ -27,7 +27,7 @@ class SynchedEntityData public: // There was one type here that took a generic Object type, using overloading here instead - DataItem(int type, int id, byte value); + DataItem(int type, int id, uint8_t value); DataItem(int type, int id, int value); DataItem(int type, int id, const wstring& value); DataItem(int type, int id, shared_ptr itemInstance); @@ -35,13 +35,13 @@ class SynchedEntityData DataItem(int type, int id, float value); int getId(); - void setValue(byte value); + void setValue(uint8_t value); void setValue(int value); void setValue(short value); void setValue(float value); void setValue(const wstring& value); void setValue(shared_ptr value); - byte getValue_byte(); + uint8_t getValue_byte(); int getValue_int(); short getValue_short(); float getValue_float(); @@ -84,7 +84,7 @@ class SynchedEntityData // 4J - this function used to be a template, but there's only 3 varieties of use I've found so just hard-coding now, as // the original had some automatic Class to type sort of conversion that's a real pain for us to actually do - void define(int id, byte value); + void define(int id, uint8_t value); void define(int id, const wstring& value); void define(int id, int value); void define(int id, short value); @@ -92,7 +92,7 @@ class SynchedEntityData void defineNULL(int id, void *pVal); void checkId(int id); // 4J - added to contain common code from overloaded define functions above - byte getByte(int id); + uint8_t getByte(int id); short getShort(int id); int getInteger(int id); float getFloat(int id); @@ -100,7 +100,7 @@ class SynchedEntityData shared_ptr getItemInstance(int id); Pos *getPos(int id); // 4J - using overloads rather than template here - void set(int id, byte value); + void set(int id, uint8_t value); void set(int id, int value); void set(int id, short value); void set(int id, float value); diff --git a/Minecraft.World/System.h b/Minecraft.World/System.h index 1d48b4088..ec5520cb7 100644 --- a/Minecraft.World/System.h +++ b/Minecraft.World/System.h @@ -15,7 +15,7 @@ class System template static void arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithLength *dst, unsigned int dstPos, unsigned int length); public: - ArrayCopyFunctionDeclaration(byte) + ArrayCopyFunctionDeclaration(uint8_t) ArrayCopyFunctionDeclaration(Node *) ArrayCopyFunctionDeclaration(Biome *) ArrayCopyFunctionDeclaration(int) diff --git a/Minecraft.World/Tag.cpp b/Minecraft.World/Tag.cpp index adc753608..ca5a1e5d7 100644 --- a/Minecraft.World/Tag.cpp +++ b/Minecraft.World/Tag.cpp @@ -84,7 +84,7 @@ Tag *Tag::readNamedTag(DataInput *dis) Tag *Tag::readNamedTag(DataInput *dis, int tagDepth) { - byte type = dis->readByte(); + uint8_t type = dis->readByte(); if (type == 0) return new EndTag(); // 4J Stu - readByte can return -1, so if it's that then also mark as the end tag @@ -101,7 +101,7 @@ Tag *Tag::readNamedTag(DataInput *dis, int tagDepth) Tag *tag = newTag(type, name); // short length = dis.readShort(); - // byte[] bytes = new byte[length]; + // uint8_t[] bytes = new uint8_t[length]; // dis.readFully(bytes); tag->load(dis, tagDepth); @@ -113,7 +113,7 @@ void Tag::writeNamedTag(Tag *tag, DataOutput *dos) dos->writeByte(tag->getId()); if (tag->getId() == Tag::TAG_End) return; - // byte[] bytes = tag.getName().getBytes("UTF-8"); + // uint8_t[] bytes = tag.getName().getBytes("UTF-8"); // dos.writeShort(bytes.length); // dos.write(bytes); dos->writeUTF(tag->getName()); @@ -121,7 +121,7 @@ void Tag::writeNamedTag(Tag *tag, DataOutput *dos) tag->write(dos); } -Tag *Tag::newTag(byte type, const wstring &name) +Tag *Tag::newTag(uint8_t type, const wstring &name) { switch (type) { @@ -153,7 +153,7 @@ Tag *Tag::newTag(byte type, const wstring &name) return NULL; } -wchar_t *Tag::getTagName(byte type) +wchar_t *Tag::getTagName(uint8_t type) { switch (type) { diff --git a/Minecraft.World/Tag.h b/Minecraft.World/Tag.h index dcd067220..c3412c1af 100644 --- a/Minecraft.World/Tag.h +++ b/Minecraft.World/Tag.h @@ -7,18 +7,18 @@ using namespace std; class Tag { public: - static const byte TAG_End = 0; - static const byte TAG_Byte = 1; - static const byte TAG_Short = 2; - static const byte TAG_Int = 3; - static const byte TAG_Long = 4; - static const byte TAG_Float = 5; - static const byte TAG_Double = 6; - static const byte TAG_Byte_Array = 7; - static const byte TAG_String = 8; - static const byte TAG_List = 9; - static const byte TAG_Compound = 10; - static const byte TAG_Int_Array = 11; + static const uint8_t TAG_End = 0; + static const uint8_t TAG_Byte = 1; + static const uint8_t TAG_Short = 2; + static const uint8_t TAG_Int = 3; + static const uint8_t TAG_Long = 4; + static const uint8_t TAG_Float = 5; + static const uint8_t TAG_Double = 6; + static const uint8_t TAG_Byte_Array = 7; + static const uint8_t TAG_String = 8; + static const uint8_t TAG_List = 9; + static const uint8_t TAG_Compound = 10; + static const uint8_t TAG_Int_Array = 11; static const int MAX_DEPTH = 512; private: wstring name; @@ -30,7 +30,7 @@ class Tag virtual void write(DataOutput *dos) = 0; virtual void load(DataInput *dis, int tagDepth) = 0; virtual wstring toString() = 0; - virtual byte getId() = 0; + virtual uint8_t getId() = 0; void print(ostream out); void print(char *prefix, wostream out); wstring getName(); @@ -38,8 +38,8 @@ class Tag static Tag *readNamedTag(DataInput *dis); static Tag *readNamedTag(DataInput *dis, int tagDepth); static void writeNamedTag(Tag *tag, DataOutput *dos); - static Tag *newTag(byte type, const wstring &name); - static wchar_t *getTagName(byte type); + static Tag *newTag(uint8_t type, const wstring &name); + static wchar_t *getTagName(uint8_t type); virtual ~Tag() {} virtual bool equals(Tag *obj); // 4J Brought forward from 1.2 virtual Tag *copy() = 0; // 4J Brought foward from 1.2 diff --git a/Minecraft.World/TamableAnimal.cpp b/Minecraft.World/TamableAnimal.cpp index 2a3ea037f..14b250d1f 100644 --- a/Minecraft.World/TamableAnimal.cpp +++ b/Minecraft.World/TamableAnimal.cpp @@ -19,7 +19,7 @@ TamableAnimal::~TamableAnimal() void TamableAnimal::defineSynchedData() { Animal::defineSynchedData(); - entityData->define(DATA_FLAGS_ID, (byte) 0); + entityData->define(DATA_FLAGS_ID, (uint8_t) 0); entityData->define(DATA_OWNERUUID_ID, L""); } @@ -87,7 +87,7 @@ void TamableAnimal::spawnTamingParticles(bool success) } } -void TamableAnimal::handleEntityEvent(byte id) +void TamableAnimal::handleEntityEvent(uint8_t id) { if (id == EntityEvent::TAMING_SUCCEEDED) { @@ -110,14 +110,14 @@ bool TamableAnimal::isTame() void TamableAnimal::setTame(bool value) { - byte current = entityData->getByte(DATA_FLAGS_ID); + uint8_t current = entityData->getByte(DATA_FLAGS_ID); if (value) { - entityData->set(DATA_FLAGS_ID, (byte) (current | 0x04)); + entityData->set(DATA_FLAGS_ID, (uint8_t) (current | 0x04)); } else { - entityData->set(DATA_FLAGS_ID, (byte) (current & ~0x04)); + entityData->set(DATA_FLAGS_ID, (uint8_t) (current & ~0x04)); } } @@ -128,14 +128,14 @@ bool TamableAnimal::isSitting() void TamableAnimal::setSitting(bool value) { - byte current = entityData->getByte(DATA_FLAGS_ID); + uint8_t current = entityData->getByte(DATA_FLAGS_ID); if (value) { - entityData->set(DATA_FLAGS_ID, (byte) (current | 0x01)); + entityData->set(DATA_FLAGS_ID, (uint8_t) (current | 0x01)); } else { - entityData->set(DATA_FLAGS_ID, (byte) (current & ~0x01)); + entityData->set(DATA_FLAGS_ID, (uint8_t) (current & ~0x01)); } } diff --git a/Minecraft.World/TamableAnimal.h b/Minecraft.World/TamableAnimal.h index 7d17a43c4..85d1b84b9 100644 --- a/Minecraft.World/TamableAnimal.h +++ b/Minecraft.World/TamableAnimal.h @@ -27,7 +27,7 @@ class TamableAnimal : public Animal, public OwnableEntity virtual void spawnTamingParticles(bool success); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); virtual bool isTame(); virtual void setTame(bool value); virtual bool isSitting(); diff --git a/Minecraft.World/TeleportEntityPacket.cpp b/Minecraft.World/TeleportEntityPacket.cpp index d31f5bc2f..45ee75e00 100644 --- a/Minecraft.World/TeleportEntityPacket.cpp +++ b/Minecraft.World/TeleportEntityPacket.cpp @@ -23,11 +23,11 @@ TeleportEntityPacket::TeleportEntityPacket(shared_ptr e) x = Mth::floor(e->x * 32); y = Mth::floor(e->y * 32); z = Mth::floor(e->z * 32); - yRot = (byte) (e->yRot * 256 / 360); - xRot = (byte) (e->xRot * 256 / 360); + yRot = (uint8_t) (e->yRot * 256 / 360); + xRot = (uint8_t) (e->xRot * 256 / 360); } -TeleportEntityPacket::TeleportEntityPacket(int id, int x, int y, int z, byte yRot, byte xRot) +TeleportEntityPacket::TeleportEntityPacket(int id, int x, int y, int z, uint8_t yRot, uint8_t xRot) { this->id = id; this->x = x; diff --git a/Minecraft.World/TeleportEntityPacket.h b/Minecraft.World/TeleportEntityPacket.h index 6fc28732b..8ceca4fa3 100644 --- a/Minecraft.World/TeleportEntityPacket.h +++ b/Minecraft.World/TeleportEntityPacket.h @@ -8,11 +8,11 @@ class TeleportEntityPacket : public Packet, public enable_shared_from_this e); - TeleportEntityPacket(int id, int x, int y, int z, byte yRot, byte xRot); + TeleportEntityPacket(int id, int x, int y, int z, uint8_t yRot, uint8_t xRot); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/TheEndBiome.cpp b/Minecraft.World/TheEndBiome.cpp index 9e2359ed0..fdab05511 100644 --- a/Minecraft.World/TheEndBiome.cpp +++ b/Minecraft.World/TheEndBiome.cpp @@ -14,8 +14,8 @@ TheEndBiome::TheEndBiome(int id) : Biome(id) ambientFriendlies.clear(); enemies.push_back(new MobSpawnerData(eTYPE_ENDERMAN, 10, 4, 4)); - topMaterial = (byte) Tile::dirt_Id; - material = (byte) Tile::dirt_Id; + topMaterial = (uint8_t) Tile::dirt_Id; + material = (uint8_t) Tile::dirt_Id; decorator = new TheEndBiomeDecorator(this); } diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/TheEndLevelRandomLevelSource.cpp index f9f384704..bdeecdb62 100644 --- a/Minecraft.World/TheEndLevelRandomLevelSource.cpp +++ b/Minecraft.World/TheEndLevelRandomLevelSource.cpp @@ -90,7 +90,7 @@ void TheEndLevelRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArra } else { } - blocks[offs] = (byte) tileId; + blocks[offs] = (uint8_t) tileId; offs += step; val += vala; } @@ -119,8 +119,8 @@ void TheEndLevelRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray int runDepth = 1; int run = -1; - byte top = (byte) Tile::endStone_Id; - byte material = (byte) Tile::endStone_Id; + uint8_t top = (uint8_t) Tile::endStone_Id; + uint8_t material = (uint8_t) Tile::endStone_Id; for (int y = Level::genDepthMinusOne; y >= 0; y--) { @@ -139,7 +139,7 @@ void TheEndLevelRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray if (runDepth <= 0) { top = 0; - material = (byte) Tile::endStone_Id; + material = (uint8_t) Tile::endStone_Id; } run = runDepth; @@ -169,7 +169,7 @@ LevelChunk *TheEndLevelRandomLevelSource::getChunk(int xOffs, int zOffs) BiomeArray biomes; // 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed unsigned int blocksSize = Level::genDepth * 16 * 16; - byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE); + uint8_t *tileData = (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/Throwable.cpp b/Minecraft.World/Throwable.cpp index 7d30b898d..c16998b1f 100644 --- a/Minecraft.World/Throwable.cpp +++ b/Minecraft.World/Throwable.cpp @@ -270,9 +270,9 @@ void Throwable::addAdditonalSaveData(CompoundTag *tag) tag->putShort(L"xTile", (short) xTile); tag->putShort(L"yTile", (short) yTile); tag->putShort(L"zTile", (short) zTile); - tag->putByte(L"inTile", (byte) lastTile); - tag->putByte(L"shake", (byte) shakeTime); - tag->putByte(L"inGround", (byte) (inGround ? 1 : 0)); + tag->putByte(L"inTile", (uint8_t) lastTile); + tag->putByte(L"shake", (uint8_t) shakeTime); + tag->putByte(L"inGround", (uint8_t) (inGround ? 1 : 0)); if (ownerName.empty() && (owner != NULL) && owner->instanceof(eTYPE_PLAYER) ) { diff --git a/Minecraft.World/TileEntityDataPacket.cpp b/Minecraft.World/TileEntityDataPacket.cpp index 41be45267..9b92c435c 100644 --- a/Minecraft.World/TileEntityDataPacket.cpp +++ b/Minecraft.World/TileEntityDataPacket.cpp @@ -50,7 +50,7 @@ void TileEntityDataPacket::write(DataOutputStream *dos) dos->writeInt(x); dos->writeShort(y); dos->writeInt(z); - dos->writeByte((byte) type); + dos->writeByte((uint8_t) type); writeNbt(tag, dos); } diff --git a/Minecraft.World/UpdateAttributesPacket.cpp b/Minecraft.World/UpdateAttributesPacket.cpp index e80ebe4ea..7268698d0 100644 --- a/Minecraft.World/UpdateAttributesPacket.cpp +++ b/Minecraft.World/UpdateAttributesPacket.cpp @@ -46,7 +46,7 @@ void UpdateAttributesPacket::read(DataInputStream *dis) { eMODIFIER_ID id = static_cast(dis->readInt()); double amount = dis->readDouble(); - byte operation = dis->readByte(); + uint8_t operation = dis->readByte(); modifiers.insert(new AttributeModifier(id, /*L"Unknown synced attribute modifier",*/ amount, operation)); } diff --git a/Minecraft.World/Villager.cpp b/Minecraft.World/Villager.cpp index f29012913..b200e181b 100644 --- a/Minecraft.World/Villager.cpp +++ b/Minecraft.World/Villager.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include #include "com.mojang.nbt.h" #include "net.minecraft.world.entity.ai.attributes.h" #include "net.minecraft.world.entity.ai.goal.h" @@ -513,7 +514,7 @@ void Villager::addOffers(int addCount) } // shuffle the list to make it more interesting - std::random_shuffle(newOffers->begin(), newOffers->end()); + std::shuffle(newOffers->begin(), newOffers->end(), std::mt19937{std::random_device{}()}); if (offers == NULL) { @@ -685,7 +686,7 @@ int Villager::getPurchaseCost(int itemId, Random *random) return minMax.first + random->nextInt(minMax.second - minMax.first); } -void Villager::handleEntityEvent(byte id) +void Villager::handleEntityEvent(uint8_t id) { if (id == EntityEvent::LOVE_HEARTS) { diff --git a/Minecraft.World/Villager.h b/Minecraft.World/Villager.h index d8aeb15a7..f015c2a2b 100644 --- a/Minecraft.World/Villager.h +++ b/Minecraft.World/Villager.h @@ -87,7 +87,7 @@ class Villager : public AgableMob, public Npc, public Merchant void setLastHurtByMob(shared_ptr mob); void die(DamageSource *source); - void handleEntityEvent(byte id); + void handleEntityEvent(uint8_t id); private: void addParticlesAroundSelf(ePARTICLE_TYPE particle); diff --git a/Minecraft.World/VillagerGolem.cpp b/Minecraft.World/VillagerGolem.cpp index dba80ffa7..0415570b7 100644 --- a/Minecraft.World/VillagerGolem.cpp +++ b/Minecraft.World/VillagerGolem.cpp @@ -53,7 +53,7 @@ VillagerGolem::VillagerGolem(Level *level) : Golem(level) void VillagerGolem::defineSynchedData() { Golem::defineSynchedData(); - entityData->define(DATA_FLAGS_ID, (byte) 0); + entityData->define(DATA_FLAGS_ID, (uint8_t) 0); } bool VillagerGolem::useNewAi() @@ -155,7 +155,7 @@ bool VillagerGolem::doHurtTarget(shared_ptr target) return hurt; } -void VillagerGolem::handleEntityEvent(byte id) +void VillagerGolem::handleEntityEvent(uint8_t id) { if (id == EntityEvent::START_ATTACKING) { @@ -231,14 +231,14 @@ bool VillagerGolem::isPlayerCreated() void VillagerGolem::setPlayerCreated(bool value) { - byte current = entityData->getByte(DATA_FLAGS_ID); + uint8_t current = entityData->getByte(DATA_FLAGS_ID); if (value) { - entityData->set(DATA_FLAGS_ID, (byte) (current | 0x01)); + entityData->set(DATA_FLAGS_ID, (uint8_t) (current | 0x01)); } else { - entityData->set(DATA_FLAGS_ID, (byte) (current & ~0x01)); + entityData->set(DATA_FLAGS_ID, (uint8_t) (current & ~0x01)); } } diff --git a/Minecraft.World/VillagerGolem.h b/Minecraft.World/VillagerGolem.h index 55b6cae2a..3826fb52e 100644 --- a/Minecraft.World/VillagerGolem.h +++ b/Minecraft.World/VillagerGolem.h @@ -41,7 +41,7 @@ class VillagerGolem : public Golem virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); virtual bool doHurtTarget(shared_ptr target); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); virtual shared_ptr getVillage(); virtual int getAttackAnimationTick(); virtual void offerFlower(bool offer); diff --git a/Minecraft.World/Witch.cpp b/Minecraft.World/Witch.cpp index c697d4676..c4e05fde3 100644 --- a/Minecraft.World/Witch.cpp +++ b/Minecraft.World/Witch.cpp @@ -43,7 +43,7 @@ void Witch::defineSynchedData() { Monster::defineSynchedData(); - getEntityData()->define(DATA_USING_ITEM, (byte) 0); + getEntityData()->define(DATA_USING_ITEM, (uint8_t) 0); } int Witch::getAmbientSound() @@ -63,7 +63,7 @@ int Witch::getDeathSound() void Witch::setUsingItem(bool isUsing) { - getEntityData()->set(DATA_USING_ITEM, isUsing ? (byte) 1 : (byte) 0); + getEntityData()->set(DATA_USING_ITEM, isUsing ? (uint8_t) 1 : (uint8_t) 0); } bool Witch::isUsingItem() @@ -153,7 +153,7 @@ void Witch::aiStep() Monster::aiStep(); } -void Witch::handleEntityEvent(byte id) +void Witch::handleEntityEvent(uint8_t id) { if (id == EntityEvent::WITCH_HAT_MAGIC) { diff --git a/Minecraft.World/Witch.h b/Minecraft.World/Witch.h index 256f358f5..856cd6559 100644 --- a/Minecraft.World/Witch.h +++ b/Minecraft.World/Witch.h @@ -37,7 +37,7 @@ class Witch : public Monster, public RangedAttackMob public: virtual bool useNewAi(); virtual void aiStep(); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); protected: virtual float getDamageAfterMagicAbsorb(DamageSource *damageSource, float damage); diff --git a/Minecraft.World/WitherSkull.cpp b/Minecraft.World/WitherSkull.cpp index d67660c40..a7dd6a34c 100644 --- a/Minecraft.World/WitherSkull.cpp +++ b/Minecraft.World/WitherSkull.cpp @@ -111,7 +111,7 @@ bool WitherSkull::hurt(DamageSource *source, float damage) void WitherSkull::defineSynchedData() { - entityData->define(DATA_DANGEROUS, (byte) 0); + entityData->define(DATA_DANGEROUS, (uint8_t) 0); } bool WitherSkull::isDangerous() @@ -121,7 +121,7 @@ bool WitherSkull::isDangerous() void WitherSkull::setDangerous(bool value) { - entityData->set(DATA_DANGEROUS, value ? (byte) 1 : (byte) 0); + entityData->set(DATA_DANGEROUS, value ? (uint8_t) 1 : (uint8_t) 0); } bool WitherSkull::shouldBurn() diff --git a/Minecraft.World/Wolf.cpp b/Minecraft.World/Wolf.cpp index 1988382e1..2d4c5029a 100644 --- a/Minecraft.World/Wolf.cpp +++ b/Minecraft.World/Wolf.cpp @@ -100,8 +100,8 @@ void Wolf::defineSynchedData() { TamableAnimal::defineSynchedData(); entityData->define(DATA_HEALTH_ID, getHealth()); - entityData->define(DATA_INTERESTED_ID, (byte)0); - entityData->define(DATA_COLLAR_COLOR, (byte) ColoredTile::getTileDataForItemAuxValue(DyePowderItem::RED)); + entityData->define(DATA_INTERESTED_ID, (uint8_t)0); + entityData->define(DATA_COLLAR_COLOR, (uint8_t) ColoredTile::getTileDataForItemAuxValue(DyePowderItem::RED)); } void Wolf::playStepSound(int xt, int yt, int zt, int t) @@ -114,7 +114,7 @@ void Wolf::addAdditonalSaveData(CompoundTag *tag) TamableAnimal::addAdditonalSaveData(tag); tag->putBoolean(L"Angry", isAngry()); - tag->putByte(L"CollarColor", (byte) getCollarColor()); + tag->putByte(L"CollarColor", (uint8_t) getCollarColor()); } void Wolf::readAdditionalSaveData(CompoundTag *tag) @@ -438,7 +438,7 @@ bool Wolf::mobInteract(shared_ptr player) return TamableAnimal::mobInteract(player); } -void Wolf::handleEntityEvent(byte id) +void Wolf::handleEntityEvent(uint8_t id) { if (id == EntityEvent::SHAKE_WETNESS) { @@ -485,14 +485,14 @@ bool Wolf::isAngry() void Wolf::setAngry(bool value) { - byte current = entityData->getByte(DATA_FLAGS_ID); + uint8_t current = entityData->getByte(DATA_FLAGS_ID); if (value) { - entityData->set(DATA_FLAGS_ID, (byte) (current | 0x02)); + entityData->set(DATA_FLAGS_ID, (uint8_t) (current | 0x02)); } else { - entityData->set(DATA_FLAGS_ID, (byte) (current & ~0x02)); + entityData->set(DATA_FLAGS_ID, (uint8_t) (current & ~0x02)); } } @@ -503,7 +503,7 @@ int Wolf::getCollarColor() void Wolf::setCollarColor(int color) { - entityData->set(DATA_COLLAR_COLOR, (byte) (color & 0xF)); + entityData->set(DATA_COLLAR_COLOR, (uint8_t) (color & 0xF)); } // 4J-PB added for tooltips @@ -536,11 +536,11 @@ void Wolf::setIsInterested(bool value) { if (value) { - entityData->set(DATA_INTERESTED_ID, (byte) 1); + entityData->set(DATA_INTERESTED_ID, (uint8_t) 1); } else { - entityData->set(DATA_INTERESTED_ID, (byte) 0); + entityData->set(DATA_INTERESTED_ID, (uint8_t) 0); } } diff --git a/Minecraft.World/Wolf.h b/Minecraft.World/Wolf.h index edfd38146..744562f92 100644 --- a/Minecraft.World/Wolf.h +++ b/Minecraft.World/Wolf.h @@ -63,7 +63,7 @@ class Wolf : public TamableAnimal virtual bool doHurtTarget(shared_ptr target); virtual void setTame(bool value); virtual bool mobInteract(shared_ptr player); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); float getTailAngle(); virtual bool isFood(shared_ptr item); virtual int getMaxSpawnClusterSize(); diff --git a/Minecraft.World/Zombie.cpp b/Minecraft.World/Zombie.cpp index e923822c9..c5eb3ac7a 100644 --- a/Minecraft.World/Zombie.cpp +++ b/Minecraft.World/Zombie.cpp @@ -68,9 +68,9 @@ void Zombie::defineSynchedData() { Monster::defineSynchedData(); - getEntityData()->define(DATA_BABY_ID, (byte) 0); - getEntityData()->define(DATA_VILLAGER_ID, (byte) 0); - getEntityData()->define(DATA_CONVERTING_ID, (byte) 0); + getEntityData()->define(DATA_BABY_ID, (uint8_t) 0); + getEntityData()->define(DATA_VILLAGER_ID, (uint8_t) 0); + getEntityData()->define(DATA_CONVERTING_ID, (uint8_t) 0); } int Zombie::getArmorValue() @@ -87,12 +87,12 @@ bool Zombie::useNewAi() bool Zombie::isBaby() { - return getEntityData()->getByte(DATA_BABY_ID) == (byte) 1; + return getEntityData()->getByte(DATA_BABY_ID) == (uint8_t) 1; } void Zombie::setBaby(bool baby) { - getEntityData()->set(DATA_BABY_ID, (byte) (baby ? 1 : 0)); + getEntityData()->set(DATA_BABY_ID, (uint8_t) (baby ? 1 : 0)); updateSize(baby); if (level != NULL && !level->isClientSide) @@ -108,12 +108,12 @@ void Zombie::setBaby(bool baby) bool Zombie::isVillager() { - return getEntityData()->getByte(DATA_VILLAGER_ID) == (byte) 1; + return getEntityData()->getByte(DATA_VILLAGER_ID) == (uint8_t) 1; } void Zombie::setVillager(bool villager) { - getEntityData()->set(DATA_VILLAGER_ID, (byte) (villager ? 1 : 0)); + getEntityData()->set(DATA_VILLAGER_ID, (uint8_t) (villager ? 1 : 0)); } void Zombie::aiStep() @@ -426,7 +426,7 @@ bool Zombie::mobInteract(shared_ptr player) void Zombie::startConverting(int time) { villagerConversionTime = time; - getEntityData()->set(DATA_CONVERTING_ID, (byte) 1); + getEntityData()->set(DATA_CONVERTING_ID, (uint8_t) 1); removeEffect(MobEffect::weakness->id); addEffect(new MobEffectInstance(MobEffect::damageBoost->id, time, min(level->difficulty - 1, 0))); @@ -434,7 +434,7 @@ void Zombie::startConverting(int time) level->broadcastEntityEvent(shared_from_this(), EntityEvent::ZOMBIE_CONVERTING); } -void Zombie::handleEntityEvent(byte id) +void Zombie::handleEntityEvent(uint8_t id) { if (id == EntityEvent::ZOMBIE_CONVERTING) { @@ -453,7 +453,7 @@ bool Zombie::removeWhenFarAway() bool Zombie::isConverting() { - return getEntityData()->getByte(DATA_CONVERTING_ID) == (byte) 1; + return getEntityData()->getByte(DATA_CONVERTING_ID) == (uint8_t) 1; } void Zombie::finishConversion() diff --git a/Minecraft.World/Zombie.h b/Minecraft.World/Zombie.h index f788ea634..b8a909e12 100644 --- a/Minecraft.World/Zombie.h +++ b/Minecraft.World/Zombie.h @@ -87,7 +87,7 @@ class Zombie : public Monster virtual void startConverting(int time); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); protected: virtual bool removeWhenFarAway(); diff --git a/Minecraft.World/compression.cpp b/Minecraft.World/compression.cpp index 99c5228ab..47eed1661 100644 --- a/Minecraft.World/compression.cpp +++ b/Minecraft.World/compression.cpp @@ -64,9 +64,9 @@ HRESULT Compression::CompressLZXRLE(void *pDestination, unsigned int *pDestSize, unsigned char *pucOut = (unsigned char *)rleCompressBuf; // Compress with RLE first: - // 0 - 254 - encodes a single byte + // 0 - 254 - encodes a single uint8_t // 255 followed by 0, 1, 2 - encodes a 1, 2, or 3 255s - // 255 followed by 3-255, followed by a byte - encodes a run of n + 1 bytes + // 255 followed by 3-255, followed by a uint8_t - encodes a run of n + 1 bytes PIXBeginNamedEvent(0,"RLE compression"); do { @@ -123,9 +123,9 @@ HRESULT Compression::CompressRLE(void *pDestination, unsigned int *pDestSize, vo unsigned char *pucOut = (unsigned char *)rleCompressBuf; // Compress with RLE first: - // 0 - 254 - encodes a single byte + // 0 - 254 - encodes a single uint8_t // 255 followed by 0, 1, 2 - encodes a 1, 2, or 3 255s - // 255 followed by 3-255, followed by a byte - encodes a run of n + 1 bytes + // 255 followed by 3-255, followed by a uint8_t - encodes a run of n + 1 bytes PIXBeginNamedEvent(0,"RLE compression"); do { diff --git a/Minecraft.World/x64headers/extraX64.h b/Minecraft.World/x64headers/extraX64.h index dc01f3b3b..91066e54e 100644 --- a/Minecraft.World/x64headers/extraX64.h +++ b/Minecraft.World/x64headers/extraX64.h @@ -11,7 +11,7 @@ #define MULTITHREAD_ENABLE -typedef unsigned char byte; +#include const int XUSER_INDEX_ANY = 255; const int XUSER_INDEX_FOCUS = 254; @@ -332,10 +332,10 @@ class IQNet #define PIXSetMarkerDeprecated(a, b, ...) PIXSetMarker(a, L ## b, __VA_ARGS__) #define PIXAddNamedCounter(a, b) PIXReportCounter( L ## b, a) #else -void PIXAddNamedCounter(int a, char *b, ...); -void PIXBeginNamedEvent(int a, char *b, ...); +void PIXAddNamedCounter(int a, const char *b, ...); +void PIXBeginNamedEvent(int a, const char *b, ...); void PIXEndNamedEvent(); -void PIXSetMarkerDeprecated(int a, char *b, ...); +void PIXSetMarkerDeprecated(int a, const char *b, ...); #endif void XSetThreadProcessor(HANDLE a, int b); @@ -418,7 +418,7 @@ const int QNET_SENDDATA_SEQUENTIAL = 0; struct XRNM_SEND_BUFFER { DWORD dwDataSize; - byte *pbyData; + uint8_t *pbyData; }; const int D3DBLEND_CONSTANTALPHA = 0;