From 15af35eef2892d72cfdecfa538be8f01f58e3908 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Fri, 6 Mar 2026 05:03:37 -0600 Subject: [PATCH] fix: remove `byte` type alias --- .../Common/GameRules/GameRuleManager.cpp | 12 +-- .../Build/Common/GameRules/GameRuleManager.h | 8 +- Minecraft.Client/Build/Extrax64Stubs.cpp | 4 +- Minecraft.Client/Level/ServerLevel.cpp | 2 +- Minecraft.Client/Level/ServerLevel.h | 2 +- .../Network/MultiPlayerChunkCache.cpp | 2 +- Minecraft.Client/Network/PlayerChunkMap.cpp | 2 +- Minecraft.Client/Network/PlayerConnection.cpp | 2 +- Minecraft.Client/Network/PlayerList.cpp | 2 +- Minecraft.Client/Network/ServerChunkCache.cpp | 2 +- .../Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl | 2 +- .../Leaderboards/DurangoStatsDebugger.cpp | 4 +- .../Durango/Network/ChatIntegrationLayer.cpp | 6 +- .../Durango/Network/ChatIntegrationLayer.h | 4 +- .../Network/DQRNetworkManager_SendReceive.cpp | 6 +- .../Durango/Sentient/DynamicConfigurations.h | 2 +- .../Orbis/Sentient/DynamicConfigurations.h | 2 +- .../PS3/Network/SonyRemoteStorage_PS3.cpp | 2 +- .../detail/impl/pipe_select_interrupter.ipp | 2 +- .../detail/impl/socket_select_interrupter.ipp | 2 +- .../PS3/PS3Extras/boost_1_53_0/boost/crc.hpp | 12 +-- .../boost_1_53_0/boost/uuid/sha1.hpp | 2 +- .../PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h | 6 +- .../SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp | 8 +- .../SPU_Tasks/ChunkUpdate/Tesselator_SPU.h | 2 +- .../PS3/Sentient/DynamicConfigurations.h | 2 +- .../Platform/PSVita/PSVitaExtras/zlib.h | 2 +- .../PSVita/Sentient/DynamicConfigurations.h | 2 +- .../Iggy/gdraw/gdraw_d3d1x_shared.inl | 2 +- .../Sentient/DynamicConfigurations.h | 2 +- .../Xbox/Sentient/DynamicConfigurations.cpp | 4 +- .../Xbox/Sentient/DynamicConfigurations.h | 2 +- Minecraft.Client/Player/TrackedEntity.cpp | 4 +- .../EntityRenderers/TileRenderer.cpp | 6 +- Minecraft.Client/Rendering/GameRenderer.cpp | 34 +++---- Minecraft.Client/Rendering/GameRenderer.h | 4 +- Minecraft.Client/Rendering/Tesselator.cpp | 8 +- Minecraft.Client/Rendering/Tesselator.h | 2 +- Minecraft.Client/Textures/Texture.cpp | 72 +++++++-------- Minecraft.Client/Textures/Textures.cpp | 24 ++--- Minecraft.World/Blocks/FallingTile.cpp | 6 +- Minecraft.World/Blocks/RedStoneDustTile.cpp | 6 +- Minecraft.World/Blocks/StemTile.cpp | 6 +- .../TileEntities/BrewingStandTileEntity.cpp | 2 +- .../Blocks/TileEntities/ChestTileEntity.cpp | 2 +- .../TileEntities/DispenserTileEntity.cpp | 2 +- .../Blocks/TileEntities/FurnaceTileEntity.cpp | 2 +- .../Blocks/TileEntities/MusicTileEntity.cpp | 2 +- .../Blocks/TileEntities/MusicTileEntity.h | 2 +- Minecraft.World/Build/System.cpp | 2 +- Minecraft.World/Build/System.h | 2 +- Minecraft.World/Build/x64headers/extraX64.h | 8 +- Minecraft.World/Containers/Inventory.cpp | 4 +- .../Containers/MerchantRecipeList.cpp | 2 +- Minecraft.World/Entities/Entity.cpp | 10 +-- Minecraft.World/Entities/Entity.h | 2 +- Minecraft.World/Entities/HangingEntity.cpp | 10 +-- Minecraft.World/Entities/ItemEntity.cpp | 2 +- Minecraft.World/Entities/Mob.cpp | 2 +- Minecraft.World/Entities/Mob.h | 2 +- Minecraft.World/Entities/Mobs/Arrow.cpp | 20 ++--- Minecraft.World/Entities/Mobs/Blaze.cpp | 4 +- Minecraft.World/Entities/Mobs/Creeper.cpp | 10 +-- Minecraft.World/Entities/Mobs/EnderMan.cpp | 12 +-- .../Entities/Mobs/ExperienceOrb.cpp | 2 +- Minecraft.World/Entities/Mobs/Fireball.cpp | 4 +- Minecraft.World/Entities/Mobs/FishingHook.cpp | 6 +- Minecraft.World/Entities/Mobs/Ghast.cpp | 8 +- Minecraft.World/Entities/Mobs/ItemFrame.cpp | 6 +- Minecraft.World/Entities/Mobs/Minecart.cpp | 8 +- Minecraft.World/Entities/Mobs/Ocelot.cpp | 4 +- Minecraft.World/Entities/Mobs/Pig.cpp | 6 +- Minecraft.World/Entities/Mobs/PrimedTnt.cpp | 2 +- Minecraft.World/Entities/Mobs/Sheep.cpp | 16 ++-- Minecraft.World/Entities/Mobs/Sheep.h | 2 +- Minecraft.World/Entities/Mobs/Slime.cpp | 4 +- Minecraft.World/Entities/Mobs/Spider.cpp | 4 +- Minecraft.World/Entities/Mobs/Villager.cpp | 2 +- Minecraft.World/Entities/Mobs/Villager.h | 2 +- .../Entities/Mobs/VillagerGolem.cpp | 10 +-- Minecraft.World/Entities/Mobs/VillagerGolem.h | 2 +- Minecraft.World/Entities/Mobs/Wolf.cpp | 22 ++--- Minecraft.World/Entities/Mobs/Wolf.h | 2 +- Minecraft.World/Entities/Mobs/Zombie.cpp | 20 ++--- Minecraft.World/Entities/Mobs/Zombie.h | 2 +- Minecraft.World/Entities/SyncedEntityData.cpp | 14 +-- Minecraft.World/Entities/SyncedEntityData.h | 14 +-- Minecraft.World/Entities/TamableAnimal.cpp | 16 ++-- Minecraft.World/Entities/TamableAnimal.h | 2 +- Minecraft.World/Entities/Throwable.cpp | 6 +- .../IO/Files/ConsoleSaveFileConverter.cpp | 2 +- .../IO/Files/ConsoleSaveFileInputStream.cpp | 2 +- .../IO/Files/ConsoleSaveFileOriginal.cpp | 12 +-- .../IO/Files/ConsoleSaveFileOutputStream.cpp | 2 +- .../IO/Files/ConsoleSaveFileSplit.cpp | 10 +-- Minecraft.World/IO/Files/FileInputStream.cpp | 2 +- Minecraft.World/IO/Files/FileOutputStream.cpp | 2 +- Minecraft.World/IO/NBT/ByteArrayTag.h | 2 +- Minecraft.World/IO/NBT/ByteTag.h | 6 +- Minecraft.World/IO/NBT/CompoundTag.h | 12 +-- Minecraft.World/IO/NBT/DoubleTag.h | 2 +- Minecraft.World/IO/NBT/EndTag.h | 2 +- Minecraft.World/IO/NBT/FloatTag.h | 2 +- Minecraft.World/IO/NBT/IntArrayTag.h | 2 +- Minecraft.World/IO/NBT/IntTag.h | 2 +- Minecraft.World/IO/NBT/ListTag.h | 6 +- Minecraft.World/IO/NBT/LongTag.h | 2 +- Minecraft.World/IO/NBT/ShortTag.h | 2 +- Minecraft.World/IO/NBT/StringTag.h | 2 +- Minecraft.World/IO/NBT/Tag.cpp | 8 +- Minecraft.World/IO/NBT/Tag.h | 30 +++---- .../IO/Streams/BufferedOutputStream.cpp | 2 +- .../IO/Streams/ByteArrayOutputStream.cpp | 2 +- Minecraft.World/IO/Streams/ByteBuffer.cpp | 90 +++++++++---------- Minecraft.World/IO/Streams/ByteBuffer.h | 10 +-- Minecraft.World/IO/Streams/DataInput.h | 2 +- .../IO/Streams/DataInputStream.cpp | 8 +- Minecraft.World/IO/Streams/DataInputStream.h | 2 +- Minecraft.World/IO/Streams/DataOutput.h | 2 +- .../IO/Streams/DataOutputStream.cpp | 22 ++--- Minecraft.World/IO/Streams/DataOutputStream.h | 2 +- Minecraft.World/Items/ItemInstance.cpp | 4 +- Minecraft.World/Items/MapItem.cpp | 8 +- Minecraft.World/Level/BlockReplacements.cpp | 2 +- Minecraft.World/Level/CustomLevelSource.cpp | 20 ++--- .../Level/Dimensions/HellDimension.cpp | 6 +- Minecraft.World/Level/EmptyLevelChunk.cpp | 2 +- Minecraft.World/Level/Level.cpp | 2 +- Minecraft.World/Level/Level.h | 2 +- Minecraft.World/Level/LevelChunk.cpp | 10 +-- Minecraft.World/Level/RandomLevelSource.cpp | 20 ++--- Minecraft.World/Level/Storage/DataLayer.cpp | 6 +- .../Level/Storage/DirectoryLevelStorage.cpp | 4 +- .../Level/Storage/DirectoryLevelStorage.h | 4 +- .../Level/Storage/MapItemSavedData.cpp | 36 ++++---- .../Level/Storage/MapItemSavedData.h | 2 +- Minecraft.World/Level/Storage/RegionFile.cpp | 16 ++-- Minecraft.World/Level/Storage/RegionFile.h | 4 +- .../Network/Packets/AddEntityPacket.cpp | 6 +- .../Network/Packets/AddEntityPacket.h | 2 +- .../Network/Packets/AddGlobalEntityPacket.cpp | 2 +- .../Network/Packets/AddMobPacket.cpp | 18 ++-- .../Network/Packets/AddMobPacket.h | 2 +- .../Network/Packets/AddPlayerPacket.cpp | 16 ++-- .../Network/Packets/AddPlayerPacket.h | 2 +- .../Network/Packets/AnimatePacket.cpp | 2 +- .../Network/Packets/AwardStatPacket.cpp | 2 +- .../Packets/ChunkTilesUpdatePacket.cpp | 20 ++--- .../Network/Packets/ChunkTilesUpdatePacket.h | 4 +- .../Network/Packets/ClientCommandPacket.cpp | 2 +- .../Network/Packets/ComplexItemDataPacket.cpp | 2 +- .../Network/Packets/ContainerAckPacket.cpp | 4 +- .../Packets/ContainerButtonClickPacket.cpp | 4 +- .../Network/Packets/ContainerClickPacket.cpp | 4 +- .../Network/Packets/ContainerClosePacket.cpp | 2 +- .../Network/Packets/ContainerOpenPacket.cpp | 12 +-- .../Packets/ContainerSetContentPacket.cpp | 2 +- .../Packets/ContainerSetDataPacket.cpp | 2 +- .../Packets/ContainerSetSlotPacket.cpp | 4 +- .../Packets/EntityActionAtPositionPacket.cpp | 4 +- .../Network/Packets/EntityEventPacket.cpp | 4 +- .../Network/Packets/EntityEventPacket.h | 4 +- .../Network/Packets/ExplodePacket.cpp | 6 +- .../Network/Packets/GameEventPacket.cpp | 4 +- .../Network/Packets/InteractPacket.cpp | 2 +- .../Network/Packets/KickPlayerPacket.cpp | 2 +- .../Network/Packets/LevelEventPacket.cpp | 4 +- .../Network/Packets/LoginPacket.cpp | 10 +-- .../Network/Packets/MoveEntityPacket.cpp | 20 ++--- .../Network/Packets/MoveEntityPacketSmall.cpp | 2 +- .../Network/Packets/PlayerAbilitiesPacket.cpp | 4 +- .../Network/Packets/PreLoginPacket.cpp | 2 +- .../Network/Packets/RemoveMobEffectPacket.cpp | 2 +- .../Network/Packets/ServerAuthDataPacket.h | 2 +- .../Network/Packets/SharedKeyPacket.h | 4 +- .../Network/Packets/SignUpdatePacket.cpp | 4 +- .../Network/Packets/TeleportEntityPacket.cpp | 10 +-- .../Network/Packets/TeleportEntityPacket.h | 4 +- .../Network/Packets/TileEntityDataPacket.cpp | 2 +- Minecraft.World/Network/Socket.cpp | 14 +-- Minecraft.World/Network/Socket.h | 4 +- Minecraft.World/Player/Player.cpp | 12 +-- Minecraft.World/Player/Player.h | 2 +- .../Player/PlayerEnderChestContainer.cpp | 2 +- Minecraft.World/Stats/DurangoStats.cpp | 20 ++--- Minecraft.World/Util/ArrayWithLength.h | 2 +- Minecraft.World/Util/Arrays.h | 4 +- Minecraft.World/Util/Random.cpp | 4 +- Minecraft.World/Util/Random.h | 2 +- .../WorldGen/Biomes/BeachBiome.cpp | 4 +- Minecraft.World/WorldGen/Biomes/Biome.cpp | 4 +- Minecraft.World/WorldGen/Biomes/Biome.h | 4 +- .../WorldGen/Biomes/BiomeSource.cpp | 2 +- .../WorldGen/Biomes/MushroomIslandBiome.cpp | 2 +- .../WorldGen/Biomes/TheEndBiome.cpp | 4 +- .../WorldGen/Features/BasicTreeFeature.cpp | 26 +++--- .../WorldGen/Features/BasicTreeFeature.h | 4 +- .../WorldGen/Features/CanyonFeature.cpp | 6 +- .../WorldGen/Features/DungeonFeature.cpp | 6 +- .../WorldGen/Features/LargeCaveFeature.cpp | 6 +- .../Features/LargeHellCaveFeature.cpp | 2 +- Minecraft.World/WorldGen/Noise/FastNoise.cpp | 6 +- Minecraft.World/WorldGen/Noise/FastNoise.h | 2 +- .../WorldGen/Sources/FlatLevelSource.cpp | 4 +- .../WorldGen/Sources/HellFlatLevelSource.cpp | 16 ++-- .../Sources/HellRandomLevelSource.cpp | 36 ++++---- .../Sources/TheEndLevelRandomLevelSource.cpp | 10 +-- meson.build | 1 - 208 files changed, 700 insertions(+), 701 deletions(-) diff --git a/Minecraft.Client/Build/Common/GameRules/GameRuleManager.cpp b/Minecraft.Client/Build/Common/GameRules/GameRuleManager.cpp index 51364e002..86f2f0851 100644 --- a/Minecraft.Client/Build/Common/GameRules/GameRuleManager.cpp +++ b/Minecraft.Client/Build/Common/GameRules/GameRuleManager.cpp @@ -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(); // = loadGameRules(dData, dSize); //, strings); @@ -126,7 +126,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(); // = loadGameRules(dData, dSize); //, strings); @@ -142,7 +142,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() ); @@ -153,7 +153,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"); @@ -240,7 +240,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) @@ -373,7 +373,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/Build/Common/GameRules/GameRuleManager.h b/Minecraft.Client/Build/Common/GameRules/GameRuleManager.h index 3f446e842..481fc723d 100644 --- a/Minecraft.Client/Build/Common/GameRules/GameRuleManager.h +++ b/Minecraft.Client/Build/Common/GameRules/GameRuleManager.h @@ -40,10 +40,10 @@ public: 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 @@ private: 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/Build/Extrax64Stubs.cpp b/Minecraft.Client/Build/Extrax64Stubs.cpp index 8b8f65724..a4626cb7b 100644 --- a/Minecraft.Client/Build/Extrax64Stubs.cpp +++ b/Minecraft.Client/Build/Extrax64Stubs.cpp @@ -406,8 +406,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/Level/ServerLevel.cpp b/Minecraft.Client/Level/ServerLevel.cpp index 0d6d28808..5a3fa9789 100644 --- a/Minecraft.Client/Level/ServerLevel.cpp +++ b/Minecraft.Client/Level/ServerLevel.cpp @@ -995,7 +995,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/Level/ServerLevel.h b/Minecraft.Client/Level/ServerLevel.h index 3dcd29855..6e2a90b3c 100644 --- a/Minecraft.Client/Level/ServerLevel.h +++ b/Minecraft.Client/Level/ServerLevel.h @@ -98,7 +98,7 @@ protected: 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/Network/MultiPlayerChunkCache.cpp b/Minecraft.Client/Network/MultiPlayerChunkCache.cpp index 23792c04b..93cedcbac 100644 --- a/Minecraft.Client/Network/MultiPlayerChunkCache.cpp +++ b/Minecraft.Client/Network/MultiPlayerChunkCache.cpp @@ -194,7 +194,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/Network/PlayerChunkMap.cpp b/Minecraft.Client/Network/PlayerChunkMap.cpp index 53b77d58f..9849c96bd 100644 --- a/Minecraft.Client/Network/PlayerChunkMap.cpp +++ b/Minecraft.Client/Network/PlayerChunkMap.cpp @@ -342,7 +342,7 @@ 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) ) ); + 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/Network/PlayerConnection.cpp b/Minecraft.Client/Network/PlayerConnection.cpp index 9ea481939..6f696d91c 100644 --- a/Minecraft.Client/Network/PlayerConnection.cpp +++ b/Minecraft.Client/Network/PlayerConnection.cpp @@ -1205,7 +1205,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/Network/PlayerList.cpp b/Minecraft.Client/Network/PlayerList.cpp index c5975fcaf..8f0a52f45 100644 --- a/Minecraft.Client/Network/PlayerList.cpp +++ b/Minecraft.Client/Network/PlayerList.cpp @@ -210,7 +210,7 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr addPlayerToReceiving( player ); 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) getMaxPlayers(), + (uint8_t) level->dimension->id, (uint8_t) level->getMaxBuildHeight(), (uint8_t) getMaxPlayers(), 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/Network/ServerChunkCache.cpp b/Minecraft.Client/Network/ServerChunkCache.cpp index 7df6d5872..7dcfd5ae7 100644 --- a/Minecraft.Client/Network/ServerChunkCache.cpp +++ b/Minecraft.Client/Network/ServerChunkCache.cpp @@ -687,7 +687,7 @@ bool ServerChunkCache::save(bool force, ProgressListener *progressListener) } LevelChunk *chunk = NULL; - 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/Platform/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl b/Minecraft.Client/Platform/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl index 1ab1f13f7..19425d782 100644 --- a/Minecraft.Client/Platform/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl +++ b/Minecraft.Client/Platform/Durango/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -2114,7 +2114,7 @@ static bool alloc_dynbuffer(U32 size) // // 1. filled polygons. these are triangulated simple polygons and thus have // roughly as many triangles as they have vertices. they use either 8- or - // 16-byte vertex formats; this makes a worst case of 6 bytes of indices + // 16-uint8_t vertex formats; this makes a worst case of 6 bytes of indices // for every 8 bytes of vertex data. // 2. strokes and edge antialiasing. they use a 16-byte vertex format and // worst-case write a "double quadstrip" which has 4 triangles for every diff --git a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.cpp b/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.cpp index a9d4294a4..03e37e037 100644 --- a/Minecraft.Client/Platform/Durango/Leaderboards/DurangoStatsDebugger.cpp +++ b/Minecraft.Client/Platform/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/Platform/Durango/Network/ChatIntegrationLayer.cpp b/Minecraft.Client/Platform/Durango/Network/ChatIntegrationLayer.cpp index 87d886abe..598a60459 100644 --- a/Minecraft.Client/Platform/Durango/Network/ChatIntegrationLayer.cpp +++ b/Minecraft.Client/Platform/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. @@ -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/Platform/Durango/Network/ChatIntegrationLayer.h b/Minecraft.Client/Platform/Durango/Network/ChatIntegrationLayer.h index 80b4e10a3..2a852245c 100644 --- a/Minecraft.Client/Platform/Durango/Network/ChatIntegrationLayer.h +++ b/Minecraft.Client/Platform/Durango/Network/ChatIntegrationLayer.h @@ -94,7 +94,7 @@ public: /// A unique ID for the remote console void OnIncomingChatMessage( unsigned int sessionAddress, - Platform::Array^ message + Platform::Array^ message ); /// @@ -217,7 +217,7 @@ public: private: void GetBufferBytes( __in Windows::Storage::Streams::IBuffer^ buffer, __out byte** ppOut ); - Windows::Storage::Streams::IBuffer^ ArrayToBuffer( __in Platform::Array^ array ); + 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/Platform/Durango/Network/DQRNetworkManager_SendReceive.cpp b/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager_SendReceive.cpp index b80bed329..2d99ccafd 100644 --- a/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager_SendReceive.cpp +++ b/Minecraft.Client/Platform/Durango/Network/DQRNetworkManager_SendReceive.cpp @@ -51,7 +51,7 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, do { - BYTE byte = *pNextByte; + BYTE uint8_t = *pNextByte; switch( connectionInfo->m_internalDataState ) { case DQRConnectionInfo::ConnectionState_InternalHeaderByte: @@ -123,7 +123,7 @@ 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; @@ -136,7 +136,7 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, DQRNetworkManager::LogCommentFormat(L"Session index of %d found for player with small id %d - attempting to resolve display name\n",sessionIndex,byte); 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(); diff --git a/Minecraft.Client/Platform/Durango/Sentient/DynamicConfigurations.h b/Minecraft.Client/Platform/Durango/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Platform/Durango/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Platform/Durango/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ private: 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/Platform/Orbis/Sentient/DynamicConfigurations.h b/Minecraft.Client/Platform/Orbis/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Platform/Orbis/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Platform/Orbis/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ private: 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/Platform/PS3/Network/SonyRemoteStorage_PS3.cpp b/Minecraft.Client/Platform/PS3/Network/SonyRemoteStorage_PS3.cpp index d118578d7..d16e8caa1 100644 --- a/Minecraft.Client/Platform/PS3/Network/SonyRemoteStorage_PS3.cpp +++ b/Minecraft.Client/Platform/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/Platform/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/impl/pipe_select_interrupter.ipp b/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/impl/pipe_select_interrupter.ipp index 7b02236e0..5545b7d30 100644 --- a/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/impl/pipe_select_interrupter.ipp +++ b/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/impl/pipe_select_interrupter.ipp @@ -90,7 +90,7 @@ void pipe_select_interrupter::recreate() void pipe_select_interrupter::interrupt() { - char byte = 0; + char uint8_t = 0; signed_size_type result = ::write(write_descriptor_, &byte, 1); (void)result; } diff --git a/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/impl/socket_select_interrupter.ipp b/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/impl/socket_select_interrupter.ipp index 6005f12ea..92a3d94dc 100644 --- a/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/impl/socket_select_interrupter.ipp +++ b/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/impl/socket_select_interrupter.ipp @@ -140,7 +140,7 @@ void socket_select_interrupter::recreate() void socket_select_interrupter::interrupt() { - char byte = 0; + char uint8_t = 0; socket_ops::buf b; socket_ops::init_buf(b, &byte, 1); boost::system::error_code ec; diff --git a/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/crc.hpp b/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/crc.hpp index 6be5aa1d8..61f0a5bd0 100644 --- a/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/crc.hpp +++ b/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/crc.hpp @@ -172,7 +172,7 @@ public: // External Operations void process_bit( bool bit ); void process_bits( unsigned char bits, std::size_t bit_count ); - void process_byte( unsigned char byte ); + void process_byte( unsigned char uint8_t ); void process_block( void const *bytes_begin, void const *bytes_end ); void process_bytes( void const *buffer, std::size_t byte_count ); @@ -223,14 +223,14 @@ public: void reset( value_type new_rem = InitRem ); // External Operations - void process_byte( unsigned char byte ); + void process_byte( unsigned char uint8_t ); void process_block( void const *bytes_begin, void const *bytes_end ); void process_bytes( void const *buffer, std::size_t byte_count ); value_type checksum() const; // Operators - void operator ()( unsigned char byte ); + void operator ()( unsigned char uint8_t ); value_type operator ()() const; private: @@ -777,7 +777,7 @@ crc_basic::process_byte unsigned char byte ) { - process_bits( (rft_in_ ? detail::reflector::reflect(byte) + process_bits( (rft_in_ ? detail::reflector::reflect(uint8_t) : byte), CHAR_BIT ); } @@ -938,7 +938,7 @@ BOOST_CRC_OPTIMAL_NAME::process_byte unsigned char byte ) { - process_bytes( &byte, sizeof(byte) ); + process_bytes( &byte, sizeof(uint8_t) ); } template < std::size_t Bits, BOOST_CRC_PARM_TYPE TruncPoly, @@ -1004,7 +1004,7 @@ BOOST_CRC_OPTIMAL_NAME::operator () unsigned char byte ) { - process_byte( byte ); + process_byte( uint8_t ); } template < std::size_t Bits, BOOST_CRC_PARM_TYPE TruncPoly, diff --git a/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/uuid/sha1.hpp b/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/uuid/sha1.hpp index e695e13b2..b0863ce8b 100644 --- a/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/uuid/sha1.hpp +++ b/Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/uuid/sha1.hpp @@ -88,7 +88,7 @@ inline void sha1::reset() inline void sha1::process_byte(unsigned char byte) { - process_byte_impl(byte); + process_byte_impl(uint8_t); // size_t max value = 0xFFFFFFFF //if (bit_count_low + 8 >= 0x100000000) { // would overflow diff --git a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h index 89cd3739c..b6fa2445e 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h @@ -20,9 +20,9 @@ public: 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/Platform/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp index d442bbf3f..2beca98b9 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp +++ b/Minecraft.Client/Platform/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); } @@ -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/Platform/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h index b0c054e13..96f3148c8 100644 --- a/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h +++ b/Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.h @@ -154,7 +154,7 @@ public: void color(float r, float g, float b, float a); void color(int r, int g, int b); void color(int r, int g, int b, int a); - void color(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/Platform/PS3/Sentient/DynamicConfigurations.h b/Minecraft.Client/Platform/PS3/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Platform/PS3/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Platform/PS3/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ private: 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/Platform/PSVita/PSVitaExtras/zlib.h b/Minecraft.Client/Platform/PSVita/PSVitaExtras/zlib.h index 3e0c7672a..cfa7f5302 100644 --- a/Minecraft.Client/Platform/PSVita/PSVitaExtras/zlib.h +++ b/Minecraft.Client/Platform/PSVita/PSVitaExtras/zlib.h @@ -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 diff --git a/Minecraft.Client/Platform/PSVita/Sentient/DynamicConfigurations.h b/Minecraft.Client/Platform/PSVita/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Platform/PSVita/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Platform/PSVita/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ private: 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/Platform/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl index 1ab1f13f7..19425d782 100644 --- a/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl +++ b/Minecraft.Client/Platform/Windows64/Iggy/gdraw/gdraw_d3d1x_shared.inl @@ -2114,7 +2114,7 @@ static bool alloc_dynbuffer(U32 size) // // 1. filled polygons. these are triangulated simple polygons and thus have // roughly as many triangles as they have vertices. they use either 8- or - // 16-byte vertex formats; this makes a worst case of 6 bytes of indices + // 16-uint8_t vertex formats; this makes a worst case of 6 bytes of indices // for every 8 bytes of vertex data. // 2. strokes and edge antialiasing. they use a 16-byte vertex format and // worst-case write a "double quadstrip" which has 4 triangles for every diff --git a/Minecraft.Client/Platform/Windows64/Sentient/DynamicConfigurations.h b/Minecraft.Client/Platform/Windows64/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Platform/Windows64/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Platform/Windows64/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ private: 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/Platform/Xbox/Sentient/DynamicConfigurations.cpp b/Minecraft.Client/Platform/Xbox/Sentient/DynamicConfigurations.cpp index 0140814d7..bd8343725 100644 --- a/Minecraft.Client/Platform/Xbox/Sentient/DynamicConfigurations.cpp +++ b/Minecraft.Client/Platform/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/Platform/Xbox/Sentient/DynamicConfigurations.h b/Minecraft.Client/Platform/Xbox/Sentient/DynamicConfigurations.h index 61b206eb2..ad2d89c2c 100644 --- a/Minecraft.Client/Platform/Xbox/Sentient/DynamicConfigurations.h +++ b/Minecraft.Client/Platform/Xbox/Sentient/DynamicConfigurations.h @@ -51,7 +51,7 @@ private: 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/Player/TrackedEntity.cpp b/Minecraft.Client/Player/TrackedEntity.cpp index 9fee39acf..9114eec32 100644 --- a/Minecraft.Client/Player/TrackedEntity.cpp +++ b/Minecraft.Client/Player/TrackedEntity.cpp @@ -136,7 +136,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; @@ -262,7 +262,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/Rendering/EntityRenderers/TileRenderer.cpp b/Minecraft.Client/Rendering/EntityRenderers/TileRenderer.cpp index 072227794..64f126fda 100644 --- a/Minecraft.Client/Rendering/EntityRenderers/TileRenderer.cpp +++ b/Minecraft.Client/Rendering/EntityRenderers/TileRenderer.cpp @@ -2598,9 +2598,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/Rendering/GameRenderer.cpp b/Minecraft.Client/Rendering/GameRenderer.cpp index def5b31d6..6dcf16d98 100644 --- a/Minecraft.Client/Rendering/GameRenderer.cpp +++ b/Minecraft.Client/Rendering/GameRenderer.cpp @@ -57,7 +57,7 @@ C4JThread* GameRenderer::m_updateThread; C4JThread::EventArray* GameRenderer::m_updateEvents; bool GameRenderer::nearThingsToDo = false; bool GameRenderer::updateRunning = false; -vector GameRenderer::m_deleteStackByte; +vector GameRenderer::m_deleteStackByte; vector GameRenderer::m_deleteStackSparseLightStorage; vector GameRenderer::m_deleteStackCompressedTileStorage; vector GameRenderer::m_deleteStackSparseDataStorage; @@ -1112,7 +1112,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); @@ -1869,9 +1869,9 @@ void GameRenderer::setupClearColor(float a) { 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;//0.02f; fg = (float)greenComponent/256;//0.02f; @@ -1881,9 +1881,9 @@ void GameRenderer::setupClearColor(float a) { 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; @@ -2025,9 +2025,9 @@ void GameRenderer::setupFog(int i, float alpha) glFogf(GL_FOG_DENSITY, 0.1f); // was 0.06 unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_In_Cloud_Fog_Colour ); - 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;//1.0f; float gg = (float)greenComponent/256;//1.0f; @@ -2057,9 +2057,9 @@ void GameRenderer::setupFog(int i, float alpha) } unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_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.4f; float gg = (float)greenComponent/256;//0.4f; @@ -2082,9 +2082,9 @@ void GameRenderer::setupFog(int i, float alpha) glFogf(GL_FOG_DENSITY, 2.0f); // was 0.06 unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Fog_Colour ); - 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.4f; float gg = (float)greenComponent/256;//0.3f; diff --git a/Minecraft.Client/Rendering/GameRenderer.h b/Minecraft.Client/Rendering/GameRenderer.h index 413d9be01..6e38161ba 100644 --- a/Minecraft.Client/Rendering/GameRenderer.h +++ b/Minecraft.Client/Rendering/GameRenderer.h @@ -156,12 +156,12 @@ public: static bool nearThingsToDo; static bool updateRunning; #endif - static 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/Rendering/Tesselator.cpp b/Minecraft.Client/Rendering/Tesselator.cpp index d16746a23..9122c26c7 100644 --- a/Minecraft.Client/Rendering/Tesselator.cpp +++ b/Minecraft.Client/Rendering/Tesselator.cpp @@ -329,7 +329,7 @@ void Tesselator::color(int r, int g, int b, int a) col = (r << 24) | (g << 16) | (b << 8) | (a); } -void Tesselator::color(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); } @@ -1043,9 +1043,9 @@ void Tesselator::normal(float x, float y, float z) 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/Rendering/Tesselator.h b/Minecraft.Client/Rendering/Tesselator.h index 72a458c22..6c0f30a23 100644 --- a/Minecraft.Client/Rendering/Tesselator.h +++ b/Minecraft.Client/Rendering/Tesselator.h @@ -138,7 +138,7 @@ public: void color(float r, float g, float b, float a); void color(int r, int g, int b); void color(int r, int g, int b, int a); - void color(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/Textures/Texture.cpp b/Minecraft.Client/Textures/Texture.cpp index ce1a85b74..178d44d05 100644 --- a/Minecraft.Client/Textures/Texture.cpp +++ b/Minecraft.Client/Textures/Texture.cpp @@ -269,10 +269,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); @@ -282,31 +282,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]; + byte[] bytes = new uint8_t[width * height * 4]; data.position(0); data.get(bytes); for (int y = height - 1; y >= 0; y--) @@ -335,7 +335,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]; + byte[] bytes = new uint8_t[width * height * 4]; buffer.position(0); buffer.get(bytes); @@ -529,10 +529,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)); } } } @@ -588,10 +588,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); } } @@ -640,10 +640,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); } } } @@ -675,10 +675,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); } } @@ -828,7 +828,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 @@ -847,7 +847,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/Textures/Textures.cpp b/Minecraft.Client/Textures/Textures.cpp index 07af71b56..47ad7c5bb 100644 --- a/Minecraft.Client/Textures/Textures.cpp +++ b/Minecraft.Client/Textures/Textures.cpp @@ -555,15 +555,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 @@ -731,10 +731,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); diff --git a/Minecraft.World/Blocks/FallingTile.cpp b/Minecraft.World/Blocks/FallingTile.cpp index 6e64400f0..87967ede8 100644 --- a/Minecraft.World/Blocks/FallingTile.cpp +++ b/Minecraft.World/Blocks/FallingTile.cpp @@ -181,9 +181,9 @@ void FallingTile::causeFallDamage(float distance) void FallingTile::addAdditonalSaveData(CompoundTag *tag) { - tag->putByte(L"Tile", (byte) tile); - tag->putByte(L"Data", (byte) data); - tag->putByte(L"Time", (byte) time); + tag->putByte(L"Tile", (uint8_t) tile); + 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/Blocks/RedStoneDustTile.cpp b/Minecraft.World/Blocks/RedStoneDustTile.cpp index 94347db44..2ae1efc05 100644 --- a/Minecraft.World/Blocks/RedStoneDustTile.cpp +++ b/Minecraft.World/Blocks/RedStoneDustTile.cpp @@ -353,9 +353,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/Blocks/StemTile.cpp b/Minecraft.World/Blocks/StemTile.cpp index 966e28049..27ef25384 100644 --- a/Minecraft.World/Blocks/StemTile.cpp +++ b/Minecraft.World/Blocks/StemTile.cpp @@ -126,9 +126,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/Blocks/TileEntities/BrewingStandTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/BrewingStandTileEntity.cpp index bc10a33de..60ce155cd 100644 --- a/Minecraft.World/Blocks/TileEntities/BrewingStandTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/BrewingStandTileEntity.cpp @@ -308,7 +308,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/Blocks/TileEntities/ChestTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp index 66879753f..6c60a0f6e 100644 --- a/Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/ChestTileEntity.cpp @@ -121,7 +121,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/Blocks/TileEntities/DispenserTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/DispenserTileEntity.cpp index c6b5e2435..7fce8839b 100644 --- a/Minecraft.World/Blocks/TileEntities/DispenserTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/DispenserTileEntity.cpp @@ -174,7 +174,7 @@ void DispenserTileEntity::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/Blocks/TileEntities/FurnaceTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.cpp index 98cabfa3a..b9be394d4 100644 --- a/Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/FurnaceTileEntity.cpp @@ -129,7 +129,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/Blocks/TileEntities/MusicTileEntity.cpp b/Minecraft.World/Blocks/TileEntities/MusicTileEntity.cpp index 4923540a3..dcd67f1ae 100644 --- a/Minecraft.World/Blocks/TileEntities/MusicTileEntity.cpp +++ b/Minecraft.World/Blocks/TileEntities/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/Blocks/TileEntities/MusicTileEntity.h b/Minecraft.World/Blocks/TileEntities/MusicTileEntity.h index a4941ff11..b5a23be6c 100644 --- a/Minecraft.World/Blocks/TileEntities/MusicTileEntity.h +++ b/Minecraft.World/Blocks/TileEntities/MusicTileEntity.h @@ -10,7 +10,7 @@ public: static TileEntity *create() { return new MusicTileEntity(); } public: - byte note; + uint8_t note; bool on; diff --git a/Minecraft.World/Build/System.cpp b/Minecraft.World/Build/System.cpp index 869817aa7..07fe99bf8 100644 --- a/Minecraft.World/Build/System.cpp +++ b/Minecraft.World/Build/System.cpp @@ -21,7 +21,7 @@ template void System::arraycopy(arrayWithLength src, unsigned int s ArrayCopyFunctionDefinition(Node *) ArrayCopyFunctionDefinition(Biome *) -void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithLength *dst, unsigned int dstPos, unsigned int length) +void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithLength *dst, unsigned int dstPos, unsigned int length) { assert( srcPos >=0 && srcPos <= src.length); assert( srcPos + length <= src.length ); diff --git a/Minecraft.World/Build/System.h b/Minecraft.World/Build/System.h index b75b2de37..9a1909286 100644 --- a/Minecraft.World/Build/System.h +++ b/Minecraft.World/Build/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/Build/x64headers/extraX64.h b/Minecraft.World/Build/x64headers/extraX64.h index 8f6b03b4d..94609ce19 100644 --- a/Minecraft.World/Build/x64headers/extraX64.h +++ b/Minecraft.World/Build/x64headers/extraX64.h @@ -202,7 +202,7 @@ public: bool IsHost(); bool IsGuest(); bool IsLocal(); - PlayerUID GetXuid(); + PlayerUID GetXuid(); LPCWSTR GetGamertag(); int GetSessionIndex(); bool IsTalking(); @@ -383,7 +383,7 @@ typedef struct _XMARKETPLACE_CONTENTOFFER_INFO DWORD dwPointsPrice; } XMARKETPLACE_CONTENTOFFER_INFO, *PXMARKETPLACE_CONTENTOFFER_INFO; -typedef enum +typedef enum { XMARKETPLACE_OFFERING_TYPE_CONTENT = 0x00000002, XMARKETPLACE_OFFERING_TYPE_GAME_DEMO = 0x00000020, @@ -403,7 +403,7 @@ const int QNET_SENDDATA_SEQUENTIAL = 0; struct XRNM_SEND_BUFFER { DWORD dwDataSize; - byte *pbyData; + uint8_t *pbyData; }; const int D3DBLEND_CONSTANTALPHA = 0; @@ -531,7 +531,7 @@ typedef struct { // const int XC_LANGUAGE_POLISH =17; // const int XC_LANGUAGE_TURKISH =18; // const int XC_LANGUAGE_LATINAMERICANSPANISH =19; -// +// // const int XC_LANGUAGE_GREEK =20; // #else // const int XC_LANGUAGE_UKENGLISH =11; diff --git a/Minecraft.World/Containers/Inventory.cpp b/Minecraft.World/Containers/Inventory.cpp index e1c324b18..4b4b9afe5 100644 --- a/Minecraft.World/Containers/Inventory.cpp +++ b/Minecraft.World/Containers/Inventory.cpp @@ -475,7 +475,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); } @@ -485,7 +485,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/Containers/MerchantRecipeList.cpp b/Minecraft.World/Containers/MerchantRecipeList.cpp index 99a1e635e..f07427254 100644 --- a/Minecraft.World/Containers/MerchantRecipeList.cpp +++ b/Minecraft.World/Containers/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/Entities/Entity.cpp b/Minecraft.World/Entities/Entity.cpp index ae2858210..cb8f59e81 100644 --- a/Minecraft.World/Entities/Entity.cpp +++ b/Minecraft.World/Entities/Entity.cpp @@ -340,7 +340,7 @@ Entity::Entity(Level *level, bool useSmallId) // 4J - added useSmallId parameter // resetPos(); setPos(0, 0, 0); - 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. // 4J Stu - We cannot call virtual functions in ctors, as at this point the object @@ -1677,7 +1677,7 @@ void Entity::lerpMotion(double xd, double yd, double zd) this->zd = zd; } -void Entity::handleEntityEvent(byte eventId) +void Entity::handleEntityEvent(uint8_t eventId) { } @@ -1781,14 +1781,14 @@ bool Entity::getSharedFlag(int flag) void Entity::setSharedFlag(int flag, bool value) { - 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/Entities/Entity.h b/Minecraft.World/Entities/Entity.h index c01b1b3a9..941764760 100644 --- a/Minecraft.World/Entities/Entity.h +++ b/Minecraft.World/Entities/Entity.h @@ -303,7 +303,7 @@ public: virtual Vec3 *getLookAngle(); virtual void handleInsidePortal(); virtual void lerpMotion(double xd, double yd, double zd); - virtual void handleEntityEvent(byte eventId); + virtual void handleEntityEvent(uint8_t eventId); virtual void animateHurt(); virtual void prepareCustomTextures(); virtual ItemInstanceArray getEquipmentSlots(); // ItemInstance[] diff --git a/Minecraft.World/Entities/HangingEntity.cpp b/Minecraft.World/Entities/HangingEntity.cpp index e01ecd856..ac1cd79f3 100644 --- a/Minecraft.World/Entities/HangingEntity.cpp +++ b/Minecraft.World/Entities/HangingEntity.cpp @@ -236,7 +236,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); @@ -245,16 +245,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/Entities/ItemEntity.cpp b/Minecraft.World/Entities/ItemEntity.cpp index 8e71cdffa..1beaa260f 100644 --- a/Minecraft.World/Entities/ItemEntity.cpp +++ b/Minecraft.World/Entities/ItemEntity.cpp @@ -202,7 +202,7 @@ bool ItemEntity::hurt(DamageSource *source, int 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/Entities/Mob.cpp b/Minecraft.World/Entities/Mob.cpp index 19c874946..4d16887cf 100644 --- a/Minecraft.World/Entities/Mob.cpp +++ b/Minecraft.World/Entities/Mob.cpp @@ -1591,7 +1591,7 @@ shared_ptr Mob::getArmor(int pos) //return equipment[pos + 1]; } -void Mob::handleEntityEvent(byte id) +void Mob::handleEntityEvent(uint8_t id) { if (id == EntityEvent::HURT) { diff --git a/Minecraft.World/Entities/Mob.h b/Minecraft.World/Entities/Mob.h index cc8f567f7..52a304d55 100644 --- a/Minecraft.World/Entities/Mob.h +++ b/Minecraft.World/Entities/Mob.h @@ -324,7 +324,7 @@ public: virtual int getMaxSpawnClusterSize(); virtual shared_ptr getCarriedItem(); virtual shared_ptr getArmor(int pos); - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); virtual bool isSleeping(); virtual Icon *getItemInHandIcon(shared_ptr item, int layer); virtual bool shouldRender(Vec3 *c); diff --git a/Minecraft.World/Entities/Mobs/Arrow.cpp b/Minecraft.World/Entities/Mobs/Arrow.cpp index 324846d56..b4809a886 100644 --- a/Minecraft.World/Entities/Mobs/Arrow.cpp +++ b/Minecraft.World/Entities/Mobs/Arrow.cpp @@ -116,7 +116,7 @@ Arrow::Arrow(Level *level, shared_ptr mob, float power) : Entity( level ) void Arrow::defineSynchedData() { - entityData->define(ID_FLAGS, (byte) 0); + entityData->define(ID_FLAGS, (uint8_t) 0); } @@ -432,11 +432,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); } @@ -513,19 +513,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/Entities/Mobs/Blaze.cpp b/Minecraft.World/Entities/Mobs/Blaze.cpp index 9926c2d18..84c9aa70c 100644 --- a/Minecraft.World/Entities/Mobs/Blaze.cpp +++ b/Minecraft.World/Entities/Mobs/Blaze.cpp @@ -44,7 +44,7 @@ void Blaze::defineSynchedData() { Monster::defineSynchedData(); - entityData->define(DATA_FLAGS_ID, (byte) 0); + entityData->define(DATA_FLAGS_ID, (uint8_t) 0); } int Blaze::getAmbientSound() @@ -209,7 +209,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/Entities/Mobs/Creeper.cpp b/Minecraft.World/Entities/Mobs/Creeper.cpp index 3b7f656be..899517ce5 100644 --- a/Minecraft.World/Entities/Mobs/Creeper.cpp +++ b/Minecraft.World/Entities/Mobs/Creeper.cpp @@ -63,8 +63,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) @@ -76,7 +76,7 @@ void Creeper::addAdditonalSaveData(CompoundTag *entityTag) 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)); } void Creeper::tick() @@ -159,11 +159,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/Entities/Mobs/EnderMan.cpp b/Minecraft.World/Entities/Mobs/EnderMan.cpp index bd0e6b7eb..1347a9b9d 100644 --- a/Minecraft.World/Entities/Mobs/EnderMan.cpp +++ b/Minecraft.World/Entities/Mobs/EnderMan.cpp @@ -63,9 +63,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) @@ -368,7 +368,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() @@ -378,7 +378,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() @@ -406,5 +406,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)); } diff --git a/Minecraft.World/Entities/Mobs/ExperienceOrb.cpp b/Minecraft.World/Entities/Mobs/ExperienceOrb.cpp index 602140d3b..5bceb80d4 100644 --- a/Minecraft.World/Entities/Mobs/ExperienceOrb.cpp +++ b/Minecraft.World/Entities/Mobs/ExperienceOrb.cpp @@ -175,7 +175,7 @@ bool ExperienceOrb::hurt(DamageSource *source, int 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/Entities/Mobs/Fireball.cpp b/Minecraft.World/Entities/Mobs/Fireball.cpp index 15cd3658d..c85ce000f 100644 --- a/Minecraft.World/Entities/Mobs/Fireball.cpp +++ b/Minecraft.World/Entities/Mobs/Fireball.cpp @@ -320,8 +320,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", this->newDoubleList(3, this->xd, this->yd, this->zd)); } diff --git a/Minecraft.World/Entities/Mobs/FishingHook.cpp b/Minecraft.World/Entities/Mobs/FishingHook.cpp index 514d304c9..c42f59d57 100644 --- a/Minecraft.World/Entities/Mobs/FishingHook.cpp +++ b/Minecraft.World/Entities/Mobs/FishingHook.cpp @@ -381,9 +381,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/Entities/Mobs/Ghast.cpp b/Minecraft.World/Entities/Mobs/Ghast.cpp index 0212d10e3..1bdc76fd4 100644 --- a/Minecraft.World/Entities/Mobs/Ghast.cpp +++ b/Minecraft.World/Entities/Mobs/Ghast.cpp @@ -66,7 +66,7 @@ void Ghast::defineSynchedData() { FlyingMob::defineSynchedData(); - entityData->define(DATA_IS_CHARGING, (byte) 0); + entityData->define(DATA_IS_CHARGING, (uint8_t) 0); } int Ghast::getMaxHealth() @@ -77,7 +77,7 @@ int Ghast::getMaxHealth() void Ghast::tick() { FlyingMob::tick(); - byte current = entityData->getByte(DATA_IS_CHARGING); + uint8_t current = entityData->getByte(DATA_IS_CHARGING); // this->textureName = current == 1 ? L"/mob/ghast_fire.png" : L"/mob/ghast.png"; // 4J replaced with following line this->textureIdx = current == 1 ? TN_MOB_GHAST_FIRE : TN_MOB_GHAST; } @@ -174,8 +174,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/Entities/Mobs/ItemFrame.cpp b/Minecraft.World/Entities/Mobs/ItemFrame.cpp index 954233637..73361dc15 100644 --- a/Minecraft.World/Entities/Mobs/ItemFrame.cpp +++ b/Minecraft.World/Entities/Mobs/ItemFrame.cpp @@ -36,7 +36,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); } void ItemFrame::dropItem() @@ -79,7 +79,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) @@ -87,7 +87,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/Entities/Mobs/Minecart.cpp b/Minecraft.World/Entities/Mobs/Minecart.cpp index 602b63ce9..0b371c89f 100644 --- a/Minecraft.World/Entities/Mobs/Minecart.cpp +++ b/Minecraft.World/Entities/Mobs/Minecart.cpp @@ -128,7 +128,7 @@ bool Minecart::makeStepSound() void Minecart::defineSynchedData() { - entityData->define(DATA_ID_FUEL, (byte) 0); + entityData->define(DATA_ID_FUEL, (uint8_t) 0); entityData->define(DATA_ID_HURT, 0); entityData->define(DATA_ID_HURTDIR, 1); entityData->define(DATA_ID_DAMAGE, 0); @@ -861,7 +861,7 @@ void Minecart::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); } @@ -1158,11 +1158,11 @@ void Minecart::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/Entities/Mobs/Ocelot.cpp b/Minecraft.World/Entities/Mobs/Ocelot.cpp index 4d22e5cda..d1f17c7ef 100644 --- a/Minecraft.World/Entities/Mobs/Ocelot.cpp +++ b/Minecraft.World/Entities/Mobs/Ocelot.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/Entities/Mobs/Pig.cpp b/Minecraft.World/Entities/Mobs/Pig.cpp index 266391bfc..5a1592c5b 100644 --- a/Minecraft.World/Entities/Mobs/Pig.cpp +++ b/Minecraft.World/Entities/Mobs/Pig.cpp @@ -64,7 +64,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) @@ -142,11 +142,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/Entities/Mobs/PrimedTnt.cpp b/Minecraft.World/Entities/Mobs/PrimedTnt.cpp index f5b1c0887..cdfa0501c 100644 --- a/Minecraft.World/Entities/Mobs/PrimedTnt.cpp +++ b/Minecraft.World/Entities/Mobs/PrimedTnt.cpp @@ -101,7 +101,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/Entities/Mobs/Sheep.cpp b/Minecraft.World/Entities/Mobs/Sheep.cpp index a0802507a..5ec0e8668 100644 --- a/Minecraft.World/Entities/Mobs/Sheep.cpp +++ b/Minecraft.World/Entities/Mobs/Sheep.cpp @@ -100,7 +100,7 @@ void Sheep::defineSynchedData() Animal::defineSynchedData(); // sheared and color share a byte - entityData->define(DATA_WOOL_ID, ((byte) 0)); //was new Byte((byte), 0) + 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::cloth_Id; } -void Sheep::handleEntityEvent(byte id) +void Sheep::handleEntityEvent(uint8_t id) { if (id == EntityEvent::EAT_GRASS) { @@ -195,7 +195,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) @@ -227,8 +227,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() @@ -238,14 +238,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/Entities/Mobs/Sheep.h b/Minecraft.World/Entities/Mobs/Sheep.h index 47e2bb298..28369137c 100644 --- a/Minecraft.World/Entities/Mobs/Sheep.h +++ b/Minecraft.World/Entities/Mobs/Sheep.h @@ -52,7 +52,7 @@ public: 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/Entities/Mobs/Slime.cpp b/Minecraft.World/Entities/Mobs/Slime.cpp index 6e07bea16..dec695bba 100644 --- a/Minecraft.World/Entities/Mobs/Slime.cpp +++ b/Minecraft.World/Entities/Mobs/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); Mob::setSize(0.6f * size, 0.6f * size); this->setPos(x, y, z); setHealth(getMaxHealth()); diff --git a/Minecraft.World/Entities/Mobs/Spider.cpp b/Minecraft.World/Entities/Mobs/Spider.cpp index a07bab7a1..c7be776ce 100644 --- a/Minecraft.World/Entities/Mobs/Spider.cpp +++ b/Minecraft.World/Entities/Mobs/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() @@ -179,7 +179,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/Entities/Mobs/Villager.cpp b/Minecraft.World/Entities/Mobs/Villager.cpp index 84e31f7be..32121f24e 100644 --- a/Minecraft.World/Entities/Mobs/Villager.cpp +++ b/Minecraft.World/Entities/Mobs/Villager.cpp @@ -701,7 +701,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/Entities/Mobs/Villager.h b/Minecraft.World/Entities/Mobs/Villager.h index 59d74d72c..75302cd10 100644 --- a/Minecraft.World/Entities/Mobs/Villager.h +++ b/Minecraft.World/Entities/Mobs/Villager.h @@ -86,7 +86,7 @@ public: 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/Entities/Mobs/VillagerGolem.cpp b/Minecraft.World/Entities/Mobs/VillagerGolem.cpp index e6837b33f..e79bbef91 100644 --- a/Minecraft.World/Entities/Mobs/VillagerGolem.cpp +++ b/Minecraft.World/Entities/Mobs/VillagerGolem.cpp @@ -56,7 +56,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() @@ -143,7 +143,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) { @@ -219,14 +219,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/Entities/Mobs/VillagerGolem.h b/Minecraft.World/Entities/Mobs/VillagerGolem.h index dfcd3ac0b..e1662474d 100644 --- a/Minecraft.World/Entities/Mobs/VillagerGolem.h +++ b/Minecraft.World/Entities/Mobs/VillagerGolem.h @@ -44,7 +44,7 @@ public: 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/Entities/Mobs/Wolf.cpp b/Minecraft.World/Entities/Mobs/Wolf.cpp index efbb9f257..7f1841238 100644 --- a/Minecraft.World/Entities/Mobs/Wolf.cpp +++ b/Minecraft.World/Entities/Mobs/Wolf.cpp @@ -91,8 +91,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) ClothTile::getTileDataForItemAuxValue(DyePowderItem::RED)); + entityData->define(DATA_INTERESTED_ID, (uint8_t)0); + entityData->define(DATA_COLLAR_COLOR, (uint8_t) ClothTile::getTileDataForItemAuxValue(DyePowderItem::RED)); } bool Wolf::makeStepSound() @@ -118,7 +118,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) @@ -424,7 +424,7 @@ bool Wolf::interact(shared_ptr player) return TamableAnimal::interact(player); } -void Wolf::handleEntityEvent(byte id) +void Wolf::handleEntityEvent(uint8_t id) { if (id == EntityEvent::SHAKE_WETNESS) { @@ -471,14 +471,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)); } } @@ -489,7 +489,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 @@ -520,15 +520,15 @@ shared_ptr Wolf::getBreedOffspring(shared_ptr target) void Wolf::setIsInterested(bool value) { - //byte current = entityData->getByte(DATA_INTERESTED_ID); + //uint8_t current = entityData->getByte(DATA_INTERESTED_ID); 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/Entities/Mobs/Wolf.h b/Minecraft.World/Entities/Mobs/Wolf.h index 1a3ed9883..a604efb93 100644 --- a/Minecraft.World/Entities/Mobs/Wolf.h +++ b/Minecraft.World/Entities/Mobs/Wolf.h @@ -63,7 +63,7 @@ public: virtual bool hurt(DamageSource *source, int dmg); virtual bool doHurtTarget(shared_ptr target); virtual bool interact(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/Entities/Mobs/Zombie.cpp b/Minecraft.World/Entities/Mobs/Zombie.cpp index a50871342..1c8d7b560 100644 --- a/Minecraft.World/Entities/Mobs/Zombie.cpp +++ b/Minecraft.World/Entities/Mobs/Zombie.cpp @@ -55,9 +55,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); } float Zombie::getWalkingSpeedModifier() @@ -87,23 +87,23 @@ 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) 1); + getEntityData()->set(DATA_BABY_ID, (uint8_t) 1); updateSize(isBaby()); } 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() @@ -292,7 +292,7 @@ bool Zombie::interact(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))); @@ -300,7 +300,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) { @@ -314,7 +314,7 @@ void Zombie::handleEntityEvent(byte id) 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/Entities/Mobs/Zombie.h b/Minecraft.World/Entities/Mobs/Zombie.h index 19aac8229..7a65d5858 100644 --- a/Minecraft.World/Entities/Mobs/Zombie.h +++ b/Minecraft.World/Entities/Mobs/Zombie.h @@ -72,7 +72,7 @@ protected: void startConverting(int time); public: - void handleEntityEvent(byte id); + void handleEntityEvent(uint8_t id); bool isConverting(); protected: diff --git a/Minecraft.World/Entities/SyncedEntityData.cpp b/Minecraft.World/Entities/SyncedEntityData.cpp index 0bb22638e..ac505d727 100644 --- a/Minecraft.World/Entities/SyncedEntityData.cpp +++ b/Minecraft.World/Entities/SyncedEntityData.cpp @@ -24,7 +24,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); @@ -82,7 +82,7 @@ void SynchedEntityData::checkId(int id) #endif } -byte SynchedEntityData::getByte(int id) +uint8_t SynchedEntityData::getByte(int id) { return itemsById[id]->getValue_byte(); } @@ -133,7 +133,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]; @@ -331,7 +331,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; @@ -462,7 +462,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; @@ -496,7 +496,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; } @@ -526,7 +526,7 @@ short SynchedEntityData::DataItem::getValue_short() return value_short; } -byte SynchedEntityData::DataItem::getValue_byte() +uint8_t SynchedEntityData::DataItem::getValue_byte() { return value_byte; } diff --git a/Minecraft.World/Entities/SyncedEntityData.h b/Minecraft.World/Entities/SyncedEntityData.h index e79a10b8f..f561e1568 100644 --- a/Minecraft.World/Entities/SyncedEntityData.h +++ b/Minecraft.World/Entities/SyncedEntityData.h @@ -15,7 +15,7 @@ public: const int id; // 4J - there used to be one "value" type here of general type Object, just storing the different (used) varieties // here separately for us - byte value_byte; + uint8_t value_byte; int value_int; short value_short; wstring value_wstring; @@ -24,19 +24,19 @@ public: 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); DataItem(int type, int id, short value); int getId(); - void setValue(byte value); + void setValue(uint8_t value); void setValue(int value); void setValue(short value); void setValue(const wstring& value); void setValue(shared_ptr value); - byte getValue_byte(); + uint8_t getValue_byte(); int getValue_int(); short getValue_short(); wstring getValue_wstring(); @@ -79,14 +79,14 @@ public: // 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); 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); @@ -94,7 +94,7 @@ public: 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, const wstring& value); diff --git a/Minecraft.World/Entities/TamableAnimal.cpp b/Minecraft.World/Entities/TamableAnimal.cpp index fe7b9aa33..075a9ba9e 100644 --- a/Minecraft.World/Entities/TamableAnimal.cpp +++ b/Minecraft.World/Entities/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""); } @@ -86,7 +86,7 @@ void TamableAnimal::spawnTamingParticles(bool success) } } -void TamableAnimal::handleEntityEvent(byte id) +void TamableAnimal::handleEntityEvent(uint8_t id) { if (id == EntityEvent::TAMING_SUCCEEDED) { @@ -109,14 +109,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)); } } @@ -127,14 +127,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/Entities/TamableAnimal.h b/Minecraft.World/Entities/TamableAnimal.h index bb7976410..8f0330964 100644 --- a/Minecraft.World/Entities/TamableAnimal.h +++ b/Minecraft.World/Entities/TamableAnimal.h @@ -26,7 +26,7 @@ protected: 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/Entities/Throwable.cpp b/Minecraft.World/Entities/Throwable.cpp index 8416ae0ca..111774913 100644 --- a/Minecraft.World/Entities/Throwable.cpp +++ b/Minecraft.World/Entities/Throwable.cpp @@ -260,9 +260,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)); } void Throwable::readAdditionalSaveData(CompoundTag *tag) diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp index 955840e6e..a4096ff4b 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileConverter.cpp @@ -10,7 +10,7 @@ void ConsoleSaveFileConverter::ProcessSimpleFile(ConsoleSaveFile *sourceSave, Fi 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/IO/Files/ConsoleSaveFileInputStream.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp index b0ba75ace..f5600a780 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileInputStream.cpp @@ -25,7 +25,7 @@ ConsoleSaveFileInputStream::ConsoleSaveFileInputStream(ConsoleSaveFile *saveFile //the next byte of data, or -1 if the end of the file is reached. int ConsoleSaveFileInputStream::read() { - byte byteRead = static_cast(0); + uint8_t byteRead = static_cast(0); DWORD numberOfBytesRead; BOOL result = m_saveFile->readFile( diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp index 950475d41..41f6777af 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp @@ -243,7 +243,7 @@ void ConsoleSaveFileOriginal::deleteFile( FileEntry *file ) const int bufferSize = 4096; int amountToRead = bufferSize; - byte buffer[bufferSize]; + uint8_t buffer[bufferSize]; DWORD bufferDataSize = 0; @@ -474,8 +474,8 @@ 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; @@ -666,11 +666,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. @@ -708,7 +708,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/IO/Files/ConsoleSaveFileOutputStream.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp index de1ba12a3..06719685d 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileOutputStream.cpp @@ -38,7 +38,7 @@ void ConsoleSaveFileOutputStream::write(unsigned int b) { DWORD numberOfBytesWritten; - byte value = (byte) b; + uint8_t value = (uint8_t) b; BOOL result = m_saveFile->writeFile( m_file, diff --git a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp index 2bc246ab3..111b741e7 100644 --- a/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp +++ b/Minecraft.World/IO/Files/ConsoleSaveFileSplit.cpp @@ -641,7 +641,7 @@ void ConsoleSaveFileSplit::deleteFile( FileEntry *file ) const int bufferSize = 4096; int amountToRead = bufferSize; - byte buffer[bufferSize]; + uint8_t buffer[bufferSize]; DWORD bufferDataSize = 0; @@ -1044,8 +1044,8 @@ void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesT 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; @@ -1352,7 +1352,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) // 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 ); // If we failed to allocate then compData will be NULL // Pre-calculate the compressed data size so that we can attempt to allocate a smaller buffer @@ -1379,7 +1379,7 @@ void ConsoleSaveFileSplit::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 ); } if(compData != NULL) diff --git a/Minecraft.World/IO/Files/FileInputStream.cpp b/Minecraft.World/IO/Files/FileInputStream.cpp index 59fc3b61a..08d172625 100644 --- a/Minecraft.World/IO/Files/FileInputStream.cpp +++ b/Minecraft.World/IO/Files/FileInputStream.cpp @@ -84,7 +84,7 @@ ssize_t ReadFile(int fd, void* buffer, size_t byteRead, DWORD* numberOfBytesRead //the next byte of data, or -1 if the end of the file is reached. int FileInputStream::read() { - byte byteRead = static_cast(0); + uint8_t byteRead = static_cast(0); DWORD numberOfBytesRead; BOOL bSuccess = ReadFile( diff --git a/Minecraft.World/IO/Files/FileOutputStream.cpp b/Minecraft.World/IO/Files/FileOutputStream.cpp index bea46104c..5b3fe1cd9 100644 --- a/Minecraft.World/IO/Files/FileOutputStream.cpp +++ b/Minecraft.World/IO/Files/FileOutputStream.cpp @@ -74,7 +74,7 @@ FileOutputStream::~FileOutputStream() //b - the byte to be written. void FileOutputStream::write(unsigned int b) { - byte value = (byte) b; + uint8_t value = (uint8_t) b; #if defined(_WIN32) BOOL result = WriteFile( diff --git a/Minecraft.World/IO/NBT/ByteArrayTag.h b/Minecraft.World/IO/NBT/ByteArrayTag.h index f98c992b2..ef962d142 100644 --- a/Minecraft.World/IO/NBT/ByteArrayTag.h +++ b/Minecraft.World/IO/NBT/ByteArrayTag.h @@ -25,7 +25,7 @@ public: dis->readFully(data); } - byte getId() { return TAG_Byte_Array; } + uint8_t getId() { return TAG_Byte_Array; } wstring toString() { diff --git a/Minecraft.World/IO/NBT/ByteTag.h b/Minecraft.World/IO/NBT/ByteTag.h index 0d2b39657..a2274a6be 100644 --- a/Minecraft.World/IO/NBT/ByteTag.h +++ b/Minecraft.World/IO/NBT/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) { 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/IO/NBT/CompoundTag.h b/Minecraft.World/IO/NBT/CompoundTag.h index e03ac2e83..e4e67ce18 100644 --- a/Minecraft.World/IO/NBT/CompoundTag.h +++ b/Minecraft.World/IO/NBT/CompoundTag.h @@ -55,7 +55,7 @@ public: return ret; } - byte getId() + uint8_t getId() { return TAG_Compound; } @@ -65,7 +65,7 @@ public: tags[name] = tag->setName(wstring( name )); } - void putByte(const wchar_t * name, byte value) + void putByte(const wchar_t * name, uint8_t value) { tags[name] = (new ByteTag(name,value)); } @@ -117,7 +117,7 @@ public: void putBoolean(const wchar_t * string, bool val) { - putByte(string, val?static_cast(1):static_cast(0)); + putByte(string, val?static_cast(1):static_cast(0)); } Tag *get(const wchar_t *name) @@ -132,9 +132,9 @@ public: return tags.find(name) != tags.end(); } - byte getByte(const wchar_t * name) + uint8_t getByte(const wchar_t * 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; } @@ -200,7 +200,7 @@ public: bool getBoolean(const wchar_t *string) { - return getByte(string) != static_cast(0); + return getByte(string) != static_cast(0); } void remove(const wstring &name) diff --git a/Minecraft.World/IO/NBT/DoubleTag.h b/Minecraft.World/IO/NBT/DoubleTag.h index 38f75880b..6a2104798 100644 --- a/Minecraft.World/IO/NBT/DoubleTag.h +++ b/Minecraft.World/IO/NBT/DoubleTag.h @@ -12,7 +12,7 @@ public: void write(DataOutput *dos) { dos->writeDouble(data); } void load(DataInput *dis) { 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/IO/NBT/EndTag.h b/Minecraft.World/IO/NBT/EndTag.h index 684ee6ce1..6ff27d535 100644 --- a/Minecraft.World/IO/NBT/EndTag.h +++ b/Minecraft.World/IO/NBT/EndTag.h @@ -10,7 +10,7 @@ public: void load(DataInput *dis) {}; 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/IO/NBT/FloatTag.h b/Minecraft.World/IO/NBT/FloatTag.h index 30055f512..60698bcaa 100644 --- a/Minecraft.World/IO/NBT/FloatTag.h +++ b/Minecraft.World/IO/NBT/FloatTag.h @@ -12,7 +12,7 @@ public: void write(DataOutput *dos) { dos->writeFloat(data); } void load(DataInput *dis) { 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/IO/NBT/IntArrayTag.h b/Minecraft.World/IO/NBT/IntArrayTag.h index 63d592763..1e7f60502 100644 --- a/Minecraft.World/IO/NBT/IntArrayTag.h +++ b/Minecraft.World/IO/NBT/IntArrayTag.h @@ -38,7 +38,7 @@ public: } } - byte getId() { return TAG_Int_Array; } + uint8_t getId() { return TAG_Int_Array; } wstring toString() { diff --git a/Minecraft.World/IO/NBT/IntTag.h b/Minecraft.World/IO/NBT/IntTag.h index f4d308188..6694f2e0a 100644 --- a/Minecraft.World/IO/NBT/IntTag.h +++ b/Minecraft.World/IO/NBT/IntTag.h @@ -11,7 +11,7 @@ public: void write(DataOutput *dos) { dos->writeInt(data); } void load(DataInput *dis) { 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/IO/NBT/ListTag.h b/Minecraft.World/IO/NBT/ListTag.h index ce65e87f7..fd077328d 100644 --- a/Minecraft.World/IO/NBT/ListTag.h +++ b/Minecraft.World/IO/NBT/ListTag.h @@ -6,7 +6,7 @@ template class ListTag : public Tag { private: vector list; - byte type; + uint8_t type; public: ListTag() : Tag(L"") {} @@ -15,7 +15,7 @@ public: void write(DataOutput *dos) { if (list.size() > 0) type = (list[0])->getId(); - else type = static_cast(1); + else type = static_cast(1); dos->writeByte(type); dos->writeInt((int)list.size()); @@ -38,7 +38,7 @@ public: } } - byte getId() { return TAG_List; } + uint8_t getId() { return TAG_List; } wstring toString() { diff --git a/Minecraft.World/IO/NBT/LongTag.h b/Minecraft.World/IO/NBT/LongTag.h index 2dcd38198..a5bc079fc 100644 --- a/Minecraft.World/IO/NBT/LongTag.h +++ b/Minecraft.World/IO/NBT/LongTag.h @@ -11,7 +11,7 @@ public: void write(DataOutput *dos) { dos->writeLong(data); } void load(DataInput *dis) { 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/IO/NBT/ShortTag.h b/Minecraft.World/IO/NBT/ShortTag.h index bfd7511bd..285a287b4 100644 --- a/Minecraft.World/IO/NBT/ShortTag.h +++ b/Minecraft.World/IO/NBT/ShortTag.h @@ -11,7 +11,7 @@ public: void write(DataOutput *dos) { dos->writeShort(data); } void load(DataInput *dis) { 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/IO/NBT/StringTag.h b/Minecraft.World/IO/NBT/StringTag.h index badd53e6f..a1dad58f5 100644 --- a/Minecraft.World/IO/NBT/StringTag.h +++ b/Minecraft.World/IO/NBT/StringTag.h @@ -18,7 +18,7 @@ public: data = dis->readUTF(); } - byte getId() { return TAG_String; } + uint8_t getId() { return TAG_String; } wstring toString() { diff --git a/Minecraft.World/IO/NBT/Tag.cpp b/Minecraft.World/IO/NBT/Tag.cpp index 94f9e7c73..a09a9958f 100644 --- a/Minecraft.World/IO/NBT/Tag.cpp +++ b/Minecraft.World/IO/NBT/Tag.cpp @@ -79,7 +79,7 @@ Tag *Tag::setName(const wstring& name) Tag *Tag::readNamedTag(DataInput *dis) { - byte type = dis->readByte(); + uint8_t type = dis->readByte(); if ( static_cast(type) == 0) return new EndTag(); // 4J Stu - readByte can return -1, so if it's that then also mark as the end tag @@ -96,7 +96,7 @@ Tag *Tag::readNamedTag(DataInput *dis) Tag *tag = newTag(type, name); // short length = dis.readShort(); - // byte[] bytes = new byte[length]; + // byte[] bytes = new uint8_t[length]; // dis.readFully(bytes); tag->load(dis); @@ -116,7 +116,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) { @@ -148,7 +148,7 @@ Tag *Tag::newTag(byte type, const wstring &name) return NULL; } -const wchar_t *Tag::getTagName(byte type) +const wchar_t *Tag::getTagName(uint8_t type) { switch (type) { diff --git a/Minecraft.World/IO/NBT/Tag.h b/Minecraft.World/IO/NBT/Tag.h index 77197c2e8..a2e0b2af6 100644 --- a/Minecraft.World/IO/NBT/Tag.h +++ b/Minecraft.World/IO/NBT/Tag.h @@ -7,18 +7,18 @@ using namespace std; class Tag { public: - static const byte TAG_End = static_cast(0); - static const byte TAG_Byte = static_cast(1); - static const byte TAG_Short = static_cast(2); - static const byte TAG_Int = static_cast(3); - static const byte TAG_Long = static_cast(4); - static const byte TAG_Float = static_cast(5); - static const byte TAG_Double = static_cast(6); - static const byte TAG_Byte_Array = static_cast(7); - static const byte TAG_String = static_cast(8); - static const byte TAG_List = static_cast(9); - static const byte TAG_Compound = static_cast(10); - static const byte TAG_Int_Array = static_cast(11); + static const uint8_t TAG_End = static_cast(0); + static const uint8_t TAG_Byte = static_cast(1); + static const uint8_t TAG_Short = static_cast(2); + static const uint8_t TAG_Int = static_cast(3); + static const uint8_t TAG_Long = static_cast(4); + static const uint8_t TAG_Float = static_cast(5); + static const uint8_t TAG_Double = static_cast(6); + static const uint8_t TAG_Byte_Array = static_cast(7); + static const uint8_t TAG_String = static_cast(8); + static const uint8_t TAG_List = static_cast(9); + static const uint8_t TAG_Compound = static_cast(10); + static const uint8_t TAG_Int_Array = static_cast(11); private: wstring name; @@ -30,15 +30,15 @@ public: virtual void write(DataOutput *dos) = 0; virtual void load(DataInput *dis) = 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(); Tag *setName(const wstring& name); static Tag *readNamedTag(DataInput *dis); static void writeNamedTag(Tag *tag, DataOutput *dos); - static Tag *newTag(byte type, const wstring &name); - static const wchar_t *getTagName(byte type); + static Tag *newTag(uint8_t type, const wstring &name); + static const 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/IO/Streams/BufferedOutputStream.cpp b/Minecraft.World/IO/Streams/BufferedOutputStream.cpp index 0677a7d25..7c9ba0dcd 100644 --- a/Minecraft.World/IO/Streams/BufferedOutputStream.cpp +++ b/Minecraft.World/IO/Streams/BufferedOutputStream.cpp @@ -79,7 +79,7 @@ void BufferedOutputStream::write(byteArray b) //b - the byte 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/IO/Streams/ByteArrayOutputStream.cpp b/Minecraft.World/IO/Streams/ByteArrayOutputStream.cpp index 4161b7613..ef46f8977 100644 --- a/Minecraft.World/IO/Streams/ByteArrayOutputStream.cpp +++ b/Minecraft.World/IO/Streams/ByteArrayOutputStream.cpp @@ -33,7 +33,7 @@ void ByteArrayOutputStream::write(unsigned int b) if( count + 1 >= buf.length ) buf.resize( buf.length * 2 ); - buf[count] = (byte) b; + buf[count] = (uint8_t) b; count++; } diff --git a/Minecraft.World/IO/Streams/ByteBuffer.cpp b/Minecraft.World/IO/Streams/ByteBuffer.cpp index 722dce8fc..0e747113b 100644 --- a/Minecraft.World/IO/Streams/ByteBuffer.cpp +++ b/Minecraft.World/IO/Streams/ByteBuffer.cpp @@ -7,8 +7,8 @@ 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; } @@ -25,7 +25,7 @@ ByteBuffer *ByteBuffer::allocateDirect(int capacity) } -ByteBuffer::ByteBuffer( unsigned int capacity, byte *backingArray ) : Buffer( capacity ) +ByteBuffer::ByteBuffer( unsigned int capacity, uint8_t *backingArray ) : Buffer( capacity ) { hasBackingArray = true; buffer = backingArray; @@ -38,7 +38,7 @@ ByteBuffer::~ByteBuffer() } //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 +//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. // @@ -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; } @@ -104,7 +104,7 @@ int ByteBuffer::getSize() //The byte at the given index //Throws: //IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit -byte ByteBuffer::get(int index) +uint8_t ByteBuffer::get(int index) { assert( index < m_limit ); assert( index >= 0 ); @@ -253,7 +253,7 @@ void ByteBuffer::getShortArray(shortArray &s) //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 ); @@ -277,17 +277,17 @@ ByteBuffer *ByteBuffer::putInt(int value) if( byteOrder == BIGENDIAN ) { - buffer[m_position] = static_cast((value >> 24) & 0xFF); - buffer[m_position+1] = static_cast((value >> 16) & 0xFF); - buffer[m_position+2] = static_cast((value >> 8) & 0xFF); - buffer[m_position+3] = static_cast(value & 0xFF); + buffer[m_position] = static_cast((value >> 24) & 0xFF); + buffer[m_position+1] = static_cast((value >> 16) & 0xFF); + buffer[m_position+2] = static_cast((value >> 8) & 0xFF); + buffer[m_position+3] = static_cast(value & 0xFF); } else if( byteOrder == LITTLEENDIAN ) { - buffer[m_position] = static_cast(value & 0xFF); - buffer[m_position+1] = static_cast((value >> 8) & 0xFF); - buffer[m_position+2] = static_cast((value >> 16) & 0xFF); - buffer[m_position+3] = static_cast((value >> 24) & 0xFF); + buffer[m_position] = static_cast(value & 0xFF); + buffer[m_position+1] = static_cast((value >> 8) & 0xFF); + buffer[m_position+2] = static_cast((value >> 16) & 0xFF); + buffer[m_position+3] = static_cast((value >> 24) & 0xFF); } m_position += 4; @@ -309,17 +309,17 @@ ByteBuffer *ByteBuffer::putInt(unsigned int index, int value) if( byteOrder == BIGENDIAN ) { - buffer[index] = static_cast((value >> 24) & 0xFF); - buffer[index+1] = static_cast((value >> 16) & 0xFF); - buffer[index+2] = static_cast((value >> 8) & 0xFF); - buffer[index+3] = static_cast(value & 0xFF); + buffer[index] = static_cast((value >> 24) & 0xFF); + buffer[index+1] = static_cast((value >> 16) & 0xFF); + buffer[index+2] = static_cast((value >> 8) & 0xFF); + buffer[index+3] = static_cast(value & 0xFF); } else if( byteOrder == LITTLEENDIAN ) { - buffer[index] = static_cast(value & 0xFF); - buffer[index+1] = static_cast((value >> 8) & 0xFF); - buffer[index+2] = static_cast((value >> 16) & 0xFF); - buffer[index+3] = static_cast((value >> 24) & 0xFF); + buffer[index] = static_cast(value & 0xFF); + buffer[index+1] = static_cast((value >> 8) & 0xFF); + buffer[index+2] = static_cast((value >> 16) & 0xFF); + buffer[index+3] = static_cast((value >> 24) & 0xFF); } return this; @@ -339,13 +339,13 @@ ByteBuffer *ByteBuffer::putShort(short value) if( byteOrder == BIGENDIAN ) { - buffer[m_position] = static_cast((value >> 8) & 0xFF); - buffer[m_position+1] = static_cast(value & 0xFF); + buffer[m_position] = static_cast((value >> 8) & 0xFF); + buffer[m_position+1] = static_cast(value & 0xFF); } else if( byteOrder == LITTLEENDIAN ) { - buffer[m_position] = static_cast(value & 0xFF); - buffer[m_position+1] = static_cast((value >> 8) & 0xFF); + buffer[m_position] = static_cast(value & 0xFF); + buffer[m_position+1] = static_cast((value >> 8) & 0xFF); } m_position += 2; @@ -379,25 +379,25 @@ ByteBuffer *ByteBuffer::putLong(__int64 value) if( byteOrder == BIGENDIAN ) { - buffer[m_position] = static_cast((value >> 56) & 0xFF); - buffer[m_position+1] = static_cast((value >> 48) & 0xFF); - buffer[m_position+2] = static_cast((value >> 40) & 0xFF); - buffer[m_position+3] = static_cast((value >> 32) & 0xFF); - buffer[m_position+4] = static_cast((value >> 24) & 0xFF); - buffer[m_position+5] = static_cast((value >> 16) & 0xFF); - buffer[m_position+6] = static_cast((value >> 8) & 0xFF); - buffer[m_position+7] = static_cast(value & 0xFF); + buffer[m_position] = static_cast((value >> 56) & 0xFF); + buffer[m_position+1] = static_cast((value >> 48) & 0xFF); + buffer[m_position+2] = static_cast((value >> 40) & 0xFF); + buffer[m_position+3] = static_cast((value >> 32) & 0xFF); + buffer[m_position+4] = static_cast((value >> 24) & 0xFF); + buffer[m_position+5] = static_cast((value >> 16) & 0xFF); + buffer[m_position+6] = static_cast((value >> 8) & 0xFF); + buffer[m_position+7] = static_cast(value & 0xFF); } else if( byteOrder == LITTLEENDIAN ) { - buffer[m_position] = static_cast((value & 0xFF)); - buffer[m_position+1] = static_cast((value >> 8) & 0xFF); - buffer[m_position+2] = static_cast((value >> 16) & 0xFF); - buffer[m_position+3] = static_cast((value >> 24) & 0xFF); - buffer[m_position+4] = static_cast((value >> 32) & 0xFF); - buffer[m_position+5] = static_cast((value >> 40) & 0xFF); - buffer[m_position+6] = static_cast((value >> 48) & 0xFF); - buffer[m_position+7] = static_cast((value >> 56) & 0xFF); + buffer[m_position] = static_cast((value & 0xFF)); + buffer[m_position+1] = static_cast((value >> 8) & 0xFF); + buffer[m_position+2] = static_cast((value >> 16) & 0xFF); + buffer[m_position+3] = static_cast((value >> 24) & 0xFF); + buffer[m_position+4] = static_cast((value >> 32) & 0xFF); + buffer[m_position+5] = static_cast((value >> 40) & 0xFF); + buffer[m_position+6] = static_cast((value >> 48) & 0xFF); + buffer[m_position+7] = static_cast((value >> 56) & 0xFF); } return this; @@ -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/IO/Streams/ByteBuffer.h b/Minecraft.World/IO/Streams/ByteBuffer.h index e87531b2f..11af68494 100644 --- a/Minecraft.World/IO/Streams/ByteBuffer.h +++ b/Minecraft.World/IO/Streams/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 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/IO/Streams/DataInput.h b/Minecraft.World/IO/Streams/DataInput.h index 258b2717e..2b2e341c0 100644 --- a/Minecraft.World/IO/Streams/DataInput.h +++ b/Minecraft.World/IO/Streams/DataInput.h @@ -7,7 +7,7 @@ public: 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/IO/Streams/DataInputStream.cpp b/Minecraft.World/IO/Streams/DataInputStream.cpp index 1d7c47e21..06387124d 100644 --- a/Minecraft.World/IO/Streams/DataInputStream.cpp +++ b/Minecraft.World/IO/Streams/DataInputStream.cpp @@ -60,7 +60,7 @@ int DataInputStream::read(byteArray b) //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 no uint8_t 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. // //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, //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], @@ -115,14 +115,14 @@ bool DataInputStream::readBoolean() //This method is suitable for reading the byte written by the writeByte method of interface DataOutput. //Returns: //the 8-bit value read. -byte DataInputStream::readByte() +uint8_t DataInputStream::readByte() { if (stream == NULL) { app.DebugPrintf("DataInputStream::readByte() but underlying stream is NULL\n"); return 0; } - return (byte) stream->read(); + return (uint8_t) stream->read(); } unsigned char DataInputStream::readUnsignedByte() @@ -183,7 +183,7 @@ bool DataInputStream::readFully(byteArray b) } else { - b[i] = static_cast(byteRead); + b[i] = static_cast(byteRead); } } return true; diff --git a/Minecraft.World/IO/Streams/DataInputStream.h b/Minecraft.World/IO/Streams/DataInputStream.h index f69d490a9..a70b16907 100644 --- a/Minecraft.World/IO/Streams/DataInputStream.h +++ b/Minecraft.World/IO/Streams/DataInputStream.h @@ -16,7 +16,7 @@ public: 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 wchar_t readChar(); virtual bool readFully(byteArray b); diff --git a/Minecraft.World/IO/Streams/DataOutput.h b/Minecraft.World/IO/Streams/DataOutput.h index 648be6df2..9df3dd957 100644 --- a/Minecraft.World/IO/Streams/DataOutput.h +++ b/Minecraft.World/IO/Streams/DataOutput.h @@ -6,7 +6,7 @@ public: 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/IO/Streams/DataOutputStream.cpp b/Minecraft.World/IO/Streams/DataOutputStream.cpp index 92a48a90b..41feda0be 100644 --- a/Minecraft.World/IO/Streams/DataOutputStream.cpp +++ b/Minecraft.World/IO/Streams/DataOutputStream.cpp @@ -66,7 +66,7 @@ void DataOutputStream::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. //Parameters: //v - a byte value to be written. -void DataOutputStream::writeByte(byte a) +void DataOutputStream::writeByte(uint8_t a) { stream->write( static_cast(a) ); } @@ -170,7 +170,7 @@ void DataOutputStream::writeChars(const wstring& str) } //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. +//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. @@ -219,15 +219,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++) @@ -235,19 +235,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/IO/Streams/DataOutputStream.h b/Minecraft.World/IO/Streams/DataOutputStream.h index 01be83095..dcb81cd6d 100644 --- a/Minecraft.World/IO/Streams/DataOutputStream.h +++ b/Minecraft.World/IO/Streams/DataOutputStream.h @@ -22,7 +22,7 @@ public: 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/Items/ItemInstance.cpp b/Minecraft.World/Items/ItemInstance.cpp index 68c60f130..30710f60b 100644 --- a/Minecraft.World/Items/ItemInstance.cpp +++ b/Minecraft.World/Items/ItemInstance.cpp @@ -139,7 +139,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 (this->tag != NULL) compoundTag->put(L"tag", tag->copy()); return compoundTag; @@ -622,7 +622,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/Items/MapItem.cpp b/Minecraft.World/Items/MapItem.cpp index 5f990893c..293398aee 100644 --- a/Minecraft.World/Items/MapItem.cpp +++ b/Minecraft.World/Items/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(); @@ -243,8 +243,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; @@ -331,7 +331,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/Level/BlockReplacements.cpp b/Minecraft.World/Level/BlockReplacements.cpp index 6963070d7..b33f6c04d 100644 --- a/Minecraft.World/Level/BlockReplacements.cpp +++ b/Minecraft.World/Level/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/Level/CustomLevelSource.cpp b/Minecraft.World/Level/CustomLevelSource.cpp index d8082880d..01aebc2f1 100644 --- a/Minecraft.World/Level/CustomLevelSource.cpp +++ b/Minecraft.World/Level/CustomLevelSource.cpp @@ -202,11 +202,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::rock_Id; + tileId = (uint8_t) Tile::rock_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 @@ -264,8 +264,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) @@ -288,7 +288,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 { @@ -305,7 +305,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (runDepth <= 0) { top = 0; - material = (byte) Tile::rock_Id; + material = (uint8_t) Tile::rock_Id; } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { @@ -319,8 +319,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; @@ -337,7 +337,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; } } } @@ -366,7 +366,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/Level/Dimensions/HellDimension.cpp b/Minecraft.World/Level/Dimensions/HellDimension.cpp index 2979a3199..d981b7f72 100644 --- a/Minecraft.World/Level/Dimensions/HellDimension.cpp +++ b/Minecraft.World/Level/Dimensions/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/Level/EmptyLevelChunk.cpp b/Minecraft.World/Level/EmptyLevelChunk.cpp index f2be2dab7..a11f45944 100644 --- a/Minecraft.World/Level/EmptyLevelChunk.cpp +++ b/Minecraft.World/Level/EmptyLevelChunk.cpp @@ -184,7 +184,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/Level/Level.cpp b/Minecraft.World/Level/Level.cpp index 590f76410..2ce4784c5 100644 --- a/Minecraft.World/Level/Level.cpp +++ b/Minecraft.World/Level/Level.cpp @@ -4425,7 +4425,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/Level.h b/Minecraft.World/Level/Level.h index 74e20ca45..05bea294a 100644 --- a/Minecraft.World/Level/Level.h +++ b/Minecraft.World/Level/Level.h @@ -458,7 +458,7 @@ public: 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/Level/LevelChunk.cpp b/Minecraft.World/Level/LevelChunk.cpp index 003a4e574..2edd40883 100644 --- a/Minecraft.World/Level/LevelChunk.cpp +++ b/Minecraft.World/Level/LevelChunk.cpp @@ -525,7 +525,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; } @@ -581,7 +581,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 (!level->dimension->hasCeiling) @@ -803,7 +803,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) { @@ -910,7 +910,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; @@ -1984,7 +1984,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) { diff --git a/Minecraft.World/Level/RandomLevelSource.cpp b/Minecraft.World/Level/RandomLevelSource.cpp index 442f18372..75d8c4377 100644 --- a/Minecraft.World/Level/RandomLevelSource.cpp +++ b/Minecraft.World/Level/RandomLevelSource.cpp @@ -200,11 +200,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::rock_Id; + tileId = (uint8_t) Tile::rock_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 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) @@ -282,7 +282,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 { @@ -299,7 +299,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi if (runDepth <= 0) { top = 0; - material = (byte) Tile::rock_Id; + material = (uint8_t) Tile::rock_Id; } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { @@ -313,8 +313,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; @@ -331,7 +331,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; } } } @@ -355,7 +355,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/Level/Storage/DataLayer.cpp b/Minecraft.World/Level/Storage/DataLayer.cpp index 2502acc2e..8ddad32d1 100644 --- a/Minecraft.World/Level/Storage/DataLayer.cpp +++ b/Minecraft.World/Level/Storage/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/Level/Storage/DirectoryLevelStorage.cpp b/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp index f974f0c03..e617c5b7e 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp +++ b/Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp @@ -19,7 +19,7 @@ _MapDataMappings::_MapDataMappings() #ifndef _DURANGO ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA); #endif - ZeroMemory(dimensions,sizeof(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/Level/Storage/DirectoryLevelStorage.h b/Minecraft.World/Level/Storage/DirectoryLevelStorage.h index 839dd953d..d59c28f27 100644 --- a/Minecraft.World/Level/Storage/DirectoryLevelStorage.h +++ b/Minecraft.World/Level/Storage/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/Level/Storage/MapItemSavedData.cpp b/Minecraft.World/Level/Storage/MapItemSavedData.cpp index 99d21f5e3..c173f2e5c 100644 --- a/Minecraft.World/Level/Storage/MapItemSavedData.cpp +++ b/Minecraft.World/Level/Storage/MapItemSavedData.cpp @@ -302,10 +302,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)); @@ -339,10 +339,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)); @@ -373,10 +373,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)); @@ -432,10 +432,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 @@ -546,8 +546,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/Level/Storage/MapItemSavedData.h b/Minecraft.World/Level/Storage/MapItemSavedData.h index 701f187f7..c8dd457ae 100644 --- a/Minecraft.World/Level/Storage/MapItemSavedData.h +++ b/Minecraft.World/Level/Storage/MapItemSavedData.h @@ -50,7 +50,7 @@ public: public: int x, z; char dimension; - byte scale; + uint8_t scale; byteArray colors; int step; vector > carriedBy; diff --git a/Minecraft.World/Level/Storage/RegionFile.cpp b/Minecraft.World/Level/Storage/RegionFile.cpp index a7add024f..1ca23099c 100644 --- a/Minecraft.World/Level/Storage/RegionFile.cpp +++ b/Minecraft.World/Level/Storage/RegionFile.cpp @@ -57,10 +57,10 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) //if ((GetFileSize(file,NULL) & 0xfff) != 0) if ((fileEntry->getFileSize() & 0xfff) != 0) { - //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 */ @@ -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,7 +403,7 @@ 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); @@ -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/Level/Storage/RegionFile.h b/Minecraft.World/Level/Storage/RegionFile.h index 7acf058c1..5718b7d17 100644 --- a/Minecraft.World/Level/Storage/RegionFile.h +++ b/Minecraft.World/Level/Storage/RegionFile.h @@ -71,11 +71,11 @@ public: /* 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/Network/Packets/AddEntityPacket.cpp b/Minecraft.World/Network/Packets/AddEntityPacket.cpp index d226a8c6e..b42180161 100644 --- a/Minecraft.World/Network/Packets/AddEntityPacket.cpp +++ b/Minecraft.World/Network/Packets/AddEntityPacket.cpp @@ -16,8 +16,8 @@ void AddEntityPacket::_init(shared_ptr e, int type, int data, int xp, in x = xp;//(int) floor(e->x * 32); y = yp;//(int) floor(e->y * 32); z = zp;//(int) floor(e->z * 32); - yRot = static_cast(yRotp); - xRot = static_cast(xRotp); + yRot = static_cast(yRotp); + xRot = static_cast(xRotp); this->type = type; this->data = data; if (data > -1) // 4J - changed "no data" value to be -1, we can have a valid entity id of 0 @@ -79,7 +79,7 @@ void AddEntityPacket::read(DataInputStream *dis) // throws IOException TODO 4J void AddEntityPacket::write(DataOutputStream *dos) // throws IOException TODO 4J JEV add throws statement { dos->writeShort(id); - dos->writeByte(static_cast(type)); + dos->writeByte(static_cast(type)); #ifdef _LARGE_WORLDS dos->writeInt(x); dos->writeInt(y); diff --git a/Minecraft.World/Network/Packets/AddEntityPacket.h b/Minecraft.World/Network/Packets/AddEntityPacket.h index 5ac7286c8..edbfa379a 100644 --- a/Minecraft.World/Network/Packets/AddEntityPacket.h +++ b/Minecraft.World/Network/Packets/AddEntityPacket.h @@ -37,7 +37,7 @@ public: int xa, ya, za; int type; int data; - byte yRot,xRot; // 4J added + uint8_t yRot,xRot; // 4J added private: void _init(shared_ptr e, int type, int data, int xp, int yp, int zp, int yRotp, int xRotp ); diff --git a/Minecraft.World/Network/Packets/AddGlobalEntityPacket.cpp b/Minecraft.World/Network/Packets/AddGlobalEntityPacket.cpp index 93caedc91..c23e9e5a4 100644 --- a/Minecraft.World/Network/Packets/AddGlobalEntityPacket.cpp +++ b/Minecraft.World/Network/Packets/AddGlobalEntityPacket.cpp @@ -48,7 +48,7 @@ void AddGlobalEntityPacket::read(DataInputStream *dis) // throws IOException void AddGlobalEntityPacket::write(DataOutputStream *dos) // throws IOException { dos->writeInt(id); - dos->writeByte(static_cast(type)); + dos->writeByte(static_cast(type)); dos->writeInt(x); dos->writeInt(y); dos->writeInt(z); diff --git a/Minecraft.World/Network/Packets/AddMobPacket.cpp b/Minecraft.World/Network/Packets/AddMobPacket.cpp index 84dc0f816..959c2a655 100644 --- a/Minecraft.World/Network/Packets/AddMobPacket.cpp +++ b/Minecraft.World/Network/Packets/AddMobPacket.cpp @@ -14,8 +14,8 @@ AddMobPacket::AddMobPacket() x = 0; y = 0; z = 0; - yRot = static_cast(0); - xRot = static_cast(0); + yRot = static_cast(0); + xRot = static_cast(0); entityData = nullptr; unpack = NULL; } @@ -36,12 +36,12 @@ AddMobPacket::AddMobPacket(shared_ptr mob, int yRotp, int xRotp, int xp, in y = yp;//Mth::floor(mob->y * 32); z = zp;//Mth::floor(mob->z * 32); // 4J - changed - send current "previously sent" value of rotations to put this in sync with other clients - yRot = static_cast(yRotp); - xRot = static_cast(xRotp); - yHeadRot = static_cast(yHeadRotp); - // yRot = (byte) (mob->yRot * 256 / 360); - // xRot = (byte) (mob->xRot * 256 / 360); - // yHeadRot = (byte) (mob->yHeadRot * 256 / 360); + yRot = static_cast(yRotp); + xRot = static_cast(xRotp); + yHeadRot = static_cast(yHeadRotp); + // 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; @@ -91,7 +91,7 @@ void AddMobPacket::read(DataInputStream *dis) //throws IOException void AddMobPacket::write(DataOutputStream *dos) //throws IOException { dos->writeShort(id); - dos->writeByte(static_cast(type & 0xff)); + dos->writeByte(static_cast(type & 0xff)); #ifdef _LARGE_WORLDS dos->writeInt(x); dos->writeInt(y); diff --git a/Minecraft.World/Network/Packets/AddMobPacket.h b/Minecraft.World/Network/Packets/AddMobPacket.h index 4ee5506b0..1254d763e 100644 --- a/Minecraft.World/Network/Packets/AddMobPacket.h +++ b/Minecraft.World/Network/Packets/AddMobPacket.h @@ -13,7 +13,7 @@ public: 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/Network/Packets/AddPlayerPacket.cpp b/Minecraft.World/Network/Packets/AddPlayerPacket.cpp index c48088751..8d01e077a 100644 --- a/Minecraft.World/Network/Packets/AddPlayerPacket.cpp +++ b/Minecraft.World/Network/Packets/AddPlayerPacket.cpp @@ -44,9 +44,9 @@ AddPlayerPacket::AddPlayerPacket(shared_ptr player, PlayerUID xuid, Play // 4J - changed - send current "previously sent" value of rotations to put this in sync with other clients yRot = yRotp; xRot = xRotp; - yHeadRot = static_cast(yHeadRotp); // 4J Added - // yRot = (byte) (player->yRot * 256 / 360); - // xRot = (byte) (player->xRot * 256 / 360); + yHeadRot = static_cast(yHeadRotp); // 4J Added + // 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); @@ -96,13 +96,13 @@ void AddPlayerPacket::write(DataOutputStream *dos) //throws IOException dos->writeInt(x); dos->writeInt(y); dos->writeInt(z); - dos->writeByte(static_cast(yRot)); - dos->writeByte(static_cast(xRot)); - dos->writeByte(static_cast(m_playerIndex)); // 4J Added + dos->writeByte(static_cast(yRot)); + dos->writeByte(static_cast(xRot)); + dos->writeByte(static_cast(m_playerIndex)); // 4J Added dos->writeShort(carriedItem); dos->writePlayerUID(xuid); dos->writePlayerUID(OnlineXuid); - dos->writeByte(static_cast(m_playerIndex)); // 4J Added + dos->writeByte(static_cast(m_playerIndex)); // 4J Added dos->writeInt(m_skinId); dos->writeInt(m_capeId); dos->writeInt(m_uiGamePrivileges); @@ -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/Network/Packets/AddPlayerPacket.h b/Minecraft.World/Network/Packets/AddPlayerPacket.h index 1762bd7cf..0c8e915e1 100644 --- a/Minecraft.World/Network/Packets/AddPlayerPacket.h +++ b/Minecraft.World/Network/Packets/AddPlayerPacket.h @@ -25,7 +25,7 @@ public: DWORD m_skinId; // 4J Added DWORD m_capeId; // 4J Added unsigned int m_uiGamePrivileges; // 4J Added - byte yHeadRot; // 4J Added + uint8_t yHeadRot; // 4J Added AddPlayerPacket(); ~AddPlayerPacket(); diff --git a/Minecraft.World/Network/Packets/AnimatePacket.cpp b/Minecraft.World/Network/Packets/AnimatePacket.cpp index b27c17248..70b38b9d0 100644 --- a/Minecraft.World/Network/Packets/AnimatePacket.cpp +++ b/Minecraft.World/Network/Packets/AnimatePacket.cpp @@ -28,7 +28,7 @@ void AnimatePacket::read(DataInputStream *dis) //throws IOException void AnimatePacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(id); - dos->writeByte(static_cast(action)); + dos->writeByte(static_cast(action)); } void AnimatePacket::handle(PacketListener *listener) diff --git a/Minecraft.World/Network/Packets/AwardStatPacket.cpp b/Minecraft.World/Network/Packets/AwardStatPacket.cpp index 076bdce5c..e13a33c7f 100644 --- a/Minecraft.World/Network/Packets/AwardStatPacket.cpp +++ b/Minecraft.World/Network/Packets/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/Network/Packets/ChunkTilesUpdatePacket.cpp b/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.cpp index aecbf356a..fca1e6be7 100644 --- a/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.cpp +++ b/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.cpp @@ -21,10 +21,10 @@ ChunkTilesUpdatePacket::ChunkTilesUpdatePacket() shouldDelay = true; xc = 0; zc = 0; - count = (byte)0; + count = (uint8_t)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; @@ -35,15 +35,15 @@ ChunkTilesUpdatePacket::ChunkTilesUpdatePacket(int xc, int zc, shortArray positi this->blocks = byteArray((unsigned int)count); this->data = byteArray((unsigned int)count); LevelChunk *levelChunk = level->getChunk(xc, zc); - for (int i = 0; (byte)i < count; i++) + for (int i = 0; (uint8_t)i < count; i++) { int x = (positions[i] >> 12) & 15; int z = (positions[i] >> 8) & 15; 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 ) ); } @@ -66,14 +66,14 @@ void ChunkTilesUpdatePacket::read(DataInputStream *dis) //throws IOException int countAndFlags = (int)dis->readByte(); bool dataAllZero = (( countAndFlags & 0x80 ) == 0x80 ); levelIdx = ( countAndFlags >> 5 ) & 3; - count = (byte)countAndFlags & (byte)0x1f; + count = (uint8_t)countAndFlags & (uint8_t)0x1f; positions = shortArray((short int)count); blocks = byteArray((unsigned int)count); data = byteArray((unsigned int)count); int currentBlockType = -1; - for( int i = 0; (byte)i < count; i++ ) + for( int i = 0; (uint8_t)i < count; i++ ) { int xzAndFlag = dis->readShort(); int y = (int)dis->readByte(); @@ -82,14 +82,14 @@ void ChunkTilesUpdatePacket::read(DataInputStream *dis) //throws IOException { currentBlockType = dis->read(); } - blocks[i] = (byte)currentBlockType; + blocks[i] = (uint8_t)currentBlockType; if( !dataAllZero) { - data[i] = (byte)dis->read(); + data[i] = (uint8_t)dis->read(); } else { - data[i] = (byte)0; + data[i] = (uint8_t)0; } } } diff --git a/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.h b/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.h index a97f49a39..67fa10a43 100644 --- a/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.h +++ b/Minecraft.World/Network/Packets/ChunkTilesUpdatePacket.h @@ -12,12 +12,12 @@ public: shortArray positions; byteArray blocks; byteArray data; - byte count; // 4J Was int but never has a value higher than 10 + uint8_t count; // 4J Was int but never has a value higher than 10 int levelIdx; ChunkTilesUpdatePacket(); ~ChunkTilesUpdatePacket(); - ChunkTilesUpdatePacket(int xc, int zc, shortArray positions, byte count, Level *level); + ChunkTilesUpdatePacket(int xc, int zc, shortArray positions, uint8_t count, Level *level); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/Network/Packets/ClientCommandPacket.cpp b/Minecraft.World/Network/Packets/ClientCommandPacket.cpp index fd774a8ea..bb88a6c4f 100644 --- a/Minecraft.World/Network/Packets/ClientCommandPacket.cpp +++ b/Minecraft.World/Network/Packets/ClientCommandPacket.cpp @@ -19,7 +19,7 @@ void ClientCommandPacket::read(DataInputStream *dis) void ClientCommandPacket::write(DataOutputStream *dos) { - dos->writeByte((byte)action & (byte)0xff); + dos->writeByte((uint8_t)action & (uint8_t)0xff); } void ClientCommandPacket::handle(PacketListener *listener) diff --git a/Minecraft.World/Network/Packets/ComplexItemDataPacket.cpp b/Minecraft.World/Network/Packets/ComplexItemDataPacket.cpp index d4199b895..b5a6d4d1d 100644 --- a/Minecraft.World/Network/Packets/ComplexItemDataPacket.cpp +++ b/Minecraft.World/Network/Packets/ComplexItemDataPacket.cpp @@ -42,7 +42,7 @@ void ComplexItemDataPacket::write(DataOutputStream *dos) //throws IOException dos->writeShort(itemId); dos->writeShort(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/Network/Packets/ContainerAckPacket.cpp b/Minecraft.World/Network/Packets/ContainerAckPacket.cpp index a51e4e30e..abb335450 100644 --- a/Minecraft.World/Network/Packets/ContainerAckPacket.cpp +++ b/Minecraft.World/Network/Packets/ContainerAckPacket.cpp @@ -34,9 +34,9 @@ void ContainerAckPacket::read(DataInputStream *dis) //throws IOException void ContainerAckPacket::write(DataOutputStream *dos) //throws IOException { - dos->writeByte((byte)containerId); + dos->writeByte((uint8_t)containerId); dos->writeShort(uid); - dos->writeByte((byte)(accepted ? 1 : 0)); + dos->writeByte((uint8_t)(accepted ? 1 : 0)); } int ContainerAckPacket::getEstimatedSize() diff --git a/Minecraft.World/Network/Packets/ContainerButtonClickPacket.cpp b/Minecraft.World/Network/Packets/ContainerButtonClickPacket.cpp index d795c71d9..d0c25691f 100644 --- a/Minecraft.World/Network/Packets/ContainerButtonClickPacket.cpp +++ b/Minecraft.World/Network/Packets/ContainerButtonClickPacket.cpp @@ -30,8 +30,8 @@ void ContainerButtonClickPacket::read(DataInputStream *dis) void ContainerButtonClickPacket::write(DataOutputStream *dos) { - dos->writeByte((byte)containerId); - dos->writeByte((byte)buttonId); + dos->writeByte((uint8_t)containerId); + dos->writeByte((uint8_t)buttonId); } int ContainerButtonClickPacket::getEstimatedSize() diff --git a/Minecraft.World/Network/Packets/ContainerClickPacket.cpp b/Minecraft.World/Network/Packets/ContainerClickPacket.cpp index c374bb699..3694dfe0b 100644 --- a/Minecraft.World/Network/Packets/ContainerClickPacket.cpp +++ b/Minecraft.World/Network/Packets/ContainerClickPacket.cpp @@ -50,9 +50,9 @@ void ContainerClickPacket::read(DataInputStream *dis) //throws IOException void ContainerClickPacket::write(DataOutputStream *dos) // throws IOException { - dos->writeByte((byte)containerId); + dos->writeByte((uint8_t)containerId); dos->writeShort(slotNum); - dos->writeByte((byte)buttonNum); + dos->writeByte((uint8_t)buttonNum); dos->writeShort(uid); dos->writeBoolean(quickKey); diff --git a/Minecraft.World/Network/Packets/ContainerClosePacket.cpp b/Minecraft.World/Network/Packets/ContainerClosePacket.cpp index 8943926cb..8961e6ee1 100644 --- a/Minecraft.World/Network/Packets/ContainerClosePacket.cpp +++ b/Minecraft.World/Network/Packets/ContainerClosePacket.cpp @@ -28,7 +28,7 @@ void ContainerClosePacket::read(DataInputStream *dis) //throws IOException void ContainerClosePacket::write(DataOutputStream *dos) //throws IOException { - dos->writeByte((byte)containerId); + dos->writeByte((uint8_t)containerId); } int ContainerClosePacket::getEstimatedSize() diff --git a/Minecraft.World/Network/Packets/ContainerOpenPacket.cpp b/Minecraft.World/Network/Packets/ContainerOpenPacket.cpp index 0492eeb11..28feaca2e 100644 --- a/Minecraft.World/Network/Packets/ContainerOpenPacket.cpp +++ b/Minecraft.World/Network/Packets/ContainerOpenPacket.cpp @@ -28,18 +28,18 @@ void ContainerOpenPacket::handle(PacketListener *listener) void ContainerOpenPacket::read(DataInputStream *dis) //throws IOException { - containerId = (int)(dis->readByte() & (byte)0xff); - type = (int)(dis->readByte() & (byte)0xff); + containerId = (int)(dis->readByte() & (uint8_t)0xff); + type = (int)(dis->readByte() & (uint8_t)0xff); title = dis->readShort(); - size = (int)(dis->readByte() & (byte)0xff); + size = (int)(dis->readByte() & (uint8_t)0xff); } void ContainerOpenPacket::write(DataOutputStream *dos) //throws IOException { - dos->writeByte((byte)containerId & (byte)0xff); - dos->writeByte((byte)type & (byte)0xff); + dos->writeByte((uint8_t)containerId & (uint8_t)0xff); + dos->writeByte((uint8_t)type & (uint8_t)0xff); dos->writeShort(title & 0xffff); - dos->writeByte((byte)size & (byte)0xff); + dos->writeByte((uint8_t)size & (uint8_t)0xff); } int ContainerOpenPacket::getEstimatedSize() diff --git a/Minecraft.World/Network/Packets/ContainerSetContentPacket.cpp b/Minecraft.World/Network/Packets/ContainerSetContentPacket.cpp index 5c20ddd94..cb20090a0 100644 --- a/Minecraft.World/Network/Packets/ContainerSetContentPacket.cpp +++ b/Minecraft.World/Network/Packets/ContainerSetContentPacket.cpp @@ -41,7 +41,7 @@ void ContainerSetContentPacket::read(DataInputStream *dis) //throws IOException void ContainerSetContentPacket::write(DataOutputStream *dos) //throws IOException { - dos->writeByte((byte)containerId); + dos->writeByte((uint8_t)containerId); dos->writeShort(items.length); for (unsigned int i = 0; i < items.length; i++) { diff --git a/Minecraft.World/Network/Packets/ContainerSetDataPacket.cpp b/Minecraft.World/Network/Packets/ContainerSetDataPacket.cpp index 62fa5c34d..14e63c864 100644 --- a/Minecraft.World/Network/Packets/ContainerSetDataPacket.cpp +++ b/Minecraft.World/Network/Packets/ContainerSetDataPacket.cpp @@ -34,7 +34,7 @@ void ContainerSetDataPacket::read(DataInputStream *dis) //throws IOException void ContainerSetDataPacket::write(DataOutputStream *dos) // throws IOException { - dos->writeByte((byte)containerId); + dos->writeByte((uint8_t)containerId); dos->writeShort(id); dos->writeShort(value); } diff --git a/Minecraft.World/Network/Packets/ContainerSetSlotPacket.cpp b/Minecraft.World/Network/Packets/ContainerSetSlotPacket.cpp index 568d70dc4..33a042f84 100644 --- a/Minecraft.World/Network/Packets/ContainerSetSlotPacket.cpp +++ b/Minecraft.World/Network/Packets/ContainerSetSlotPacket.cpp @@ -34,7 +34,7 @@ void ContainerSetSlotPacket::read(DataInputStream *dis) //throws IOException { // 4J Stu - TU-1 hotfix // Fix for #13142 - Holding down the A button on the furnace ingredient slot causes the UI to display incorrect item counts - byte byteId = dis->readByte(); + uint8_t byteId = dis->readByte(); containerId = *(char *)&byteId; slot = dis->readShort(); item = readItem(dis); @@ -42,7 +42,7 @@ void ContainerSetSlotPacket::read(DataInputStream *dis) //throws IOException void ContainerSetSlotPacket::write(DataOutputStream *dos) //throws IOException { - dos->writeByte((byte)containerId); + dos->writeByte((uint8_t)containerId); dos->writeShort(slot); writeItem(item, dos); } diff --git a/Minecraft.World/Network/Packets/EntityActionAtPositionPacket.cpp b/Minecraft.World/Network/Packets/EntityActionAtPositionPacket.cpp index c4a3abccc..9140d1933 100644 --- a/Minecraft.World/Network/Packets/EntityActionAtPositionPacket.cpp +++ b/Minecraft.World/Network/Packets/EntityActionAtPositionPacket.cpp @@ -39,9 +39,9 @@ void EntityActionAtPositionPacket::read(DataInputStream *dis) //throws IOExcepti void EntityActionAtPositionPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(id); - dos->writeByte((byte)action); + dos->writeByte((uint8_t)action); dos->writeInt(x); - dos->writeByte((byte)y); + dos->writeByte((uint8_t)y); dos->writeInt(z); } diff --git a/Minecraft.World/Network/Packets/EntityEventPacket.cpp b/Minecraft.World/Network/Packets/EntityEventPacket.cpp index eff244567..928422faf 100644 --- a/Minecraft.World/Network/Packets/EntityEventPacket.cpp +++ b/Minecraft.World/Network/Packets/EntityEventPacket.cpp @@ -9,10 +9,10 @@ EntityEventPacket::EntityEventPacket() { entityId = 0; - eventId = (byte)0; + eventId = (uint8_t)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/Network/Packets/EntityEventPacket.h b/Minecraft.World/Network/Packets/EntityEventPacket.h index a151dbdb4..716be4e4f 100644 --- a/Minecraft.World/Network/Packets/EntityEventPacket.h +++ b/Minecraft.World/Network/Packets/EntityEventPacket.h @@ -7,10 +7,10 @@ class EntityEventPacket : public Packet, public enable_shared_from_thiswriteByte((byte)xx); - dos->writeByte((byte)yy); - dos->writeByte((byte)zz); + dos->writeByte((uint8_t)xx); + dos->writeByte((uint8_t)yy); + dos->writeByte((uint8_t)zz); } } diff --git a/Minecraft.World/Network/Packets/GameEventPacket.cpp b/Minecraft.World/Network/Packets/GameEventPacket.cpp index 86304941e..bb3f62879 100644 --- a/Minecraft.World/Network/Packets/GameEventPacket.cpp +++ b/Minecraft.World/Network/Packets/GameEventPacket.cpp @@ -43,8 +43,8 @@ void GameEventPacket::read(DataInputStream *dis) //throws IOException void GameEventPacket::write(DataOutputStream *dos) //throws IOException { - dos->writeByte((byte)_event); - dos->writeByte((byte)param); + dos->writeByte((uint8_t)_event); + dos->writeByte((uint8_t)param); } void GameEventPacket::handle(PacketListener *listener) diff --git a/Minecraft.World/Network/Packets/InteractPacket.cpp b/Minecraft.World/Network/Packets/InteractPacket.cpp index 85d75bf01..117011d14 100644 --- a/Minecraft.World/Network/Packets/InteractPacket.cpp +++ b/Minecraft.World/Network/Packets/InteractPacket.cpp @@ -34,7 +34,7 @@ void InteractPacket::write(DataOutputStream *dos) // throws IOException { dos->writeInt(source); dos->writeInt(target); - dos->writeByte((byte)action); + dos->writeByte((uint8_t)action); } void InteractPacket::handle(PacketListener *listener) diff --git a/Minecraft.World/Network/Packets/KickPlayerPacket.cpp b/Minecraft.World/Network/Packets/KickPlayerPacket.cpp index a8e727b48..488809323 100644 --- a/Minecraft.World/Network/Packets/KickPlayerPacket.cpp +++ b/Minecraft.World/Network/Packets/KickPlayerPacket.cpp @@ -28,7 +28,7 @@ void KickPlayerPacket::read(DataInputStream *dis) //throws IOException void KickPlayerPacket::write(DataOutputStream *dos) //throws IOException { - dos->writeByte((byte)m_networkSmallId); + dos->writeByte((uint8_t)m_networkSmallId); } int KickPlayerPacket::getEstimatedSize() diff --git a/Minecraft.World/Network/Packets/LevelEventPacket.cpp b/Minecraft.World/Network/Packets/LevelEventPacket.cpp index 8334bb9b1..706e1f8ff 100644 --- a/Minecraft.World/Network/Packets/LevelEventPacket.cpp +++ b/Minecraft.World/Network/Packets/LevelEventPacket.cpp @@ -28,7 +28,7 @@ void LevelEventPacket::read(DataInputStream *dis) //throws IOException { type = dis->readInt(); x = dis->readInt(); - y = (int)(dis->readByte() & (byte)0xff); + y = (int)(dis->readByte() & (uint8_t)0xff); z = dis->readInt(); data = dis->readInt(); } @@ -37,7 +37,7 @@ void LevelEventPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(type); dos->writeInt(x); - dos->writeByte((byte)(y & 0xff)); + dos->writeByte((uint8_t)(y & 0xff)); dos->writeInt(z); dos->writeInt(data); } diff --git a/Minecraft.World/Network/Packets/LoginPacket.cpp b/Minecraft.World/Network/Packets/LoginPacket.cpp index 6df42e5e8..eaecc7093 100644 --- a/Minecraft.World/Network/Packets/LoginPacket.cpp +++ b/Minecraft.World/Network/Packets/LoginPacket.cpp @@ -144,16 +144,16 @@ void LoginPacket::write(DataOutputStream *dos) //throws IOException } dos->writeLong(seed); dos->writeInt(gameType); - dos->writeByte((byte)dimension); - dos->writeByte((byte)mapHeight); - dos->writeByte((byte)maxPlayers); + dos->writeByte((uint8_t)dimension); + dos->writeByte((uint8_t)mapHeight); + dos->writeByte((uint8_t)maxPlayers); dos->writePlayerUID(m_offlineXuid); dos->writePlayerUID(m_onlineXuid); dos->writeBoolean(m_friendsOnlyUGC); dos->writeInt(m_ugcPlayersVersion); - dos->writeByte((byte)difficulty); + dos->writeByte((uint8_t)difficulty); dos->writeInt(m_multiplayerInstanceId); - dos->writeByte((byte)m_playerIndex); + dos->writeByte((uint8_t)m_playerIndex); dos->writeInt(m_playerSkinId); dos->writeInt(m_playerCapeId); dos->writeBoolean(m_isGuest); diff --git a/Minecraft.World/Network/Packets/MoveEntityPacket.cpp b/Minecraft.World/Network/Packets/MoveEntityPacket.cpp index 6f032d5f5..c8a828756 100644 --- a/Minecraft.World/Network/Packets/MoveEntityPacket.cpp +++ b/Minecraft.World/Network/Packets/MoveEntityPacket.cpp @@ -92,11 +92,11 @@ void MoveEntityPacket::PosRot::read(DataInputStream *dis) //throws IOException void MoveEntityPacket::PosRot::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); - dos->writeByte((byte)xa); - dos->writeByte((byte)ya); - dos->writeByte((byte)za); - dos->writeByte((byte)yRot); - dos->writeByte((byte)xRot); + dos->writeByte((uint8_t)xa); + dos->writeByte((uint8_t)ya); + dos->writeByte((uint8_t)za); + dos->writeByte((uint8_t)yRot); + dos->writeByte((uint8_t)xRot); } int MoveEntityPacket::PosRot::getEstimatedSize() @@ -126,9 +126,9 @@ void MoveEntityPacket::Pos::read(DataInputStream *dis) //throws IOException void MoveEntityPacket::Pos::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); - dos->writeByte((byte)xa); - dos->writeByte((byte)ya); - dos->writeByte((byte)za); + dos->writeByte((uint8_t)xa); + dos->writeByte((uint8_t)ya); + dos->writeByte((uint8_t)za); } int MoveEntityPacket::Pos::getEstimatedSize() @@ -158,8 +158,8 @@ void MoveEntityPacket::Rot::read(DataInputStream *dis) //throws IOException void MoveEntityPacket::Rot::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); - dos->writeByte((byte)yRot); - dos->writeByte((byte)xRot); + dos->writeByte((uint8_t)yRot); + dos->writeByte((uint8_t)xRot); } int MoveEntityPacket::Rot::getEstimatedSize() diff --git a/Minecraft.World/Network/Packets/MoveEntityPacketSmall.cpp b/Minecraft.World/Network/Packets/MoveEntityPacketSmall.cpp index 51254675a..6645b6fbd 100644 --- a/Minecraft.World/Network/Packets/MoveEntityPacketSmall.cpp +++ b/Minecraft.World/Network/Packets/MoveEntityPacketSmall.cpp @@ -146,7 +146,7 @@ void MoveEntityPacketSmall::Pos::write(DataOutputStream *dos) //throws IOExcepti short idAndY = id | ya << 11; dos->writeShort(idAndY); char XandZ = ( xa << 4 ) | ( za & 0x0f ); - dos->writeByte((byte)XandZ); + dos->writeByte((uint8_t)XandZ); } int MoveEntityPacketSmall::Pos::getEstimatedSize() diff --git a/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp b/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp index f50dc992c..43bff16ac 100644 --- a/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp +++ b/Minecraft.World/Network/Packets/PlayerAbilitiesPacket.cpp @@ -27,7 +27,7 @@ PlayerAbilitiesPacket::PlayerAbilitiesPacket(Abilities *abilities) void PlayerAbilitiesPacket::read(DataInputStream *dis) { - byte bitfield = dis->readByte(); + uint8_t bitfield = dis->readByte(); this->setInvulnerable((bitfield & FLAG_INVULNERABLE) > 0); this->setFlying((bitfield & FLAG_FLYING) > 0); @@ -39,7 +39,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/Network/Packets/PreLoginPacket.cpp b/Minecraft.World/Network/Packets/PreLoginPacket.cpp index 9fe37f007..1087e3967 100644 --- a/Minecraft.World/Network/Packets/PreLoginPacket.cpp +++ b/Minecraft.World/Network/Packets/PreLoginPacket.cpp @@ -90,7 +90,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/Network/Packets/RemoveMobEffectPacket.cpp b/Minecraft.World/Network/Packets/RemoveMobEffectPacket.cpp index 5da41a5bd..952808f4d 100644 --- a/Minecraft.World/Network/Packets/RemoveMobEffectPacket.cpp +++ b/Minecraft.World/Network/Packets/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/Network/Packets/ServerAuthDataPacket.h b/Minecraft.World/Network/Packets/ServerAuthDataPacket.h index c56844d10..176daaf4e 100644 --- a/Minecraft.World/Network/Packets/ServerAuthDataPacket.h +++ b/Minecraft.World/Network/Packets/ServerAuthDataPacket.h @@ -7,7 +7,7 @@ class ServerAuthDataPacket : public Packet #if 0 private String serverId; private PublicKey publicKey; - private byte[] nonce = new byte[]{}; + private byte[] nonce = new uint8_t[]{}; public ServerAuthDataPacket() { // Needed diff --git a/Minecraft.World/Network/Packets/SharedKeyPacket.h b/Minecraft.World/Network/Packets/SharedKeyPacket.h index 4f50ad5c6..0abfea493 100644 --- a/Minecraft.World/Network/Packets/SharedKeyPacket.h +++ b/Minecraft.World/Network/Packets/SharedKeyPacket.h @@ -5,8 +5,8 @@ class SharedKeyPacket : public Packet { #if 0 - private byte[] keybytes = new byte[]{}; - private byte[] nonce = new byte[]{}; + private byte[] keybytes = new uint8_t[]{}; + private byte[] nonce = new uint8_t[]{}; private SecretKey secretKey; diff --git a/Minecraft.World/Network/Packets/SignUpdatePacket.cpp b/Minecraft.World/Network/Packets/SignUpdatePacket.cpp index 7748f99ea..c8a0ae158 100644 --- a/Minecraft.World/Network/Packets/SignUpdatePacket.cpp +++ b/Minecraft.World/Network/Packets/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/Network/Packets/TeleportEntityPacket.cpp b/Minecraft.World/Network/Packets/TeleportEntityPacket.cpp index a4bb0994d..7af6dc25d 100644 --- a/Minecraft.World/Network/Packets/TeleportEntityPacket.cpp +++ b/Minecraft.World/Network/Packets/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; @@ -49,8 +49,8 @@ void TeleportEntityPacket::read(DataInputStream *dis) //throws IOException y = dis->readShort(); z = dis->readShort(); #endif - yRot = (byte) dis->read(); - xRot = (byte) dis->read(); + yRot = (uint8_t) dis->read(); + xRot = (uint8_t) dis->read(); } void TeleportEntityPacket::write(DataOutputStream *dos) //throws IOException diff --git a/Minecraft.World/Network/Packets/TeleportEntityPacket.h b/Minecraft.World/Network/Packets/TeleportEntityPacket.h index 6fc28732b..8ceca4fa3 100644 --- a/Minecraft.World/Network/Packets/TeleportEntityPacket.h +++ b/Minecraft.World/Network/Packets/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/Network/Packets/TileEntityDataPacket.cpp b/Minecraft.World/Network/Packets/TileEntityDataPacket.cpp index 2eb318541..becb1cd77 100644 --- a/Minecraft.World/Network/Packets/TileEntityDataPacket.cpp +++ b/Minecraft.World/Network/Packets/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/Network/Socket.cpp b/Minecraft.World/Network/Socket.cpp index 801c6a61d..29b543770 100644 --- a/Minecraft.World/Network/Socket.cpp +++ b/Minecraft.World/Network/Socket.cpp @@ -11,7 +11,7 @@ // link, the end (0 or 1) is passed as a parameter to the ctor. CRITICAL_SECTION Socket::s_hostQueueLock[2]; -std::queue Socket::s_hostQueue[2]; +std::queue Socket::s_hostQueue[2]; Socket::SocketOutputStreamLocal *Socket::s_hostOutStream[2]; Socket::SocketInputStreamLocal *Socket::s_hostInStream[2]; ServerConnection *Socket::s_serverConnection = NULL; @@ -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]); } @@ -272,7 +272,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; @@ -337,7 +337,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]); } @@ -388,7 +388,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; @@ -448,8 +448,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/Network/Socket.h b/Minecraft.World/Network/Socket.h index b30e83962..5f128b93f 100644 --- a/Minecraft.World/Network/Socket.h +++ b/Minecraft.World/Network/Socket.h @@ -95,12 +95,12 @@ private: // For local connections between the host player and the server static CRITICAL_SECTION s_hostQueueLock[2]; - static std::queue s_hostQueue[2]; + static std::queue s_hostQueue[2]; static SocketOutputStreamLocal *s_hostOutStream[2]; static SocketInputStreamLocal *s_hostInStream[2]; // For network connections - std::queue m_queueNetwork[2]; // For input data + std::queue m_queueNetwork[2]; // For input data CRITICAL_SECTION m_queueLockNetwork[2]; // For input data SocketInputStreamNetwork *m_inputStream[2]; SocketOutputStreamNetwork *m_outputStream[2]; diff --git a/Minecraft.World/Player/Player.cpp b/Minecraft.World/Player/Player.cpp index a3fc57549..6389addc0 100644 --- a/Minecraft.World/Player/Player.cpp +++ b/Minecraft.World/Player/Player.cpp @@ -183,8 +183,8 @@ void Player::defineSynchedData() { this->Mob::defineSynchedData(); - entityData->define(DATA_PLAYER_FLAGS_ID, (byte) 0); - entityData->define(DATA_PLAYER_RUNNING_ID, (byte) 0); + entityData->define(DATA_PLAYER_FLAGS_ID, (uint8_t) 0); + entityData->define(DATA_PLAYER_RUNNING_ID, (uint8_t) 0); } shared_ptr Player::getUseItem() @@ -572,7 +572,7 @@ void Player::completeUsingItem() } } -void Player::handleEntityEvent(byte id) +void Player::handleEntityEvent(uint8_t id) { if (id == EntityEvent::USE_ITEM_COMPLETE) { @@ -1979,14 +1979,14 @@ bool Player::getPlayerFlag(int flag) void Player::setPlayerFlag(int flag, bool value) { - 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/Player.h b/Minecraft.World/Player/Player.h index f66c0c1aa..ccb6df441 100644 --- a/Minecraft.World/Player/Player.h +++ b/Minecraft.World/Player/Player.h @@ -160,7 +160,7 @@ protected: virtual void completeUsingItem(); public: - virtual void handleEntityEvent(byte id); + virtual void handleEntityEvent(uint8_t id); protected: bool isImmobile(); diff --git a/Minecraft.World/Player/PlayerEnderChestContainer.cpp b/Minecraft.World/Player/PlayerEnderChestContainer.cpp index c0a2f3adc..98ca78371 100644 --- a/Minecraft.World/Player/PlayerEnderChestContainer.cpp +++ b/Minecraft.World/Player/PlayerEnderChestContainer.cpp @@ -35,7 +35,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/Stats/DurangoStats.cpp b/Minecraft.World/Stats/DurangoStats.cpp index 97ea27aee..67be03e6c 100644 --- a/Minecraft.World/Stats/DurangoStats.cpp +++ b/Minecraft.World/Stats/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/Util/ArrayWithLength.h b/Minecraft.World/Util/ArrayWithLength.h index 78f77ad64..b91fd618a 100644 --- a/Minecraft.World/Util/ArrayWithLength.h +++ b/Minecraft.World/Util/ArrayWithLength.h @@ -83,7 +83,7 @@ class Enchantment; class ClipChunk; typedef arrayWithLength doubleArray; -typedef arrayWithLength byteArray; +typedef arrayWithLength byteArray; typedef arrayWithLength charArray; typedef arrayWithLength shortArray; typedef arrayWithLength intArray; diff --git a/Minecraft.World/Util/Arrays.h b/Minecraft.World/Util/Arrays.h index 6241a9841..f13cfdab2 100644 --- a/Minecraft.World/Util/Arrays.h +++ b/Minecraft.World/Util/Arrays.h @@ -15,9 +15,9 @@ public: 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/Util/Random.cpp b/Minecraft.World/Util/Random.cpp index 5ab242dce..cb8c16586 100644 --- a/Minecraft.World/Util/Random.cpp +++ b/Minecraft.World/Util/Random.cpp @@ -37,11 +37,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/Util/Random.h b/Minecraft.World/Util/Random.h index 9af3a3c25..ae36d48f3 100644 --- a/Minecraft.World/Util/Random.h +++ b/Minecraft.World/Util/Random.h @@ -12,7 +12,7 @@ public: Random(); Random(__int64 seed); void setSeed(__int64 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/WorldGen/Biomes/BeachBiome.cpp b/Minecraft.World/WorldGen/Biomes/BeachBiome.cpp index 3183fb7d2..7074fd76a 100644 --- a/Minecraft.World/WorldGen/Biomes/BeachBiome.cpp +++ b/Minecraft.World/WorldGen/Biomes/BeachBiome.cpp @@ -8,8 +8,8 @@ BeachBiome::BeachBiome(int id) : Biome(id) // remove default mob spawn settings friendlies.clear(); friendlies_chicken.clear(); // 4J added - this->topMaterial = (byte) Tile::sand_Id; - this->material = (byte) Tile::sand_Id; + this->topMaterial = (uint8_t) Tile::sand_Id; + this->material = (uint8_t) Tile::sand_Id; decorator->treeCount = -999; decorator->deadBushCount = 0; diff --git a/Minecraft.World/WorldGen/Biomes/Biome.cpp b/Minecraft.World/WorldGen/Biomes/Biome.cpp index af9d4a160..7259639f2 100644 --- a/Minecraft.World/WorldGen/Biomes/Biome.cpp +++ b/Minecraft.World/WorldGen/Biomes/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/WorldGen/Biomes/Biome.h b/Minecraft.World/WorldGen/Biomes/Biome.h index 284082f14..018b0d389 100644 --- a/Minecraft.World/WorldGen/Biomes/Biome.h +++ b/Minecraft.World/WorldGen/Biomes/Biome.h @@ -52,8 +52,8 @@ public: 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/WorldGen/Biomes/BiomeSource.cpp b/Minecraft.World/WorldGen/Biomes/BiomeSource.cpp index b1104f90a..d07ff6b32 100644 --- a/Minecraft.World/WorldGen/Biomes/BiomeSource.cpp +++ b/Minecraft.World/WorldGen/Biomes/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/WorldGen/Biomes/MushroomIslandBiome.cpp b/Minecraft.World/WorldGen/Biomes/MushroomIslandBiome.cpp index dfb740dcf..037486d6e 100644 --- a/Minecraft.World/WorldGen/Biomes/MushroomIslandBiome.cpp +++ b/Minecraft.World/WorldGen/Biomes/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/WorldGen/Biomes/TheEndBiome.cpp b/Minecraft.World/WorldGen/Biomes/TheEndBiome.cpp index cd30eb4a2..256f1d983 100644 --- a/Minecraft.World/WorldGen/Biomes/TheEndBiome.cpp +++ b/Minecraft.World/WorldGen/Biomes/TheEndBiome.cpp @@ -13,8 +13,8 @@ TheEndBiome::TheEndBiome(int id) : Biome(id) waterFriendlies.clear(); enemies.push_back(new MobSpawnerData(eTYPE_ENDERMAN, 10, 4, 4)); - topMaterial = (byte) Tile::dirt_Id; - this->material = (byte) Tile::dirt_Id; + topMaterial = (uint8_t) Tile::dirt_Id; + this->material = (uint8_t) Tile::dirt_Id; decorator = new TheEndBiomeDecorator(this); } diff --git a/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp b/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp index a0ad3dd91..4de3ec869 100644 --- a/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp +++ b/Minecraft.World/WorldGen/Features/BasicTreeFeature.cpp @@ -3,7 +3,7 @@ #include "../../Headers/net.minecraft.world.level.tile.h" #include "BasicTreeFeature.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,8 +403,8 @@ 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 diff --git a/Minecraft.World/WorldGen/Features/BasicTreeFeature.h b/Minecraft.World/WorldGen/Features/BasicTreeFeature.h index feb145815..7bc085270 100644 --- a/Minecraft.World/WorldGen/Features/BasicTreeFeature.h +++ b/Minecraft.World/WorldGen/Features/BasicTreeFeature.h @@ -23,7 +23,7 @@ private: // 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 @@ private: 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/WorldGen/Features/CanyonFeature.cpp b/Minecraft.World/WorldGen/Features/CanyonFeature.cpp index ff3480584..d5576098a 100644 --- a/Minecraft.World/WorldGen/Features/CanyonFeature.cpp +++ b/Minecraft.World/WorldGen/Features/CanyonFeature.cpp @@ -141,12 +141,12 @@ void CanyonFeature::addTunnel(__int64 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/WorldGen/Features/DungeonFeature.cpp b/Minecraft.World/WorldGen/Features/DungeonFeature.cpp index d555022dd..422e8a0a6 100644 --- a/Minecraft.World/WorldGen/Features/DungeonFeature.cpp +++ b/Minecraft.World/WorldGen/Features/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/WorldGen/Features/LargeCaveFeature.cpp b/Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp index 28f6462bd..f8153819f 100644 --- a/Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp +++ b/Minecraft.World/WorldGen/Features/LargeCaveFeature.cpp @@ -144,12 +144,12 @@ void LargeCaveFeature::addTunnel(__int64 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/WorldGen/Features/LargeHellCaveFeature.cpp b/Minecraft.World/WorldGen/Features/LargeHellCaveFeature.cpp index dbdb5e95e..a7e2cded2 100644 --- a/Minecraft.World/WorldGen/Features/LargeHellCaveFeature.cpp +++ b/Minecraft.World/WorldGen/Features/LargeHellCaveFeature.cpp @@ -140,7 +140,7 @@ void LargeHellCaveFeature::addTunnel(int xOffs, int zOffs, byteArray blocks, dou int block = blocks[p]; if (block == Tile::hellRock_Id || block == Tile::dirt_Id || block == Tile::grass_Id) { - blocks[p] = (byte) 0; + blocks[p] = (uint8_t) 0; } } p--; diff --git a/Minecraft.World/WorldGen/Noise/FastNoise.cpp b/Minecraft.World/WorldGen/Noise/FastNoise.cpp index 7ecc76dfd..fd52fc2f4 100644 --- a/Minecraft.World/WorldGen/Noise/FastNoise.cpp +++ b/Minecraft.World/WorldGen/Noise/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/WorldGen/Noise/FastNoise.h b/Minecraft.World/WorldGen/Noise/FastNoise.h index f41c32e83..e3bd991b3 100644 --- a/Minecraft.World/WorldGen/Noise/FastNoise.h +++ b/Minecraft.World/WorldGen/Noise/FastNoise.h @@ -3,7 +3,7 @@ class FastNoise { private: - byte **noiseMaps; + uint8_t **noiseMaps; int levels; public: diff --git a/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp b/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp index c3b68814a..e1110ab93 100644 --- a/Minecraft.World/WorldGen/Sources/FlatLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/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/WorldGen/Sources/HellFlatLevelSource.cpp b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp index 15cb3eedd..10b6811b8 100644 --- a/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/HellFlatLevelSource.cpp @@ -38,7 +38,7 @@ void HellFlatLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks) block = Tile::hellRock_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/WorldGen/Sources/HellRandomLevelSource.cpp b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp index 0c8a3407d..2194ce47d 100644 --- a/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/HellRandomLevelSource.cpp @@ -104,7 +104,7 @@ void HellRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray block tileId = Tile::hellRock_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::hellRock_Id; - byte material = (byte) Tile::hellRock_Id; + uint8_t top = (uint8_t) Tile::hellRock_Id; + uint8_t material = (uint8_t) Tile::hellRock_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::hellRock_Id; + material = (uint8_t) Tile::hellRock_Id; } else if (y >= waterHeight - 4 && y <= waterHeight + 1) { - top = (byte) Tile::hellRock_Id; - material = (byte) Tile::hellRock_Id; - if (gravel) top = (byte) Tile::gravel_Id; - if (gravel) material = (byte) Tile::hellRock_Id; + top = (uint8_t) Tile::hellRock_Id; + material = (uint8_t) Tile::hellRock_Id; + if (gravel) top = (uint8_t) Tile::gravel_Id; + if (gravel) material = (uint8_t) Tile::hellRock_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::hellSand_Id; + top = (uint8_t) Tile::hellSand_Id; } } - if (sand) material = (byte) Tile::hellSand_Id; + if (sand) material = (uint8_t) Tile::hellSand_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/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp index fdd76e9b2..3c3632f2f 100644 --- a/Minecraft.World/WorldGen/Sources/TheEndLevelRandomLevelSource.cpp +++ b/Minecraft.World/WorldGen/Sources/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::whiteStone_Id; - byte material = (byte) Tile::whiteStone_Id; + uint8_t top = (uint8_t) Tile::whiteStone_Id; + uint8_t material = (uint8_t) Tile::whiteStone_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::whiteStone_Id; + material = (uint8_t) Tile::whiteStone_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/meson.build b/meson.build index 2b78b43bb..459eefd92 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,6 @@ project('4jcraft-chucklegrounds', ['cpp', 'c'], version : '0.1.0', default_options : [ - 'cpp_std=gnu++11', 'warning_level=0', 'buildtype=debug', 'unity=on', # merge source files per target → fewer compile units