├── .gitattributes ├── .gitignore ├── GameMods.hpp ├── LICENSE.txt ├── README.md ├── TODO.md ├── compat ├── AKeyCodes.hpp ├── GL.hpp ├── GLExt.cpp └── readme.txt ├── screenshots ├── ingame.png ├── inventory.png ├── loading.png ├── pause_screen.png └── title_screen.png ├── source ├── client │ ├── App.cpp │ ├── App.hpp │ ├── AppPlatform.cpp │ ├── AppPlatform.hpp │ ├── AppPlatform_windows.cpp │ ├── AppPlatform_windows.hpp │ ├── Minecraft.cpp │ ├── Minecraft.hpp │ ├── NinecraftApp.cpp │ ├── NinecraftApp.hpp │ ├── common │ │ ├── CThread.cpp │ │ ├── CThread.hpp │ │ ├── LongHack.hpp │ │ ├── Options.cpp │ │ ├── Options.hpp │ │ ├── Timer.cpp │ │ ├── Timer.hpp │ │ ├── Util.cpp │ │ ├── Util.hpp │ │ ├── Utils.cpp │ │ └── Utils.hpp │ ├── gui │ │ ├── Font.cpp │ │ ├── Font.hpp │ │ ├── Gui.cpp │ │ ├── Gui.hpp │ │ ├── GuiComponent.cpp │ │ ├── GuiComponent.hpp │ │ ├── Screen.cpp │ │ ├── Screen.hpp │ │ ├── components │ │ │ ├── AvailableGamesList.cpp │ │ │ ├── AvailableGamesList.hpp │ │ │ ├── Button.cpp │ │ │ ├── Button.hpp │ │ │ ├── RolledSelectionList.cpp │ │ │ ├── RolledSelectionList.hpp │ │ │ ├── ScrolledSelectionList.cpp │ │ │ ├── ScrolledSelectionList.hpp │ │ │ ├── SmallButton.cpp │ │ │ ├── SmallButton.hpp │ │ │ ├── TextInputBox.cpp │ │ │ ├── TextInputBox.hpp │ │ │ ├── WorldSelectionList.cpp │ │ │ └── WorldSelectionList.hpp │ │ └── screens │ │ │ ├── ChatScreen.cpp │ │ │ ├── ChatScreen.hpp │ │ │ ├── ConfirmScreen.cpp │ │ │ ├── ConfirmScreen.hpp │ │ │ ├── CreateWorldScreen.cpp │ │ │ ├── CreateWorldScreen.hpp │ │ │ ├── DeleteWorldScreen.cpp │ │ │ ├── DeleteWorldScreen.hpp │ │ │ ├── IngameBlockSelectionScreen.cpp │ │ │ ├── IngameBlockSelectionScreen.hpp │ │ │ ├── InvalidLicenseScreen.cpp │ │ │ ├── InvalidLicenseScreen.hpp │ │ │ ├── JoinGameScreen.cpp │ │ │ ├── JoinGameScreen.hpp │ │ │ ├── OptionsScreen.cpp │ │ │ ├── OptionsScreen.hpp │ │ │ ├── PauseScreen.cpp │ │ │ ├── PauseScreen.hpp │ │ │ ├── ProgressScreen.cpp │ │ │ ├── ProgressScreen.hpp │ │ │ ├── RenameMPLevelScreen.cpp │ │ │ ├── RenameMPLevelScreen.hpp │ │ │ ├── SavingWorldScreen.cpp │ │ │ ├── SavingWorldScreen.hpp │ │ │ ├── SelectWorldScreen.cpp │ │ │ ├── SelectWorldScreen.hpp │ │ │ ├── StartMenuScreen.cpp │ │ │ └── StartMenuScreen.hpp │ ├── main_windows.cpp │ ├── math │ │ ├── Matrix.cpp │ │ ├── Matrix.hpp │ │ ├── Mth.cpp │ │ ├── Mth.hpp │ │ ├── Random.cpp │ │ └── Random.hpp │ ├── model │ │ ├── Cube.cpp │ │ ├── Cube.hpp │ │ ├── HumanoidModel.cpp │ │ ├── HumanoidModel.hpp │ │ ├── Model.cpp │ │ ├── Model.hpp │ │ ├── PolygonQuad.cpp │ │ ├── PolygonQuad.hpp │ │ └── VertexPT.hpp │ ├── network │ │ ├── ClientSideNetworkHandler.cpp │ │ ├── ClientSideNetworkHandler.hpp │ │ ├── MinecraftPackets.cpp │ │ ├── MinecraftPackets.hpp │ │ ├── NetEventCallback.cpp │ │ ├── NetEventCallback.hpp │ │ ├── Packet.hpp │ │ ├── PingedCompatibleServer.hpp │ │ ├── RakNetInstance.cpp │ │ ├── RakNetInstance.hpp │ │ ├── ServerSideNetworkHandler.cpp │ │ ├── ServerSideNetworkHandler.hpp │ │ └── packets │ │ │ ├── AddPlayerPacket.cpp │ │ │ ├── ChunkDataPacket.cpp │ │ │ ├── LoginPacket.cpp │ │ │ ├── MessagePacket.cpp │ │ │ ├── MovePlayerPacket.cpp │ │ │ ├── PlaceBlockPacket.cpp │ │ │ ├── PlayerEquipmentPacket.cpp │ │ │ ├── RemoveBlockPacket.cpp │ │ │ ├── RemoveEntityPacket.cpp │ │ │ ├── RequestChunkPacket.cpp │ │ │ ├── StartGamePacket.cpp │ │ │ └── UpdateBlockPacket.cpp │ ├── particle │ │ ├── BubbleParticle.cpp │ │ ├── ExplodeParticle.cpp │ │ ├── FlameParticle.cpp │ │ ├── LavaParticle.cpp │ │ ├── Particle.cpp │ │ ├── Particle.hpp │ │ ├── ParticleEngine.cpp │ │ ├── ParticleEngine.hpp │ │ ├── RedDustParticle.cpp │ │ ├── SmokeParticle.cpp │ │ └── TerrainParticle.cpp │ ├── player │ │ └── input │ │ │ ├── Controller.cpp │ │ │ ├── Controller.hpp │ │ │ ├── ControllerTurnInput.cpp │ │ │ ├── ControllerTurnInput.hpp │ │ │ ├── ITurnInput.cpp │ │ │ ├── ITurnInput.hpp │ │ │ ├── Keyboard.cpp │ │ │ ├── Keyboard.hpp │ │ │ ├── KeyboardInput.cpp │ │ │ ├── KeyboardInput.hpp │ │ │ ├── Mouse.cpp │ │ │ ├── Mouse.hpp │ │ │ ├── MouseTurnInput.cpp │ │ │ ├── MouseTurnInput.hpp │ │ │ └── User.hpp │ ├── renderer │ │ ├── Chunk.cpp │ │ ├── Chunk.hpp │ │ ├── Culler.cpp │ │ ├── Culler.hpp │ │ ├── DynamicTexture.cpp │ │ ├── DynamicTexture.hpp │ │ ├── Frustum.cpp │ │ ├── Frustum.hpp │ │ ├── FrustumCuller.cpp │ │ ├── FrustumCuller.hpp │ │ ├── GameRenderer.cpp │ │ ├── GameRenderer.hpp │ │ ├── ItemInHandRenderer.cpp │ │ ├── ItemInHandRenderer.hpp │ │ ├── LevelRenderer.cpp │ │ ├── LevelRenderer.hpp │ │ ├── RenderChunk.cpp │ │ ├── RenderChunk.hpp │ │ ├── RenderList.cpp │ │ ├── RenderList.hpp │ │ ├── Tesselator.cpp │ │ ├── Tesselator.hpp │ │ ├── Texture.hpp │ │ ├── Textures.cpp │ │ ├── Textures.hpp │ │ ├── TileRenderer.cpp │ │ ├── TileRenderer.hpp │ │ ├── WaterSideTexture.cpp │ │ ├── WaterSideTexture.hpp │ │ ├── WaterTexture.cpp │ │ ├── WaterTexture.hpp │ │ └── entity │ │ │ ├── EntityRenderDispatcher.cpp │ │ │ ├── EntityRenderDispatcher.hpp │ │ │ ├── EntityRenderer.cpp │ │ │ ├── EntityRenderer.hpp │ │ │ ├── FallingTileRenderer.cpp │ │ │ ├── FallingTileRenderer.hpp │ │ │ ├── HumanoidMobRenderer.cpp │ │ │ ├── HumanoidMobRenderer.hpp │ │ │ ├── ItemRenderer.cpp │ │ │ ├── ItemRenderer.hpp │ │ │ ├── ItemSpriteRenderer.cpp │ │ │ ├── ItemSpriteRenderer.hpp │ │ │ ├── MobRenderer.cpp │ │ │ ├── MobRenderer.hpp │ │ │ ├── TntRenderer.cpp │ │ │ ├── TntRenderer.hpp │ │ │ ├── TripodCameraRenderer.cpp │ │ │ └── TripodCameraRenderer.hpp │ └── sound │ │ ├── SoundData.cpp │ │ ├── SoundData.hpp │ │ ├── SoundDefs.hpp │ │ ├── SoundEngine.cpp │ │ ├── SoundEngine.hpp │ │ ├── SoundRepository.cpp │ │ ├── SoundRepository.hpp │ │ ├── SoundSystem.cpp │ │ ├── SoundSystem.hpp │ │ ├── SoundSystemWindows.cpp │ │ └── SoundSystemWindows.hpp └── world │ ├── entity │ ├── Entity.cpp │ ├── Entity.hpp │ ├── FallingTile.cpp │ ├── FallingTile.hpp │ ├── ItemEntity.cpp │ ├── ItemEntity.hpp │ ├── LocalPlayer.cpp │ ├── LocalPlayer.hpp │ ├── Mob.cpp │ ├── Mob.hpp │ ├── Player.cpp │ ├── Player.hpp │ ├── PrimedTnt.cpp │ ├── PrimedTnt.hpp │ ├── TripodCamera.cpp │ └── TripodCamera.hpp │ ├── gamemode │ ├── GameMode.cpp │ ├── GameMode.hpp │ ├── SurvivalMode.cpp │ └── SurvivalMode.hpp │ ├── item │ ├── CameraItem.cpp │ ├── CameraItem.hpp │ ├── DoorItem.cpp │ ├── DoorItem.hpp │ ├── Inventory.cpp │ ├── Inventory.hpp │ ├── Item.cpp │ ├── Item.hpp │ ├── ItemInstance.cpp │ ├── ItemInstance.hpp │ ├── TileItem.cpp │ ├── TileItem.hpp │ ├── TilePlanterItem.cpp │ └── TilePlanterItem.hpp │ ├── level │ ├── Dimension.cpp │ ├── Dimension.hpp │ ├── Explosion.cpp │ ├── Explosion.hpp │ ├── Level.cpp │ ├── Level.hpp │ ├── LevelListener.cpp │ ├── LevelListener.hpp │ ├── LightLayer.cpp │ ├── LightLayer.hpp │ ├── LightUpdate.cpp │ ├── LightUpdate.hpp │ ├── Region.cpp │ ├── Region.hpp │ ├── RegionFile.cpp │ ├── RegionFile.hpp │ ├── TickNextTickData.cpp │ ├── TickNextTickData.hpp │ ├── biome │ │ ├── Biome.cpp │ │ ├── Biome.hpp │ │ ├── BiomeSource.cpp │ │ └── BiomeSource.hpp │ ├── chunk │ │ ├── ChunkCache.cpp │ │ ├── ChunkCache.hpp │ │ ├── ChunkSource.cpp │ │ ├── ChunkSource.hpp │ │ ├── LevelChunk.cpp │ │ └── LevelChunk.hpp │ ├── levelgen │ │ ├── PerformanceTestChunkSource.cpp │ │ ├── PerformanceTestChunkSource.hpp │ │ ├── RandomLevelSource.cpp │ │ ├── RandomLevelSource.hpp │ │ ├── feature │ │ │ ├── BirchFeature.cpp │ │ │ ├── ClayFeature.cpp │ │ │ ├── Feature.cpp │ │ │ ├── Feature.hpp │ │ │ ├── FlowerFeature.cpp │ │ │ ├── LargeCaveFeature.cpp │ │ │ ├── LargeCaveFeature.hpp │ │ │ ├── LargeFeature.cpp │ │ │ ├── LargeFeature.hpp │ │ │ ├── OreFeature.cpp │ │ │ ├── PineFeature.cpp │ │ │ ├── ReedsFeature.cpp │ │ │ ├── SpringFeature.cpp │ │ │ ├── SpruceFeature.cpp │ │ │ └── TreeFeature.cpp │ │ └── synth │ │ │ ├── ImprovedNoise.cpp │ │ │ ├── ImprovedNoise.hpp │ │ │ ├── PerlinNoise.cpp │ │ │ ├── PerlinNoise.hpp │ │ │ ├── Synth.cpp │ │ │ └── Synth.hpp │ ├── material │ │ ├── Material.cpp │ │ └── Material.hpp │ ├── storage │ │ ├── ChunkStorage.cpp │ │ ├── ChunkStorage.hpp │ │ ├── ExternalFileLevelStorage.cpp │ │ ├── ExternalFileLevelStorage.hpp │ │ ├── ExternalFileLevelStorageSource.cpp │ │ ├── ExternalFileLevelStorageSource.hpp │ │ ├── LevelData.cpp │ │ ├── LevelData.hpp │ │ ├── LevelSource.cpp │ │ ├── LevelSource.hpp │ │ ├── LevelStorage.cpp │ │ ├── LevelStorage.hpp │ │ ├── LevelStorageSource.cpp │ │ ├── LevelStorageSource.hpp │ │ ├── MemoryChunkStorage.cpp │ │ ├── MemoryChunkStorage.hpp │ │ ├── MemoryLevelStorage.cpp │ │ ├── MemoryLevelStorage.hpp │ │ ├── MemoryLevelStorageSource.cpp │ │ └── MemoryLevelStorageSource.hpp │ └── tile │ │ ├── Bush.cpp │ │ ├── Bush.hpp │ │ ├── ClayTile.cpp │ │ ├── ClayTile.hpp │ │ ├── ClothTile.cpp │ │ ├── ClothTile.hpp │ │ ├── DirtTile.cpp │ │ ├── DirtTile.hpp │ │ ├── DoorTile.cpp │ │ ├── DoorTile.hpp │ │ ├── FarmTile.cpp │ │ ├── FarmTile.hpp │ │ ├── FireTile.cpp │ │ ├── FireTile.hpp │ │ ├── GlassTile.cpp │ │ ├── GlassTile.hpp │ │ ├── GrassTile.cpp │ │ ├── GrassTile.hpp │ │ ├── GravelTile.cpp │ │ ├── GravelTile.hpp │ │ ├── HalfTransparentTile.cpp │ │ ├── HalfTransparentTile.hpp │ │ ├── IceTile.cpp │ │ ├── IceTile.hpp │ │ ├── InvisibleTile.cpp │ │ ├── InvisibleTile.hpp │ │ ├── LadderTile.cpp │ │ ├── LadderTile.hpp │ │ ├── LeafTile.cpp │ │ ├── LeafTile.hpp │ │ ├── LiquidTile.cpp │ │ ├── LiquidTile.hpp │ │ ├── LiquidTileDynamic.cpp │ │ ├── LiquidTileDynamic.hpp │ │ ├── LiquidTileStatic.cpp │ │ ├── LiquidTileStatic.hpp │ │ ├── MetalTile.cpp │ │ ├── MetalTile.hpp │ │ ├── ObsidianTile.cpp │ │ ├── ObsidianTile.hpp │ │ ├── OreTile.cpp │ │ ├── OreTile.hpp │ │ ├── RedStoneOreTile.cpp │ │ ├── RedStoneOreTile.hpp │ │ ├── ReedTile.cpp │ │ ├── ReedTile.hpp │ │ ├── SandStoneTile.cpp │ │ ├── SandStoneTile.hpp │ │ ├── SandTile.cpp │ │ ├── SandTile.hpp │ │ ├── StairTile.cpp │ │ ├── StairTile.hpp │ │ ├── StoneSlabTile.cpp │ │ ├── StoneSlabTile.hpp │ │ ├── StoneTile.cpp │ │ ├── StoneTile.hpp │ │ ├── Tile.cpp │ │ ├── Tile.hpp │ │ ├── TntTile.cpp │ │ ├── TntTile.hpp │ │ ├── TopSnowTile.cpp │ │ ├── TopSnowTile.hpp │ │ ├── TorchTile.cpp │ │ ├── TorchTile.hpp │ │ ├── TransparentTile.cpp │ │ ├── TransparentTile.hpp │ │ ├── TreeTile.cpp │ │ └── TreeTile.hpp │ └── phys │ ├── AABB.cpp │ ├── AABB.hpp │ ├── HitResult.cpp │ ├── HitResult.hpp │ ├── Vec3.cpp │ └── Vec3.hpp ├── thirdparty ├── GL │ └── glext.h ├── direntm.h ├── raknet │ ├── AutopatcherPatchContext.h │ ├── AutopatcherRepositoryInterface.h │ ├── Base64Encoder.cpp │ ├── Base64Encoder.h │ ├── BitStream.cpp │ ├── BitStream.h │ ├── CCRakNetSlidingWindow.cpp │ ├── CCRakNetSlidingWindow.h │ ├── CCRakNetUDT.cpp │ ├── CCRakNetUDT.h │ ├── CMakeLists.txt │ ├── CheckSum.cpp │ ├── CheckSum.h │ ├── CloudClient.cpp │ ├── CloudClient.h │ ├── CloudCommon.cpp │ ├── CloudCommon.h │ ├── CloudServer.cpp │ ├── CloudServer.h │ ├── CommandParserInterface.cpp │ ├── CommandParserInterface.h │ ├── ConnectionGraph2.cpp │ ├── ConnectionGraph2.h │ ├── ConsoleServer.cpp │ ├── ConsoleServer.h │ ├── DR_SHA1.cpp │ ├── DR_SHA1.h │ ├── DS_BPlusTree.h │ ├── DS_BinarySearchTree.h │ ├── DS_BytePool.cpp │ ├── DS_BytePool.h │ ├── DS_ByteQueue.cpp │ ├── DS_ByteQueue.h │ ├── DS_Hash.h │ ├── DS_Heap.h │ ├── DS_HuffmanEncodingTree.cpp │ ├── DS_HuffmanEncodingTree.h │ ├── DS_HuffmanEncodingTreeFactory.h │ ├── DS_HuffmanEncodingTreeNode.h │ ├── DS_LinkedList.h │ ├── DS_List.h │ ├── DS_Map.h │ ├── DS_MemoryPool.h │ ├── DS_Multilist.h │ ├── DS_OrderedChannelHeap.h │ ├── DS_OrderedList.h │ ├── DS_Queue.h │ ├── DS_QueueLinkedList.h │ ├── DS_RangeList.h │ ├── DS_Table.cpp │ ├── DS_Table.h │ ├── DS_ThreadsafeAllocatingQueue.h │ ├── DS_Tree.h │ ├── DS_WeightedGraph.h │ ├── DataCompressor.cpp │ ├── DataCompressor.h │ ├── DirectoryDeltaTransfer.cpp │ ├── DirectoryDeltaTransfer.h │ ├── DynDNS.cpp │ ├── DynDNS.h │ ├── EmailSender.cpp │ ├── EmailSender.h │ ├── EmptyHeader.h │ ├── EpochTimeToString.cpp │ ├── EpochTimeToString.h │ ├── Export.h │ ├── FileList.cpp │ ├── FileList.h │ ├── FileListNodeContext.h │ ├── FileListTransfer.cpp │ ├── FileListTransfer.h │ ├── FileListTransferCBInterface.h │ ├── FileOperations.cpp │ ├── FileOperations.h │ ├── FormatString.cpp │ ├── FormatString.h │ ├── FullyConnectedMesh2.cpp │ ├── FullyConnectedMesh2.h │ ├── GetTime.cpp │ ├── GetTime.h │ ├── Getche.cpp │ ├── Getche.h │ ├── Gets.cpp │ ├── Gets.h │ ├── GridSectorizer.cpp │ ├── GridSectorizer.h │ ├── HTTPConnection.cpp │ ├── HTTPConnection.h │ ├── HTTPConnection2.cpp │ ├── HTTPConnection2.h │ ├── IncrementalReadInterface.cpp │ ├── IncrementalReadInterface.h │ ├── InternalPacket.h │ ├── Itoa.cpp │ ├── Itoa.h │ ├── Kbhit.h │ ├── LICENSE │ ├── LinuxStrings.cpp │ ├── LinuxStrings.h │ ├── LocklessTypes.cpp │ ├── LocklessTypes.h │ ├── LogCommandParser.cpp │ ├── LogCommandParser.h │ ├── MTUSize.h │ ├── MessageFilter.cpp │ ├── MessageFilter.h │ ├── MessageIdentifiers.h │ ├── NatPunchthroughClient.cpp │ ├── NatPunchthroughClient.h │ ├── NatPunchthroughServer.cpp │ ├── NatPunchthroughServer.h │ ├── NatTypeDetectionClient.cpp │ ├── NatTypeDetectionClient.h │ ├── NatTypeDetectionCommon.cpp │ ├── NatTypeDetectionCommon.h │ ├── NatTypeDetectionServer.cpp │ ├── NatTypeDetectionServer.h │ ├── NativeFeatureIncludes.h │ ├── NativeFeatureIncludesOverrides.h │ ├── NativeTypes.h │ ├── NetworkIDManager.cpp │ ├── NetworkIDManager.h │ ├── NetworkIDObject.cpp │ ├── NetworkIDObject.h │ ├── PS3Includes.h │ ├── PS4Includes.cpp │ ├── PS4Includes.h │ ├── PacketConsoleLogger.cpp │ ├── PacketConsoleLogger.h │ ├── PacketFileLogger.cpp │ ├── PacketFileLogger.h │ ├── PacketLogger.cpp │ ├── PacketLogger.h │ ├── PacketOutputWindowLogger.cpp │ ├── PacketOutputWindowLogger.h │ ├── PacketPool.h │ ├── PacketPriority.h │ ├── PacketizedTCP.cpp │ ├── PacketizedTCP.h │ ├── PluginInterface2.cpp │ ├── PluginInterface2.h │ ├── RPC4Plugin.cpp │ ├── RPC4Plugin.h │ ├── Rackspace.cpp │ ├── Rackspace.h │ ├── RakAlloca.h │ ├── RakAssert.h │ ├── RakMemoryOverride.cpp │ ├── RakMemoryOverride.h │ ├── RakNet.vcproj │ ├── RakNetCommandParser.cpp │ ├── RakNetCommandParser.h │ ├── RakNetDefines.h │ ├── RakNetDefinesOverrides.h │ ├── RakNetSmartPtr.h │ ├── RakNetSocket.cpp │ ├── RakNetSocket.h │ ├── RakNetSocket2.cpp │ ├── RakNetSocket2.h │ ├── RakNetSocket2_360_720.cpp │ ├── RakNetSocket2_Berkley.cpp │ ├── RakNetSocket2_Berkley_NativeClient.cpp │ ├── RakNetSocket2_NativeClient.cpp │ ├── RakNetSocket2_PS3_PS4.cpp │ ├── RakNetSocket2_PS4.cpp │ ├── RakNetSocket2_Vita.cpp │ ├── RakNetSocket2_WindowsStore8.cpp │ ├── RakNetSocket2_Windows_Linux.cpp │ ├── RakNetSocket2_Windows_Linux_360.cpp │ ├── RakNetStatistics.cpp │ ├── RakNetStatistics.h │ ├── RakNetTime.h │ ├── RakNetTransport2.cpp │ ├── RakNetTransport2.h │ ├── RakNetTypes.cpp │ ├── RakNetTypes.h │ ├── RakNetVersion.h │ ├── RakNet_vc8.vcproj │ ├── RakNet_vc9.vcproj │ ├── RakPeer.cpp │ ├── RakPeer.h │ ├── RakPeerInterface.h │ ├── RakSleep.cpp │ ├── RakSleep.h │ ├── RakString.cpp │ ├── RakString.h │ ├── RakThread.cpp │ ├── RakThread.h │ ├── RakWString.cpp │ ├── RakWString.h │ ├── Rand.cpp │ ├── Rand.h │ ├── RandSync.cpp │ ├── RandSync.h │ ├── ReadyEvent.cpp │ ├── ReadyEvent.h │ ├── RefCountedObj.h │ ├── RelayPlugin.cpp │ ├── RelayPlugin.h │ ├── ReliabilityLayer.cpp │ ├── ReliabilityLayer.h │ ├── ReplicaEnums.h │ ├── ReplicaManager3.cpp │ ├── ReplicaManager3.h │ ├── Router2.cpp │ ├── Router2.h │ ├── SecureHandshake.cpp │ ├── SecureHandshake.h │ ├── SendToThread.cpp │ ├── SendToThread.h │ ├── SignaledEvent.cpp │ ├── SignaledEvent.h │ ├── SimpleMutex.cpp │ ├── SimpleMutex.h │ ├── SimpleTCPServer.h │ ├── SingleProducerConsumer.h │ ├── SocketDefines.h │ ├── SocketIncludes.h │ ├── SocketLayer.cpp │ ├── SocketLayer.h │ ├── StatisticsHistory.cpp │ ├── StatisticsHistory.h │ ├── StringCompressor.cpp │ ├── StringCompressor.h │ ├── StringTable.cpp │ ├── StringTable.h │ ├── SuperFastHash.cpp │ ├── SuperFastHash.h │ ├── TCPInterface.cpp │ ├── TCPInterface.h │ ├── TableSerializer.cpp │ ├── TableSerializer.h │ ├── TeamBalancer.cpp │ ├── TeamBalancer.h │ ├── TeamManager.cpp │ ├── TeamManager.h │ ├── TelnetTransport.cpp │ ├── TelnetTransport.h │ ├── ThreadPool.h │ ├── ThreadsafePacketLogger.cpp │ ├── ThreadsafePacketLogger.h │ ├── TransportInterface.h │ ├── TwoWayAuthentication.cpp │ ├── TwoWayAuthentication.h │ ├── UDPForwarder.cpp │ ├── UDPForwarder.h │ ├── UDPProxyClient.cpp │ ├── UDPProxyClient.h │ ├── UDPProxyCommon.h │ ├── UDPProxyCoordinator.cpp │ ├── UDPProxyCoordinator.h │ ├── UDPProxyServer.cpp │ ├── UDPProxyServer.h │ ├── VariableDeltaSerializer.cpp │ ├── VariableDeltaSerializer.h │ ├── VariableListDeltaTracker.cpp │ ├── VariableListDeltaTracker.h │ ├── VariadicSQLParser.cpp │ ├── VariadicSQLParser.h │ ├── VitaIncludes.cpp │ ├── VitaIncludes.h │ ├── WSAStartupSingleton.cpp │ ├── WSAStartupSingleton.h │ ├── WindowsIncludes.h │ ├── XBox360Includes.h │ ├── _FindFirst.cpp │ ├── _FindFirst.h │ ├── gettimeofday.cpp │ └── gettimeofday.h ├── stb_image.h ├── stb_image_impl.c └── stb_image_write.h ├── tools └── grabsounds.py └── windows_vs ├── minecraftcpp.sln ├── minecraftcpp.vcxproj ├── minecraftcpp.vcxproj.filters └── options.txt /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Minecraft PE Reverse Engineering Project 2 | Copyright (C) 2023 iProgramInCpp 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 9 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 10 | SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 11 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 12 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 13 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /compat/readme.txt: -------------------------------------------------------------------------------- 1 | This folder contains compatibility crap since Microsoft never updated from OpenGL V1.2. -------------------------------------------------------------------------------- /screenshots/ingame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReMinecraftPE/mcped/58e14a36a254bfe0e7ad72100d72ee8aa3930a0c/screenshots/ingame.png -------------------------------------------------------------------------------- /screenshots/inventory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReMinecraftPE/mcped/58e14a36a254bfe0e7ad72100d72ee8aa3930a0c/screenshots/inventory.png -------------------------------------------------------------------------------- /screenshots/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReMinecraftPE/mcped/58e14a36a254bfe0e7ad72100d72ee8aa3930a0c/screenshots/loading.png -------------------------------------------------------------------------------- /screenshots/pause_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReMinecraftPE/mcped/58e14a36a254bfe0e7ad72100d72ee8aa3930a0c/screenshots/pause_screen.png -------------------------------------------------------------------------------- /screenshots/title_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReMinecraftPE/mcped/58e14a36a254bfe0e7ad72100d72ee8aa3930a0c/screenshots/title_screen.png -------------------------------------------------------------------------------- /source/client/App.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "App.hpp" 10 | 11 | void App::destroy() 12 | { 13 | 14 | } 15 | 16 | void App::draw() 17 | { 18 | 19 | } 20 | 21 | bool App::handleBack(bool b) 22 | { 23 | return false; 24 | } 25 | 26 | void App::init() 27 | { 28 | 29 | } 30 | 31 | void App::loadState(void* a2, int a3) 32 | { 33 | 34 | } 35 | 36 | AppPlatform* App::platform() 37 | { 38 | return m_pPlatform; 39 | } 40 | 41 | void App::quit() 42 | { 43 | m_bWantToQuit = true; 44 | } 45 | 46 | bool App::wantToQuit() 47 | { 48 | return m_bWantToQuit; 49 | } 50 | 51 | void App::saveState(void**, int) 52 | { 53 | 54 | } 55 | 56 | void App::update() 57 | { 58 | 59 | } 60 | -------------------------------------------------------------------------------- /source/client/App.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "AppPlatform.hpp" 12 | 13 | class App 14 | { 15 | 16 | public: 17 | void destroy(); 18 | void draw(); 19 | virtual bool handleBack(bool); 20 | virtual void init(); 21 | void loadState(void*, int); 22 | AppPlatform* platform(); 23 | void quit(); 24 | void saveState(void**, int); 25 | virtual void update(); 26 | bool wantToQuit(); 27 | 28 | public: 29 | bool m_bWantToQuit = false; 30 | 31 | // don't know what these are ... 32 | int field_8; 33 | int field_C; 34 | int field_10; 35 | 36 | AppPlatform* m_pPlatform = nullptr; 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /source/client/NinecraftApp.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Minecraft.hpp" 12 | #include "world/level/Level.hpp" 13 | #include "world/level/tile/Tile.hpp" 14 | 15 | //@TYPO: This is probably meant to say "MinecraftApp". Still not fixed in V0.3.0 though so not sure 16 | class NinecraftApp : public Minecraft 17 | { 18 | public: 19 | virtual ~NinecraftApp(); 20 | 21 | bool handleBack(bool) override; 22 | void init() override; 23 | void update() override; 24 | void onGraphicsReset() override; 25 | void teardown(); 26 | 27 | void updateStats(); 28 | void initGLStates(); 29 | 30 | private: 31 | int field_DBC = 0; 32 | bool field_DC0 = 1; 33 | int m_fps = 0; 34 | 35 | static bool _hasInitedStatics; 36 | }; 37 | 38 | -------------------------------------------------------------------------------- /source/client/common/CThread.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "CThread.hpp" 10 | #include "Utils.hpp" 11 | 12 | #ifdef _WIN32 13 | #include // for Sleep() 14 | #else 15 | #include 16 | #endif 17 | 18 | void CThread::sleep(uint32_t ms) 19 | { 20 | #ifdef _WIN32 21 | Sleep(ms); 22 | #else 23 | usleep(1000 * ms); 24 | #endif 25 | } 26 | 27 | CThread::CThread(CThreadFunction func, void* parm) 28 | { 29 | m_func = func; 30 | 31 | #ifdef USE_CPP11_THREADS 32 | std::thread thr(func, parm); 33 | m_thrd.swap(thr); 34 | #else 35 | pthread_attr_init(&m_thrd_attr); 36 | pthread_attr_setdetachstate(&m_thrd_attr, 1); 37 | pthread_create(&m_thrd, &m_thrd_attr, m_func, parm); 38 | #endif 39 | } 40 | 41 | CThread::~CThread() 42 | { 43 | #ifdef USE_CPP11_THREADS 44 | m_thrd.join(); 45 | #else 46 | pthread_join(m_thrd, 0); 47 | pthread_attr_destroy(&m_thrd_attr); 48 | #endif 49 | } 50 | -------------------------------------------------------------------------------- /source/client/common/CThread.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | // CThread - Object oriented pthread wrapper 12 | #define USE_CPP11_THREADS 13 | 14 | // USE_CPP11_THREADS - Use a C++11 implementation of threads instead of using pthread 15 | #ifdef USE_CPP11_THREADS 16 | #include 17 | #else 18 | #include 19 | #endif 20 | 21 | typedef void* (*CThreadFunction)(void*); 22 | 23 | class CThread 24 | { 25 | public: 26 | CThread(CThreadFunction, void* parm); 27 | ~CThread(); 28 | 29 | static void sleep(uint32_t ms); 30 | 31 | private: 32 | CThreadFunction m_func; 33 | 34 | #ifdef USE_CPP11_THREADS 35 | std::thread m_thrd; 36 | #else 37 | pthread_t m_thrd; 38 | pthread_attr_t m_thrd_attr; 39 | #endif 40 | }; 41 | 42 | -------------------------------------------------------------------------------- /source/client/common/LongHack.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Have to do this because GCC on 64-bit targets makes longs 64-bit. 4 | #ifdef ORIGINAL_CODE 5 | #define TLong long 6 | #else 7 | #define TLong int 8 | #endif 9 | -------------------------------------------------------------------------------- /source/client/common/Timer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #if defined(_WIN32) && !defined(ORIGINAL_CODE) 12 | #define USE_ACCURATE_TIMER 13 | #endif 14 | 15 | class Timer 16 | { 17 | public: 18 | Timer(); 19 | 20 | void advanceTime(); 21 | 22 | public: 23 | float field_0 = 0; 24 | #ifndef USE_ACCURATE_TIMER 25 | int field_4 = 0; 26 | int field_8 = 0; 27 | #else 28 | double field_4 = 0; 29 | double field_8 = 0; 30 | #endif 31 | float field_C = 1.0f; 32 | float field_10 = 20.0f; 33 | int field_14 = 0; 34 | float field_18 = 0; 35 | float field_1C = 1.0f; 36 | float field_20 = 0; 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /source/client/common/Util.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "Util.hpp" 10 | 11 | std::string Util::stringTrim(const std::string& str, const std::string& filter, bool a4, bool a5) 12 | { 13 | if (str.empty() || filter.empty()) 14 | return ""; 15 | 16 | // don't know what the hell this does. TODO: clean this crap up 17 | if (!a4 && !a5) 18 | return ""; 19 | 20 | int startIndex = 0, endIndex = int(str.size()) - 1; 21 | 22 | // @TODO: Is this accurate? 23 | if (a4) 24 | { 25 | while (startIndex < endIndex && strchr(filter.c_str(), str[startIndex])) 26 | { 27 | startIndex++; 28 | } 29 | } 30 | if (a5) 31 | { 32 | while (startIndex < endIndex && strchr(filter.c_str(), str[endIndex])) 33 | { 34 | endIndex--; 35 | } 36 | } 37 | 38 | return str.substr(startIndex, endIndex + 1 - startIndex); 39 | } 40 | 41 | std::string Util::stringTrim(const std::string& str) 42 | { 43 | return stringTrim(str, " \t\n\r", true, true); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /source/client/gui/GuiComponent.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "client/renderer/Tesselator.hpp" 12 | #include "client/gui/Font.hpp" 13 | 14 | class GuiComponent 15 | { 16 | public: 17 | void blit(int dstX, int dstY, int srcX, int srcY, int dstWidth, int dstHeight, int srcWidth, int srcHeight); 18 | void drawCenteredString(Font*, const std::string&, int cx, int cy, int color); 19 | void drawString(Font*, const std::string&, int cx, int cy, int color); 20 | void fill(int left, int top, int right, int bottom, int color); 21 | void fillGradient(int left, int top, int right, int bottom, int colorUp, int colorDown); 22 | 23 | public: 24 | float field_4; 25 | }; 26 | 27 | -------------------------------------------------------------------------------- /source/client/gui/components/AvailableGamesList.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "AvailableGamesList.hpp" 10 | 11 | AvailableGamesList::AvailableGamesList(Minecraft* a, int b, int c, int d, int e, int f) : 12 | ScrolledSelectionList(a, b, c, d, e, f) 13 | { 14 | } 15 | 16 | int AvailableGamesList::getNumberOfItems() 17 | { 18 | return int(m_games.size()); 19 | } 20 | 21 | bool AvailableGamesList::isSelectedItem(int i) 22 | { 23 | return m_selectedIndex == i; 24 | } 25 | 26 | void AvailableGamesList::renderBackground() 27 | { 28 | } 29 | 30 | void AvailableGamesList::renderItem(int idx, int x, int y, int width, Tesselator& t) 31 | { 32 | drawString(m_pMinecraft->m_pFont, std::string(m_games[idx].m_name.C_String()), x, y + 2, 0xFFFFA0); 33 | drawString(m_pMinecraft->m_pFont, std::string(m_games[idx].m_address.ToString()), x, y + 16, 0xFFFFA0); 34 | } 35 | 36 | void AvailableGamesList::selectItem(int index, bool b) 37 | { 38 | m_selectedIndex = index; 39 | } 40 | -------------------------------------------------------------------------------- /source/client/gui/components/AvailableGamesList.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "ScrolledSelectionList.hpp" 12 | #include "client/network/PingedCompatibleServer.hpp" 13 | 14 | class AvailableGamesList : public ScrolledSelectionList 15 | { 16 | public: 17 | AvailableGamesList(Minecraft*, int, int, int, int, int); 18 | int getNumberOfItems() override; 19 | bool isSelectedItem(int i) override; 20 | void renderBackground() override; 21 | void renderItem(int, int, int, int, Tesselator& t) override; 22 | void selectItem(int, bool) override; 23 | 24 | public: 25 | int m_selectedIndex; 26 | std::vector m_games; 27 | }; 28 | 29 | -------------------------------------------------------------------------------- /source/client/gui/components/SmallButton.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "SmallButton.hpp" 10 | 11 | // @NOTE: Used in the ConfirmScreen. 12 | // I reckon this was used in the OptionsScreen as well, since the button sizes are the same. 13 | 14 | SmallButton::SmallButton(int id, int x, int y, const std::string& str) : 15 | Button(id, x, y, 150, 20, str) 16 | { 17 | } 18 | 19 | SmallButton::SmallButton(int id, int x, int y, int width, int height, const std::string& str) : 20 | Button(id, x, y, width, height, str) 21 | { 22 | } 23 | 24 | SmallButton::SmallButton(int id, int x, int y, Options::Option* pOption, const std::string& str) : 25 | Button(id, x, y, 150, 20, str), 26 | m_pOption(pOption) 27 | { 28 | } 29 | 30 | Options::Option* SmallButton::getOption() 31 | { 32 | return m_pOption; 33 | } 34 | -------------------------------------------------------------------------------- /source/client/gui/components/SmallButton.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Button.hpp" 12 | 13 | class SmallButton : public Button 14 | { 15 | public: 16 | SmallButton(int id, int x, int y, const std::string& str); 17 | SmallButton(int id, int x, int y, int width, int height, const std::string& str); 18 | SmallButton(int id, int x, int y, Options::Option* pOption, const std::string& str); 19 | Options::Option* getOption(); 20 | 21 | private: 22 | Options::Option* m_pOption = nullptr; 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /source/client/gui/screens/ChatScreen.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "ChatScreen.hpp" 10 | 11 | // @NOTE: This is unused. 12 | 13 | void ChatScreen::buttonClicked(Button* pButton) 14 | { 15 | } 16 | 17 | void ChatScreen::init() 18 | { 19 | m_pMinecraft->platform()->showDialog(AppPlatform::DLG_CHAT); 20 | m_pMinecraft->platform()->createUserInput(); 21 | } 22 | 23 | void ChatScreen::render(int mouseX, int mouseY, float f) 24 | { 25 | int userInputStatus = m_pMinecraft->platform()->getUserInputStatus(); 26 | if (userInputStatus < 0) 27 | return; 28 | 29 | if (userInputStatus == 1) 30 | { 31 | std::vector userInput = m_pMinecraft->platform()->getUserInput(); 32 | if (userInput.size() >= 1) 33 | { 34 | // @NOTE: No sending multiplayer chats. Weird 35 | m_pMinecraft->m_gui.addMessage(userInput[0]); 36 | } 37 | } 38 | 39 | m_pMinecraft->setScreen(nullptr); 40 | } 41 | -------------------------------------------------------------------------------- /source/client/gui/screens/ChatScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | 13 | class ChatScreen : public Screen 14 | { 15 | public: 16 | void buttonClicked(Button*) override; 17 | void init() override; 18 | void render(int mouseX, int mouseY, float f) override; 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /source/client/gui/screens/ConfirmScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | #include "../components/SmallButton.hpp" 13 | 14 | class ConfirmScreen : public Screen 15 | { 16 | public: 17 | ConfirmScreen(Screen* pScreen, const std::string& line1, const std::string& line2, int x); 18 | ConfirmScreen(Screen* pScreen, const std::string& line1, const std::string& line2, const std::string& ok, const std::string& cancel, int x); 19 | 20 | void buttonClicked(Button* pButton) override; 21 | bool handleBackEvent(bool b) override; 22 | void init() override; 23 | void render(int mouseX, int mouseY, float f) override; 24 | 25 | virtual void postResult(bool b); 26 | 27 | private: 28 | Screen* m_pScreen = nullptr; 29 | int field_40 = 0; 30 | std::string m_textLine1; 31 | std::string m_textLine2; 32 | SmallButton m_btnOK; 33 | SmallButton m_btnCancel; 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /source/client/gui/screens/CreateWorldScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | 13 | #ifndef ORIGINAL_CODE 14 | 15 | class CreateWorldScreen : public Screen 16 | { 17 | public: 18 | CreateWorldScreen(); 19 | 20 | void init() override; 21 | void buttonClicked(Button* pButton) override; 22 | void render(int mouseX, int mouseY, float f) override; 23 | 24 | public: 25 | TextInputBox m_textName; 26 | TextInputBox m_textSeed; 27 | Button m_btnBack; 28 | Button m_btnCreate; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /source/client/gui/screens/DeleteWorldScreen.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "DeleteWorldScreen.hpp" 10 | #include "SelectWorldScreen.hpp" 11 | 12 | DeleteWorldScreen::DeleteWorldScreen(const LevelSummary& level) : 13 | ConfirmScreen(nullptr, 14 | "Are you sure you want to delete this world?", 15 | "'" + level.field_18 + "' will be lost forever!", 16 | "Delete", "Cancel", 0), 17 | m_level(level) 18 | { 19 | // highlight the cancel button so the user will have to do 1 extra action to delete their world 20 | m_tabButtonIndex = 1; 21 | } 22 | 23 | void DeleteWorldScreen::postResult(bool b) 24 | { 25 | if (b) 26 | { 27 | m_pMinecraft->getLevelSource()->deleteLevel(m_level.field_0); 28 | } 29 | 30 | m_pMinecraft->setScreen(new SelectWorldScreen); 31 | } 32 | -------------------------------------------------------------------------------- /source/client/gui/screens/DeleteWorldScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "ConfirmScreen.hpp" 12 | 13 | class DeleteWorldScreen : public ConfirmScreen 14 | { 15 | public: 16 | DeleteWorldScreen(const LevelSummary& level); 17 | 18 | void postResult(bool b) override; 19 | 20 | private: 21 | LevelSummary m_level; 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /source/client/gui/screens/IngameBlockSelectionScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | 13 | class IngameBlockSelectionScreen : public Screen 14 | { 15 | public: 16 | int getSelectedSlot(int x, int y); 17 | int getSlotPosX(int x); 18 | int getSlotPosY(int y); 19 | bool isAllowed(int slot); 20 | void renderSlots(); 21 | void renderDemoOverlay(); 22 | void renderSlot(int index, int x, int y, float f); 23 | void selectSlotAndClose(); 24 | 25 | virtual void init() override; 26 | virtual void render(int x, int y, float f) override; 27 | virtual void mouseClicked(int x, int y, int type) override; 28 | virtual void mouseReleased(int x, int y, int type) override; 29 | 30 | private: 31 | int m_selectedSlot = 0; 32 | }; 33 | 34 | -------------------------------------------------------------------------------- /source/client/gui/screens/InvalidLicenseScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | 13 | class InvalidLicenseScreen : public Screen 14 | { 15 | public: 16 | InvalidLicenseScreen(int error, bool bHasQuitButton); 17 | void buttonClicked(Button* pButton) override; 18 | void init() override; 19 | void tick() override; 20 | void render(int mouseX, int mouseY, float f) override; 21 | 22 | private: 23 | int m_error; 24 | std::string m_textLine1; 25 | std::string m_textLine2; 26 | Button m_btnOk; 27 | Button m_btnBuy; 28 | bool m_bHasQuitButton; 29 | int field_E4 = 0; 30 | }; 31 | 32 | -------------------------------------------------------------------------------- /source/client/gui/screens/JoinGameScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | #include "../components/AvailableGamesList.hpp" 13 | 14 | class JoinGameScreen : public Screen 15 | { 16 | public: 17 | JoinGameScreen(); 18 | ~JoinGameScreen(); 19 | void buttonClicked(Button* pButton) override; 20 | bool handleBackEvent(bool b) override; 21 | void init() override; 22 | bool isInGameScreen() override; 23 | void render(int mouseX, int mouseY, float f) override; 24 | void tick() override; 25 | 26 | virtual bool isIndexValid(int idx); 27 | 28 | public: 29 | Button m_btnJoin; 30 | Button m_btnBack; 31 | AvailableGamesList* m_pAvailableGamesList = nullptr; 32 | }; 33 | 34 | -------------------------------------------------------------------------------- /source/client/gui/screens/OptionsScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | 13 | class OptionsScreen : public Screen 14 | { 15 | public: 16 | OptionsScreen(); 17 | void init() override; 18 | void render(int, int, float) override; 19 | void removed() override; 20 | 21 | #ifndef ORIGINAL_CODE 22 | void buttonClicked(Button* pButton) override; 23 | 24 | void UpdateTexts(); 25 | 26 | private: 27 | Button m_BackButton; 28 | Button m_AOButton; 29 | Button m_srvVisButton; 30 | Button m_fancyGfxButton; 31 | Button m_invertYButton; 32 | Button m_anaglyphsButton; 33 | Button m_viewBobButton; 34 | Button m_viewDistButton; 35 | Button m_flightHaxButton; 36 | #endif 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /source/client/gui/screens/PauseScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | 13 | class PauseScreen : public Screen 14 | { 15 | public: 16 | PauseScreen(); 17 | virtual void init() override; 18 | virtual void tick() override; 19 | virtual void render(int a, int b, float c) override; 20 | virtual void buttonClicked(Button*) override; 21 | 22 | void updateServerVisibilityText(); 23 | 24 | private: 25 | int field_3C = 0; 26 | int field_40 = 0; 27 | Button m_btnBack; 28 | Button m_btnQuit; 29 | Button m_btnQuitAndCopy; 30 | Button m_btnVisible; 31 | 32 | #ifdef ENH_ADD_OPTIONS_PAUSE 33 | Button m_btnOptions; 34 | #endif 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /source/client/gui/screens/ProgressScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | 13 | class ProgressScreen : public Screen 14 | { 15 | public: 16 | void render(int, int, float) override; 17 | bool isInGameScreen() override; 18 | }; 19 | 20 | -------------------------------------------------------------------------------- /source/client/gui/screens/RenameMPLevelScreen.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "RenameMPLevelScreen.hpp" 10 | #include "StartMenuScreen.hpp" 11 | 12 | RenameMPLevelScreen::RenameMPLevelScreen(const std::string& levelName) : m_levelName(levelName) 13 | { 14 | } 15 | 16 | void RenameMPLevelScreen::init() 17 | { 18 | m_pMinecraft->platform()->showDialog(AppPlatform::DLG_RENAME_MP_WORLD); 19 | m_pMinecraft->platform()->createUserInput(); 20 | } 21 | 22 | void RenameMPLevelScreen::render(int mouseX, int mouseY, float f) 23 | { 24 | int userInputStatus = m_pMinecraft->platform()->getUserInputStatus(); 25 | if (userInputStatus < 0) 26 | return; 27 | 28 | if (userInputStatus == 1) 29 | { 30 | std::vector input = m_pMinecraft->platform()->getUserInput(); 31 | if (input.size() > 0 && !input[0].empty()) 32 | { 33 | m_pMinecraft->getLevelSource()->renameLevel(m_levelName, input[0]); 34 | } 35 | } 36 | 37 | m_pMinecraft->setScreen(new StartMenuScreen); 38 | } 39 | -------------------------------------------------------------------------------- /source/client/gui/screens/RenameMPLevelScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | 13 | class RenameMPLevelScreen : public Screen 14 | { 15 | public: 16 | RenameMPLevelScreen(const std::string& levelName); 17 | void init() override; 18 | void render(int mouseX, int mouseY, float f) override; 19 | 20 | private: 21 | std::string m_levelName; 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /source/client/gui/screens/SavingWorldScreen.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Screen.hpp" 4 | 5 | #ifdef ENH_IMPROVED_SAVING 6 | 7 | class SavingWorldScreen : public Screen 8 | { 9 | public: 10 | SavingWorldScreen(bool bCopyMap); 11 | 12 | void render(int mouseX, int mouseY, float f) override; 13 | void tick() override; 14 | 15 | public: 16 | bool m_bCopyMapAtEnd; 17 | int m_timer = 0; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /source/client/gui/screens/SelectWorldScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | #include "../components/WorldSelectionList.hpp" 13 | 14 | class SelectWorldScreen : public Screen 15 | { 16 | public: 17 | SelectWorldScreen(); 18 | 19 | void init() override; 20 | bool isInGameScreen() override; 21 | void keyPressed(int code) override; 22 | void tick() override; 23 | void render(int mouseX, int mouseY, float f) override; 24 | bool handleBackEvent(bool b) override; 25 | void buttonClicked(Button* pButton) override; 26 | 27 | bool isIndexValid(int); 28 | std::string getUniqueLevelName(const std::string& in); 29 | void loadLevelSource(); 30 | 31 | public: 32 | Button m_btnDelete; 33 | Button m_btnCreateNew; 34 | Button m_btnBack; 35 | Button m_btnUnknown; 36 | WorldSelectionList* m_pWorldSelectionList = nullptr; 37 | std::vector m_levels; 38 | bool field_12C; 39 | int field_130 = 0; 40 | }; 41 | 42 | -------------------------------------------------------------------------------- /source/client/gui/screens/StartMenuScreen.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "../Screen.hpp" 12 | 13 | class StartMenuScreen : public Screen 14 | { 15 | public: 16 | StartMenuScreen(); 17 | void _updateLicense(); 18 | 19 | void init() override; 20 | void buttonClicked(Button*) override; 21 | bool isInGameScreen() override; 22 | void render(int, int, float) override; 23 | void tick() override; 24 | 25 | private: 26 | Button m_startButton; 27 | Button m_joinButton; 28 | Button m_optionsButton; 29 | Button m_testButton; 30 | Button m_buyButton; 31 | std::string field_154; 32 | int field_16C; 33 | std::string field_170; 34 | int field_188; 35 | 36 | //TextInputBox m_testBox; 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /source/client/math/Matrix.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include "Mth.hpp" 13 | #include "compat/GL.hpp" 14 | 15 | class Matrix 16 | { 17 | public: 18 | Matrix(); // create an empty matrix 19 | Matrix(float a); // create an identity matrix 20 | Matrix(float* p); // load matrix from memory 21 | Matrix(float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l, float m, float n, float o, float p); 22 | void fetchGL(GLenum pname); 23 | 24 | friend Matrix operator*(const Matrix& a, const Matrix& b); 25 | 26 | public: 27 | float c[16] = { 0.0f }; 28 | }; 29 | 30 | Matrix operator*(const Matrix& a, const Matrix& b); 31 | 32 | -------------------------------------------------------------------------------- /source/client/math/Mth.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | #include "Random.hpp" 14 | 15 | class Mth 16 | { 17 | static Random g_Random; 18 | 19 | public: 20 | static float Max(float, float); 21 | static int Max(int, int); 22 | static float Min(float, float); 23 | static int Min(int, int); 24 | static float abs(float); 25 | static int abs(int); 26 | static float absMax(float, float); 27 | static float absMaxSigned(float, float); 28 | static float atan(float); 29 | static float atan2(float y, float x); 30 | static float cos(float); 31 | static int floor(float); 32 | static void initMth(); 33 | static int intFloorDiv(int, int); 34 | static float invSqrt(float); 35 | static int random(int); 36 | static float random(void); 37 | static float sin(float); 38 | static float sqrt(float); 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /source/client/model/HumanoidModel.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Model.hpp" 12 | 13 | class HumanoidModel : public Model 14 | { 15 | public: 16 | HumanoidModel(float a, float b); 17 | void _logGraphics(); 18 | // @TODO - No xrefs: void render(HumanoidModel* a, float f); 19 | 20 | void onGraphicsReset() override; 21 | void render(float, float, float, float, float, float) override; 22 | void renderHorrible(float, float, float, float, float, float) override; 23 | void setupAnim(float, float, float, float, float, float) override; 24 | 25 | public: 26 | // @TODO: swap armL and armR.. Steve punches with the right hand. 27 | Cube m_head, m_body, m_armL, m_armR, m_legL, m_legR; 28 | bool field_10BC = false; 29 | bool field_10BD = false; 30 | bool field_10BE = false; 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /source/client/model/Model.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "Model.hpp" 10 | 11 | void Model::onGraphicsReset() 12 | { 13 | 14 | } 15 | 16 | void Model::prepareMobModel(Mob*, float, float, float) 17 | { 18 | 19 | } 20 | 21 | void Model::render(float, float, float, float, float, float) 22 | { 23 | 24 | } 25 | 26 | void Model::renderHorrible(float, float, float, float, float, float) 27 | { 28 | 29 | } 30 | 31 | void Model::setupAnim(float, float, float, float, float, float) 32 | { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /source/client/model/Model.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Cube.hpp" 12 | #include "world/entity/Mob.hpp" 13 | 14 | class Model 15 | { 16 | public: 17 | virtual void onGraphicsReset(); 18 | virtual void prepareMobModel(Mob*, float, float, float); 19 | virtual void render(float, float, float, float, float, float); 20 | virtual void renderHorrible(float, float, float, float, float, float); 21 | virtual void setupAnim(float, float, float, float, float, float); 22 | 23 | public: 24 | float field_4 = 0.0f; 25 | bool field_8 = false; 26 | }; 27 | -------------------------------------------------------------------------------- /source/client/model/PolygonQuad.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include "GameMods.hpp" 13 | #include "VertexPT.hpp" 14 | #include "client/renderer/Tesselator.hpp" 15 | 16 | class PolygonQuad 17 | { 18 | public: 19 | PolygonQuad() {}; 20 | PolygonQuad(VertexPT* a, VertexPT* b, VertexPT* c, VertexPT* d); 21 | PolygonQuad(VertexPT* a, VertexPT* b, VertexPT* c, VertexPT* d, float u1, float v1, float u2, float v2); 22 | PolygonQuad(VertexPT* a, VertexPT* b, VertexPT* c, VertexPT* d, int u1i, int v1i, int u2i, int v2i); 23 | 24 | void flipNormal(); 25 | void mirror(); 26 | void render(Tesselator& t, float scale, int unused); 27 | 28 | #ifdef ENH_ENTITY_SHADING 29 | void setColor(float r, float g, float b); 30 | #endif 31 | 32 | private: 33 | VertexPT m_verts[4]; 34 | bool m_bFlipNormals = false; 35 | 36 | #ifdef ENH_ENTITY_SHADING 37 | int m_color = 0xFFFFFF; 38 | #endif 39 | }; 40 | -------------------------------------------------------------------------------- /source/client/model/VertexPT.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | struct VertexPT 12 | { 13 | float x = 0, y = 0, z = 0; 14 | float u = 0, v = 0; 15 | 16 | VertexPT() {} 17 | VertexPT(float x, float y, float z) : x(x), y(y), z(z) {} 18 | VertexPT(float x, float y, float z, float(u), float(v)) : x(x), y(y), z(z), u(u), v(v) {} 19 | 20 | void setUV(float _u, float _v) 21 | { 22 | u = _u, v = _v; 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /source/client/network/MinecraftPackets.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Packet.hpp" 12 | 13 | class MinecraftPackets 14 | { 15 | public: 16 | static Packet* createPacket(int type); 17 | }; 18 | 19 | -------------------------------------------------------------------------------- /source/client/network/PingedCompatibleServer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include "RakNetTypes.h" 13 | #include "RakString.h" 14 | 15 | 16 | struct PingedCompatibleServer 17 | { 18 | RakNet::RakString m_name; 19 | RakNet::SystemAddress m_address; 20 | int m_lastPinged; 21 | }; 22 | -------------------------------------------------------------------------------- /source/client/network/packets/AddPlayerPacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | AddPlayerPacket::AddPlayerPacket(const RakNet::RakNetGUID& guid, RakNet::RakString name, int id, float x, float y, float z) 12 | { 13 | m_guid = guid; 14 | m_name = name; 15 | m_id = id; 16 | m_x = x; 17 | m_y = y; 18 | m_z = z; 19 | } 20 | 21 | void AddPlayerPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 22 | { 23 | pCallback->handle(guid, this); 24 | } 25 | 26 | void AddPlayerPacket::write(RakNet::BitStream* bs) 27 | { 28 | bs->Write(PACKET_ADD_PLAYER); 29 | bs->Write(m_guid); 30 | bs->Write(m_name); 31 | bs->Write(m_id); 32 | bs->Write(m_x); 33 | bs->Write(m_y); 34 | bs->Write(m_z); 35 | } 36 | 37 | void AddPlayerPacket::read(RakNet::BitStream* bs) 38 | { 39 | bs->Read(m_guid); 40 | bs->Read(m_name); 41 | bs->Read(m_id); 42 | bs->Read(m_x); 43 | bs->Read(m_y); 44 | bs->Read(m_z); 45 | } -------------------------------------------------------------------------------- /source/client/network/packets/LoginPacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void LoginPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void LoginPacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_LOGIN); 19 | bs->Write(m_str); 20 | } 21 | 22 | void LoginPacket::read(RakNet::BitStream* bs) 23 | { 24 | bs->Read(m_str); 25 | } 26 | -------------------------------------------------------------------------------- /source/client/network/packets/MessagePacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void MessagePacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void MessagePacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_MESSAGE); 19 | bs->Write(m_str); 20 | } 21 | 22 | void MessagePacket::read(RakNet::BitStream* bs) 23 | { 24 | bs->Read(m_str); 25 | } -------------------------------------------------------------------------------- /source/client/network/packets/MovePlayerPacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void MovePlayerPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void MovePlayerPacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_MOVE_PLAYER); 19 | bs->Write(m_id); 20 | bs->Write(m_x); 21 | bs->Write(m_y); 22 | bs->Write(m_z); 23 | bs->Write(m_pitch); 24 | bs->Write(m_yaw); 25 | } 26 | 27 | void MovePlayerPacket::read(RakNet::BitStream* bs) 28 | { 29 | bs->Read(m_id); 30 | bs->Read(m_x); 31 | bs->Read(m_y); 32 | bs->Read(m_z); 33 | bs->Read(m_pitch); 34 | bs->Read(m_yaw); 35 | } 36 | -------------------------------------------------------------------------------- /source/client/network/packets/PlaceBlockPacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void PlaceBlockPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void PlaceBlockPacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_PLACE_BLOCK); 19 | bs->Write(m_playerID); 20 | bs->Write(m_x); 21 | bs->Write(m_z); 22 | bs->Write(m_y); 23 | bs->Write(m_tile); 24 | bs->Write(m_face); 25 | } 26 | 27 | void PlaceBlockPacket::read(RakNet::BitStream* bs) 28 | { 29 | bs->Read(m_playerID); 30 | bs->Read(m_x); 31 | bs->Read(m_z); 32 | bs->Read(m_y); 33 | bs->Read(m_tile); 34 | bs->Read(m_face); 35 | } 36 | -------------------------------------------------------------------------------- /source/client/network/packets/PlayerEquipmentPacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void PlayerEquipmentPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void PlayerEquipmentPacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_PLAYER_EQUIPMENT); 19 | bs->Write(m_playerID); 20 | bs->Write(m_itemID); 21 | } 22 | 23 | void PlayerEquipmentPacket::read(RakNet::BitStream* bs) 24 | { 25 | bs->Read(m_playerID); 26 | bs->Read(m_itemID); 27 | } 28 | -------------------------------------------------------------------------------- /source/client/network/packets/RemoveBlockPacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void RemoveBlockPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void RemoveBlockPacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_REMOVE_BLOCK); 19 | bs->Write(m_playerID); 20 | bs->Write(m_x); 21 | bs->Write(m_z); 22 | bs->Write(m_y); 23 | } 24 | 25 | void RemoveBlockPacket::read(RakNet::BitStream* bs) 26 | { 27 | bs->Read(m_playerID); 28 | bs->Read(m_x); 29 | bs->Read(m_z); 30 | bs->Read(m_y); 31 | } 32 | -------------------------------------------------------------------------------- /source/client/network/packets/RemoveEntityPacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void RemoveEntityPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void RemoveEntityPacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_REMOVE_ENTITY); 19 | bs->Write(m_id); 20 | } 21 | 22 | void RemoveEntityPacket::read(RakNet::BitStream* bs) 23 | { 24 | bs->Read(m_id); 25 | } 26 | -------------------------------------------------------------------------------- /source/client/network/packets/RequestChunkPacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void RequestChunkPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void RequestChunkPacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_REQUEST_CHUNK); 19 | bs->Write(m_x); 20 | bs->Write(m_z); 21 | } 22 | 23 | void RequestChunkPacket::read(RakNet::BitStream* bs) 24 | { 25 | bs->Read(m_x); 26 | bs->Read(m_z); 27 | } 28 | -------------------------------------------------------------------------------- /source/client/network/packets/StartGamePacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void StartGamePacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void StartGamePacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_START_GAME); 19 | bs->Write(field_4); 20 | bs->Write(field_8); 21 | bs->Write(field_C); 22 | bs->Write(field_10); 23 | bs->Write(field_14); 24 | bs->Write(field_18); 25 | } 26 | 27 | void StartGamePacket::read(RakNet::BitStream* bs) 28 | { 29 | bs->Read(field_4); 30 | bs->Read(field_8); 31 | bs->Read(field_C); 32 | bs->Read(field_10); 33 | bs->Read(field_14); 34 | bs->Read(field_18); 35 | } -------------------------------------------------------------------------------- /source/client/network/packets/UpdateBlockPacket.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "../Packet.hpp" 10 | 11 | void UpdateBlockPacket::handle(const RakNet::RakNetGUID& guid, NetEventCallback* pCallback) 12 | { 13 | pCallback->handle(guid, this); 14 | } 15 | 16 | void UpdateBlockPacket::write(RakNet::BitStream* bs) 17 | { 18 | bs->Write(PACKET_UPDATE_BLOCK); 19 | bs->Write(m_x); 20 | bs->Write(m_z); 21 | bs->Write(m_y); 22 | bs->Write(m_tile); 23 | bs->Write(m_data); 24 | } 25 | 26 | void UpdateBlockPacket::read(RakNet::BitStream* bs) 27 | { 28 | bs->Read(m_x); 29 | bs->Read(m_z); 30 | bs->Read(m_y); 31 | bs->Read(m_tile); 32 | bs->Read(m_data); 33 | } 34 | -------------------------------------------------------------------------------- /source/client/particle/ParticleEngine.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "world/level/Level.hpp" 12 | #include "client/renderer/Textures.hpp" 13 | #include "Particle.hpp" 14 | 15 | class ParticleEngine 16 | { 17 | public: 18 | ParticleEngine(Level*, Textures*); 19 | 20 | void add(Particle*); 21 | std::string countParticles(); 22 | void crack(int x, int y, int z, int dir); 23 | void destroy(int x, int y, int z); 24 | void render(Entity*, float f); 25 | void renderLit(); 26 | void tick(); 27 | void setLevel(Level*); 28 | 29 | public: 30 | Level* m_pLevel; 31 | // todo 32 | std::vector m_particles[4]; 33 | Textures* m_pTextures; 34 | Random m_random; 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /source/client/player/input/Controller.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | class Controller 14 | { 15 | public: 16 | static bool isValidStick(int stickNo); 17 | static float linearTransform(float, float, float, bool); 18 | static void feed(int stickNo, int touched, float x, float y); 19 | static float getX(int stickNo); 20 | static float getY(int stickNo); 21 | static float getTransformedX(int stickNo, float a2, float a3, bool b); 22 | static float getTransformedY(int stickNo, float a2, float a3, bool b); 23 | static bool isTouched(int stickNo); 24 | 25 | public: 26 | static bool isTouchedValues[2]; 27 | static float stickValuesX[2], stickValuesY[2]; 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /source/client/player/input/ControllerTurnInput.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "ITurnInput.hpp" 12 | 13 | class ControllerTurnInput : public ITurnInput 14 | { 15 | public: 16 | ITurnInput::Delta getTurnDelta(); 17 | 18 | private: 19 | int field_8 = 2; 20 | int m_stickNo = 2; 21 | float field_10 = 0.0f; 22 | float field_14 = 0.0f; 23 | bool field_18 = false; 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /source/client/player/input/ITurnInput.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "ITurnInput.hpp" 10 | #include "client/common/Utils.hpp" 11 | 12 | float ITurnInput::getDeltaTime() 13 | { 14 | if (m_prevTime == -1.0f) 15 | m_prevTime = getTimeS(); 16 | 17 | float newTime = getTimeS(); 18 | float delta = newTime - m_prevTime; 19 | m_prevTime = newTime; 20 | 21 | return delta; 22 | } 23 | -------------------------------------------------------------------------------- /source/client/player/input/ITurnInput.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | class ITurnInput 12 | { 13 | public: 14 | struct Delta 15 | { 16 | float x = 0.0f, y = 0.0f; 17 | Delta() {} 18 | Delta(float x, float y) : x(x), y(y) {} 19 | }; 20 | 21 | public: 22 | float getDeltaTime(); 23 | virtual ~ITurnInput(); 24 | virtual Delta getTurnDelta() = 0; 25 | 26 | private: 27 | float m_prevTime = -1.0f; 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /source/client/player/input/Keyboard.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "Keyboard.hpp" 10 | 11 | std::vector Keyboard::_inputs; 12 | int Keyboard::_index = -1; 13 | int Keyboard::_states[256]; 14 | 15 | void Keyboard::feed(int down, int key) 16 | { 17 | Input i; 18 | i.field_0 = down; 19 | i.field_4 = uint8_t(key); 20 | _inputs.push_back(i); 21 | 22 | _states[key] = down; 23 | } 24 | -------------------------------------------------------------------------------- /source/client/player/input/Keyboard.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | class Keyboard 14 | { 15 | public: 16 | //@TODO: Rename this to KeyboardAction 17 | struct Input 18 | { 19 | int field_0; 20 | uint8_t field_4; 21 | }; 22 | 23 | static std::vector _inputs; 24 | static int _states[256]; 25 | static int _index; 26 | 27 | // likely inlined 28 | static void feed(int down, int key); 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /source/client/player/input/KeyboardInput.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "client/common/Options.hpp" 12 | 13 | class KeyboardInput 14 | { 15 | public: 16 | enum 17 | { 18 | FORWARD, 19 | BACKWARD, 20 | LEFT, 21 | RIGHT, 22 | JUMP, 23 | SNEAK, 24 | }; 25 | 26 | public: 27 | KeyboardInput(Options*); 28 | 29 | virtual void releaseAllKeys(); 30 | virtual void setKey(int index, bool b); 31 | virtual void tick(/* Player* */); 32 | 33 | public: 34 | float m_horzInput = 0.0f; 35 | float m_vertInput = 0.0f; 36 | bool field_C = false; 37 | bool m_bJumpButton = false; 38 | bool m_bSneakButton = false; 39 | bool m_keys[10]; 40 | Options* m_pOptions = nullptr; 41 | }; 42 | 43 | -------------------------------------------------------------------------------- /source/client/player/input/Mouse.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "Mouse.hpp" 10 | 11 | std::vector Mouse::_inputs; 12 | int Mouse::_index, Mouse::_x, Mouse::_y; 13 | int Mouse::_xOld, Mouse::_yOld, Mouse::_buttonStates[3]; 14 | 15 | void Mouse::feed(int x1, int x2, int x3, int x4) 16 | { 17 | _inputs.push_back(MouseInput(x1, x2, x3, x4)); 18 | 19 | if (x1) 20 | Mouse::_buttonStates[x1] = x2; 21 | 22 | _xOld = _x; 23 | _yOld = _y; 24 | _x = x3; 25 | _y = x4; 26 | } 27 | -------------------------------------------------------------------------------- /source/client/player/input/Mouse.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | struct MouseInput 14 | { 15 | int field_0 = 0; 16 | int field_4 = 0; 17 | int field_8 = 0; 18 | int field_C = 0; 19 | 20 | MouseInput() {} 21 | MouseInput(int x1, int x2, int x3, int x4) 22 | { 23 | field_0 = x1; 24 | field_4 = x2; 25 | field_8 = x3; 26 | field_C = x4; 27 | } 28 | }; 29 | 30 | class Mouse 31 | { 32 | public: 33 | static void feed(int, int, int, int); 34 | 35 | // @TODO: There's plenty of inlined code here. Out-line it. 36 | 37 | public: 38 | static std::vector _inputs; 39 | static int _index; 40 | static int _x, _y; 41 | static int _xOld, _yOld; 42 | static int _buttonStates[3]; 43 | }; 44 | 45 | -------------------------------------------------------------------------------- /source/client/player/input/MouseTurnInput.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "MouseTurnInput.hpp" 10 | #include "Mouse.hpp" 11 | 12 | constexpr float C_SENSITIVITY = 1.0f; 13 | 14 | MouseTurnInput::MouseTurnInput(Minecraft* pMC) 15 | { 16 | m_pMinecraft = pMC; 17 | } 18 | 19 | ITurnInput::~ITurnInput() 20 | { 21 | } 22 | 23 | ITurnInput::Delta MouseTurnInput::getTurnDelta() 24 | { 25 | int deltaX = 0, deltaY = 0; 26 | m_pMinecraft->platform()->getMouseDiff(deltaX, deltaY); 27 | m_pMinecraft->platform()->clearDiff(); 28 | 29 | Delta d; 30 | d.x = C_SENSITIVITY * deltaX; 31 | d.y = C_SENSITIVITY * deltaY; 32 | 33 | return d; 34 | } 35 | -------------------------------------------------------------------------------- /source/client/player/input/MouseTurnInput.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "ITurnInput.hpp" 12 | #include "client/Minecraft.hpp" 13 | class Minecraft; 14 | 15 | class MouseTurnInput : public ITurnInput 16 | { 17 | public: 18 | MouseTurnInput(Minecraft*); 19 | Delta getTurnDelta() override; 20 | 21 | private: 22 | int m_lastX = -1; 23 | int m_lastY = -1; 24 | 25 | Minecraft* m_pMinecraft; 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /source/client/player/input/User.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | class User 14 | { 15 | public: 16 | User(const std::string& a, const std::string& b) 17 | { 18 | field_0 = a; 19 | field_18 = b; 20 | } 21 | 22 | public: 23 | std::string field_0; 24 | std::string field_18; 25 | }; 26 | -------------------------------------------------------------------------------- /source/client/renderer/Culler.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "Culler.hpp" 10 | 11 | void Culler::prepare(float x, float y, float z) 12 | { 13 | } 14 | 15 | Culler::~Culler() 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /source/client/renderer/Culler.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "world/phys/AABB.hpp" 12 | 13 | class Culler 14 | { 15 | public: 16 | virtual ~Culler(); 17 | virtual bool isVisible(const AABB&) = 0; 18 | virtual bool cubeInFrustum(float, float, float, float, float, float) = 0; 19 | virtual bool cubeFullyInFrustum(float, float, float, float, float, float) = 0; 20 | virtual void prepare(float, float, float); 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /source/client/renderer/DynamicTexture.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "DynamicTexture.hpp" 10 | #include "client/common/Utils.hpp" 11 | 12 | DynamicTexture::DynamicTexture(int a2) : m_textureIndex(a2) 13 | { 14 | memset(m_pixels, 0, sizeof m_pixels); 15 | } 16 | 17 | void DynamicTexture::bindTexture(Textures* pTextures) 18 | { 19 | pTextures->loadAndBindTexture(C_TERRAIN_NAME); 20 | } 21 | 22 | DynamicTexture::~DynamicTexture() 23 | { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /source/client/renderer/DynamicTexture.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Textures.hpp" 11 | class Textures; // in case we are being included from Textures. We don't need a complete type 12 | 13 | // Essentially, the way these work is by patching themselves into terrain.png with a 14 | // call to glTexSubImage2D 15 | 16 | class DynamicTexture 17 | { 18 | public: 19 | virtual void tick() = 0; 20 | virtual void bindTexture(Textures*); 21 | 22 | DynamicTexture(int a2); 23 | virtual ~DynamicTexture(); 24 | 25 | protected: 26 | int m_textureIndex = 0; 27 | int m_textureSize = 1; 28 | uint8_t m_pixels[1024]; 29 | 30 | friend class Textures; 31 | }; 32 | -------------------------------------------------------------------------------- /source/client/renderer/Frustum.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "client/math/Matrix.hpp" 12 | #include "world/phys/AABB.hpp" 13 | 14 | class Frustum 15 | { 16 | public: 17 | void normalizePlane(Matrix*, int); 18 | 19 | //it's inlined in GameRenderer 20 | static void doOurJobInGameRenderer(); 21 | 22 | static Frustum frustum; 23 | 24 | public: 25 | Matrix m[19]; 26 | }; 27 | 28 | class FrustumData 29 | { 30 | public: 31 | bool pointInFrustum(float x, float y, float z); 32 | bool sphereInFrustum(float x, float y, float z, float radius); 33 | bool cubeFullyInFrustum(float x1, float y1, float z1, float x2, float y2, float z2); 34 | bool cubeInFrustum(float x1, float y1, float z1, float x2, float y2, float z2); 35 | bool cubeInFrustum(const AABB& aabb); 36 | 37 | public: 38 | Frustum x; 39 | }; -------------------------------------------------------------------------------- /source/client/renderer/FrustumCuller.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Culler.hpp" 12 | #include "Frustum.hpp" 13 | #include "world/phys/Vec3.hpp" 14 | 15 | class FrustumCuller : public Culler 16 | { 17 | public: 18 | bool cubeFullyInFrustum(float, float, float, float, float, float); 19 | bool cubeInFrustum(float, float, float, float, float, float); 20 | bool isVisible(const AABB&); 21 | void prepare(float x, float y, float z); 22 | 23 | public: 24 | FrustumData m_frustumData; 25 | Vec3 m_camPos; 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /source/client/renderer/ItemInHandRenderer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "TileRenderer.hpp" 12 | #include "world/item/ItemInstance.hpp" 13 | 14 | class Minecraft; 15 | 16 | class ItemInHandRenderer 17 | { 18 | public: 19 | ItemInHandRenderer(Minecraft* pMC); 20 | void itemPlaced(); 21 | void itemUsed(); 22 | void render(float f); 23 | void renderItem(ItemInstance*); 24 | void renderScreenEffect(float f); 25 | void renderFire(float f); 26 | void renderTex(float f, int tex); 27 | void tick(); 28 | 29 | public: 30 | int field_0 = -1; 31 | ItemInstance m_ItemInstance; 32 | Minecraft* m_pMinecraft; 33 | int field_18 = 0; 34 | float field_1C = 0.0f; 35 | float field_20 = 0.0f; 36 | TileRenderer m_tileRenderer; 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /source/client/renderer/RenderChunk.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "RenderChunk.hpp" 10 | 11 | int RenderChunk::runningId = 0; 12 | -------------------------------------------------------------------------------- /source/client/renderer/RenderChunk.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "compat/GL.hpp" 12 | 13 | class RenderChunk 14 | { 15 | static int runningId; 16 | 17 | public: 18 | GLuint field_0 = -1; 19 | int field_4 = 0; 20 | int m_id; 21 | float field_C = 0.0f; 22 | float field_10 = 0.0f; 23 | float field_14 = 0.0f; 24 | 25 | public: 26 | RenderChunk() 27 | { 28 | m_id = ++runningId; 29 | } 30 | RenderChunk(GLuint a1, int a2) 31 | { 32 | m_id = ++runningId; 33 | field_0 = a1; 34 | field_4 = a2; 35 | } 36 | }; 37 | 38 | -------------------------------------------------------------------------------- /source/client/renderer/RenderList.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "RenderChunk.hpp" 12 | 13 | class RenderList 14 | { 15 | public: 16 | RenderList(); 17 | ~RenderList(); 18 | 19 | void add(int x); 20 | void addR(const RenderChunk&); 21 | void clear(); 22 | void init(float, float, float); 23 | void render(); 24 | void renderChunks(); 25 | 26 | public: 27 | float m_posX = 0.0f; 28 | float m_posY = 0.0f; 29 | float m_posZ = 0.0f; 30 | int* field_C = nullptr; 31 | RenderChunk* field_10 = nullptr; 32 | int field_14 = 0; 33 | bool field_18 = false; 34 | bool field_19 = false; 35 | int field_1C = 0; 36 | }; 37 | 38 | -------------------------------------------------------------------------------- /source/client/renderer/Texture.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | struct Texture 14 | { 15 | int m_width = 0; 16 | int m_height = 0; 17 | uint32_t* m_pixels = nullptr; 18 | uint8_t field_C = false; 19 | uint8_t field_D = false; 20 | 21 | Texture() {} 22 | Texture(int width, int height, void* pixels, uint8_t a1, uint8_t a2) : m_width(width), m_height(height), m_pixels((uint32_t*)pixels), field_C(a1), field_D(a2) {} 23 | }; 24 | 25 | struct GLTexture 26 | { 27 | unsigned m_textureID; // GL texture ID 28 | Texture m_textureData; 29 | }; 30 | -------------------------------------------------------------------------------- /source/client/renderer/WaterSideTexture.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "DynamicTexture.hpp" 11 | 12 | class WaterSideTexture : public DynamicTexture 13 | { 14 | public: 15 | WaterSideTexture(); 16 | ~WaterSideTexture(); 17 | 18 | void tick() override; 19 | 20 | public: 21 | int field_40C = 0; 22 | int field_410 = 0; 23 | int field_414 = 0; 24 | float* m_data1 = nullptr; 25 | float* m_data2 = nullptr; 26 | float* m_data3 = nullptr; 27 | float* m_data4 = nullptr; 28 | }; 29 | -------------------------------------------------------------------------------- /source/client/renderer/WaterTexture.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "DynamicTexture.hpp" 11 | 12 | class WaterTexture : public DynamicTexture 13 | { 14 | public: 15 | WaterTexture(); 16 | ~WaterTexture(); 17 | 18 | void tick() override; 19 | 20 | public: 21 | int field_40C = 0; 22 | int field_410 = 0; 23 | float* m_data1 = nullptr; 24 | float* m_data2 = nullptr; 25 | float* m_data3 = nullptr; 26 | float* m_data4 = nullptr; 27 | }; 28 | -------------------------------------------------------------------------------- /source/client/renderer/entity/EntityRenderer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "client/model/HumanoidModel.hpp" 12 | #include "client/gui/Font.hpp" 13 | 14 | class EntityRenderDispatcher; 15 | 16 | class EntityRenderer 17 | { 18 | public: 19 | EntityRenderer(); 20 | void bindTexture(const std::string& file); 21 | Font* getFont(); 22 | void init(EntityRenderDispatcher* d); 23 | static void render(const AABB&, float, float, float); 24 | static void renderFlat(const AABB&); 25 | 26 | virtual void render(Entity*, float, float, float, float, float) = 0; 27 | virtual void onGraphicsReset(); 28 | 29 | public: 30 | float field_4 = 0.0f; 31 | float field_8 = 1.0f; 32 | EntityRenderDispatcher* m_pDispatcher = nullptr; 33 | 34 | // @HUH: Why is there a HumanoidModel here? There's another 35 | // in HumanoidMobRenderer... 36 | HumanoidModel m_model; 37 | }; 38 | -------------------------------------------------------------------------------- /source/client/renderer/entity/FallingTileRenderer.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "GameMods.hpp" 10 | #if defined(ENH_ALLOW_SAND_GRAVITY) 11 | #include "FallingTileRenderer.hpp" 12 | #include "FallingTile.hpp" 13 | 14 | FallingTileRenderer::FallingTileRenderer() 15 | { 16 | field_4 = 0.5f; 17 | } 18 | 19 | void FallingTileRenderer::render(Entity* entity, float x, float y, float z, float a6, float a7) 20 | { 21 | FallingTile* fallingTile = (FallingTile*)entity; 22 | 23 | glPushMatrix(); 24 | glTranslatef(x, y, z); 25 | 26 | bindTexture(C_TERRAIN_NAME); 27 | 28 | // @NOTE: Useless assignment. Already being done by the renderTile function 29 | Tesselator::instance.color(1.0f, 1.0f, 1.0f); 30 | 31 | // Render the base 32 | #ifdef ENH_SHADE_HELD_TILES 33 | #define ARGPATCH , 1.0f 34 | #else 35 | #define ARGPATCH 36 | #endif 37 | 38 | m_tileRenderer.renderTile(Tile::tiles[fallingTile->m_id], 0 ARGPATCH); 39 | 40 | glPopMatrix(); 41 | 42 | #ifdef ARGPATCH 43 | #undef ARGPATCH 44 | #endif 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /source/client/renderer/entity/FallingTileRenderer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | #if defined(ENH_ALLOW_SAND_GRAVITY) 11 | 12 | #include "EntityRenderer.hpp" 13 | #include "TileRenderer.hpp" 14 | 15 | class FallingTileRenderer : public EntityRenderer 16 | { 17 | public: 18 | FallingTileRenderer(); 19 | 20 | void render(Entity*, float, float, float, float, float) override; 21 | 22 | public: 23 | TileRenderer m_tileRenderer; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /source/client/renderer/entity/HumanoidMobRenderer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "MobRenderer.hpp" 12 | 13 | class HumanoidMobRenderer : public MobRenderer 14 | { 15 | public: 16 | HumanoidMobRenderer(HumanoidModel*, float); 17 | virtual void additionalRendering(Mob*, float) override; 18 | virtual void onGraphicsReset() override; 19 | 20 | void renderHand(); 21 | 22 | public: 23 | HumanoidModel* m_pHumanoidModel; 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /source/client/renderer/entity/ItemRenderer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "EntityRenderer.hpp" 12 | #include "world/item/ItemInstance.hpp" 13 | #include "client/renderer/TileRenderer.hpp" 14 | 15 | class ItemRenderer : public EntityRenderer 16 | { 17 | public: 18 | ItemRenderer(); 19 | 20 | void render(Entity*, float, float, float, float, float) override; 21 | void blitRect(Tesselator&, int, int, int, int, int); 22 | 23 | static void blit(int, int, int, int, int, int); 24 | static void renderGuiItem(Font*, Textures*, ItemInstance*, int, int, bool); 25 | 26 | public: 27 | Random m_random; 28 | static TileRenderer* tileRenderer; 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /source/client/renderer/entity/ItemSpriteRenderer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "EntityRenderer.hpp" 4 | 5 | class ItemSpriteRenderer : public EntityRenderer 6 | { 7 | public: 8 | ItemSpriteRenderer(int sprite); 9 | void render(Entity*, float x, float y, float z, float a, float b) override; 10 | 11 | public: 12 | int m_sprite; 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /source/client/renderer/entity/MobRenderer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "EntityRenderer.hpp" 12 | 13 | class MobRenderer : public EntityRenderer 14 | { 15 | public: 16 | MobRenderer(Model*, float); 17 | void setArmor(Model*); 18 | 19 | virtual void render(Entity*, float, float, float, float, float) override; 20 | virtual int prepareArmor(Mob*, int, float); 21 | virtual void setupPosition(Entity*, float, float, float); 22 | virtual void setupRotations(Entity*, float, float, float); 23 | virtual float getAttackAnim(Mob*, float); 24 | virtual float getBob(Mob*, float); 25 | virtual float getFlipDegrees(Mob*); 26 | virtual int getOverlayColor(Mob*, float, float); 27 | virtual void scale(Mob*, float); 28 | virtual void renderName(Mob*, float, float, float); 29 | virtual void renderNameTag(Mob*, const std::string&, float, float, float, int); 30 | virtual void additionalRendering(Mob*, float); 31 | 32 | public: 33 | Model* m_pModel; 34 | Model* m_pArmorModel = nullptr; 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /source/client/renderer/entity/TntRenderer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "EntityRenderer.hpp" 12 | #include "client/renderer/TileRenderer.hpp" 13 | 14 | class TntRenderer : public EntityRenderer 15 | { 16 | public: 17 | TntRenderer(); 18 | 19 | void render(Entity*, float, float, float, float, float) override; 20 | 21 | public: 22 | TileRenderer m_tileRenderer; 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /source/client/renderer/entity/TripodCameraRenderer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "EntityRenderer.hpp" 12 | #include "world/level/tile/Tile.hpp" 13 | #include "world/entity/TripodCamera.hpp" 14 | #include "client/renderer/TileRenderer.hpp" 15 | 16 | class TripodCameraRenderer : public EntityRenderer 17 | { 18 | public: 19 | TripodCameraRenderer(); 20 | 21 | void render(Entity*, float, float, float, float, float) override; 22 | 23 | static float getFlashTime(TripodCamera*, float f); 24 | 25 | public: 26 | TileRenderer m_renderer; 27 | Tile m_tile; 28 | Cube m_cube; 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /source/client/sound/SoundData.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "SoundData.hpp" 10 | 11 | // -------------------------------------------------------------------- 12 | // WARNING! If you have an error here it is most likely because you did 13 | // not grab the sound data from a working mcpe01_canada.apk. 14 | // 15 | // Check the readme for a guide on how to extract game sounds from the 16 | // mcpe01_canada.apk file. 17 | // -------------------------------------------------------------------- 18 | #include "../../../sound_data/sounds.h" 19 | -------------------------------------------------------------------------------- /source/client/sound/SoundData.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | struct PCMSoundHeader 14 | { 15 | int m_channels; 16 | int m_bytes_per_sample; 17 | int m_sample_rate; 18 | int m_length; 19 | }; 20 | 21 | struct SoundDesc 22 | { 23 | uint16_t* m_pData; 24 | int field_4; 25 | PCMSoundHeader m_header; 26 | PCMSoundHeader* m_pHeader = nullptr; 27 | 28 | SoundDesc() {} 29 | SoundDesc(PCMSoundHeader& header, uint16_t* data) 30 | { 31 | m_pHeader = &header; 32 | m_header = header; 33 | m_pData = data; 34 | field_4 = header.m_channels * header.m_length * header.m_bytes_per_sample; 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /source/client/sound/SoundEngine.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "SoundSystem.hpp" 12 | #include "SoundRepository.hpp" 13 | #include "client/common/Options.hpp" 14 | #include "client/math/Random.hpp" 15 | 16 | // Platform specific type for the sound system. 17 | 18 | #ifdef _WIN32 19 | #include "SoundSystemWindows.hpp" 20 | #define SOUND_SYSTEM_TYPE SoundSystemWindows 21 | #else 22 | #define SOUND_SYSTEM_TYPE SoundSystem 23 | #endif 24 | 25 | //#define SOUND_SYSTEM_TYPE SoundSystemSL 26 | 27 | // @TODO: SoundSystemSL - Use this for the Android port 28 | 29 | class SoundEngine 30 | { 31 | public: 32 | SoundEngine(); 33 | void init(Options*); 34 | void play(const std::string& name); 35 | void play(const std::string& name, float, float, float, float, float); 36 | 37 | public: 38 | SOUND_SYSTEM_TYPE m_soundSystem; 39 | Options* m_pOptions; 40 | int field_40 = 0; 41 | Random m_random; 42 | SoundRepository m_repository; 43 | int field_A1C = 0; 44 | int field_A20; 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /source/client/sound/SoundRepository.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "SoundRepository.hpp" 10 | #include "client/common/Utils.hpp" 11 | #include "client/math/Mth.hpp" 12 | 13 | void SoundRepository::add(const std::string& name, SoundDesc& sd) 14 | { 15 | auto iter = m_repo.find(name); 16 | if (iter == m_repo.end()) 17 | { 18 | std::vector sdv; 19 | sdv.push_back(sd); 20 | m_repo.insert({ name, sdv }); 21 | } 22 | else 23 | { 24 | iter->second.push_back(sd); 25 | } 26 | } 27 | 28 | bool SoundRepository::get(const std::string& name, SoundDesc& sd) 29 | { 30 | auto iter = m_repo.find(name); 31 | if (iter == m_repo.end()) 32 | { 33 | printf("Couldn't find a sound with id: %s\n", name.c_str()); 34 | return false; 35 | } 36 | 37 | int index = Mth::random(int(iter->second.size())); 38 | 39 | sd = iter->second[index]; 40 | 41 | return true; 42 | } 43 | -------------------------------------------------------------------------------- /source/client/sound/SoundRepository.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | #include 14 | #include "SoundData.hpp" 15 | 16 | class SoundRepository 17 | { 18 | public: 19 | void add(const std::string& name, SoundDesc& sd); 20 | bool get(const std::string& name, SoundDesc& sd); 21 | 22 | public: 23 | std::map> m_repo; 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /source/client/sound/SoundSystem.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "SoundSystem.hpp" 10 | 11 | bool SoundSystem::isAvailable() 12 | { 13 | return false; 14 | } 15 | 16 | void SoundSystem::setListenerPos(float x, float y, float z) 17 | { 18 | } 19 | 20 | #ifndef ORIGINAL_CODE 21 | void SoundSystem::setListenerAngle(float yaw, float pitch) 22 | { 23 | } 24 | #else 25 | void SoundSystem::setListenerAngle(float yaw) 26 | { 27 | } 28 | #endif 29 | 30 | void SoundSystem::load(const std::string& sound) 31 | { 32 | } 33 | 34 | void SoundSystem::play(const std::string& sound) 35 | { 36 | } 37 | 38 | void SoundSystem::pause(const std::string& sound) 39 | { 40 | } 41 | 42 | void SoundSystem::stop(const std::string& sound) 43 | { 44 | } 45 | 46 | void SoundSystem::playAt(const SoundDesc& sound, float x, float y, float z, float a, float b) 47 | { 48 | } 49 | -------------------------------------------------------------------------------- /source/client/sound/SoundSystem.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include "SoundData.hpp" 13 | 14 | class SoundSystem 15 | { 16 | public: 17 | virtual bool isAvailable(); 18 | virtual void setListenerPos(float x, float y, float z); 19 | #ifndef ORIGINAL_CODE 20 | virtual void setListenerAngle(float yaw, float pitch); 21 | #else 22 | virtual void setListenerAngle(float yaw); 23 | #endif 24 | virtual void load(const std::string& sound); 25 | virtual void play(const std::string& sound); 26 | virtual void pause(const std::string& sound); 27 | virtual void stop(const std::string& sound); 28 | virtual void playAt(const SoundDesc& sound, float x, float y, float z, float a, float b); 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /source/world/entity/FallingTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Entity.hpp" 12 | 13 | class FallingTile : public Entity 14 | { 15 | public: 16 | FallingTile(Level*); 17 | FallingTile(Level*, float x, float y, float z, int id); 18 | 19 | float getShadowHeightOffs() override; 20 | bool isPickable() override; 21 | void tick() override; 22 | 23 | Level* getLevel(); 24 | 25 | public: 26 | int m_id; 27 | int field_E0 = 0; 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /source/world/entity/PrimedTnt.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Entity.hpp" 12 | 13 | class PrimedTnt : public Entity 14 | { 15 | public: 16 | PrimedTnt(Level*); 17 | PrimedTnt(Level*, float, float, float); 18 | 19 | float getShadowHeightOffs() override; 20 | bool isPickable() override; 21 | void tick() override; 22 | 23 | void explode(); 24 | 25 | public: 26 | int m_fuseTimer; 27 | }; 28 | 29 | -------------------------------------------------------------------------------- /source/world/entity/TripodCamera.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Mob.hpp" 12 | 13 | class Level; 14 | class Player; 15 | 16 | class TripodCamera : public Mob 17 | { 18 | public: 19 | TripodCamera(Level*, Player*, float, float, float); 20 | 21 | void defineSynchedData() override; 22 | float getShadowHeightOffs() override; 23 | bool interact(Player* player) override; 24 | int interactPreventDefault() override; 25 | bool isPickable() override; 26 | bool isPushable() override; 27 | void tick() override; 28 | 29 | public: 30 | int field_B8C = 0; 31 | int field_B90 = 80; 32 | Player* m_owner = nullptr; 33 | bool m_bActive = false; 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /source/world/gamemode/SurvivalMode.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "GameMode.hpp" 12 | 13 | class SurvivalMode : public GameMode 14 | { 15 | public: 16 | SurvivalMode(Minecraft*); 17 | 18 | virtual void startDestroyBlock(int x, int y, int z, int i) override; 19 | virtual bool destroyBlock(int x, int y, int z, int i); 20 | virtual void continueDestroyBlock(int x, int y, int z, int i); 21 | virtual void stopDestroyBlock() override; 22 | virtual void tick() override; 23 | virtual void render(float f) override; 24 | virtual float getPickRange() override; 25 | virtual bool isCreativeType() override; 26 | virtual bool isSurvivalType() override; 27 | virtual void initPlayer(Player*) override; 28 | 29 | public: 30 | int m_destroyingX = -1; 31 | int m_destroyingY = -1; 32 | int m_destroyingZ = -1; 33 | float field_18 = 0.0f; 34 | float field_1C = 0.0f; 35 | int field_20 = 0; 36 | int field_24 = 0; 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /source/world/item/CameraItem.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "CameraItem.hpp" 10 | #include "world/level/Level.hpp" 11 | #include "world/entity/TripodCamera.hpp" 12 | #include "world/entity/Player.hpp" 13 | 14 | CameraItem::CameraItem(int id) : Item(id) 15 | { 16 | } 17 | 18 | ItemInstance* CameraItem::use(ItemInstance* inst, Level* level, Player* player) 19 | { 20 | #ifndef ORIGINAL_CODE 21 | // prevent players from using this in multiplayer, to prevent a desync of entity IDs 22 | if (level->field_11) 23 | return inst; 24 | #endif 25 | 26 | level->addEntity(new TripodCamera(level, player, player->pos.x, player->pos.y, player->pos.z)); 27 | return inst; 28 | } 29 | -------------------------------------------------------------------------------- /source/world/item/CameraItem.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Item.hpp" 12 | 13 | class CameraItem : public Item 14 | { 15 | public: 16 | CameraItem(int id); 17 | 18 | ItemInstance* use(ItemInstance* inst, Level* level, Player* player) override; 19 | }; 20 | -------------------------------------------------------------------------------- /source/world/item/DoorItem.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Item.hpp" 12 | 13 | class DoorItem : public Item 14 | { 15 | public: 16 | DoorItem(int id, Material* pMtl); 17 | 18 | virtual bool useOn(ItemInstance*, Player*, Level*, int, int, int, int); 19 | 20 | public: 21 | Material* material; 22 | }; 23 | -------------------------------------------------------------------------------- /source/world/item/Inventory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "world/entity/Player.hpp" 4 | 5 | class Player; // in case we're included from Player.hpp 6 | 7 | #define C_MAX_HOTBAR_ITEMS (9) 8 | 9 | #ifdef ENH_EXTRA_ITEMS_IN_INV 10 | #define C_MAX_INVENTORY_ITEMS (36+9) 11 | #else 12 | #define C_MAX_INVENTORY_ITEMS (36) 13 | #endif 14 | 15 | class Inventory 16 | { 17 | public: 18 | Inventory(Player*); 19 | 20 | int getSelectionSize(); 21 | int getSelectionSlotItemId(int slotNo); 22 | int getSelectedItemId(); 23 | void selectSlot(int slotNo); 24 | void setSelectionSlotItemId(int slotNo, int item); 25 | 26 | public: 27 | int m_SelectedHotbarSlot; 28 | Player* m_pPlayer; 29 | 30 | int m_hotbar[C_MAX_HOTBAR_ITEMS]; 31 | int m_items [C_MAX_INVENTORY_ITEMS]; 32 | }; 33 | 34 | -------------------------------------------------------------------------------- /source/world/item/TileItem.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Item.hpp" 12 | 13 | class TileItem : public Item 14 | { 15 | public: 16 | TileItem(int id); 17 | 18 | virtual std::string getDescriptionId(); 19 | virtual std::string getDescriptionId(ItemInstance*); 20 | virtual bool useOn(ItemInstance*, Player*, Level*, int, int, int, int); 21 | 22 | public: 23 | int m_tile; 24 | }; 25 | -------------------------------------------------------------------------------- /source/world/item/TilePlanterItem.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Item.hpp" 12 | 13 | class TilePlanterItem : public Item 14 | { 15 | public: 16 | TilePlanterItem(int id, int place); 17 | 18 | virtual bool useOn(ItemInstance*, Player*, Level*, int, int, int, int); 19 | 20 | public: 21 | int m_tile; 22 | }; 23 | -------------------------------------------------------------------------------- /source/world/level/Explosion.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include "world/level/Level.hpp" 13 | #include "world/entity/Entity.hpp" 14 | 15 | class Explosion 16 | { 17 | public: 18 | Explosion(Level*, Entity*, float x, float y, float z, float power); 19 | void addParticles(); 20 | void explode(); 21 | 22 | // @NOTE: This is inlined 23 | inline void setFiery(bool b) 24 | { 25 | m_bIsFiery = b; 26 | } 27 | 28 | public: 29 | Vec3 m_pos; 30 | float m_power; 31 | 32 | //field_10, field_14, field_18, field_1C - Likely a set 33 | std::set m_tiles; 34 | int field_20 = 0; 35 | 36 | bool m_bIsFiery = false; 37 | Entity* m_pEntity = nullptr; 38 | Random m_random; 39 | Level* m_pLevel; 40 | 41 | }; 42 | 43 | -------------------------------------------------------------------------------- /source/world/level/LevelListener.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | #include 11 | #include "world/entity/TripodCamera.hpp" 12 | 13 | class LevelListener 14 | { 15 | public: 16 | virtual ~LevelListener() {} 17 | virtual void tileChanged(int, int, int); 18 | virtual void tileBrightnessChanged(int, int, int); 19 | virtual void setTilesDirty(int, int, int, int, int, int); 20 | virtual void allChanged(); 21 | virtual void playSound(const std::string&, float, float, float, float, float); 22 | virtual void takePicture(TripodCamera*, Entity*); 23 | virtual void addParticle(const std::string&, float, float, float, float, float, float); 24 | virtual void playMusic(const std::string&, float, float, float, float); 25 | virtual void entityAdded(Entity*); 26 | virtual void entityRemoved(Entity*); 27 | virtual void skyColorChanged(); 28 | virtual void playStreamingMusic(const std::string&, int, int, int); 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /source/world/level/LightLayer.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "LightLayer.hpp" 10 | 11 | LightLayer LightLayer::Sky(15), LightLayer::Block(0); 12 | 13 | LightLayer::LightLayer(int x) 14 | { 15 | m_x = x; 16 | } 17 | -------------------------------------------------------------------------------- /source/world/level/LightLayer.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | class LightLayer 12 | { 13 | public: 14 | LightLayer(int x); 15 | public: 16 | static LightLayer Sky, Block; 17 | public: 18 | int m_x; 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /source/world/level/LightUpdate.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "LightLayer.hpp" 12 | 13 | class Level; 14 | 15 | struct LightUpdate 16 | { 17 | const LightLayer* m_lightLayer; 18 | int m_x1, m_y1, m_z1, m_x2, m_y2, m_z2; 19 | 20 | LightUpdate(const LightLayer& ll, int x1, int y1, int z1, int x2, int y2, int z2) 21 | { 22 | m_lightLayer = ≪ 23 | m_x1 = x1; m_x2 = x2; 24 | m_y1 = y1; m_y2 = y2; 25 | m_z1 = z1; m_z2 = z2; 26 | } 27 | 28 | void update(Level* pLevel); 29 | bool expandToContain(int x1, int y1, int z1, int x2, int y2, int z2); 30 | }; 31 | 32 | -------------------------------------------------------------------------------- /source/world/level/RegionFile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "BitStream.h" 8 | 9 | class RegionFile 10 | { 11 | public: 12 | RegionFile(const std::string fileName); 13 | ~RegionFile(); 14 | void close(); 15 | bool open(); 16 | bool readChunk(int x, int z, RakNet::BitStream**); 17 | bool write(int index, RakNet::BitStream&); 18 | bool writeChunk(int x, int z, RakNet::BitStream&); 19 | 20 | public: 21 | FILE* m_pFile = nullptr; 22 | std::string m_fileName; 23 | int* field_20; 24 | int* field_24; 25 | std::map field_28; 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /source/world/level/TickNextTickData.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | #include "client/common/LongHack.hpp" 11 | 12 | struct TickNextTickData 13 | { 14 | static int C; 15 | 16 | TickNextTickData(int a, int b, int c, int d); 17 | int hashCode() const; 18 | bool operator<(const TickNextTickData& other) const; 19 | bool operator==(const TickNextTickData& other) const; 20 | void setDelay(TLong); 21 | 22 | int id; 23 | int field_4; 24 | int field_8; 25 | int field_C; 26 | int field_10; 27 | TLong m_delay; 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /source/world/level/biome/BiomeSource.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Biome.hpp" 12 | 13 | class Level; 14 | class BiomeSource 15 | { 16 | public: 17 | BiomeSource(Level*); 18 | BiomeSource(); 19 | virtual ~BiomeSource(); 20 | 21 | virtual Biome* getBiome(ChunkPos&); 22 | virtual Biome* getBiome(int, int); 23 | virtual Biome** getBiomeBlock(int, int, int, int); 24 | virtual Biome** getBiomeBlock(Biome**, int, int, int, int); 25 | virtual float* getTemperatureBlock(int, int, int, int); 26 | 27 | public: 28 | float* temperatures = nullptr; 29 | float* downfalls = nullptr; 30 | float* noises = nullptr; 31 | int unused_field_10 = 0; 32 | int unused_field_14 = 0; 33 | int unused_field_18 = 0; 34 | int unused_field_1C = 0; 35 | Biome** biomes = nullptr; 36 | PerlinNoise* temperatureMap = nullptr; 37 | PerlinNoise* downfallMap = nullptr; 38 | PerlinNoise* noiseMap = nullptr; 39 | Random random1; 40 | Random random2; 41 | Random random3; 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /source/world/level/chunk/ChunkSource.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "ChunkSource.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | ChunkSource::~ChunkSource() 13 | { 14 | } 15 | 16 | void ChunkSource::saveAll() 17 | { 18 | 19 | } 20 | 21 | #ifdef ENH_IMPROVED_SAVING 22 | void ChunkSource::saveUnsaved() 23 | { 24 | 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /source/world/level/chunk/ChunkSource.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | #include 11 | #include "GameMods.hpp" 12 | class Level; 13 | class LevelChunk; 14 | 15 | class ChunkSource 16 | { 17 | public: 18 | virtual ~ChunkSource(); 19 | virtual bool hasChunk(int, int) = 0; 20 | virtual LevelChunk* getChunk(int, int) = 0; 21 | virtual LevelChunk* create(int, int) = 0; 22 | virtual void postProcess(ChunkSource*, int, int) = 0; 23 | virtual int tick() = 0; 24 | virtual bool shouldSave() = 0; 25 | virtual void saveAll(); 26 | virtual std::string gatherStats() = 0; 27 | #ifdef ENH_IMPROVED_SAVING 28 | virtual void saveUnsaved(); 29 | #endif 30 | }; 31 | 32 | -------------------------------------------------------------------------------- /source/world/level/levelgen/PerformanceTestChunkSource.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include "world/level/chunk/ChunkSource.hpp" 13 | 14 | class Level; 15 | 16 | class PerformanceTestChunkSource : public ChunkSource 17 | { 18 | public: 19 | LevelChunk* create(int x, int z) override; 20 | LevelChunk* getChunk(int x, int z) override; 21 | bool hasChunk(int x, int z) override; 22 | std::string gatherStats() override; 23 | void postProcess(ChunkSource*, int, int) override; 24 | bool shouldSave() override; 25 | int tick() override; 26 | 27 | public: 28 | Level* m_pLevel = nullptr; 29 | }; 30 | -------------------------------------------------------------------------------- /source/world/level/levelgen/feature/Feature.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "Feature.hpp" 10 | 11 | void Feature::init(float a, float b, float c) 12 | { 13 | 14 | } 15 | 16 | Feature::~Feature() 17 | { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /source/world/level/levelgen/feature/FlowerFeature.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "Feature.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | FlowerFeature::FlowerFeature(int id) 13 | { 14 | this->id = id; 15 | } 16 | 17 | bool FlowerFeature::place(Level* level, Random* random, int x, int y, int z) 18 | { 19 | for (int i = 0; i < 64; i++) 20 | { 21 | int nX = x + random->nextInt(8) - random->nextInt(8); 22 | int nY = y + random->nextInt(4) - random->nextInt(4); 23 | int nZ = z + random->nextInt(8) - random->nextInt(8); 24 | 25 | if (level->isEmptyTile(nX, nY, nZ) && Tile::tiles[id]->canSurvive(level, nX, nY, nZ)) 26 | level->setTileNoUpdate(nX, nY, nZ, id); 27 | } 28 | 29 | return true; 30 | } 31 | -------------------------------------------------------------------------------- /source/world/level/levelgen/feature/LargeCaveFeature.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "LargeFeature.hpp" 4 | 5 | class LargeCaveFeature : public LargeFeature 6 | { 7 | public: 8 | void addFeature(Level*, int ax, int az, int x, int z, TileID* tiles, int unk) override; 9 | 10 | void addRoom(int x, int z, TileID* tiles, float rx, float ry, float rz); 11 | void addTunnel(int x, int z, TileID* tiles, float rx, float ry, float rz, float x1, float ang, float x2, int x3, int x4, float x5); 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /source/world/level/levelgen/feature/LargeFeature.cpp: -------------------------------------------------------------------------------- 1 | #include "LargeFeature.hpp" 2 | 3 | LargeFeature::LargeFeature() 4 | { 5 | } 6 | 7 | LargeFeature::~LargeFeature() 8 | { 9 | } 10 | 11 | void LargeFeature::apply(ChunkSource* csrc, Level* level, int x, int z, uint8_t* tiles, int unk) 12 | { 13 | m_random.setSeed(level->getSeed()); 14 | 15 | int r1 = 2 * (m_random.nextLong() / 2) + 1; 16 | int r2 = 2 * (m_random.nextLong() / 2) + 1; 17 | 18 | for (int ax = x - m_radius; ax <= x + m_radius; ax++) 19 | { 20 | for (int az = z - m_radius; az <= z + m_radius; az++) 21 | { 22 | m_random.setSeed((r1 * ax + r2 * az) & level->getSeed()); 23 | addFeature(level, ax, az, x, z, tiles, unk); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/world/level/levelgen/feature/LargeFeature.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "LargeFeature.hpp" 4 | #include "client/math/Random.hpp" 5 | #include "world/level/Level.hpp" 6 | 7 | class LargeFeature 8 | { 9 | public: 10 | LargeFeature(); 11 | virtual ~LargeFeature(); 12 | virtual void apply(ChunkSource*, Level*, int, int, TileID*, int); 13 | virtual void addFeature(Level*, int, int, int, int, TileID*, int) = 0; 14 | 15 | 16 | public: 17 | int m_radius = 8; 18 | Random m_random; 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /source/world/level/levelgen/synth/ImprovedNoise.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Synth.hpp" 12 | #include "client/math/Random.hpp" 13 | 14 | // note: appears to maybe inherit from a class called Synth? 15 | // the only purpose that it serves I guess is to provide 16 | // a virtual getValue 17 | class ImprovedNoise : public Synth 18 | { 19 | public: 20 | float getValue(float, float) override; 21 | 22 | ImprovedNoise(); 23 | ImprovedNoise(Random* pRandom); 24 | 25 | void init(Random* pRandom); 26 | float getValue(float, float, float); 27 | float noise(float, float, float); 28 | float grad(int, float, float, float); 29 | float grad2(int, float, float); 30 | float lerp(float prog, float a, float b); 31 | float fade(float x); // inlined in the code 32 | void add(float* a2, float a3, float a4, float a5, int a6, int a7, int a8, float a9, float a10, float a11, float a12); 33 | 34 | public: 35 | float xo; 36 | float yo; 37 | float zo; 38 | int p[512]; 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /source/world/level/levelgen/synth/PerlinNoise.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "ImprovedNoise.hpp" 12 | 13 | class PerlinNoise : public Synth 14 | { 15 | public: 16 | PerlinNoise(int nOctaves); 17 | PerlinNoise(Random*, int nOctaves); 18 | virtual ~PerlinNoise(); 19 | void init(int nOctaves); 20 | 21 | float getValue(float, float) override; 22 | float getValue(float, float, float); 23 | 24 | float* getRegion(float*, int, int, int, int, float, float, float); 25 | float* getRegion(float*, float, float , float, int, int, int, float, float, float); 26 | 27 | private: 28 | ImprovedNoise** noiseLevels; 29 | int levels; 30 | 31 | private: 32 | Random _defaultRandom; 33 | Random* _seedRandom; 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /source/world/level/levelgen/synth/Synth.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "Synth.hpp" 10 | -------------------------------------------------------------------------------- /source/world/level/levelgen/synth/Synth.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | class Synth 12 | { 13 | public: 14 | virtual float getValue(float, float) = 0; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /source/world/level/storage/ChunkStorage.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "ChunkStorage.hpp" 10 | 11 | ChunkStorage::~ChunkStorage() 12 | { 13 | } 14 | 15 | LevelChunk* ChunkStorage::load(Level* a, int b, int c) 16 | { 17 | return 0; 18 | } 19 | 20 | void ChunkStorage::save(Level* a, LevelChunk* b) 21 | { 22 | } 23 | 24 | void ChunkStorage::saveEntities(Level* a, LevelChunk* b) 25 | { 26 | } 27 | 28 | void ChunkStorage::saveAll(Level* a, std::vector& b) 29 | { 30 | for (auto chk : b) 31 | { 32 | save(a, chk); 33 | } 34 | } 35 | 36 | void ChunkStorage::tick() 37 | { 38 | 39 | } 40 | 41 | void ChunkStorage::flush() 42 | { 43 | 44 | } 45 | -------------------------------------------------------------------------------- /source/world/level/storage/ChunkStorage.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include 12 | #include 13 | 14 | class Level; 15 | class LevelChunk; 16 | 17 | class ChunkStorage 18 | { 19 | public: 20 | virtual ~ChunkStorage(); 21 | virtual LevelChunk* load(Level*, int, int); 22 | virtual void save(Level*, LevelChunk*); 23 | virtual void saveEntities(Level*, LevelChunk*); 24 | virtual void saveAll(Level*, std::vector&); 25 | virtual void tick(); 26 | virtual void flush(); 27 | }; 28 | 29 | -------------------------------------------------------------------------------- /source/world/level/storage/LevelSource.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "LevelSource.hpp" 10 | 11 | LevelSource::~LevelSource() 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /source/world/level/storage/LevelSource.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "client/common/Utils.hpp" 12 | #include "world/level/material/Material.hpp" 13 | 14 | class LevelSource 15 | { 16 | public: 17 | virtual ~LevelSource(); 18 | virtual TileID getTile(int x, int y, int z) = 0; 19 | virtual float getBrightness(int x, int y, int z) = 0; 20 | virtual int getData(int x, int y, int z) = 0; 21 | virtual Material* getMaterial(int x, int y, int z) = 0; 22 | virtual bool isSolidTile(int x, int y, int z) = 0; 23 | }; 24 | 25 | -------------------------------------------------------------------------------- /source/world/level/storage/LevelStorage.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "LevelStorage.hpp" 10 | 11 | LevelStorage::~LevelStorage() 12 | { 13 | } 14 | 15 | void LevelStorage::saveLevelData(LevelData* levelData) 16 | { 17 | std::vector nothing; 18 | saveLevelData(levelData, nothing); 19 | } 20 | 21 | void LevelStorage::savePlayerData(LevelData* levelData, std::vector& players) 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /source/world/level/storage/LevelStorage.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "ChunkStorage.hpp" 12 | #include "LevelData.hpp" 13 | 14 | class Dimension; 15 | class Player; 16 | 17 | typedef void ProgressListener; 18 | 19 | class LevelStorage 20 | { 21 | public: 22 | virtual ~LevelStorage(); 23 | virtual LevelData* prepareLevel(Level*) = 0; 24 | virtual ChunkStorage* createChunkStorage(Dimension*) = 0; 25 | virtual void saveLevelData(LevelData* levelData, std::vector& players) = 0; 26 | virtual void saveLevelData(LevelData* levelData); 27 | virtual void savePlayerData(LevelData* levelData, std::vector& players); 28 | virtual void closeAll() = 0; 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /source/world/level/storage/LevelStorageSource.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "LevelStorageSource.hpp" 10 | 11 | LevelStorageSource::~LevelStorageSource() 12 | { 13 | } 14 | 15 | void LevelStorageSource::getLevelList(std::vector& vec) 16 | { 17 | // @TODO: complete mock 18 | #ifndef ORIGINAL_CODE 19 | vec.push_back(LevelSummary("Level1", "Level-1", 12345, 1234567)); 20 | vec.push_back(LevelSummary("Level2", "Level-2", 23456, 2345678)); 21 | vec.push_back(LevelSummary("Level3", "Level-3", 34567, 3456789)); 22 | vec.push_back(LevelSummary("Level4", "Level-4", 45678, 4567890)); 23 | vec.push_back(LevelSummary("Level5", "Level-5", 56789, 5678901)); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /source/world/level/storage/MemoryChunkStorage.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "MemoryChunkStorage.hpp" 10 | -------------------------------------------------------------------------------- /source/world/level/storage/MemoryChunkStorage.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "ChunkStorage.hpp" 12 | 13 | class MemoryChunkStorage : public ChunkStorage 14 | { 15 | // no difference 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /source/world/level/storage/MemoryLevelStorage.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "MemoryLevelStorage.hpp" 10 | #include "MemoryChunkStorage.hpp" 11 | #include "LevelData.hpp" 12 | 13 | LevelData* MemoryLevelStorage::prepareLevel(Level* pLevel) 14 | { 15 | return nullptr; 16 | } 17 | 18 | ChunkStorage* MemoryLevelStorage::createChunkStorage(Dimension* pDim) 19 | { 20 | return new MemoryChunkStorage; 21 | } 22 | 23 | void MemoryLevelStorage::saveLevelData(LevelData* levelData, std::vector& players) 24 | { 25 | } 26 | 27 | void MemoryLevelStorage::saveLevelData(LevelData* levelData) 28 | { 29 | } 30 | 31 | void MemoryLevelStorage::closeAll() 32 | { 33 | } 34 | -------------------------------------------------------------------------------- /source/world/level/storage/MemoryLevelStorage.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "LevelStorage.hpp" 12 | 13 | class MemoryLevelStorage : public LevelStorage 14 | { 15 | public: 16 | LevelData* prepareLevel(Level*) override; 17 | ChunkStorage* createChunkStorage(Dimension*) override; 18 | void saveLevelData(LevelData* levelData, std::vector& players) override; 19 | void saveLevelData(LevelData* levelData) override; 20 | void closeAll() override; 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /source/world/level/storage/MemoryLevelStorageSource.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "LevelStorageSource.hpp" 12 | 13 | #ifdef DEMO 14 | class MemoryLevelStorageSource : public LevelStorageSource 15 | { 16 | std::string getName() override; 17 | LevelStorage* selectLevel(const std::string&, bool) override; 18 | void clearAll() override; 19 | int getDataTagFor(const std::string&) override; 20 | bool isNewLevelIdAcceptable(const std::string&) override; 21 | void deleteLevel(const std::string&) override; 22 | void renameLevel(const std::string&, const std::string&) override; 23 | bool isConvertible(const std::string&) override; 24 | bool requiresConversion(const std::string&) override; 25 | int convertLevel(const std::string&, ProgressListener*) override; 26 | }; 27 | #endif 28 | -------------------------------------------------------------------------------- /source/world/level/tile/Bush.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class Bush : public Tile 13 | { 14 | public: 15 | Bush(int id, int texture); 16 | 17 | bool canSurvive(Level*, int x, int y, int z) override; 18 | AABB* getAABB(Level*, int x, int y, int z) override; 19 | int getRenderShape() override; 20 | bool isCubeShaped() override; 21 | bool isSolidRender() override; 22 | bool mayPlace(Level*, int x, int y, int z) override; 23 | void tick(Level*, int x, int y, int z, Random*) override; 24 | void neighborChanged(Level*, int x, int y, int z, int dir) override; 25 | 26 | void checkAlive(Level*, int x, int y, int z); 27 | }; 28 | -------------------------------------------------------------------------------- /source/world/level/tile/ClayTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "ClayTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | ClayTile::ClayTile(int a, int b, Material* c) : Tile(a, b, c) 13 | { 14 | } 15 | 16 | int ClayTile::getResource(int, Random* random) 17 | { 18 | return 0; //@NOTE: Would be clay's item ID 19 | } 20 | 21 | int ClayTile::getResourceCount(Random* random) 22 | { 23 | return 4; 24 | } 25 | -------------------------------------------------------------------------------- /source/world/level/tile/ClayTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class ClayTile : public Tile 13 | { 14 | public: 15 | ClayTile(int ID, int texture, Material*); 16 | 17 | int getResource(int, Random*) override; 18 | int getResourceCount(Random*) override; 19 | }; 20 | -------------------------------------------------------------------------------- /source/world/level/tile/ClothTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "ClothTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | ClothTile::ClothTile(int id, int type) : Tile(id, TEXTURE_CLOTH_64, Material::cloth) 13 | { 14 | field_6C = type; 15 | 16 | tex = getTexture(0, type); 17 | } 18 | 19 | int ClothTile::getTexture(int dir) 20 | { 21 | return getTexture(dir, field_6C); 22 | } 23 | 24 | int ClothTile::getTexture(int dir, int data) 25 | { 26 | //@HUH: what? 27 | return ((~(this->field_6C & 0xFu) >> 3) & 1) + 16 * (~(this->field_6C & 0xF) & 7) + 113; 28 | } 29 | 30 | int ClothTile::getSpawnResourcesAuxValue(int val) 31 | { 32 | return val; 33 | } 34 | -------------------------------------------------------------------------------- /source/world/level/tile/ClothTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class ClothTile : public Tile 13 | { 14 | public: 15 | ClothTile(int id, int type); 16 | int getTexture(int dir) override; 17 | int getTexture(int dir, int data) override; 18 | int getSpawnResourcesAuxValue(int val) override; 19 | 20 | uint8_t field_6C; 21 | }; 22 | -------------------------------------------------------------------------------- /source/world/level/tile/DirtTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "DirtTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | DirtTile::DirtTile(int a, int b, Material* c) : Tile(a, b, c) 13 | { 14 | } 15 | -------------------------------------------------------------------------------- /source/world/level/tile/DirtTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class DirtTile : public Tile 13 | { 14 | public: 15 | DirtTile(int ID, int texture, Material*); 16 | 17 | //@NOTE: No difference 18 | }; 19 | -------------------------------------------------------------------------------- /source/world/level/tile/FarmTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class FarmTile : public Tile 13 | { 14 | public: 15 | FarmTile(int ID, Material*); 16 | 17 | AABB* getAABB(Level*, int x, int y, int z) override; 18 | int getResource(int, Random*) override; 19 | int getTexture(int dir, int data) override; 20 | bool isCubeShaped() override; 21 | bool isSolidRender() override; 22 | void neighborChanged(Level*, int x, int y, int z, int dir) override; 23 | void stepOn(Level* level, int x, int y, int z, Entity* pEnt) override; 24 | void tick(Level* level, int x, int y, int z, Random* random) override; 25 | 26 | bool isNearWater(Level* level, int x, int y, int z); 27 | }; 28 | -------------------------------------------------------------------------------- /source/world/level/tile/GlassTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "GlassTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | GlassTile::GlassTile(int a, int b, Material* c) : HalfTransparentTile(a, b, c) 13 | { 14 | } 15 | 16 | int GlassTile::getResourceCount(Random* pRandom) 17 | { 18 | return 0; 19 | } -------------------------------------------------------------------------------- /source/world/level/tile/GlassTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "HalfTransparentTile.hpp" 11 | 12 | class GlassTile : public HalfTransparentTile 13 | { 14 | public: 15 | GlassTile(int ID, int texture, Material*); 16 | 17 | int getResourceCount(Random*) override; 18 | }; 19 | -------------------------------------------------------------------------------- /source/world/level/tile/GrassTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class GrassTile : public Tile 13 | { 14 | public: 15 | GrassTile(int ID, Material*); 16 | 17 | int getResource(int, Random*) override; 18 | int getColor(LevelSource*, int x, int y, int z) override; 19 | int getTexture(LevelSource*, int x, int y, int z, int dir) override; 20 | void tick(Level*, int x, int y, int z, Random*) override; 21 | }; 22 | -------------------------------------------------------------------------------- /source/world/level/tile/GravelTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "GravelTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | GravelTile::GravelTile(int a, int b, Material* c) : SandTile(a, b, c) 13 | { 14 | } 15 | 16 | int GravelTile::getResource(int a, Random* b) 17 | { 18 | // @NOTE: Here would drop flint if it were added 19 | return id; 20 | } 21 | -------------------------------------------------------------------------------- /source/world/level/tile/GravelTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "SandTile.hpp" 11 | 12 | class GravelTile : public SandTile 13 | { 14 | public: 15 | GravelTile(int ID, int texture, Material*); 16 | 17 | int getResource(int, Random*) override; 18 | }; 19 | -------------------------------------------------------------------------------- /source/world/level/tile/HalfTransparentTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "HalfTransparentTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | HalfTransparentTile::HalfTransparentTile(int a, int b, Material* c) : Tile(a, b, c) 13 | { 14 | } 15 | 16 | bool HalfTransparentTile::isSolidRender() 17 | { 18 | return false; 19 | } 20 | 21 | bool HalfTransparentTile::shouldRenderFace(LevelSource* level, int x, int y, int z, int dir) 22 | { 23 | if (field_6C || level->getTile(x, y, z) != id) 24 | return Tile::shouldRenderFace(level, x, y, z, dir); 25 | 26 | return field_6C; 27 | } -------------------------------------------------------------------------------- /source/world/level/tile/HalfTransparentTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class HalfTransparentTile : public Tile 13 | { 14 | public: 15 | HalfTransparentTile(int ID, int texture, Material*); 16 | 17 | virtual bool isSolidRender() override; 18 | virtual bool shouldRenderFace(LevelSource*, int, int, int, int) override; 19 | 20 | public: 21 | bool field_6C = false; 22 | }; 23 | -------------------------------------------------------------------------------- /source/world/level/tile/IceTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "HalfTransparentTile.hpp" 11 | 12 | class IceTile : public HalfTransparentTile 13 | { 14 | public: 15 | IceTile(int ID, int texture, Material*); 16 | 17 | int getRenderLayer() override; 18 | int getResourceCount(Random*) override; 19 | void onRemove(Level*, int x, int y, int z) override; 20 | bool shouldRenderFace(LevelSource*, int x, int y, int z, int dir) override; 21 | void tick(Level*, int x, int y, int z, Random*) override; 22 | }; 23 | -------------------------------------------------------------------------------- /source/world/level/tile/InvisibleTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "InvisibleTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | InvisibleTile::InvisibleTile(int ID, int texture, Material* pMtl) : 13 | Tile(ID, texture, pMtl) 14 | { 15 | 16 | } 17 | 18 | int InvisibleTile::getRenderShape() 19 | { 20 | return SHAPE_NONE; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /source/world/level/tile/InvisibleTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class InvisibleTile : public Tile 13 | { 14 | public: 15 | InvisibleTile(int ID, int texture, Material*); 16 | int getRenderShape() override; 17 | }; 18 | -------------------------------------------------------------------------------- /source/world/level/tile/LadderTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class LadderTile : public Tile 13 | { 14 | public: 15 | LadderTile(int ID, int texture); 16 | 17 | bool isCubeShaped() override; 18 | bool isSolidRender() override; 19 | int getRenderShape() override; 20 | int getResourceCount(Random* random) override; 21 | AABB* getAABB(Level*, int x, int y, int z); 22 | AABB getTileAABB(Level*, int x, int y, int z); 23 | void setPlacedOnFace(Level*, int x, int y, int z, int face) override; 24 | void neighborChanged(Level*, int, int, int, int) override; 25 | bool mayPlace(Level*, int, int, int) override; 26 | }; 27 | -------------------------------------------------------------------------------- /source/world/level/tile/LeafTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "TransparentTile.hpp" 11 | 12 | class LeafTile : public TransparentTile 13 | { 14 | public: 15 | LeafTile(int id); 16 | ~LeafTile(); 17 | 18 | int getColor(LevelSource*, int, int, int) override; 19 | int getTexture(int dir, int data) override; 20 | bool isSolidRender() override; 21 | void onRemove(Level*, int x, int y, int z) override; 22 | void stepOn(Level*, int x, int y, int z, Entity*) override; 23 | void tick(Level*, int x, int y, int z, Random*) override; 24 | 25 | void die(Level*, int, int, int); 26 | 27 | int* field_70 = nullptr; 28 | int field_74 = 0; 29 | }; 30 | -------------------------------------------------------------------------------- /source/world/level/tile/LiquidTileDynamic.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "LiquidTile.hpp" 11 | 12 | class LiquidTileDynamic : public LiquidTile 13 | { 14 | public: 15 | LiquidTileDynamic(int id, Material* pMtl); 16 | 17 | void onPlace(Level*, int x, int y, int z) override; 18 | void tick(Level*, int x, int y, int z, Random*) override; 19 | 20 | bool isWaterBlocking(Level*, int x, int y, int z); 21 | bool canSpreadTo(Level*, int x, int y, int z); 22 | int getSlopeDistance(Level*, int, int, int, int, int); 23 | bool* getSpread(Level*, int x, int y, int z); 24 | void setStatic(Level*, int x, int y, int z); 25 | void trySpreadTo(Level*, int x, int y, int z, int a); 26 | int getSmallestDepth(Level*, int x, int y, int z, int oldDepth); 27 | }; 28 | -------------------------------------------------------------------------------- /source/world/level/tile/LiquidTileStatic.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "LiquidTile.hpp" 11 | 12 | class LiquidTileStatic : public LiquidTile 13 | { 14 | public: 15 | LiquidTileStatic(int id, Material* pMtl); 16 | 17 | void neighborChanged(Level* level, int x, int y, int z, int dir) override; 18 | void tick(Level* level, int x, int y, int z, Random* random) override; 19 | 20 | bool isFlammable(Level*, int x, int y, int z); 21 | void setDynamic(Level*, int x, int y, int z); 22 | }; 23 | -------------------------------------------------------------------------------- /source/world/level/tile/MetalTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "MetalTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | MetalTile::MetalTile(int ID, int texture, Material* pMtl) : Tile(ID, pMtl) 13 | { 14 | tex = texture; 15 | } 16 | 17 | // @NOTE: I think the MCPE devs were left dumbfounded by this. "Why did notch 18 | // overload this function?" Well, fun fact, there used to be top, side and bottom 19 | // textures for these tiles. :) 20 | int MetalTile::getTexture(int dir) 21 | { 22 | return tex; 23 | } 24 | -------------------------------------------------------------------------------- /source/world/level/tile/MetalTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class MetalTile : public Tile 13 | { 14 | public: 15 | MetalTile(int ID, int texture, Material*); 16 | 17 | virtual int getTexture(int dir) override; 18 | }; 19 | -------------------------------------------------------------------------------- /source/world/level/tile/ObsidianTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "ObsidianTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | ObsidianTile::ObsidianTile(int a, int b, Material* c) : Tile(a, b, c) 13 | { 14 | } 15 | 16 | int ObsidianTile::getResource(int data, Random* random) 17 | { 18 | return Tile::obsidian->id; 19 | } 20 | 21 | int ObsidianTile::getResourceCount(Random* random) 22 | { 23 | return 1; 24 | } 25 | -------------------------------------------------------------------------------- /source/world/level/tile/ObsidianTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class ObsidianTile : public Tile 13 | { 14 | public: 15 | ObsidianTile(int ID, int texture, Material*); 16 | 17 | int getResource(int data, Random*) override; 18 | int getResourceCount(Random*) override; 19 | }; 20 | -------------------------------------------------------------------------------- /source/world/level/tile/OreTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "OreTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | OreTile::OreTile(int id, int texture) : Tile(id, texture, Material::stone) 13 | { 14 | 15 | } 16 | 17 | int OreTile::getResource(int x, Random* random) 18 | { 19 | return id; 20 | } 21 | 22 | int OreTile::getResourceCount(Random* random) 23 | { 24 | if (id == Tile::lapisOre->id) 25 | return random->genrand_int32() % 5 + 4; 26 | 27 | return 1; 28 | } 29 | 30 | int OreTile::getSpawnResourcesAuxValue(int x) 31 | { 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /source/world/level/tile/OreTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class OreTile : public Tile 13 | { 14 | public: 15 | OreTile(int id, int texture); 16 | 17 | int getResource(int, Random*) override; 18 | int getResourceCount(Random*) override; 19 | int getSpawnResourcesAuxValue(int) override; 20 | }; 21 | -------------------------------------------------------------------------------- /source/world/level/tile/RedStoneOreTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class RedStoneOreTile : public Tile 13 | { 14 | public: 15 | RedStoneOreTile(int id, int texture, bool bLit); 16 | 17 | int getResource(int, Random*) override; 18 | int getResourceCount(Random*) override; 19 | int getSpawnResourcesAuxValue(int) override; 20 | int getTickDelay() override; 21 | void animateTick(Level*, int x, int y, int z, Random*) override; 22 | void tick(Level*, int x, int y, int z, Random*) override; 23 | void attack(Level*, int x, int y, int z, Player*) override; 24 | int use(Level*, int x, int y, int z, Player*) override; 25 | void stepOn(Level*, int x, int y, int z, Entity*) override; 26 | 27 | int poofParticles(Level*, int x, int y, int z); 28 | void interact(Level*, int x, int y, int z); 29 | 30 | bool m_bLit = false; 31 | }; 32 | -------------------------------------------------------------------------------- /source/world/level/tile/ReedTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class ReedTile : public Tile 13 | { 14 | public: 15 | ReedTile(int id); 16 | 17 | bool canSurvive(Level*, int x, int y, int z) override; 18 | AABB* getAABB(Level*, int x, int y, int z) override; 19 | int getRenderShape() override; 20 | bool isCubeShaped() override; 21 | bool isSolidRender() override; 22 | bool mayPlace(Level*, int x, int y, int z) override; 23 | void tick(Level*, int x, int y, int z, Random*) override; 24 | void neighborChanged(Level*, int x, int y, int z, int dir) override; 25 | int getResource(int, Random*) override; 26 | 27 | void checkAlive(Level*, int x, int y, int z); 28 | }; 29 | -------------------------------------------------------------------------------- /source/world/level/tile/SandStoneTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "SandStoneTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | SandStoneTile::SandStoneTile(int a, int b, Material* c) : Tile(a, b, c) 13 | { 14 | } 15 | 16 | int SandStoneTile::getTexture(int side) 17 | { 18 | if (side == DIR_YNEG) 19 | return TEXTURE_SANDSTONE_BOTTOM; 20 | 21 | if (side == DIR_YPOS) 22 | return TEXTURE_SANDSTONE_TOP; 23 | 24 | return tex; 25 | } 26 | -------------------------------------------------------------------------------- /source/world/level/tile/SandStoneTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class SandStoneTile : public Tile 13 | { 14 | public: 15 | SandStoneTile(int ID, int texture, Material*); 16 | 17 | int getTexture(int side) override; 18 | }; 19 | -------------------------------------------------------------------------------- /source/world/level/tile/SandTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class SandTile : public Tile 13 | { 14 | public: 15 | SandTile(int ID, int texture, Material*); 16 | 17 | int getTickDelay() override; 18 | void tick(Level* level, int x, int y, int z, Random* random) override; 19 | void neighborChanged(Level* level, int x, int y, int z, int dir) override; 20 | void onPlace(Level* level, int x, int y, int z) override; 21 | 22 | void checkSlide(Level* level, int x, int y, int z); 23 | static bool isFree(Level* level, int x, int y, int z); 24 | 25 | static bool instaFall; 26 | }; 27 | -------------------------------------------------------------------------------- /source/world/level/tile/StoneSlabTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class StoneSlabTile : public Tile 13 | { 14 | public: 15 | StoneSlabTile(int ID, bool bFull); 16 | 17 | bool isSolidRender() override; 18 | bool isCubeShaped() override; 19 | int getResource(int, Random*) override; 20 | int getResourceCount(Random*) override; 21 | int getSpawnResourcesAuxValue(int) override; 22 | int getTexture(int dir) override; 23 | int getTexture(int dir, int data) override; 24 | void onPlace(Level*, int x, int y, int z) override; 25 | bool shouldRenderFace(LevelSource*, int x, int y, int z, int dir) override; 26 | 27 | bool m_bFull = false; 28 | }; 29 | -------------------------------------------------------------------------------- /source/world/level/tile/StoneTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "StoneTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | StoneTile::StoneTile(int a, int b, Material* c) : Tile(a, b, c) 13 | { 14 | } 15 | 16 | int StoneTile::getResource(int a, Random* b) 17 | { 18 | return Tile::stoneBrick->id; 19 | } 20 | -------------------------------------------------------------------------------- /source/world/level/tile/StoneTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class StoneTile : public Tile 13 | { 14 | public: 15 | StoneTile(int ID, int texture, Material*); 16 | 17 | int getResource(int, Random*) override; 18 | }; 19 | -------------------------------------------------------------------------------- /source/world/level/tile/TntTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class TntTile : public Tile 13 | { 14 | public: 15 | TntTile(int ID, int texture); 16 | 17 | int getResourceCount(Random*) override; 18 | int getTexture(int dir) override; 19 | void neighborChanged(Level*, int x, int y, int z, int d) override; 20 | void destroy(Level*, int x, int y, int z, int data) override; 21 | void wasExploded(Level*, int x, int y, int z) override; 22 | }; 23 | -------------------------------------------------------------------------------- /source/world/level/tile/TopSnowTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class TopSnowTile : public Tile 13 | { 14 | public: 15 | TopSnowTile(int id, int texture, Material* pMtl); 16 | 17 | AABB* getAABB(Level*, int x, int y, int z) override; 18 | bool isCubeShaped() override; 19 | bool isSolidRender() override; 20 | int getResource(int, Random*) override; 21 | int getResourceCount(Random*) override; 22 | bool mayPlace(Level*, int x, int y, int z) override; 23 | void neighborChanged(Level*, int x, int y, int z, int d) override; 24 | bool shouldRenderFace(LevelSource*, int x, int y, int z, int i) override; 25 | void tick(Level*, int x, int y, int z, Random*) override; 26 | 27 | bool checkCanSurvive(Level*, int x, int y, int z); 28 | }; 29 | -------------------------------------------------------------------------------- /source/world/level/tile/TorchTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class TorchTile : public Tile 13 | { 14 | public: 15 | TorchTile(int ID, int texture, Material* pMtl); 16 | 17 | AABB* getAABB(Level*, int x, int y, int z) override; 18 | bool isSolidRender() override; 19 | bool isCubeShaped() override; 20 | int getRenderShape() override; 21 | void animateTick(Level*, int x, int y, int z, Random*) override; 22 | HitResult clip(Level*, int x, int y, int z, Vec3 a, Vec3 b) override; 23 | bool mayPlace(Level*, int, int, int) override; 24 | void neighborChanged(Level*, int, int, int, int) override; 25 | void onPlace(Level*, int, int, int) override; 26 | void setPlacedOnFace(Level*, int, int, int, int) override; 27 | void tick(Level*, int, int, int, Random*) override; 28 | 29 | bool checkCanSurvive(Level*, int x, int y, int z); 30 | }; 31 | -------------------------------------------------------------------------------- /source/world/level/tile/TransparentTile.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "TransparentTile.hpp" 10 | #include "world/level/Level.hpp" 11 | 12 | TransparentTile::TransparentTile(int ID, int texture, Material* mtl, bool bTransparent) :Tile(ID, texture, mtl) 13 | { 14 | m_bTransparent = bTransparent; 15 | } 16 | 17 | bool TransparentTile::isSolidRender() 18 | { 19 | return false; 20 | } 21 | 22 | bool TransparentTile::shouldRenderFace(LevelSource* level, int x, int y, int z, int dir) 23 | { 24 | if (!m_bTransparent && level->getTile(x, y, z) == id) 25 | return false; 26 | 27 | return Tile::shouldRenderFace(level, x, y, z, dir); 28 | } 29 | -------------------------------------------------------------------------------- /source/world/level/tile/TransparentTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class TransparentTile : public Tile 13 | { 14 | public: 15 | TransparentTile(int ID, int texture, Material*, bool bTransparent); 16 | 17 | virtual bool isSolidRender() override; 18 | virtual bool shouldRenderFace(LevelSource*, int, int, int, int) override; 19 | 20 | public: 21 | bool m_bTransparent; 22 | }; 23 | -------------------------------------------------------------------------------- /source/world/level/tile/TreeTile.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | #pragma once 9 | 10 | #include "Tile.hpp" 11 | 12 | class TreeTile : public Tile 13 | { 14 | public: 15 | TreeTile(int ID); 16 | 17 | int getResource(int, Random*) override; 18 | int getResourceCount(Random*) override; 19 | int getSpawnResourcesAuxValue(int) override; 20 | int getTexture(int dir, int data) override; 21 | void onRemove(Level*, int x, int y, int z) override; 22 | }; 23 | -------------------------------------------------------------------------------- /source/world/phys/HitResult.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #include "HitResult.hpp" 10 | 11 | HitResult::HitResult() {} 12 | 13 | HitResult::HitResult(int x, int y, int z, eHitSide hitSide, const Vec3& vec) 14 | { 15 | m_hitType = AABB; 16 | m_hitSide = hitSide; 17 | m_tileX = x; 18 | m_tileY = y; 19 | m_tileZ = z; 20 | m_bUnk24 = false; 21 | m_hitPos = vec; 22 | } 23 | 24 | HitResult::HitResult(Entity* pEnt) 25 | { 26 | m_hitType = ENTITY; 27 | m_pEnt = pEnt; 28 | } 29 | -------------------------------------------------------------------------------- /source/world/phys/HitResult.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | The following code is licensed under the BSD 1 clause license. 6 | SPDX-License-Identifier: BSD-1-Clause 7 | ********************************************************************/ 8 | 9 | #pragma once 10 | 11 | #include "Vec3.hpp" 12 | 13 | class Entity; 14 | 15 | class HitResult 16 | { 17 | public: 18 | // looks ass backwards, but what can you do about it 19 | enum eHitResultType 20 | { 21 | AABB, 22 | ENTITY, 23 | NONE, 24 | }; 25 | 26 | enum eHitSide 27 | { 28 | NOHIT = -1, 29 | MINY = 0, 30 | MAXY, // 1 31 | MINZ, // 2 32 | MAXZ, // 3 33 | MINX, // 4 34 | MAXX, // 5 35 | }; 36 | 37 | public: 38 | HitResult(); 39 | HitResult(Entity*); 40 | HitResult(int x, int y, int z, eHitSide hitSide, const Vec3&); 41 | 42 | public: 43 | eHitResultType m_hitType = NONE; 44 | // block coords? 45 | int m_tileX = 0; 46 | int m_tileY = 0; 47 | int m_tileZ = 0; 48 | 49 | eHitSide m_hitSide = MINY; 50 | 51 | // hit position 52 | Vec3 m_hitPos; 53 | 54 | Entity* m_pEnt = nullptr; 55 | bool m_bUnk24 = 0; 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /thirdparty/raknet/AutopatcherPatchContext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __AUTOPATCHER_PATCH_CONTEXT_H 12 | #define __AUTOPATCHER_PATCH_CONTEXT_H 13 | 14 | enum PatchContext 15 | { 16 | PC_HASH_1_WITH_PATCH, 17 | PC_HASH_2_WITH_PATCH, 18 | PC_WRITE_FILE, 19 | PC_ERROR_FILE_WRITE_FAILURE, 20 | PC_ERROR_PATCH_TARGET_MISSING, 21 | PC_ERROR_PATCH_APPLICATION_FAILURE, 22 | PC_ERROR_PATCH_RESULT_CHECKSUM_FAILURE, 23 | PC_NOTICE_WILL_COPY_ON_RESTART, 24 | PC_NOTICE_FILE_DOWNLOADED, 25 | PC_NOTICE_FILE_DOWNLOADED_PATCH, 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /thirdparty/raknet/Base64Encoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __BASE_64_ENCODER_H 12 | #define __BASE_64_ENCODER_H 13 | 14 | #include "Export.h" 15 | 16 | extern "C" { 17 | /// \brief Returns how many bytes were written. 18 | // outputData should be at least the size of inputData * 2 + 6 19 | int Base64Encoding(const unsigned char *inputData, int dataLength, char *outputData); 20 | } 21 | 22 | extern "C" { 23 | const char *Base64Map(void); 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /thirdparty/raknet/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | -------------------------------------------------------------------------------- /thirdparty/raknet/CheckSum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | /// 12 | /// \file CheckSum.cpp 13 | /// \brief [Internal] CheckSum implementation from http://www.flounder.com/checksum.htm 14 | /// 15 | 16 | #ifndef __CHECKSUM_H 17 | #define __CHECKSUM_H 18 | 19 | #include "RakMemoryOverride.h" 20 | 21 | /// Generates and validates checksums 22 | class CheckSum 23 | { 24 | 25 | public: 26 | 27 | /// Default constructor 28 | 29 | CheckSum() 30 | { 31 | Clear(); 32 | } 33 | 34 | void Clear() 35 | { 36 | sum = 0; 37 | r = 55665; 38 | c1 = 52845; 39 | c2 = 22719; 40 | } 41 | 42 | void Add ( unsigned int w ); 43 | 44 | 45 | void Add ( unsigned short w ); 46 | 47 | void Add ( unsigned char* b, unsigned int length ); 48 | 49 | void Add ( unsigned char b ); 50 | 51 | unsigned int Get () 52 | { 53 | return sum; 54 | } 55 | 56 | protected: 57 | unsigned short r; 58 | unsigned short c1; 59 | unsigned short c2; 60 | unsigned int sum; 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /thirdparty/raknet/DS_HuffmanEncodingTreeNode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | /// \file 12 | /// \brief \b [Internal] A single node in the Huffman Encoding Tree. 13 | /// 14 | 15 | #ifndef __HUFFMAN_ENCODING_TREE_NODE 16 | #define __HUFFMAN_ENCODING_TREE_NODE 17 | 18 | struct HuffmanEncodingTreeNode 19 | { 20 | unsigned char value; 21 | unsigned weight; 22 | HuffmanEncodingTreeNode *left; 23 | HuffmanEncodingTreeNode *right; 24 | HuffmanEncodingTreeNode *parent; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /thirdparty/raknet/EmptyHeader.h: -------------------------------------------------------------------------------- 1 | // This is here to remove Missing #include header? in the Unreal Engine 2 | -------------------------------------------------------------------------------- /thirdparty/raknet/EpochTimeToString.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include "FormatString.h" 12 | #include "EpochTimeToString.h" 13 | #include 14 | #include 15 | #include 16 | // localtime 17 | #include 18 | #include "LinuxStrings.h" 19 | 20 | char * EpochTimeToString(long long time) 21 | { 22 | static int textIndex=0; 23 | static char text[4][64]; 24 | 25 | if (++textIndex==4) 26 | textIndex=0; 27 | 28 | struct tm * timeinfo; 29 | time_t t = time; 30 | timeinfo = localtime ( &t ); 31 | strftime (text[textIndex],64,"%c.",timeinfo); 32 | 33 | /* 34 | time_t 35 | // Copied from the docs 36 | struct tm *newtime; 37 | newtime = _localtime64(& time); 38 | asctime_s( text[textIndex], sizeof(text[textIndex]), newtime ); 39 | 40 | while (text[textIndex][0] && (text[textIndex][strlen(text[textIndex])-1]=='\n' || text[textIndex][strlen(text[textIndex])-1]=='\r')) 41 | text[textIndex][strlen(text[textIndex])-1]=0; 42 | */ 43 | 44 | return text[textIndex]; 45 | } 46 | -------------------------------------------------------------------------------- /thirdparty/raknet/EpochTimeToString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | 12 | /// \file EpochTimeToString.h 13 | /// 14 | 15 | 16 | #ifndef __EPOCH_TIME_TO_STRING_H 17 | #define __EPOCH_TIME_TO_STRING_H 18 | 19 | #include "Export.h" 20 | 21 | RAK_DLL_EXPORT char * EpochTimeToString(long long time); 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /thirdparty/raknet/Export.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include "RakNetDefines.h" 12 | 13 | #if defined(_WIN32) && !(defined(__GNUC__) || defined(__GCCXML__)) && !defined(_RAKNET_LIB) && defined(_RAKNET_DLL) 14 | #define RAK_DLL_EXPORT __declspec(dllexport) 15 | #else 16 | #define RAK_DLL_EXPORT 17 | #endif 18 | 19 | #define STATIC_FACTORY_DECLARATIONS(x) static x* GetInstance(void); \ 20 | static void DestroyInstance( x *i); 21 | 22 | #define STATIC_FACTORY_DEFINITIONS(x,y) x* x::GetInstance(void) {return RakNet::OP_NEW( _FILE_AND_LINE_ );} \ 23 | void x::DestroyInstance( x *i) {RakNet::OP_DELETE(( y* ) i, _FILE_AND_LINE_);} 24 | -------------------------------------------------------------------------------- /thirdparty/raknet/FileOperations.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | /// \file FileOperations.h 12 | /// 13 | 14 | 15 | #include "NativeFeatureIncludes.h" 16 | #if _RAKNET_SUPPORT_FileOperations==1 17 | 18 | #ifndef __FILE_OPERATIONS_H 19 | #define __FILE_OPERATIONS_H 20 | 21 | #include "Export.h" 22 | 23 | bool RAK_DLL_EXPORT WriteFileWithDirectories( const char *path, char *data, unsigned dataLength ); 24 | bool RAK_DLL_EXPORT IsSlash(unsigned char c); 25 | void RAK_DLL_EXPORT AddSlash( char *input ); 26 | void RAK_DLL_EXPORT QuoteIfSpaces(char *str); 27 | bool RAK_DLL_EXPORT DirectoryExists(const char *directory); 28 | unsigned int RAK_DLL_EXPORT GetFileLength(const char *path); 29 | 30 | #endif 31 | 32 | #endif // _RAKNET_SUPPORT_FileOperations 33 | -------------------------------------------------------------------------------- /thirdparty/raknet/FormatString.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include "FormatString.h" 12 | #include 13 | #include 14 | #include 15 | #include "LinuxStrings.h" 16 | 17 | char * FormatString(const char *format, ...) 18 | { 19 | static int textIndex=0; 20 | static char text[4][8096]; 21 | va_list ap; 22 | va_start(ap, format); 23 | 24 | if (++textIndex==4) 25 | textIndex=0; 26 | _vsnprintf(text[textIndex], 8096, format, ap); 27 | va_end(ap); 28 | text[textIndex][8096-1]=0; 29 | 30 | return text[textIndex]; 31 | } 32 | 33 | char * FormatStringTS(char *output, const char *format, ...) 34 | { 35 | va_list ap; 36 | va_start(ap, format); 37 | _vsnprintf(output, 512, format, ap); 38 | va_end(ap); 39 | return output; 40 | } 41 | -------------------------------------------------------------------------------- /thirdparty/raknet/FormatString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | /// \file FormatString.h 12 | /// 13 | 14 | 15 | #ifndef __FORMAT_STRING_H 16 | #define __FORMAT_STRING_H 17 | 18 | #include "Export.h" 19 | 20 | extern "C" { 21 | char * FormatString(const char *format, ...); 22 | } 23 | // Threadsafe 24 | extern "C" { 25 | char * FormatStringTS(char *output, const char *format, ...); 26 | } 27 | 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /thirdparty/raknet/Getche.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #if defined(_WIN32) 12 | #include /* getche() */ 13 | #elif defined(__S3E__) 14 | 15 | #else 16 | 17 | #include "Getche.h" 18 | 19 | char getche() 20 | { 21 | 22 | 23 | struct termios oldt, 24 | newt; 25 | char ch; 26 | tcgetattr( STDIN_FILENO, &oldt ); 27 | newt = oldt; 28 | newt.c_lflag &= ~( ICANON | ECHO ); 29 | tcsetattr( STDIN_FILENO, TCSANOW, &newt ); 30 | ch = getchar(); 31 | tcsetattr( STDIN_FILENO, TCSANOW, &oldt ); 32 | return ch; 33 | 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /thirdparty/raknet/Getche.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #if defined(_WIN32) 12 | #include /* getche() */ 13 | 14 | #else 15 | #include 16 | #include 17 | #include 18 | char getche(); 19 | #endif 20 | -------------------------------------------------------------------------------- /thirdparty/raknet/Gets.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | char * Gets ( char * str, int num ) 19 | { 20 | fgets(str, num, stdin); 21 | if (str[0]=='\n' || str[0]=='\r') 22 | str[0]=0; 23 | 24 | size_t len=strlen(str); 25 | if (len>0 && (str[len-1]=='\n' || str[len-1]=='\r')) 26 | str[len-1]=0; 27 | if (len>1 && (str[len-2]=='\n' || str[len-2]=='\r')) 28 | str[len-2]=0; 29 | 30 | return str; 31 | } 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /thirdparty/raknet/Gets.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __GETS__H_ 12 | #define __GETS__H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | char * Gets ( char * str, int num ); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /thirdparty/raknet/IncrementalReadInterface.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include "IncrementalReadInterface.h" 12 | #include 13 | 14 | using namespace RakNet; 15 | 16 | unsigned int IncrementalReadInterface::GetFilePart( const char *filename, unsigned int startReadBytes, unsigned int numBytesToRead, void *preallocatedDestination, FileListNodeContext context) 17 | { 18 | FILE *fp = fopen(filename, "rb"); 19 | if (fp==0) 20 | return 0; 21 | fseek(fp,startReadBytes,SEEK_SET); 22 | unsigned int numRead = (unsigned int) fread(preallocatedDestination,1,numBytesToRead, fp); 23 | fclose(fp); 24 | return numRead; 25 | } 26 | -------------------------------------------------------------------------------- /thirdparty/raknet/Itoa.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __RAK_ITOA_H 12 | #define __RAK_ITOA_H 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | char* Itoa( int value, char* result, int base ); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /thirdparty/raknet/LinuxStrings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #if (defined(__GNUC__) || defined(__ARMCC_VERSION) || defined(__GCCXML__) || defined(__S3E__) ) && !defined(_WIN32) 12 | #include 13 | #ifndef _stricmp 14 | int _stricmp(const char* s1, const char* s2) 15 | { 16 | return strcasecmp(s1,s2); 17 | } 18 | #endif 19 | int _strnicmp(const char* s1, const char* s2, size_t n) 20 | { 21 | return strncasecmp(s1,s2,n); 22 | } 23 | #ifndef _vsnprintf 24 | #define _vsnprintf vsnprintf 25 | #endif 26 | #ifndef __APPLE__ 27 | char *_strlwr(char * str ) 28 | { 29 | if (str==0) 30 | return 0; 31 | for (int i=0; str[i]; i++) 32 | { 33 | if (str[i]>='A' && str[i]<='Z') 34 | str[i]+='a'-'A'; 35 | } 36 | return str; 37 | } 38 | #endif 39 | #endif 40 | -------------------------------------------------------------------------------- /thirdparty/raknet/LinuxStrings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef _GCC_WIN_STRINGS 12 | #define _GCC_WIN_STRINGS 13 | 14 | #if defined(__native_client__) 15 | #ifndef _stricmp 16 | int _stricmp(const char* s1, const char* s2); 17 | #endif 18 | int _strnicmp(const char* s1, const char* s2, size_t n); 19 | char *_strlwr(char * str ); 20 | #define _vsnprintf vsnprintf 21 | #else 22 | #if (defined(__GNUC__) || defined(__GCCXML__) || defined(__S3E__) ) && !defined(_WIN32) 23 | #ifndef _stricmp 24 | int _stricmp(const char* s1, const char* s2); 25 | #endif 26 | int _strnicmp(const char* s1, const char* s2, size_t n); 27 | // http://www.jenkinssoftware.com/forum/index.php?topic=5010.msg20920#msg20920 28 | // #ifndef _vsnprintf 29 | #define _vsnprintf vsnprintf 30 | // #endif 31 | #ifndef __APPLE__ 32 | char *_strlwr(char * str ); //this won't compile on OSX for some reason 33 | #endif 34 | 35 | 36 | 37 | #endif 38 | #endif 39 | 40 | #endif // _GCC_WIN_STRINGS 41 | -------------------------------------------------------------------------------- /thirdparty/raknet/NativeFeatureIncludesOverrides.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | // USER EDITABLE FILE 12 | // See NativeFeatureIncludes.h 13 | 14 | #ifndef __NATIVE_FEATURE_INCLDUES_OVERRIDES_H 15 | #define __NATIVE_FEATURE_INCLDUES_OVERRIDES_H 16 | 17 | //#define LIBCAT_SECURITY 1 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /thirdparty/raknet/NativeTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __NATIVE_TYPES_H 12 | #define __NATIVE_TYPES_H 13 | 14 | #if defined(__GNUC__) || defined(__GCCXML__) || defined(__SNC__) || defined(__S3E__) 15 | #include 16 | #elif !defined(_STDINT_H) && !defined(_SN_STDINT_H) && !defined(_SYS_STDINT_H_) && !defined(_STDINT) && !defined(_MACHTYPES_H_) && !defined(_STDINT_H_) 17 | typedef unsigned char uint8_t; 18 | typedef unsigned short uint16_t; 19 | typedef unsigned __int32 uint32_t; 20 | typedef signed char int8_t; 21 | typedef signed short int16_t; 22 | typedef __int32 int32_t; 23 | #if defined(_MSC_VER) && _MSC_VER < 1300 24 | typedef unsigned __int64 uint64_t; 25 | typedef signed __int64 int64_t; 26 | #else 27 | typedef unsigned long long int uint64_t; 28 | typedef signed long long int64_t; 29 | #endif 30 | #endif 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /thirdparty/raknet/PS3Includes.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /thirdparty/raknet/PS4Includes.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /thirdparty/raknet/PS4Includes.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /thirdparty/raknet/PacketConsoleLogger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include "NativeFeatureIncludes.h" 12 | #if _RAKNET_SUPPORT_LogCommandParser==1 && _RAKNET_SUPPORT_PacketLogger==1 13 | #include "PacketConsoleLogger.h" 14 | #include "LogCommandParser.h" 15 | #include 16 | 17 | using namespace RakNet; 18 | 19 | PacketConsoleLogger::PacketConsoleLogger() 20 | { 21 | logCommandParser=0; 22 | } 23 | 24 | void PacketConsoleLogger::SetLogCommandParser(LogCommandParser *lcp) 25 | { 26 | logCommandParser=lcp; 27 | if (logCommandParser) 28 | logCommandParser->AddChannel("PacketConsoleLogger"); 29 | } 30 | void PacketConsoleLogger::WriteLog(const char *str) 31 | { 32 | if (logCommandParser) 33 | logCommandParser->WriteLog("PacketConsoleLogger", str); 34 | } 35 | 36 | #endif // _RAKNET_SUPPORT_* 37 | -------------------------------------------------------------------------------- /thirdparty/raknet/PacketFileLogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | /// \file 12 | /// \brief This will write all incoming and outgoing network messages to a file 13 | /// 14 | 15 | 16 | #include "NativeFeatureIncludes.h" 17 | #if _RAKNET_SUPPORT_PacketLogger==1 18 | 19 | #ifndef __PACKET_FILE_LOGGER_H_ 20 | #define __PACKET_FILE_LOGGER_H_ 21 | 22 | #include "PacketLogger.h" 23 | #include 24 | 25 | namespace RakNet 26 | { 27 | 28 | /// \ingroup PACKETLOGGER_GROUP 29 | /// \brief Packetlogger that outputs to a file 30 | class RAK_DLL_EXPORT PacketFileLogger : public PacketLogger 31 | { 32 | public: 33 | PacketFileLogger(); 34 | virtual ~PacketFileLogger(); 35 | void StartLog(const char *filenamePrefix); 36 | virtual void WriteLog(const char *str); 37 | protected: 38 | FILE *packetLogFile; 39 | }; 40 | 41 | } // namespace RakNet 42 | 43 | #endif 44 | 45 | #endif // _RAKNET_SUPPORT_* 46 | -------------------------------------------------------------------------------- /thirdparty/raknet/PacketOutputWindowLogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | /// \file 12 | /// \brief This will write all incoming and outgoing network messages to a file 13 | /// 14 | 15 | 16 | #include "NativeFeatureIncludes.h" 17 | #if _RAKNET_SUPPORT_PacketLogger==1 18 | 19 | #ifndef __PACKET_OUTPUT_WINDOW_LOGGER_H_ 20 | #define __PACKET_OUTPUT_WINDOW_LOGGER_H_ 21 | 22 | #include "PacketLogger.h" 23 | 24 | namespace RakNet 25 | { 26 | 27 | /// \ingroup PACKETLOGGER_GROUP 28 | /// \brief Packetlogger that outputs to the output window in the debugger. Windows only. 29 | class RAK_DLL_EXPORT PacketOutputWindowLogger : public PacketLogger 30 | { 31 | public: 32 | PacketOutputWindowLogger(); 33 | virtual ~PacketOutputWindowLogger(); 34 | virtual void WriteLog(const char *str); 35 | protected: 36 | }; 37 | 38 | } // namespace RakNet 39 | 40 | #endif 41 | 42 | #endif // _RAKNET_SUPPORT_* 43 | -------------------------------------------------------------------------------- /thirdparty/raknet/PacketPool.h: -------------------------------------------------------------------------------- 1 | // REMOVEME -------------------------------------------------------------------------------- /thirdparty/raknet/RakAlloca.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #if defined(__FreeBSD__) 12 | #include 13 | 14 | 15 | 16 | 17 | #elif defined ( __APPLE__ ) || defined ( __APPLE_CC__ ) 18 | #include 19 | #include 20 | #elif defined(_WIN32) 21 | #include 22 | #else 23 | #include 24 | // Alloca needed on Ubuntu apparently 25 | #include 26 | #endif 27 | -------------------------------------------------------------------------------- /thirdparty/raknet/RakAssert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include 12 | #include "RakNetDefines.h" 13 | -------------------------------------------------------------------------------- /thirdparty/raknet/RakNetDefinesOverrides.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | // USER EDITABLE FILE 12 | 13 | -------------------------------------------------------------------------------- /thirdparty/raknet/RakNetSocket2_360_720.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include "EmptyHeader.h" 12 | 13 | #ifdef RAKNET_SOCKET_2_INLINE_FUNCTIONS 14 | 15 | #ifndef RAKNETSOCKET2_360_720_CPP 16 | #define RAKNETSOCKET2_360_720_CPP 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | #endif // file header 85 | 86 | #endif // #ifdef RAKNET_SOCKET_2_INLINE_FUNCTIONS 87 | -------------------------------------------------------------------------------- /thirdparty/raknet/RakNetSocket2_PS4.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include "EmptyHeader.h" 12 | 13 | #ifdef RAKNET_SOCKET_2_INLINE_FUNCTIONS 14 | 15 | #ifndef RAKNETSOCKET2_PS4_CPP 16 | #define RAKNETSOCKET2_PS4_CPP 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | #endif // file header 71 | 72 | #endif // #ifdef RAKNET_SOCKET_2_INLINE_FUNCTIONS 73 | -------------------------------------------------------------------------------- /thirdparty/raknet/RakNetTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __RAKNET_TIME_H 12 | #define __RAKNET_TIME_H 13 | 14 | #include "NativeTypes.h" 15 | #include "RakNetDefines.h" 16 | 17 | namespace RakNet { 18 | 19 | // Define __GET_TIME_64BIT if you want to use large types for GetTime (takes more bandwidth when you transmit time though!) 20 | // You would want to do this if your system is going to run long enough to overflow the millisecond counter (over a month) 21 | #if __GET_TIME_64BIT==1 22 | typedef uint64_t Time; 23 | typedef uint32_t TimeMS; 24 | typedef uint64_t TimeUS; 25 | #else 26 | typedef uint32_t Time; 27 | typedef uint32_t TimeMS; 28 | typedef uint64_t TimeUS; 29 | #endif 30 | 31 | } // namespace RakNet 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /thirdparty/raknet/RakNetVersion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #define RAKNET_VERSION "4.081" 12 | #define RAKNET_VERSION_NUMBER 4.081 13 | #define RAKNET_VERSION_NUMBER_INT 4081 14 | 15 | #define RAKNET_DATE "5/28/2014" 16 | 17 | // What compatible protocol version RakNet is using. When this value changes, it indicates this version of RakNet cannot connection to an older version. 18 | // ID_INCOMPATIBLE_PROTOCOL_VERSION will be returned on connection attempt in this case 19 | 20 | // ----- The version that RakNet actually implements. 21 | //#define RAKNET_PROTOCOL_VERSION 6 22 | // ----- The version that we fake in order to get actual MCPE clients to connect. 23 | #define RAKNET_PROTOCOL_VERSION 4 24 | 25 | // @TODO: Look for a version of RakNet that supports protocol version 4. 26 | // While changing this directly to version 4 will allow interop with official MCPE clients, 27 | // it's not a good solution long-term. 28 | -------------------------------------------------------------------------------- /thirdparty/raknet/RakSleep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __RAK_SLEEP_H 12 | #define __RAK_SLEEP_H 13 | 14 | #include "Export.h" 15 | 16 | void RAK_DLL_EXPORT RakSleep(unsigned int ms); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /thirdparty/raknet/RefCountedObj.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | /// \file 12 | /// \brief \b Reference counted object. Very simple class for quick and dirty uses. 13 | /// 14 | 15 | 16 | 17 | #ifndef __REF_COUNTED_OBJ_H 18 | #define __REF_COUNTED_OBJ_H 19 | 20 | #include "RakMemoryOverride.h" 21 | 22 | /// World's simplest class :) 23 | class RefCountedObj 24 | { 25 | public: 26 | RefCountedObj() {refCount=1;} 27 | virtual ~RefCountedObj() {} 28 | void AddRef(void) {refCount++;} 29 | void Deref(void) {if (--refCount==0) RakNet::OP_DELETE(this, _FILE_AND_LINE_);} 30 | int refCount; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /thirdparty/raknet/SecureHandshake.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | /// \file 12 | /// 13 | 14 | 15 | #ifndef SECURE_HANDSHAKE_H 16 | #define SECURE_HANDSHAKE_H 17 | 18 | #include "NativeFeatureIncludes.h" 19 | 20 | #if LIBCAT_SECURITY==1 21 | 22 | // If building a RakNet DLL, be sure to tweak the CAT_EXPORT macro meaning 23 | #if !defined(_RAKNET_LIB) && defined(_RAKNET_DLL) 24 | # define CAT_BUILD_DLL 25 | #else 26 | # define CAT_NEUTER_EXPORT 27 | #endif 28 | 29 | // Include DependentExtensions in your path to include this 30 | #include "cat/AllTunnel.hpp" 31 | 32 | #endif // LIBCAT_SECURITY 33 | 34 | #endif // SECURE_HANDSHAKE_H 35 | -------------------------------------------------------------------------------- /thirdparty/raknet/SimpleTCPServer.h: -------------------------------------------------------------------------------- 1 | // Eraseme -------------------------------------------------------------------------------- /thirdparty/raknet/SuperFastHash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __SUPER_FAST_HASH_H 12 | #define __SUPER_FAST_HASH_H 13 | 14 | #include 15 | #include "NativeTypes.h" 16 | 17 | // From http://www.azillionmonkeys.com/qed/hash.html 18 | // Author of main code is Paul Hsieh 19 | // I just added some convenience functions 20 | // Also note http://burtleburtle.net/bob/hash/doobs.html, which shows that this is 20% faster than the one on that page but has more collisions 21 | 22 | uint32_t SuperFastHash (const char * data, int length); 23 | uint32_t SuperFastHashIncremental (const char * data, int len, unsigned int lastHash ); 24 | uint32_t SuperFastHashFile (const char * filename); 25 | uint32_t SuperFastHashFilePtr (FILE *fp); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /thirdparty/raknet/TCPInterface.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReMinecraftPE/mcped/58e14a36a254bfe0e7ad72100d72ee8aa3930a0c/thirdparty/raknet/TCPInterface.cpp -------------------------------------------------------------------------------- /thirdparty/raknet/ThreadsafePacketLogger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #include "NativeFeatureIncludes.h" 12 | #if _RAKNET_SUPPORT_PacketLogger==1 13 | 14 | #include "ThreadsafePacketLogger.h" 15 | #include 16 | 17 | using namespace RakNet; 18 | 19 | ThreadsafePacketLogger::ThreadsafePacketLogger() 20 | { 21 | 22 | } 23 | ThreadsafePacketLogger::~ThreadsafePacketLogger() 24 | { 25 | char **msg; 26 | while ((msg = logMessages.ReadLock()) != 0) 27 | { 28 | rakFree_Ex((*msg), _FILE_AND_LINE_ ); 29 | } 30 | } 31 | void ThreadsafePacketLogger::Update(void) 32 | { 33 | char **msg; 34 | while ((msg = logMessages.ReadLock()) != 0) 35 | { 36 | WriteLog(*msg); 37 | rakFree_Ex((*msg), _FILE_AND_LINE_ ); 38 | } 39 | } 40 | void ThreadsafePacketLogger::AddToLog(const char *str) 41 | { 42 | char **msg = logMessages.WriteLock(); 43 | *msg = (char*) rakMalloc_Ex( strlen(str)+1, _FILE_AND_LINE_ ); 44 | strcpy(*msg, str); 45 | logMessages.WriteUnlock(); 46 | } 47 | 48 | #endif // _RAKNET_SUPPORT_* 49 | -------------------------------------------------------------------------------- /thirdparty/raknet/ThreadsafePacketLogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | /// \file 12 | /// \brief Derivation of the packet logger to defer the call to WriteLog until the user thread. 13 | /// 14 | 15 | 16 | #include "NativeFeatureIncludes.h" 17 | #if _RAKNET_SUPPORT_PacketLogger==1 18 | 19 | #ifndef __THREADSAFE_PACKET_LOGGER_H 20 | #define __THREADSAFE_PACKET_LOGGER_H 21 | 22 | #include "PacketLogger.h" 23 | #include "SingleProducerConsumer.h" 24 | 25 | namespace RakNet 26 | { 27 | 28 | /// \ingroup PACKETLOGGER_GROUP 29 | /// \brief Same as PacketLogger, but writes output in the user thread. 30 | class RAK_DLL_EXPORT ThreadsafePacketLogger : public PacketLogger 31 | { 32 | public: 33 | ThreadsafePacketLogger(); 34 | virtual ~ThreadsafePacketLogger(); 35 | 36 | virtual void Update(void); 37 | 38 | protected: 39 | virtual void AddToLog(const char *str); 40 | 41 | DataStructures::SingleProducerConsumer logMessages; 42 | }; 43 | 44 | } // namespace RakNet 45 | 46 | #endif 47 | 48 | #endif // _RAKNET_SUPPORT_* 49 | -------------------------------------------------------------------------------- /thirdparty/raknet/VariadicSQLParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __VARIADIC_SQL_PARSER_H 12 | #define __VARIADIC_SQL_PARSER_H 13 | 14 | #include "DS_List.h" 15 | 16 | #include 17 | 18 | namespace VariadicSQLParser 19 | { 20 | struct IndexAndType 21 | { 22 | unsigned int strIndex; 23 | unsigned int typeMappingIndex; 24 | }; 25 | const char* GetTypeMappingAtIndex(int i); 26 | void GetTypeMappingIndices( const char *format, DataStructures::List &indices ); 27 | // Given an SQL string with variadic arguments, allocate argumentBinary and argumentLengths, and hold the parameters in binary format 28 | // Last 2 parameters are out parameters 29 | void ExtractArguments( va_list argptr, const DataStructures::List &indices, char ***argumentBinary, int **argumentLengths ); 30 | void FreeArguments(const DataStructures::List &indices, char **argumentBinary, int *argumentLengths); 31 | } 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /thirdparty/raknet/VitaIncludes.cpp: -------------------------------------------------------------------------------- 1 | #include "EmptyHeader.h" 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /thirdparty/raknet/VitaIncludes.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /thirdparty/raknet/WSAStartupSingleton.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #ifndef __WSA_STARTUP_SINGLETON_H 12 | #define __WSA_STARTUP_SINGLETON_H 13 | 14 | class WSAStartupSingleton 15 | { 16 | public: 17 | WSAStartupSingleton(); 18 | ~WSAStartupSingleton(); 19 | static void AddRef(void); 20 | static void Deref(void); 21 | 22 | protected: 23 | static int refCount; 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /thirdparty/raknet/WindowsIncludes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, Oculus VR, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #if defined (WINDOWS_STORE_RT) 12 | #include 13 | #include 14 | #elif defined (_WIN32) 15 | #include 16 | #include 17 | #include 18 | 19 | // Must always include Winsock2.h before windows.h 20 | // or else: 21 | // winsock2.h(99) : error C2011: 'fd_set' : 'struct' type redefinition 22 | // winsock2.h(134) : warning C4005: 'FD_SET' : macro redefinition 23 | // winsock.h(83) : see previous definition of 'FD_SET' 24 | // winsock2.h(143) : error C2011: 'timeval' : 'struct' type redefinition 25 | // winsock2.h(199) : error C2011: 'hostent' : 'struct' type redefinition 26 | // winsock2.h(212) : error C2011: 'netent' : 'struct' type redefinition 27 | // winsock2.h(219) : error C2011: 'servent' : 'struct' type redefinition 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /thirdparty/raknet/XBox360Includes.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /thirdparty/stb_image_impl.c: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | Minecraft: Pocket Edition - Decompilation Project 3 | Copyright (C) 2023 iProgramInCpp 4 | 5 | thirdparty/stb_image_impl.c 6 | 7 | The following code is licensed under the following license: 8 | < no license yet :( > 9 | ********************************************************************/ 10 | 11 | #define STB_IMAGE_IMPLEMENTATION 12 | #define STB_IMAGE_WRITE_IMPLEMENTATION 13 | 14 | #include "stb_image.h" 15 | #include "stb_image_write.h" 16 | -------------------------------------------------------------------------------- /windows_vs/options.txt: -------------------------------------------------------------------------------- 1 | #Config file for Minecraft PE. The # at the start denotes a comment, removing it makes it a command. 2 | 3 | # Multiplayer 4 | mp_username|ReMinecraftPE 5 | mp_server_visible_default|true 6 | 7 | # Controls 8 | #ctrl_invertmouse|true 9 | 10 | # Graphics Options 11 | gfx_fancygraphics|true 12 | gfx_smoothlighting|false 13 | gfx_viewdistance|2 14 | #gfx_viewdistance|0 15 | --------------------------------------------------------------------------------