From 7074f35e4ba831e358117842b99ee35b87f85ae5 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 15:58:20 +0700 Subject: [PATCH] shared_ptr -> std::shared_ptr This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today. --- Minecraft.Client/AbstractContainerScreen.cpp | 8 +- Minecraft.Client/AbstractContainerScreen.h | 2 +- Minecraft.Client/ArrowRenderer.cpp | 6 +- Minecraft.Client/ArrowRenderer.h | 2 +- Minecraft.Client/BlazeModel.cpp | 18 +- Minecraft.Client/BlazeModel.h | 4 +- Minecraft.Client/BlazeRenderer.cpp | 6 +- Minecraft.Client/BlazeRenderer.h | 2 +- Minecraft.Client/BoatModel.cpp | 12 +- Minecraft.Client/BoatModel.h | 2 +- Minecraft.Client/BoatRenderer.cpp | 6 +- Minecraft.Client/BoatRenderer.h | 2 +- Minecraft.Client/BookModel.cpp | 4 +- Minecraft.Client/BookModel.h | 4 +- Minecraft.Client/Camera.cpp | 8 +- Minecraft.Client/Camera.h | 8 +- Minecraft.Client/ChestRenderer.cpp | 4 +- Minecraft.Client/ChestRenderer.h | 4 +- Minecraft.Client/ChickenModel.cpp | 14 +- Minecraft.Client/ChickenModel.h | 2 +- Minecraft.Client/ChickenRenderer.cpp | 8 +- Minecraft.Client/ChickenRenderer.h | 4 +- Minecraft.Client/Chunk.cpp | 72 +- Minecraft.Client/Chunk.h | 12 +- Minecraft.Client/ClientConnection.cpp | 514 +++++++------- Minecraft.Client/ClientConnection.h | 140 ++-- .../Common/Audio/Consoles_SoundEngine.h | 2 +- Minecraft.Client/Common/Audio/SoundEngine.cpp | 98 +-- Minecraft.Client/Common/Audio/SoundEngine.h | 10 +- Minecraft.Client/Common/Consoles_App.cpp | 32 +- Minecraft.Client/Common/Consoles_App.h | 24 +- .../AddEnchantmentRuleDefinition.cpp | 4 +- .../GameRules/AddEnchantmentRuleDefinition.h | 2 +- .../GameRules/AddItemRuleDefinition.cpp | 4 +- .../Common/GameRules/AddItemRuleDefinition.h | 2 +- .../GameRules/CollectItemRuleDefinition.cpp | 6 +- .../GameRules/CollectItemRuleDefinition.h | 8 +- .../GameRules/CompleteAllRuleDefinition.cpp | 8 +- .../GameRules/CompleteAllRuleDefinition.h | 2 +- .../GameRules/CompoundGameRuleDefinition.cpp | 8 +- .../GameRules/CompoundGameRuleDefinition.h | 4 +- .../Common/GameRules/ConsoleSchematicFile.cpp | 28 +- .../Common/GameRules/ConsoleSchematicFile.h | 4 +- .../Common/GameRules/GameRule.cpp | 6 +- Minecraft.Client/Common/GameRules/GameRule.h | 2 +- .../Common/GameRules/GameRuleDefinition.h | 6 +- .../GameRules/UpdatePlayerRuleDefinition.cpp | 4 +- .../GameRules/UpdatePlayerRuleDefinition.h | 6 +- .../XboxStructureActionPlaceContainer.cpp | 6 +- .../XboxStructureActionPlaceSpawner.cpp | 2 +- .../Common/Network/GameNetworkManager.cpp | 12 +- .../Common/Tutorial/ChangeStateConstraint.cpp | 20 +- .../Common/Tutorial/CompleteUsingItemTask.cpp | 4 +- .../Common/Tutorial/CompleteUsingItemTask.h | 2 +- .../Common/Tutorial/CraftTask.cpp | 2 +- Minecraft.Client/Common/Tutorial/CraftTask.h | 2 +- .../Common/Tutorial/DiggerItemHint.cpp | 4 +- .../Common/Tutorial/DiggerItemHint.h | 4 +- .../Common/Tutorial/PickupTask.cpp | 2 +- Minecraft.Client/Common/Tutorial/PickupTask.h | 2 +- .../Common/Tutorial/ProcedureCompoundTask.cpp | 8 +- .../Common/Tutorial/ProcedureCompoundTask.h | 8 +- .../Common/Tutorial/TakeItemHint.cpp | 2 +- .../Common/Tutorial/TakeItemHint.h | 2 +- Minecraft.Client/Common/Tutorial/Tutorial.cpp | 20 +- Minecraft.Client/Common/Tutorial/Tutorial.h | 22 +- .../Common/Tutorial/TutorialHint.cpp | 14 +- .../Common/Tutorial/TutorialHint.h | 12 +- .../Common/Tutorial/TutorialMode.cpp | 10 +- .../Common/Tutorial/TutorialMode.h | 4 +- .../Common/Tutorial/TutorialTask.h | 14 +- .../Common/Tutorial/UseItemTask.cpp | 2 +- .../Common/Tutorial/UseItemTask.h | 2 +- .../Common/Tutorial/UseTileTask.cpp | 2 +- .../Common/Tutorial/UseTileTask.h | 2 +- .../UI/IUIScene_AbstractContainerMenu.cpp | 82 +-- .../UI/IUIScene_AbstractContainerMenu.h | 22 +- .../Common/UI/IUIScene_AnvilMenu.cpp | 6 +- .../Common/UI/IUIScene_AnvilMenu.h | 8 +- .../Common/UI/IUIScene_CraftingMenu.cpp | 112 +-- .../Common/UI/IUIScene_CraftingMenu.h | 18 +- .../Common/UI/IUIScene_CreativeMenu.cpp | 70 +- .../Common/UI/IUIScene_CreativeMenu.h | 16 +- .../Common/UI/IUIScene_TradingMenu.cpp | 44 +- .../Common/UI/IUIScene_TradingMenu.h | 14 +- .../Common/UI/UIComponent_TutorialPopup.cpp | 44 +- .../Common/UI/UIComponent_TutorialPopup.h | 2 +- .../Common/UI/UIControl_EnchantmentBook.cpp | 4 +- .../Common/UI/UIControl_EnchantmentBook.h | 2 +- Minecraft.Client/Common/UI/UIScene.cpp | 8 +- Minecraft.Client/Common/UI/UIScene.h | 6 +- .../UI/UIScene_AbstractContainerMenu.cpp | 24 +- .../Common/UI/UIScene_AbstractContainerMenu.h | 6 +- .../Common/UI/UIScene_BrewingStandMenu.h | 2 +- .../Common/UI/UIScene_CraftingMenu.cpp | 26 +- .../Common/UI/UIScene_CraftingMenu.h | 14 +- .../Common/UI/UIScene_CreativeMenu.cpp | 8 +- .../Common/UI/UIScene_DebugOverlay.cpp | 4 +- .../Common/UI/UIScene_FurnaceMenu.h | 2 +- Minecraft.Client/Common/UI/UIScene_HUD.cpp | 26 +- .../UI/UIScene_InGameHostOptionsMenu.cpp | 6 +- .../Common/UI/UIScene_InGameInfoMenu.cpp | 28 +- .../UI/UIScene_InGamePlayerOptionsMenu.cpp | 18 +- .../Common/UI/UIScene_InventoryMenu.cpp | 6 +- .../Common/UI/UIScene_LeaderboardsMenu.cpp | 40 +- .../Common/UI/UIScene_SignEntryMenu.cpp | 6 +- .../Common/UI/UIScene_SignEntryMenu.h | 2 +- .../Common/UI/UIScene_TeleportMenu.cpp | 14 +- .../Common/UI/UIScene_TradingMenu.cpp | 10 +- Minecraft.Client/Common/UI/UIStructs.h | 46 +- .../Common/XUI/SlotProgressControl.cpp | 8 +- .../XUI/XUI_Ctrl_CraftIngredientSlot.cpp | 12 +- .../Common/XUI/XUI_Ctrl_CraftIngredientSlot.h | 4 +- .../Common/XUI/XUI_Ctrl_EnchantmentBook.cpp | 8 +- .../Common/XUI/XUI_Ctrl_EnchantmentBook.h | 2 +- .../Common/XUI/XUI_Ctrl_MinecraftSlot.cpp | 20 +- .../Common/XUI/XUI_Ctrl_MinecraftSlot.h | 4 +- .../Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp | 34 +- .../Common/XUI/XUI_Ctrl_SlotItemCtrlBase.h | 10 +- .../Common/XUI/XUI_CustomMessages.h | 4 +- .../Common/XUI/XUI_DebugItemEditor.cpp | 12 +- .../Common/XUI/XUI_DebugItemEditor.h | 4 +- .../Common/XUI/XUI_InGameHostOptions.cpp | 8 +- .../Common/XUI/XUI_InGameInfo.cpp | 26 +- .../Common/XUI/XUI_InGamePlayerOptions.cpp | 24 +- .../XUI/XUI_Scene_AbstractContainer.cpp | 24 +- .../Common/XUI/XUI_Scene_AbstractContainer.h | 6 +- .../Common/XUI/XUI_Scene_Base.cpp | 2 +- .../Common/XUI/XUI_Scene_Container.cpp | 10 +- .../Common/XUI/XUI_Scene_CraftingPanel.cpp | 38 +- .../Common/XUI/XUI_Scene_CraftingPanel.h | 16 +- .../Common/XUI/XUI_Scene_Inventory.cpp | 10 +- .../XUI/XUI_Scene_Inventory_Creative.cpp | 18 +- .../Common/XUI/XUI_Scene_Trading.cpp | 18 +- .../Common/XUI/XUI_Scene_Trading.h | 10 +- Minecraft.Client/Common/XUI/XUI_SignEntry.cpp | 12 +- Minecraft.Client/Common/XUI/XUI_SignEntry.h | 2 +- Minecraft.Client/Common/XUI/XUI_Teleport.cpp | 12 +- Minecraft.Client/Common/XUI/XUI_TextEntry.cpp | 14 +- .../Common/XUI/XUI_TutorialPopup.cpp | 18 +- Minecraft.Client/ConnectScreen.cpp | 2 +- Minecraft.Client/ContainerScreen.cpp | 2 +- Minecraft.Client/ContainerScreen.h | 6 +- Minecraft.Client/CowModel.h | 4 +- Minecraft.Client/CowRenderer.cpp | 2 +- Minecraft.Client/CowRenderer.h | 2 +- Minecraft.Client/CraftingScreen.cpp | 2 +- Minecraft.Client/CraftingScreen.h | 2 +- Minecraft.Client/CreativeMode.cpp | 10 +- Minecraft.Client/CreativeMode.h | 8 +- Minecraft.Client/CreeperModel.cpp | 2 +- Minecraft.Client/CreeperModel.h | 2 +- Minecraft.Client/CreeperRenderer.cpp | 14 +- Minecraft.Client/CreeperRenderer.h | 8 +- Minecraft.Client/CritParticle.cpp | 10 +- Minecraft.Client/CritParticle.h | 8 +- Minecraft.Client/DefaultRenderer.cpp | 2 +- Minecraft.Client/DefaultRenderer.h | 2 +- Minecraft.Client/DemoLevel.cpp | 2 +- Minecraft.Client/DemoLevel.h | 2 +- Minecraft.Client/DemoMode.cpp | 6 +- Minecraft.Client/DemoMode.h | 6 +- Minecraft.Client/DerivedServerLevel.cpp | 2 +- Minecraft.Client/DerivedServerLevel.h | 2 +- Minecraft.Client/DirtyChunkSorter.cpp | 2 +- Minecraft.Client/DirtyChunkSorter.h | 6 +- Minecraft.Client/DistanceChunkSorter.cpp | 4 +- Minecraft.Client/DistanceChunkSorter.h | 4 +- Minecraft.Client/DragonModel.cpp | 18 +- Minecraft.Client/DragonModel.h | 4 +- .../Durango/Network/ChatIntegrationLayer.cpp | 152 ++-- .../Durango/Network/ChatIntegrationLayer.h | 60 +- .../Durango/Sentient/DurangoTelemetry.cpp | 26 +- Minecraft.Client/EnchantTableRenderer.cpp | 4 +- Minecraft.Client/EnchantTableRenderer.h | 2 +- Minecraft.Client/EnderChestRenderer.cpp | 4 +- Minecraft.Client/EnderChestRenderer.h | 2 +- Minecraft.Client/EnderCrystalModel.cpp | 4 +- Minecraft.Client/EnderCrystalModel.h | 2 +- Minecraft.Client/EnderCrystalRenderer.cpp | 6 +- Minecraft.Client/EnderCrystalRenderer.h | 2 +- Minecraft.Client/EnderDragonRenderer.cpp | 28 +- Minecraft.Client/EnderDragonRenderer.h | 12 +- Minecraft.Client/EndermanRenderer.cpp | 18 +- Minecraft.Client/EndermanRenderer.h | 6 +- Minecraft.Client/EntityRenderDispatcher.cpp | 16 +- Minecraft.Client/EntityRenderDispatcher.h | 10 +- Minecraft.Client/EntityRenderer.cpp | 22 +- Minecraft.Client/EntityRenderer.h | 10 +- Minecraft.Client/EntityTileRenderer.cpp | 4 +- Minecraft.Client/EntityTileRenderer.h | 4 +- Minecraft.Client/EntityTracker.cpp | 48 +- Minecraft.Client/EntityTracker.h | 22 +- Minecraft.Client/ExperienceOrbRenderer.cpp | 4 +- Minecraft.Client/ExperienceOrbRenderer.h | 2 +- Minecraft.Client/FallingTileRenderer.cpp | 4 +- Minecraft.Client/FallingTileRenderer.h | 2 +- Minecraft.Client/FireballRenderer.cpp | 8 +- Minecraft.Client/FireballRenderer.h | 4 +- Minecraft.Client/FishingHookRenderer.cpp | 4 +- Minecraft.Client/FishingHookRenderer.h | 4 +- Minecraft.Client/FurnaceScreen.cpp | 2 +- Minecraft.Client/FurnaceScreen.h | 4 +- Minecraft.Client/GameMode.cpp | 38 +- Minecraft.Client/GameMode.h | 28 +- Minecraft.Client/GameRenderer.cpp | 46 +- Minecraft.Client/GameRenderer.h | 4 +- Minecraft.Client/GhastModel.cpp | 2 +- Minecraft.Client/GhastModel.h | 2 +- Minecraft.Client/GhastRenderer.cpp | 6 +- Minecraft.Client/GhastRenderer.h | 2 +- Minecraft.Client/GiantMobRenderer.cpp | 4 +- Minecraft.Client/GiantMobRenderer.h | 2 +- Minecraft.Client/Gui.cpp | 8 +- Minecraft.Client/HumanoidMobRenderer.cpp | 12 +- Minecraft.Client/HumanoidMobRenderer.h | 6 +- Minecraft.Client/HumanoidModel.cpp | 32 +- Minecraft.Client/HumanoidModel.h | 6 +- Minecraft.Client/InventoryScreen.cpp | 2 +- Minecraft.Client/InventoryScreen.h | 2 +- Minecraft.Client/ItemFrameRenderer.cpp | 28 +- Minecraft.Client/ItemFrameRenderer.h | 6 +- Minecraft.Client/ItemInHandRenderer.cpp | 24 +- Minecraft.Client/ItemInHandRenderer.h | 4 +- Minecraft.Client/ItemRenderer.cpp | 52 +- Minecraft.Client/ItemRenderer.h | 20 +- Minecraft.Client/ItemSpriteRenderer.cpp | 2 +- Minecraft.Client/ItemSpriteRenderer.h | 2 +- Minecraft.Client/LavaSlimeModel.cpp | 24 +- Minecraft.Client/LavaSlimeModel.h | 6 +- Minecraft.Client/LavaSlimeRenderer.cpp | 14 +- Minecraft.Client/LavaSlimeRenderer.h | 4 +- Minecraft.Client/LevelRenderer.cpp | 150 ++-- Minecraft.Client/LevelRenderer.h | 24 +- Minecraft.Client/LightningBoltRenderer.cpp | 4 +- Minecraft.Client/LightningBoltRenderer.h | 2 +- Minecraft.Client/LocalPlayer.cpp | 82 +-- Minecraft.Client/LocalPlayer.h | 22 +- Minecraft.Client/MinecartModel.cpp | 14 +- Minecraft.Client/MinecartModel.h | 2 +- Minecraft.Client/MinecartRenderer.cpp | 4 +- Minecraft.Client/MinecartRenderer.h | 2 +- Minecraft.Client/Minecraft.cpp | 98 +-- Minecraft.Client/Minecraft.h | 10 +- Minecraft.Client/MinecraftServer.cpp | 38 +- Minecraft.Client/Minimap.cpp | 8 +- Minecraft.Client/Minimap.h | 2 +- Minecraft.Client/MobRenderer.cpp | 58 +- Minecraft.Client/MobRenderer.h | 30 +- Minecraft.Client/MobSpawnerRenderer.cpp | 6 +- Minecraft.Client/MobSpawnerRenderer.h | 4 +- Minecraft.Client/Model.h | 4 +- Minecraft.Client/MultiPlayerGameMode.cpp | 88 +-- Minecraft.Client/MultiPlayerGameMode.h | 28 +- Minecraft.Client/MultiPlayerLevel.cpp | 50 +- Minecraft.Client/MultiPlayerLevel.h | 26 +- Minecraft.Client/MultiPlayerLocalPlayer.cpp | 56 +- Minecraft.Client/MultiPlayerLocalPlayer.h | 6 +- Minecraft.Client/MushroomCowRenderer.cpp | 12 +- Minecraft.Client/MushroomCowRenderer.h | 4 +- Minecraft.Client/OzelotModel.cpp | 6 +- Minecraft.Client/OzelotModel.h | 4 +- Minecraft.Client/OzelotRenderer.cpp | 8 +- Minecraft.Client/OzelotRenderer.h | 4 +- Minecraft.Client/PS3/PS3Extras/Ps3Types.h | 4 +- .../boost/archive/binary_iarchive.hpp | 22 +- .../boost/archive/binary_wiarchive.hpp | 26 +- .../boost/archive/polymorphic_iarchive.hpp | 6 +- .../boost/archive/polymorphic_oarchive.hpp | 2 +- .../boost/archive/shared_ptr_helper.hpp | 46 +- .../boost/archive/text_iarchive.hpp | 28 +- .../boost/archive/text_wiarchive.hpp | 18 +- .../boost/archive/xml_iarchive.hpp | 22 +- .../boost/archive/xml_wiarchive.hpp | 30 +- .../boost_1_53_0/boost/asio/detail/config.hpp | 2 +- .../boost/asio/detail/shared_ptr.hpp | 6 +- .../boost/asio/detail/socket_ops.hpp | 4 +- .../boost_1_53_0/boost/asio/io_service.hpp | 8 +- .../boost/asio/ip/basic_resolver_iterator.hpp | 4 +- .../asio/ssl/detail/impl/openssl_init.ipp | 10 +- .../boost/asio/ssl/detail/openssl_init.hpp | 6 +- .../boost/config/compiler/gcc.hpp | 28 +- .../boost/config/compiler/sunpro_cc.hpp | 22 +- .../boost/config/platform/win32.hpp | 14 +- .../boost/date_time/gregorian/greg_month.hpp | 12 +- .../date_time/local_time/custom_time_zone.hpp | 10 +- .../date_time/local_time/local_date_time.hpp | 40 +- .../date_time/local_time/local_time_types.hpp | 14 +- .../date_time/local_time/posix_time_zone.hpp | 10 +- .../date_time/local_time/tz_database.hpp | 10 +- .../boost/date_time/microsec_time_clock.hpp | 4 +- .../boost/date_time/time_clock.hpp | 4 +- .../boost/date_time/tz_db_base.hpp | 170 ++--- .../boost/exception/detail/exception_ptr.hpp | 10 +- .../boost/exception/exception.hpp | 6 +- .../boost/exception/get_error_info.hpp | 4 +- .../boost_1_53_0/boost/exception/info.hpp | 14 +- .../boost/filesystem/operations.hpp | 98 +-- .../boost_1_53_0/boost/filesystem/path.hpp | 70 +- .../boost_1_53_0/boost/format/alt_sstream.hpp | 74 +- .../boost/functional/hash/extensions.hpp | 6 +- .../boost_1_53_0/boost/get_pointer.hpp | 6 +- .../boost/gil/extension/io/io_error.hpp | 8 +- .../gil/extension/io/jpeg_dynamic_io.hpp | 10 +- .../boost/gil/extension/io/jpeg_io.hpp | 8 +- .../boost/gil/extension/io/png_dynamic_io.hpp | 10 +- .../boost/graph/detail/self_avoiding_walk.hpp | 108 +-- .../distributed/detail/mpi_process_group.ipp | 130 ++-- .../graph/distributed/mpi_process_group.hpp | 140 ++-- .../boost/graph/distributed/queue.hpp | 12 +- .../distributed/rmat_graph_generator.hpp | 16 +- .../graph/distributed/vertex_list_adaptor.hpp | 62 +- .../boost/graph/erdos_renyi_generator.hpp | 8 +- .../boost/graph/gursoy_atun_layout.hpp | 92 +-- .../boost/graph/incremental_components.hpp | 28 +- .../boost/graph/mcgregor_common_subgraphs.hpp | 128 ++-- .../boost/graph/metric_tsp_approx.hpp | 2 +- .../boost/graph/parallel/distribution.hpp | 92 +-- .../planar_detail/boyer_myrvold_impl.hpp | 658 +++++++++--------- .../graph/planar_detail/face_handles.hpp | 94 +-- .../boost/graph/plod_generator.hpp | 46 +- .../boost/graph/rmat_graph_generator.hpp | 14 +- .../boost_1_53_0/boost/graph/topology.hpp | 88 +-- .../boost/interprocess/interprocess_fwd.hpp | 2 +- .../smart_ptr/enable_shared_from_this.hpp | 14 +- .../interprocess/smart_ptr/shared_ptr.hpp | 116 +-- .../boost/interprocess/smart_ptr/weak_ptr.hpp | 38 +- .../boost_1_53_0/boost/iostreams/chain.hpp | 24 +- .../boost/iostreams/code_converter.hpp | 74 +- .../boost/iostreams/device/file.hpp | 30 +- .../iostreams/device/file_descriptor.hpp | 18 +- .../boost/iostreams/device/mapped_file.hpp | 80 +-- .../boost/iostreams/filter/symmetric.hpp | 14 +- .../boost_1_53_0/boost/iostreams/invert.hpp | 42 +- .../boost/iterator/indirect_iterator.hpp | 12 +- .../boost/locale/boundary/index.hpp | 118 ++-- .../boost_1_53_0/boost/locale/generator.hpp | 34 +- .../boost_1_53_0/boost/mpi/communicator.hpp | 146 ++-- .../boost/mpi/detail/communicator_sc.hpp | 12 +- .../boost/mpi/graph_communicator.hpp | 64 +- .../boost_1_53_0/boost/mpi/group.hpp | 24 +- .../boost/mpi/intercommunicator.hpp | 10 +- .../boost_1_53_0/boost/mpi/request.hpp | 12 +- .../boost/mpi/skeleton_and_content.hpp | 4 +- .../PS3Extras/boost_1_53_0/boost/pointee.hpp | 18 +- .../program_options/detail/config_file.hpp | 36 +- .../program_options/options_description.hpp | 60 +- .../boost/program_options/variables_map.hpp | 38 +- .../property_map/dynamic_property_map.hpp | 18 +- .../parallel/distributed_property_map.hpp | 60 +- .../parallel/global_index_map.hpp | 10 +- .../impl/distributed_property_map.ipp | 42 +- .../property_map/vector_property_map.hpp | 50 +- .../boost/ptr_container/clone_allocator.hpp | 16 +- .../boost/python/converter/registered.hpp | 24 +- .../boost/python/converter/registrations.hpp | 12 +- .../boost/python/converter/registry.hpp | 6 +- .../converter/shared_ptr_from_python.hpp | 20 +- .../python/converter/shared_ptr_to_python.hpp | 8 +- .../boost/python/detail/is_shared_ptr.hpp | 8 +- .../python/detail/value_is_shared_ptr.hpp | 8 +- .../boost/python/instance_holder.hpp | 8 +- .../boost/python/object/find_instance.hpp | 6 +- .../boost/python/object/inheritance.hpp | 4 +- .../boost/python/to_python_indirect.hpp | 14 +- .../boost/python/to_python_value.hpp | 28 +- .../boost_1_53_0/boost/regex/icu.hpp | 286 ++++---- .../boost/regex/pending/object_cache.hpp | 26 +- .../boost/regex/v4/basic_regex.hpp | 156 ++--- .../boost/regex/v4/cpp_regex_traits.hpp | 88 +-- .../boost/regex/v4/match_results.hpp | 16 +- .../boost/regex/v4/regex_iterator.hpp | 34 +- .../boost/regex/v4/regex_token_iterator.hpp | 44 +- .../boost/regex/v4/regex_workaround.hpp | 42 +- .../boost/regex/v4/u32regex_iterator.hpp | 28 +- .../regex/v4/u32regex_token_iterator.hpp | 40 +- .../boost/regex/v4/w32_regex_traits.hpp | 46 +- .../serialization/detail/shared_ptr_132.hpp | 110 +-- .../detail/shared_ptr_nmt_132.hpp | 44 +- .../boost/serialization/shared_ptr.hpp | 34 +- .../boost/serialization/shared_ptr_132.hpp | 44 +- .../boost/serialization/weak_ptr.hpp | 8 +- .../boost/shared_container_iterator.hpp | 8 +- .../boost_1_53_0/boost/shared_ptr.hpp | 6 +- .../boost_1_53_0/boost/signals/connection.hpp | 4 +- .../boost/signals/detail/named_slot_map.hpp | 16 +- .../boost/signals/detail/signal_base.hpp | 10 +- .../boost_1_53_0/boost/signals/slot.hpp | 12 +- .../boost/signals2/connection.hpp | 22 +- .../boost/signals2/deconstruct.hpp | 78 +-- .../boost/signals2/deconstruct_ptr.hpp | 16 +- .../boost/signals2/detail/foreign_ptr.hpp | 8 +- .../boost/signals2/detail/signal_template.hpp | 34 +- .../boost/signals2/postconstructible.hpp | 6 +- .../boost/signals2/predestructible.hpp | 4 +- .../signals2/shared_connection_block.hpp | 8 +- .../boost_1_53_0/boost/signals2/signal.hpp | 2 +- .../boost/signals2/signal_base.hpp | 4 +- .../boost_1_53_0/boost/signals2/slot_base.hpp | 4 +- .../boost_1_53_0/boost/signals2/trackable.hpp | 6 +- .../boost_1_53_0/boost/smart_ptr.hpp | 2 +- .../boost/smart_ptr/allocate_shared_array.hpp | 46 +- .../boost/smart_ptr/detail/shared_ptr_nmt.hpp | 44 +- .../boost/smart_ptr/detail/sp_if_array.hpp | 14 +- .../boost/smart_ptr/detail/spinlock_pool.hpp | 26 +- .../smart_ptr/enable_shared_from_raw.hpp | 34 +- .../smart_ptr/enable_shared_from_this.hpp | 16 +- .../boost/smart_ptr/make_shared_array.hpp | 46 +- .../boost/smart_ptr/make_shared_object.hpp | 334 ++++----- .../boost/smart_ptr/owner_less.hpp | 8 +- .../boost/smart_ptr/scoped_ptr.hpp | 2 +- .../boost/smart_ptr/shared_array.hpp | 6 +- .../boost/smart_ptr/shared_ptr.hpp | 202 +++--- .../boost_1_53_0/boost/smart_ptr/weak_ptr.hpp | 16 +- .../core/non_terminal/impl/grammar.ipp | 2 +- .../core/non_terminal/impl/object_with_id.ipp | 8 +- .../home/classic/dynamic/stored_rule.hpp | 8 +- .../home/classic/iterator/file_iterator.hpp | 2 +- .../classic/iterator/impl/file_iterator.ipp | 18 +- .../spirit/home/classic/utility/chset.hpp | 6 +- .../home/classic/utility/impl/chset.ipp | 18 +- .../spirit/home/karma/string/symbols.hpp | 6 +- .../spirit/home/phoenix/operator/member.hpp | 16 +- .../boost/spirit/home/qi/string/symbols.hpp | 4 +- .../home/qi/operator/detail/keywords.hpp | 46 +- .../boost/statechart/processor_container.hpp | 8 +- .../boost/test/parameterized_test.hpp | 18 +- .../boost/test/predicate_result.hpp | 8 +- .../boost/test/unit_test_suite_impl.hpp | 44 +- .../boost/test/utils/callback.hpp | 18 +- .../utils/runtime/cla/basic_parameter.hpp | 14 +- .../test/utils/runtime/cla/char_parameter.hpp | 12 +- .../boost/test/utils/runtime/cla/fwd.hpp | 10 +- .../test/utils/runtime/cla/parameter.hpp | 12 +- .../boost/test/utils/runtime/cla/parser.hpp | 8 +- .../runtime/file/config_file_iterator.hpp | 10 +- .../boost/test/utils/runtime/fwd.hpp | 8 +- .../boost/test/utils/runtime/validation.hpp | 10 +- .../boost_1_53_0/boost/thread/future.hpp | 36 +- .../boost/thread/pthread/thread_data.hpp | 12 +- .../boost_1_53_0/boost/thread/tss.hpp | 24 +- .../boost_1_53_0/boost/tr1/memory.hpp | 20 +- .../boost/uuid/random_generator.hpp | 14 +- .../boost_1_53_0/boost/wave/cpp_context.hpp | 200 +++--- .../boost/wave/util/cpp_iterator.hpp | 6 +- .../boost/wave/util/cpp_macromap.hpp | 4 +- .../boost/wave/util/symbol_table.hpp | 28 +- .../boost/xpressive/detail/core/access.hpp | 4 +- .../boost/xpressive/detail/core/linker.hpp | 2 +- .../core/matcher/regex_byref_matcher.hpp | 4 +- .../detail/core/matcher/regex_matcher.hpp | 2 +- .../boost/xpressive/detail/detail_fwd.hpp | 4 +- .../boost/xpressive/detail/static/compile.hpp | 8 +- .../xpressive/detail/static/placeholders.hpp | 2 +- .../boost/xpressive/detail/static/visitor.hpp | 10 +- .../xpressive/detail/utility/symbols.hpp | 14 +- .../xpressive/detail/utility/tracking_ptr.hpp | 26 +- .../boost/xpressive/regex_compiler.hpp | 4 +- .../ChunkUpdate/ChunkRebuildData.cpp | 158 ++--- .../PS3/SPU_Tasks/ChunkUpdate/LeverTile_SPU.h | 2 +- .../ChunkUpdate/PistonBaseTile_SPU.h | 2 +- .../ChunkUpdate/PistonExtensionTile_SPU.h | 2 +- .../SPU_Tasks/ChunkUpdate/TheEndPortal_SPU.h | 2 +- .../PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp | 228 +++--- .../LevelRenderer_FindNearestChunk.cpp | 22 +- .../LevelRenderer_FindNearestChunk.h | 6 +- Minecraft.Client/PaintingRenderer.cpp | 10 +- Minecraft.Client/PaintingRenderer.h | 6 +- Minecraft.Client/Particle.cpp | 10 +- Minecraft.Client/Particle.h | 4 +- Minecraft.Client/ParticleEngine.cpp | 18 +- Minecraft.Client/ParticleEngine.h | 8 +- Minecraft.Client/PendingConnection.cpp | 32 +- Minecraft.Client/PendingConnection.h | 16 +- Minecraft.Client/PigRenderer.cpp | 8 +- Minecraft.Client/PigRenderer.h | 4 +- Minecraft.Client/PistonPieceRenderer.cpp | 6 +- Minecraft.Client/PistonPieceRenderer.h | 4 +- Minecraft.Client/PlayerChunkMap.cpp | 56 +- Minecraft.Client/PlayerChunkMap.h | 32 +- Minecraft.Client/PlayerCloudParticle.cpp | 2 +- Minecraft.Client/PlayerConnection.cpp | 244 +++---- Minecraft.Client/PlayerConnection.h | 80 +-- Minecraft.Client/PlayerList.cpp | 232 +++--- Minecraft.Client/PlayerList.h | 56 +- Minecraft.Client/PlayerRenderer.cpp | 52 +- Minecraft.Client/PlayerRenderer.h | 20 +- Minecraft.Client/QuadrupedModel.cpp | 14 +- Minecraft.Client/QuadrupedModel.h | 2 +- Minecraft.Client/ReceivingLevelScreen.cpp | 2 +- Minecraft.Client/RemotePlayer.cpp | 4 +- Minecraft.Client/RemotePlayer.h | 2 +- Minecraft.Client/ServerCommandDispatcher.cpp | 4 +- Minecraft.Client/ServerCommandDispatcher.h | 2 +- Minecraft.Client/ServerConnection.cpp | 34 +- Minecraft.Client/ServerConnection.h | 10 +- Minecraft.Client/ServerLevel.cpp | 66 +- Minecraft.Client/ServerLevel.h | 38 +- Minecraft.Client/ServerLevelListener.cpp | 30 +- Minecraft.Client/ServerLevelListener.h | 10 +- Minecraft.Client/ServerPlayer.cpp | 228 +++--- Minecraft.Client/ServerPlayer.h | 38 +- Minecraft.Client/ServerPlayerGameMode.cpp | 20 +- Minecraft.Client/ServerPlayerGameMode.h | 6 +- Minecraft.Client/SheepFurModel.cpp | 4 +- Minecraft.Client/SheepFurModel.h | 2 +- Minecraft.Client/SheepModel.cpp | 6 +- Minecraft.Client/SheepModel.h | 2 +- Minecraft.Client/SheepRenderer.cpp | 8 +- Minecraft.Client/SheepRenderer.h | 4 +- Minecraft.Client/SignRenderer.cpp | 14 +- Minecraft.Client/SignRenderer.h | 2 +- Minecraft.Client/SilverfishModel.cpp | 2 +- Minecraft.Client/SilverfishModel.h | 2 +- Minecraft.Client/SilverfishRenderer.cpp | 6 +- Minecraft.Client/SilverfishRenderer.h | 6 +- Minecraft.Client/SkeletonHeadModel.cpp | 2 +- Minecraft.Client/SkeletonHeadModel.h | 2 +- Minecraft.Client/SkullTileRenderer.cpp | 4 +- Minecraft.Client/SkullTileRenderer.h | 2 +- Minecraft.Client/SlimeModel.cpp | 2 +- Minecraft.Client/SlimeModel.h | 2 +- Minecraft.Client/SlimeRenderer.cpp | 10 +- Minecraft.Client/SlimeRenderer.h | 4 +- Minecraft.Client/SnowManModel.cpp | 6 +- Minecraft.Client/SnowManModel.h | 4 +- Minecraft.Client/SnowManRenderer.cpp | 8 +- Minecraft.Client/SnowManRenderer.h | 2 +- Minecraft.Client/SpiderModel.cpp | 10 +- Minecraft.Client/SpiderModel.h | 2 +- Minecraft.Client/SpiderRenderer.cpp | 12 +- Minecraft.Client/SpiderRenderer.h | 6 +- Minecraft.Client/SquidModel.cpp | 2 +- Minecraft.Client/SquidModel.h | 2 +- Minecraft.Client/SquidRenderer.cpp | 10 +- Minecraft.Client/SquidRenderer.h | 6 +- Minecraft.Client/SurvivalMode.cpp | 12 +- Minecraft.Client/SurvivalMode.h | 6 +- Minecraft.Client/TakeAnimationParticle.cpp | 10 +- Minecraft.Client/TakeAnimationParticle.h | 6 +- Minecraft.Client/TeleportCommand.cpp | 12 +- Minecraft.Client/TeleportCommand.h | 4 +- Minecraft.Client/TerrainParticle.cpp | 6 +- Minecraft.Client/TerrainParticle.h | 4 +- Minecraft.Client/TextEditScreen.cpp | 6 +- Minecraft.Client/TextEditScreen.h | 4 +- Minecraft.Client/TheEndPortalRenderer.cpp | 4 +- Minecraft.Client/TheEndPortalRenderer.h | 2 +- .../TileEntityRenderDispatcher.cpp | 10 +- Minecraft.Client/TileEntityRenderDispatcher.h | 12 +- Minecraft.Client/TileEntityRenderer.h | 2 +- Minecraft.Client/TileRenderer.cpp | 4 +- Minecraft.Client/TileRenderer.h | 6 +- Minecraft.Client/TntRenderer.cpp | 4 +- Minecraft.Client/TntRenderer.h | 2 +- Minecraft.Client/TrackedEntity.cpp | 288 ++++---- Minecraft.Client/TrackedEntity.h | 32 +- Minecraft.Client/TrapScreen.cpp | 2 +- Minecraft.Client/TrapScreen.h | 2 +- Minecraft.Client/ViewportCuller.cpp | 34 +- Minecraft.Client/ViewportCuller.h | 6 +- Minecraft.Client/VillagerGolemModel.cpp | 6 +- Minecraft.Client/VillagerGolemModel.h | 4 +- Minecraft.Client/VillagerGolemRenderer.cpp | 14 +- Minecraft.Client/VillagerGolemRenderer.h | 6 +- Minecraft.Client/VillagerModel.cpp | 6 +- Minecraft.Client/VillagerModel.h | 4 +- Minecraft.Client/VillagerRenderer.cpp | 14 +- Minecraft.Client/VillagerRenderer.h | 10 +- Minecraft.Client/WolfModel.cpp | 12 +- Minecraft.Client/WolfModel.h | 4 +- Minecraft.Client/WolfRenderer.cpp | 8 +- Minecraft.Client/WolfRenderer.h | 4 +- Minecraft.Client/Xbox/Audio/SoundEngine.cpp | 8 +- Minecraft.Client/Xbox/Audio/SoundEngine.h | 4 +- Minecraft.Client/ZombieRenderer.cpp | 18 +- Minecraft.Client/ZombieRenderer.h | 10 +- Minecraft.World/AbstractContainerMenu.cpp | 70 +- Minecraft.World/AbstractContainerMenu.h | 34 +- Minecraft.World/Achievement.cpp | 10 +- Minecraft.World/Achievement.h | 6 +- Minecraft.World/AddEntityPacket.cpp | 12 +- Minecraft.World/AddEntityPacket.h | 8 +- Minecraft.World/AddExperienceOrbPacket.cpp | 2 +- Minecraft.World/AddExperienceOrbPacket.h | 4 +- Minecraft.World/AddGlobalEntityPacket.cpp | 6 +- Minecraft.World/AddGlobalEntityPacket.h | 4 +- Minecraft.World/AddIslandLayer.cpp | 2 +- Minecraft.World/AddIslandLayer.h | 2 +- Minecraft.World/AddMobPacket.cpp | 6 +- Minecraft.World/AddMobPacket.h | 10 +- Minecraft.World/AddMushroomIslandLayer.cpp | 2 +- Minecraft.World/AddMushroomIslandLayer.h | 2 +- Minecraft.World/AddPaintingPacket.cpp | 2 +- Minecraft.World/AddPaintingPacket.h | 4 +- Minecraft.World/AddPlayerPacket.cpp | 10 +- Minecraft.World/AddPlayerPacket.h | 10 +- Minecraft.World/AddSnowLayer.cpp | 2 +- Minecraft.World/AddSnowLayer.h | 2 +- Minecraft.World/AdminLogCommand.h | 2 +- Minecraft.World/AgableMob.cpp | 6 +- Minecraft.World/AgableMob.h | 4 +- Minecraft.World/Animal.cpp | 56 +- Minecraft.World/Animal.h | 18 +- Minecraft.World/AnimatePacket.cpp | 10 +- Minecraft.World/AnimatePacket.h | 8 +- Minecraft.World/AnvilTile.cpp | 8 +- Minecraft.World/AnvilTile.h | 8 +- Minecraft.World/ArmorDyeRecipe.cpp | 20 +- Minecraft.World/ArmorDyeRecipe.h | 10 +- Minecraft.World/ArmorItem.cpp | 12 +- Minecraft.World/ArmorItem.h | 12 +- Minecraft.World/ArmorSlot.cpp | 14 +- Minecraft.World/ArmorSlot.h | 8 +- Minecraft.World/ArrayWithLength.h | 4 +- Minecraft.World/Arrow.cpp | 36 +- Minecraft.World/Arrow.h | 8 +- Minecraft.World/ArrowAttackGoal.cpp | 10 +- Minecraft.World/AvoidPlayerGoal.cpp | 4 +- Minecraft.World/AwardStatPacket.h | 2 +- Minecraft.World/BedItem.cpp | 2 +- Minecraft.World/BedItem.h | 2 +- Minecraft.World/BedTile.cpp | 14 +- Minecraft.World/BedTile.h | 8 +- Minecraft.World/BegGoal.cpp | 4 +- Minecraft.World/BegGoal.h | 2 +- Minecraft.World/BiomeInitLayer.cpp | 2 +- Minecraft.World/BiomeInitLayer.h | 2 +- Minecraft.World/BiomeSource.h | 4 +- Minecraft.World/Blaze.cpp | 4 +- Minecraft.World/Blaze.h | 2 +- Minecraft.World/BlockRegionUpdatePacket.h | 2 +- Minecraft.World/Boat.cpp | 14 +- Minecraft.World/Boat.h | 4 +- Minecraft.World/BoatItem.cpp | 12 +- Minecraft.World/BoatItem.h | 4 +- Minecraft.World/BonusChestFeature.cpp | 2 +- Minecraft.World/BookItem.cpp | 2 +- Minecraft.World/BookItem.h | 2 +- Minecraft.World/BossMob.cpp | 4 +- Minecraft.World/BossMob.h | 2 +- Minecraft.World/BossMobPart.cpp | 2 +- Minecraft.World/BossMobPart.h | 2 +- Minecraft.World/BottleItem.cpp | 10 +- Minecraft.World/BottleItem.h | 4 +- Minecraft.World/BowItem.cpp | 12 +- Minecraft.World/BowItem.h | 10 +- Minecraft.World/BowlFoodItem.cpp | 4 +- Minecraft.World/BowlFoodItem.h | 2 +- Minecraft.World/BreedGoal.cpp | 12 +- Minecraft.World/BreedGoal.h | 2 +- Minecraft.World/BrewingStandMenu.cpp | 32 +- Minecraft.World/BrewingStandMenu.h | 26 +- Minecraft.World/BrewingStandTile.cpp | 18 +- Minecraft.World/BrewingStandTile.h | 6 +- Minecraft.World/BrewingStandTileEntity.cpp | 44 +- Minecraft.World/BrewingStandTileEntity.h | 16 +- Minecraft.World/BucketItem.cpp | 54 +- Minecraft.World/BucketItem.h | 4 +- Minecraft.World/ButtonTile.cpp | 10 +- Minecraft.World/ButtonTile.h | 10 +- Minecraft.World/CactusTile.cpp | 4 +- Minecraft.World/CactusTile.h | 4 +- Minecraft.World/CakeTile.cpp | 8 +- Minecraft.World/CakeTile.h | 8 +- Minecraft.World/CarrotOnAStickItem.cpp | 6 +- Minecraft.World/CarrotOnAStickItem.h | 2 +- Minecraft.World/CauldronTile.cpp | 12 +- Minecraft.World/CauldronTile.h | 4 +- Minecraft.World/CaveSpider.cpp | 2 +- Minecraft.World/CaveSpider.h | 2 +- Minecraft.World/ChatPacket.h | 2 +- Minecraft.World/ChestTile.cpp | 40 +- Minecraft.World/ChestTile.h | 8 +- Minecraft.World/ChestTileEntity.cpp | 36 +- Minecraft.World/ChestTileEntity.h | 12 +- Minecraft.World/Chicken.cpp | 22 +- Minecraft.World/Chicken.h | 8 +- Minecraft.World/ChunkPos.cpp | 2 +- Minecraft.World/ChunkPos.h | 2 +- Minecraft.World/ChunkTilesUpdatePacket.h | 2 +- Minecraft.World/ChunkVisibilityAreaPacket.h | 2 +- Minecraft.World/ChunkVisibilityPacket.h | 2 +- Minecraft.World/ClientCommandPacket.h | 2 +- Minecraft.World/ClientSideMerchant.cpp | 12 +- Minecraft.World/ClientSideMerchant.h | 12 +- Minecraft.World/ClothTileItem.cpp | 14 +- Minecraft.World/ClothTileItem.h | 8 +- Minecraft.World/CoalItem.cpp | 4 +- Minecraft.World/CoalItem.h | 2 +- Minecraft.World/CocoaTile.cpp | 10 +- Minecraft.World/CocoaTile.h | 6 +- Minecraft.World/ColoredTileItem.cpp | 4 +- Minecraft.World/ColoredTileItem.h | 4 +- Minecraft.World/Command.cpp | 10 +- Minecraft.World/Command.h | 10 +- Minecraft.World/CommandDispatcher.cpp | 2 +- Minecraft.World/CommandDispatcher.h | 2 +- Minecraft.World/ComplexItem.cpp | 2 +- Minecraft.World/ComplexItem.h | 2 +- Minecraft.World/ComplexItemDataPacket.h | 2 +- Minecraft.World/CompoundContainer.cpp | 12 +- Minecraft.World/CompoundContainer.h | 14 +- Minecraft.World/Connection.cpp | 40 +- Minecraft.World/Connection.h | 12 +- Minecraft.World/Container.h | 10 +- Minecraft.World/ContainerAckPacket.h | 2 +- Minecraft.World/ContainerButtonClickPacket.h | 2 +- Minecraft.World/ContainerClickPacket.cpp | 4 +- Minecraft.World/ContainerClickPacket.h | 6 +- Minecraft.World/ContainerClosePacket.h | 2 +- Minecraft.World/ContainerMenu.cpp | 20 +- Minecraft.World/ContainerMenu.h | 12 +- Minecraft.World/ContainerOpenPacket.h | 2 +- Minecraft.World/ContainerSetContentPacket.cpp | 14 +- Minecraft.World/ContainerSetContentPacket.h | 4 +- Minecraft.World/ContainerSetDataPacket.h | 2 +- Minecraft.World/ContainerSetSlotPacket.cpp | 6 +- Minecraft.World/ContainerSetSlotPacket.h | 6 +- Minecraft.World/ControlledByPlayerGoal.cpp | 8 +- Minecraft.World/Cow.cpp | 34 +- Minecraft.World/Cow.h | 4 +- Minecraft.World/CraftItemPacket.h | 2 +- Minecraft.World/CraftingContainer.cpp | 18 +- Minecraft.World/CraftingContainer.h | 12 +- Minecraft.World/CraftingMenu.cpp | 20 +- Minecraft.World/CraftingMenu.h | 14 +- Minecraft.World/Creeper.cpp | 8 +- Minecraft.World/Creeper.h | 2 +- Minecraft.World/CropTile.cpp | 2 +- Minecraft.World/CustomPayloadPacket.h | 2 +- Minecraft.World/DamageEnchantment.cpp | 4 +- Minecraft.World/DamageEnchantment.h | 4 +- Minecraft.World/DamageSource.cpp | 26 +- Minecraft.World/DamageSource.h | 22 +- Minecraft.World/DeadBushTile.cpp | 4 +- Minecraft.World/DeadBushTile.h | 2 +- Minecraft.World/DebugOptionsPacket.h | 2 +- Minecraft.World/DefaultGameModeCommand.cpp | 2 +- Minecraft.World/DefaultGameModeCommand.h | 2 +- Minecraft.World/DefendVillageTargetGoal.cpp | 2 +- Minecraft.World/DelayedRelease.cpp | 4 +- Minecraft.World/DelayedRelease.h | 4 +- Minecraft.World/DerivedLevelData.cpp | 2 +- Minecraft.World/DerivedLevelData.h | 2 +- Minecraft.World/DetectorRailTile.cpp | 4 +- Minecraft.World/DetectorRailTile.h | 2 +- Minecraft.World/DigDurabilityEnchantment.cpp | 4 +- Minecraft.World/DigDurabilityEnchantment.h | 4 +- Minecraft.World/DiggerItem.cpp | 10 +- Minecraft.World/DiggerItem.h | 10 +- Minecraft.World/DiggingEnchantment.cpp | 2 +- Minecraft.World/DiggingEnchantment.h | 2 +- Minecraft.World/DiodeTile.cpp | 6 +- Minecraft.World/DiodeTile.h | 4 +- Minecraft.World/DirectoryLevelStorage.cpp | 8 +- Minecraft.World/DirectoryLevelStorage.h | 8 +- .../DirectoryLevelStorageSource.cpp | 22 +- Minecraft.World/DirectoryLevelStorageSource.h | 4 +- Minecraft.World/DisconnectPacket.cpp | 4 +- Minecraft.World/DisconnectPacket.h | 4 +- Minecraft.World/DispenserTile.cpp | 92 +-- Minecraft.World/DispenserTile.h | 10 +- Minecraft.World/DispenserTileEntity.cpp | 44 +- Minecraft.World/DispenserTileEntity.h | 16 +- Minecraft.World/DoorItem.cpp | 2 +- Minecraft.World/DoorItem.h | 4 +- Minecraft.World/DoorTile.cpp | 6 +- Minecraft.World/DoorTile.h | 6 +- Minecraft.World/DownfallLayer.cpp | 2 +- Minecraft.World/DownfallLayer.h | 2 +- Minecraft.World/DownfallMixerLayer.cpp | 2 +- Minecraft.World/DownfallMixerLayer.h | 4 +- Minecraft.World/DragonFireball.cpp | 8 +- Minecraft.World/DragonFireball.h | 2 +- Minecraft.World/DurangoStats.cpp | 106 +-- Minecraft.World/DurangoStats.h | 40 +- Minecraft.World/DyePowderItem.cpp | 68 +- Minecraft.World/DyePowderItem.h | 8 +- Minecraft.World/EggItem.cpp | 4 +- Minecraft.World/EggItem.h | 2 +- Minecraft.World/EggTile.cpp | 8 +- Minecraft.World/EggTile.h | 4 +- Minecraft.World/EmptyLevelChunk.cpp | 18 +- Minecraft.World/EmptyLevelChunk.h | 16 +- Minecraft.World/EnchantItemCommand.cpp | 10 +- Minecraft.World/EnchantItemCommand.h | 4 +- Minecraft.World/EnchantedBookItem.cpp | 24 +- Minecraft.World/EnchantedBookItem.h | 18 +- Minecraft.World/Enchantment.cpp | 6 +- Minecraft.World/Enchantment.h | 4 +- Minecraft.World/EnchantmentHelper.cpp | 54 +- Minecraft.World/EnchantmentHelper.h | 52 +- Minecraft.World/EnchantmentMenu.cpp | 30 +- Minecraft.World/EnchantmentMenu.h | 14 +- Minecraft.World/EnchantmentSlot.h | 6 +- Minecraft.World/EnchantmentTableEntity.cpp | 6 +- Minecraft.World/EnchantmentTableEntity.h | 2 +- Minecraft.World/EnchantmentTableTile.cpp | 6 +- Minecraft.World/EnchantmentTableTile.h | 6 +- Minecraft.World/EnderChestTile.cpp | 12 +- Minecraft.World/EnderChestTile.h | 6 +- Minecraft.World/EnderChestTileEntity.cpp | 10 +- Minecraft.World/EnderChestTileEntity.h | 4 +- Minecraft.World/EnderCrystal.cpp | 10 +- Minecraft.World/EnderDragon.cpp | 88 +-- Minecraft.World/EnderDragon.h | 36 +- Minecraft.World/EnderEyeItem.cpp | 16 +- Minecraft.World/EnderEyeItem.h | 6 +- Minecraft.World/EnderMan.cpp | 12 +- Minecraft.World/EnderMan.h | 6 +- Minecraft.World/EnderpearlItem.cpp | 8 +- Minecraft.World/EnderpearlItem.h | 4 +- Minecraft.World/Entity.cpp | 72 +- Minecraft.World/Entity.h | 46 +- .../EntityActionAtPositionPacket.cpp | 4 +- .../EntityActionAtPositionPacket.h | 4 +- Minecraft.World/EntityDamageSource.cpp | 14 +- Minecraft.World/EntityDamageSource.h | 12 +- Minecraft.World/EntityEventPacket.h | 2 +- Minecraft.World/EntityIO.cpp | 32 +- Minecraft.World/EntityIO.h | 12 +- Minecraft.World/EntityPos.cpp | 2 +- Minecraft.World/EntityPos.h | 2 +- Minecraft.World/EntityTile.cpp | 2 +- Minecraft.World/EntityTile.h | 2 +- Minecraft.World/ExperienceCommand.cpp | 6 +- Minecraft.World/ExperienceCommand.h | 4 +- Minecraft.World/ExperienceItem.cpp | 8 +- Minecraft.World/ExperienceItem.h | 6 +- Minecraft.World/ExperienceOrb.cpp | 4 +- Minecraft.World/ExperienceOrb.h | 4 +- Minecraft.World/ExplodePacket.h | 4 +- Minecraft.World/Explosion.cpp | 14 +- Minecraft.World/Explosion.h | 10 +- Minecraft.World/EyeOfEnderSignal.cpp | 2 +- Minecraft.World/FallingTile.cpp | 6 +- Minecraft.World/FarmTile.cpp | 4 +- Minecraft.World/FarmTile.h | 2 +- Minecraft.World/FenceGateTile.cpp | 6 +- Minecraft.World/FenceGateTile.h | 6 +- Minecraft.World/FenceTile.cpp | 2 +- Minecraft.World/FenceTile.h | 2 +- Minecraft.World/FireChargeItem.cpp | 10 +- Minecraft.World/FireChargeItem.h | 2 +- Minecraft.World/Fireball.cpp | 24 +- Minecraft.World/Fireball.h | 4 +- Minecraft.World/FishingHook.cpp | 28 +- Minecraft.World/FishingHook.h | 8 +- Minecraft.World/FishingRodItem.cpp | 18 +- Minecraft.World/FishingRodItem.h | 2 +- Minecraft.World/FlintAndSteelItem.cpp | 8 +- Minecraft.World/FlintAndSteelItem.h | 2 +- Minecraft.World/FlowerPotTile.cpp | 36 +- Minecraft.World/FlowerPotTile.h | 6 +- Minecraft.World/FollowOwnerGoal.cpp | 2 +- Minecraft.World/FollowParentGoal.cpp | 6 +- Minecraft.World/FoodData.cpp | 2 +- Minecraft.World/FoodData.h | 2 +- Minecraft.World/FoodItem.cpp | 14 +- Minecraft.World/FoodItem.h | 12 +- Minecraft.World/FurnaceMenu.cpp | 20 +- Minecraft.World/FurnaceMenu.h | 10 +- Minecraft.World/FurnaceResultSlot.cpp | 16 +- Minecraft.World/FurnaceResultSlot.h | 16 +- Minecraft.World/FurnaceTile.cpp | 24 +- Minecraft.World/FurnaceTile.h | 6 +- Minecraft.World/FurnaceTileEntity.cpp | 28 +- Minecraft.World/FurnaceTileEntity.h | 16 +- Minecraft.World/FuzzyZoomLayer.cpp | 8 +- Minecraft.World/FuzzyZoomLayer.h | 4 +- Minecraft.World/GameCommandPacket.h | 2 +- Minecraft.World/GameEventPacket.h | 2 +- Minecraft.World/GameModeCommand.cpp | 6 +- Minecraft.World/GameModeCommand.h | 6 +- Minecraft.World/GenericStats.cpp | 174 ++--- Minecraft.World/GenericStats.h | 16 +- Minecraft.World/GetInfoPacket.h | 2 +- Minecraft.World/Ghast.cpp | 24 +- Minecraft.World/Ghast.h | 4 +- Minecraft.World/GiveItemCommand.cpp | 12 +- Minecraft.World/GiveItemCommand.h | 4 +- Minecraft.World/GoldenAppleItem.cpp | 8 +- Minecraft.World/GoldenAppleItem.h | 8 +- Minecraft.World/GrowMushroomIslandLayer.cpp | 2 +- Minecraft.World/GrowMushroomIslandLayer.h | 2 +- Minecraft.World/HalfSlabTile.cpp | 52 +- Minecraft.World/HalfSlabTile.h | 6 +- Minecraft.World/HangingEntity.cpp | 78 +-- Minecraft.World/HangingEntity.h | 4 +- Minecraft.World/HangingEntityItem.cpp | 26 +- Minecraft.World/HangingEntityItem.h | 8 +- Minecraft.World/HashExtension.h | 4 +- Minecraft.World/HatchetItem.cpp | 2 +- Minecraft.World/HatchetItem.h | 2 +- Minecraft.World/HeavyTile.cpp | 4 +- Minecraft.World/HeavyTile.h | 2 +- Minecraft.World/HellSandTile.cpp | 2 +- Minecraft.World/HellSandTile.h | 2 +- Minecraft.World/HitResult.cpp | 4 +- Minecraft.World/HitResult.h | 6 +- Minecraft.World/HoeItem.cpp | 6 +- Minecraft.World/HoeItem.h | 2 +- Minecraft.World/HouseFeature.cpp | 2 +- Minecraft.World/HurtByTargetGoal.cpp | 4 +- Minecraft.World/HurtByTargetGoal.h | 2 +- Minecraft.World/IceTile.cpp | 4 +- Minecraft.World/IceTile.h | 2 +- .../IndirectEntityDamageSource.cpp | 16 +- Minecraft.World/IndirectEntityDamageSource.h | 14 +- Minecraft.World/InteractPacket.h | 2 +- Minecraft.World/Inventory.cpp | 78 +-- Minecraft.World/Inventory.h | 52 +- Minecraft.World/InventoryMenu.cpp | 46 +- Minecraft.World/InventoryMenu.h | 20 +- Minecraft.World/Item.cpp | 74 +- Minecraft.World/Item.h | 82 +-- Minecraft.World/ItemEntity.cpp | 36 +- Minecraft.World/ItemEntity.h | 12 +- Minecraft.World/ItemFrame.cpp | 50 +- Minecraft.World/ItemFrame.h | 6 +- Minecraft.World/ItemInstance.cpp | 104 +-- Minecraft.World/ItemInstance.h | 54 +- Minecraft.World/KeepAlivePacket.cpp | 6 +- Minecraft.World/KeepAlivePacket.h | 4 +- Minecraft.World/KickPlayerPacket.h | 2 +- Minecraft.World/KillCommand.cpp | 4 +- Minecraft.World/KillCommand.h | 2 +- Minecraft.World/LadderTile.cpp | 2 +- Minecraft.World/LadderTile.h | 2 +- Minecraft.World/LavaSlime.cpp | 4 +- Minecraft.World/LavaSlime.h | 2 +- Minecraft.World/Layer.cpp | 58 +- Minecraft.World/Layer.h | 2 +- Minecraft.World/LeafTile.cpp | 14 +- Minecraft.World/LeafTile.h | 8 +- Minecraft.World/LeafTileItem.cpp | 6 +- Minecraft.World/LeafTileItem.h | 6 +- Minecraft.World/Level.cpp | 198 +++--- Minecraft.World/Level.h | 118 ++-- Minecraft.World/LevelChunk.cpp | 56 +- Minecraft.World/LevelChunk.h | 20 +- Minecraft.World/LevelData.cpp | 2 +- Minecraft.World/LevelData.h | 2 +- Minecraft.World/LevelEventPacket.h | 2 +- Minecraft.World/LevelListener.h | 10 +- Minecraft.World/LevelSoundPacket.h | 2 +- Minecraft.World/LevelSource.h | 2 +- Minecraft.World/LevelStorage.h | 4 +- .../LevelStorageProfilerDecorator.cpp | 2 +- .../LevelStorageProfilerDecorator.h | 2 +- Minecraft.World/LevelStorageSource.h | 6 +- Minecraft.World/LeverTile.cpp | 8 +- Minecraft.World/LeverTile.h | 6 +- Minecraft.World/LightningBolt.cpp | 6 +- Minecraft.World/LiquidTile.cpp | 4 +- Minecraft.World/LiquidTile.h | 2 +- Minecraft.World/LoginPacket.h | 2 +- Minecraft.World/LookControl.cpp | 6 +- Minecraft.World/LookControl.h | 2 +- Minecraft.World/MakeLoveGoal.cpp | 6 +- Minecraft.World/MapItem.cpp | 66 +- Minecraft.World/MapItem.h | 14 +- Minecraft.World/MapItemSavedData.cpp | 42 +- Minecraft.World/MapItemSavedData.h | 18 +- Minecraft.World/McRegionLevelStorage.cpp | 16 +- Minecraft.World/McRegionLevelStorage.h | 2 +- .../McRegionLevelStorageSource.cpp | 32 +- Minecraft.World/McRegionLevelStorageSource.h | 6 +- Minecraft.World/MeleeAttackGoal.cpp | 4 +- Minecraft.World/MemoryLevelStorage.cpp | 12 +- Minecraft.World/MemoryLevelStorage.h | 8 +- Minecraft.World/MemoryLevelStorageSource.cpp | 10 +- Minecraft.World/MemoryLevelStorageSource.h | 4 +- Minecraft.World/MenuBackup.cpp | 2 +- Minecraft.World/MenuBackup.h | 4 +- Minecraft.World/Merchant.h | 8 +- Minecraft.World/MerchantContainer.cpp | 24 +- Minecraft.World/MerchantContainer.h | 16 +- Minecraft.World/MerchantMenu.cpp | 24 +- Minecraft.World/MerchantMenu.h | 18 +- Minecraft.World/MerchantRecipe.cpp | 20 +- Minecraft.World/MerchantRecipe.h | 22 +- Minecraft.World/MerchantRecipeList.cpp | 12 +- Minecraft.World/MerchantRecipeList.h | 4 +- Minecraft.World/MerchantResultSlot.cpp | 24 +- Minecraft.World/MerchantResultSlot.h | 20 +- Minecraft.World/MilkBucketItem.cpp | 10 +- Minecraft.World/MilkBucketItem.h | 8 +- Minecraft.World/MineShaftPieces.cpp | 14 +- Minecraft.World/Minecart.cpp | 64 +- Minecraft.World/Minecart.h | 16 +- Minecraft.World/MinecartItem.cpp | 8 +- Minecraft.World/MinecartItem.h | 4 +- Minecraft.World/Mob.cpp | 326 ++++----- Minecraft.World/Mob.h | 44 +- Minecraft.World/MobEffect.cpp | 8 +- Minecraft.World/MobEffect.h | 6 +- Minecraft.World/MobEffectInstance.cpp | 6 +- Minecraft.World/MobEffectInstance.h | 4 +- Minecraft.World/MobSpawner.cpp | 38 +- Minecraft.World/MobSpawner.h | 4 +- Minecraft.World/MobSpawnerTile.cpp | 4 +- Minecraft.World/MobSpawnerTile.h | 2 +- Minecraft.World/MobSpawnerTileEntity.cpp | 32 +- Minecraft.World/MobSpawnerTileEntity.h | 12 +- Minecraft.World/MockedLevelStorage.cpp | 6 +- Minecraft.World/MockedLevelStorage.h | 4 +- Minecraft.World/Monster.cpp | 24 +- Minecraft.World/Monster.h | 6 +- Minecraft.World/MonsterPlacerItem.cpp | 26 +- Minecraft.World/MonsterPlacerItem.h | 10 +- Minecraft.World/MonsterRoomFeature.cpp | 32 +- Minecraft.World/MonsterRoomFeature.h | 2 +- Minecraft.World/MoveEntityPacket.cpp | 26 +- Minecraft.World/MoveEntityPacket.h | 10 +- Minecraft.World/MoveEntityPacketSmall.cpp | 28 +- Minecraft.World/MoveEntityPacketSmall.h | 10 +- Minecraft.World/MoveIndoorsGoal.cpp | 8 +- Minecraft.World/MovePlayerPacket.cpp | 26 +- Minecraft.World/MovePlayerPacket.h | 10 +- Minecraft.World/MoveThroughVillageGoal.cpp | 20 +- Minecraft.World/MoveThroughVillageGoal.h | 4 +- Minecraft.World/MultiTextureTileItem.cpp | 10 +- Minecraft.World/MultiTextureTileItem.h | 4 +- Minecraft.World/MushroomCow.cpp | 20 +- Minecraft.World/MushroomCow.h | 4 +- Minecraft.World/MusicTile.cpp | 14 +- Minecraft.World/MusicTile.h | 6 +- Minecraft.World/MusicTileEntity.cpp | 10 +- Minecraft.World/MusicTileEntity.h | 2 +- .../NearestAttackableTargetGoal.cpp | 8 +- Minecraft.World/NearestAttackableTargetGoal.h | 2 +- Minecraft.World/NetherBridgePieces.cpp | 32 +- Minecraft.World/NetherStalkTile.cpp | 2 +- Minecraft.World/OcelotSitOnTileGoal.cpp | 2 +- Minecraft.World/OldChunkStorage.cpp | 16 +- Minecraft.World/OwnerHurtByTargetGoal.cpp | 2 +- Minecraft.World/OwnerHurtTargetGoal.cpp | 2 +- Minecraft.World/Ozelot.cpp | 16 +- Minecraft.World/Ozelot.h | 10 +- Minecraft.World/OzelotAttackGoal.cpp | 2 +- Minecraft.World/Packet.cpp | 22 +- Minecraft.World/Packet.h | 18 +- Minecraft.World/PacketListener.cpp | 302 ++++---- Minecraft.World/PacketListener.h | 174 ++--- Minecraft.World/Painting.cpp | 10 +- Minecraft.World/Painting.h | 4 +- Minecraft.World/Path.cpp | 16 +- Minecraft.World/Path.h | 6 +- Minecraft.World/PathNavigation.cpp | 4 +- Minecraft.World/PathNavigation.h | 4 +- Minecraft.World/PathfinderMob.cpp | 12 +- Minecraft.World/PathfinderMob.h | 10 +- Minecraft.World/PickaxeItem.cpp | 2 +- Minecraft.World/PickaxeItem.h | 4 +- Minecraft.World/Pig.cpp | 40 +- Minecraft.World/Pig.h | 6 +- Minecraft.World/PigZombie.cpp | 30 +- Minecraft.World/PigZombie.h | 10 +- Minecraft.World/PistonBaseTile.cpp | 28 +- Minecraft.World/PistonBaseTile.h | 14 +- Minecraft.World/PistonExtensionTile.cpp | 4 +- Minecraft.World/PistonExtensionTile.h | 4 +- Minecraft.World/PistonMovingPiece.cpp | 22 +- Minecraft.World/PistonMovingPiece.h | 10 +- Minecraft.World/PistonPieceEntity.cpp | 8 +- Minecraft.World/PistonPieceEntity.h | 2 +- Minecraft.World/PlayGoal.cpp | 6 +- Minecraft.World/Player.cpp | 240 +++---- Minecraft.World/Player.h | 96 +-- Minecraft.World/PlayerAbilitiesPacket.cpp | 2 +- Minecraft.World/PlayerAbilitiesPacket.h | 4 +- Minecraft.World/PlayerActionPacket.h | 2 +- Minecraft.World/PlayerCommandPacket.cpp | 8 +- Minecraft.World/PlayerCommandPacket.h | 4 +- Minecraft.World/PlayerEnderChestContainer.cpp | 6 +- Minecraft.World/PlayerEnderChestContainer.h | 6 +- Minecraft.World/PlayerIO.h | 8 +- Minecraft.World/PlayerInfoPacket.cpp | 2 +- Minecraft.World/PlayerInfoPacket.h | 4 +- Minecraft.World/PlayerInputPacket.h | 2 +- Minecraft.World/PortalForcer.cpp | 12 +- Minecraft.World/PortalForcer.h | 6 +- Minecraft.World/PortalTile.cpp | 4 +- Minecraft.World/PortalTile.h | 4 +- Minecraft.World/PotatoTile.cpp | 2 +- Minecraft.World/PotionItem.cpp | 42 +- Minecraft.World/PotionItem.h | 24 +- Minecraft.World/PreLoginPacket.h | 2 +- Minecraft.World/PressurePlateTile.cpp | 6 +- Minecraft.World/PressurePlateTile.h | 6 +- Minecraft.World/ProtectionEnchantment.cpp | 6 +- Minecraft.World/ProtectionEnchantment.h | 4 +- Minecraft.World/PumpkinTile.cpp | 6 +- Minecraft.World/PumpkinTile.h | 2 +- Minecraft.World/QuartzBlockTile.cpp | 4 +- Minecraft.World/QuartzBlockTile.h | 2 +- Minecraft.World/RailTile.cpp | 2 +- Minecraft.World/RailTile.h | 2 +- Minecraft.World/RandomPos.cpp | 8 +- Minecraft.World/RandomPos.h | 8 +- Minecraft.World/Recipes.cpp | 76 +- Minecraft.World/Recipes.h | 16 +- Minecraft.World/Recipy.h | 12 +- Minecraft.World/RecordPlayerTile.cpp | 14 +- Minecraft.World/RecordPlayerTile.h | 10 +- Minecraft.World/RecordingItem.cpp | 8 +- Minecraft.World/RecordingItem.h | 6 +- Minecraft.World/RedStoneItem.cpp | 4 +- Minecraft.World/RedStoneItem.h | 4 +- Minecraft.World/RedStoneOreTile.cpp | 10 +- Minecraft.World/RedStoneOreTile.h | 10 +- Minecraft.World/Region.cpp | 2 +- Minecraft.World/Region.h | 2 +- Minecraft.World/RegionHillsLayer.cpp | 2 +- Minecraft.World/RegionHillsLayer.h | 2 +- Minecraft.World/RemoveEntitiesPacket.h | 2 +- Minecraft.World/RemoveMobEffectPacket.h | 2 +- Minecraft.World/RepairMenu.cpp | 26 +- Minecraft.World/RepairMenu.h | 16 +- Minecraft.World/RepairResultSlot.cpp | 12 +- Minecraft.World/RepairResultSlot.h | 10 +- Minecraft.World/RespawnPacket.h | 2 +- Minecraft.World/RestrictOpenDoorGoal.cpp | 8 +- Minecraft.World/ResultContainer.cpp | 14 +- Minecraft.World/ResultContainer.h | 10 +- Minecraft.World/ResultSlot.cpp | 20 +- Minecraft.World/ResultSlot.h | 18 +- Minecraft.World/RiverInitLayer.cpp | 2 +- Minecraft.World/RiverInitLayer.h | 2 +- Minecraft.World/RiverLayer.cpp | 2 +- Minecraft.World/RiverLayer.h | 2 +- Minecraft.World/RiverMixerLayer.cpp | 2 +- Minecraft.World/RiverMixerLayer.h | 6 +- Minecraft.World/RotateHeadPacket.cpp | 4 +- Minecraft.World/RotateHeadPacket.h | 4 +- Minecraft.World/SaddleItem.cpp | 8 +- Minecraft.World/SaddleItem.h | 4 +- Minecraft.World/SaplingTileItem.cpp | 6 +- Minecraft.World/SaplingTileItem.h | 2 +- Minecraft.World/SavedDataStorage.cpp | 24 +- Minecraft.World/SavedDataStorage.h | 12 +- Minecraft.World/SeedFoodItem.cpp | 2 +- Minecraft.World/SeedFoodItem.h | 2 +- Minecraft.World/SeedItem.cpp | 4 +- Minecraft.World/SeedItem.h | 4 +- Minecraft.World/Sensing.cpp | 2 +- Minecraft.World/Sensing.h | 2 +- Minecraft.World/ServerSettingsChangedPacket.h | 2 +- Minecraft.World/SetCarriedItemPacket.cpp | 14 +- Minecraft.World/SetCarriedItemPacket.h | 4 +- Minecraft.World/SetCreativeModeSlotPacket.cpp | 4 +- Minecraft.World/SetCreativeModeSlotPacket.h | 6 +- Minecraft.World/SetEntityDataPacket.cpp | 10 +- Minecraft.World/SetEntityDataPacket.h | 8 +- Minecraft.World/SetEntityMotionPacket.cpp | 14 +- Minecraft.World/SetEntityMotionPacket.h | 6 +- Minecraft.World/SetEquippedItemPacket.cpp | 14 +- Minecraft.World/SetEquippedItemPacket.h | 12 +- Minecraft.World/SetExperiencePacket.cpp | 2 +- Minecraft.World/SetExperiencePacket.h | 4 +- Minecraft.World/SetHealthPacket.cpp | 8 +- Minecraft.World/SetHealthPacket.h | 4 +- Minecraft.World/SetRidingPacket.cpp | 8 +- Minecraft.World/SetRidingPacket.h | 6 +- Minecraft.World/SetSpawnPositionPacket.cpp | 10 +- Minecraft.World/SetSpawnPositionPacket.h | 4 +- Minecraft.World/SetTimePacket.cpp | 2 +- Minecraft.World/SetTimePacket.h | 4 +- Minecraft.World/ShapedRecipy.cpp | 60 +- Minecraft.World/ShapedRecipy.h | 8 +- Minecraft.World/ShapelessRecipy.cpp | 44 +- Minecraft.World/ShapelessRecipy.h | 8 +- Minecraft.World/ShearsItem.cpp | 4 +- Minecraft.World/ShearsItem.h | 6 +- Minecraft.World/Sheep.cpp | 62 +- Minecraft.World/Sheep.h | 12 +- Minecraft.World/ShoreLayer.cpp | 2 +- Minecraft.World/ShoreLayer.h | 2 +- Minecraft.World/SignItem.cpp | 10 +- Minecraft.World/SignItem.h | 4 +- Minecraft.World/SignTile.cpp | 6 +- Minecraft.World/SignTile.h | 4 +- Minecraft.World/SignTileEntity.cpp | 24 +- Minecraft.World/SignTileEntity.h | 4 +- Minecraft.World/SignUpdatePacket.h | 2 +- Minecraft.World/Silverfish.cpp | 8 +- Minecraft.World/Silverfish.h | 4 +- Minecraft.World/SimpleContainer.cpp | 16 +- Minecraft.World/SimpleContainer.h | 10 +- Minecraft.World/SitGoal.cpp | 2 +- Minecraft.World/Skeleton.cpp | 22 +- Minecraft.World/Skeleton.h | 4 +- Minecraft.World/SkullItem.cpp | 12 +- Minecraft.World/SkullItem.h | 8 +- Minecraft.World/SkullTile.cpp | 24 +- Minecraft.World/SkullTile.h | 10 +- Minecraft.World/SkullTileEntity.cpp | 10 +- Minecraft.World/SkullTileEntity.h | 4 +- Minecraft.World/Slime.cpp | 22 +- Minecraft.World/Slime.h | 6 +- Minecraft.World/Slot.cpp | 38 +- Minecraft.World/Slot.h | 28 +- Minecraft.World/SmallFireball.cpp | 2 +- Minecraft.World/SmallFireball.h | 2 +- Minecraft.World/SmoothLayer.cpp | 2 +- Minecraft.World/SmoothLayer.h | 2 +- Minecraft.World/SmoothStoneBrickTileItem.cpp | 2 +- Minecraft.World/SmoothStoneBrickTileItem.h | 2 +- Minecraft.World/SmoothZoomLayer.cpp | 8 +- Minecraft.World/SmoothZoomLayer.h | 4 +- Minecraft.World/Snowball.cpp | 2 +- Minecraft.World/Snowball.h | 2 +- Minecraft.World/SnowballItem.cpp | 6 +- Minecraft.World/SnowballItem.h | 2 +- Minecraft.World/Spider.cpp | 16 +- Minecraft.World/Spider.h | 6 +- Minecraft.World/SpikeFeature.cpp | 16 +- Minecraft.World/Squid.cpp | 42 +- Minecraft.World/StairTile.cpp | 16 +- Minecraft.World/StairTile.h | 16 +- Minecraft.World/Stat.h | 2 +- Minecraft.World/StemTile.cpp | 4 +- Minecraft.World/StemTile.h | 2 +- Minecraft.World/StoneMonsterTile.cpp | 6 +- Minecraft.World/StoneMonsterTile.h | 2 +- Minecraft.World/StoneMonsterTileItem.cpp | 2 +- Minecraft.World/StoneMonsterTileItem.h | 2 +- Minecraft.World/StoneSlabTile.cpp | 12 +- Minecraft.World/StoneSlabTile.h | 2 +- Minecraft.World/StoneSlabTileItem.cpp | 38 +- Minecraft.World/StoneSlabTileItem.h | 8 +- Minecraft.World/StrongholdPieces.cpp | 48 +- Minecraft.World/StructurePiece.cpp | 10 +- Minecraft.World/SwampRiversLayer.cpp | 2 +- Minecraft.World/SwampRiversLayer.h | 2 +- Minecraft.World/SwellGoal.cpp | 2 +- Minecraft.World/SynchedEntityData.cpp | 94 +-- Minecraft.World/SynchedEntityData.h | 28 +- Minecraft.World/TakeFlowerGoal.cpp | 4 +- Minecraft.World/TakeItemEntityPacket.h | 2 +- Minecraft.World/TallGrass.cpp | 6 +- Minecraft.World/TallGrass.h | 2 +- Minecraft.World/TamableAnimal.cpp | 2 +- Minecraft.World/TamableAnimal.h | 2 +- Minecraft.World/TargetGoal.cpp | 10 +- Minecraft.World/TargetGoal.h | 4 +- Minecraft.World/TeleportEntityPacket.cpp | 12 +- Minecraft.World/TeleportEntityPacket.h | 6 +- Minecraft.World/TemperatureLayer.cpp | 2 +- Minecraft.World/TemperatureLayer.h | 2 +- Minecraft.World/TemperatureMixerLayer.cpp | 2 +- Minecraft.World/TemperatureMixerLayer.h | 4 +- Minecraft.World/TemptGoal.cpp | 2 +- .../TextureAndGeometryChangePacket.cpp | 10 +- .../TextureAndGeometryChangePacket.h | 4 +- Minecraft.World/TextureAndGeometryPacket.h | 8 +- Minecraft.World/TextureChangePacket.cpp | 10 +- Minecraft.World/TextureChangePacket.h | 4 +- Minecraft.World/TexturePacket.h | 4 +- Minecraft.World/TheEndBiomeDecorator.cpp | 4 +- Minecraft.World/TheEndPortal.cpp | 10 +- Minecraft.World/TheEndPortal.h | 12 +- Minecraft.World/TheEndPortalFrameTile.cpp | 4 +- Minecraft.World/TheEndPortalFrameTile.h | 4 +- Minecraft.World/TheEndPortalTileEntity.cpp | 4 +- Minecraft.World/TheEndPortalTileEntity.h | 2 +- Minecraft.World/ThinFenceTile.cpp | 8 +- Minecraft.World/ThinFenceTile.h | 8 +- Minecraft.World/ThornsEnchantment.cpp | 6 +- Minecraft.World/ThornsEnchantment.h | 4 +- Minecraft.World/Throwable.cpp | 8 +- Minecraft.World/Throwable.h | 4 +- Minecraft.World/ThrownEgg.cpp | 4 +- Minecraft.World/ThrownEgg.h | 2 +- Minecraft.World/ThrownEnderpearl.cpp | 4 +- Minecraft.World/ThrownEnderpearl.h | 2 +- Minecraft.World/ThrownExpBottle.cpp | 4 +- Minecraft.World/ThrownExpBottle.h | 2 +- Minecraft.World/ThrownPotion.cpp | 10 +- Minecraft.World/ThrownPotion.h | 2 +- Minecraft.World/Tile.cpp | 42 +- Minecraft.World/Tile.h | 32 +- Minecraft.World/TileDestructionPacket.cpp | 6 +- Minecraft.World/TileDestructionPacket.h | 4 +- Minecraft.World/TileEntity.cpp | 10 +- Minecraft.World/TileEntity.h | 8 +- Minecraft.World/TileEntityDataPacket.h | 2 +- Minecraft.World/TileEventPacket.h | 2 +- Minecraft.World/TileItem.cpp | 34 +- Minecraft.World/TileItem.h | 14 +- Minecraft.World/TilePlanterItem.cpp | 12 +- Minecraft.World/TilePlanterItem.h | 2 +- Minecraft.World/TileUpdatePacket.h | 2 +- Minecraft.World/TimeCommand.cpp | 10 +- Minecraft.World/TimeCommand.h | 8 +- Minecraft.World/TntTile.cpp | 16 +- Minecraft.World/TntTile.h | 6 +- Minecraft.World/ToggleDownfallCommand.cpp | 6 +- Minecraft.World/ToggleDownfallCommand.h | 4 +- Minecraft.World/TopSnowTile.cpp | 6 +- Minecraft.World/TopSnowTile.h | 6 +- Minecraft.World/TorchTile.cpp | 4 +- Minecraft.World/TorchTile.h | 4 +- Minecraft.World/TradeItemPacket.h | 2 +- Minecraft.World/TradeWithPlayerGoal.cpp | 2 +- Minecraft.World/TrapDoorTile.cpp | 6 +- Minecraft.World/TrapDoorTile.h | 6 +- Minecraft.World/TrapMenu.cpp | 10 +- Minecraft.World/TrapMenu.h | 8 +- Minecraft.World/TreeTile.cpp | 8 +- Minecraft.World/TreeTile.h | 6 +- Minecraft.World/TreeTileItem.cpp | 4 +- Minecraft.World/TreeTileItem.h | 4 +- Minecraft.World/TripWireSourceTile.cpp | 8 +- Minecraft.World/TripWireSourceTile.h | 2 +- Minecraft.World/TripWireTile.cpp | 12 +- Minecraft.World/TripWireTile.h | 6 +- Minecraft.World/UntouchingEnchantment.cpp | 2 +- Minecraft.World/UntouchingEnchantment.h | 2 +- .../UpdateGameRuleProgressPacket.h | 2 +- Minecraft.World/UpdateMobEffectPacket.cpp | 4 +- Minecraft.World/UpdateMobEffectPacket.h | 4 +- Minecraft.World/UpdateProgressPacket.h | 2 +- Minecraft.World/UseItemPacket.cpp | 14 +- Minecraft.World/UseItemPacket.h | 8 +- Minecraft.World/Village.cpp | 46 +- Minecraft.World/Village.h | 22 +- Minecraft.World/VillagePieces.cpp | 16 +- Minecraft.World/VillageSiege.cpp | 18 +- Minecraft.World/Villager.cpp | 62 +- Minecraft.World/Villager.h | 16 +- Minecraft.World/VillagerGolem.cpp | 6 +- Minecraft.World/VillagerGolem.h | 4 +- Minecraft.World/Villages.cpp | 38 +- Minecraft.World/Villages.h | 10 +- Minecraft.World/VineTile.cpp | 6 +- Minecraft.World/VineTile.h | 4 +- Minecraft.World/VoronoiZoom.cpp | 2 +- Minecraft.World/VoronoiZoom.h | 2 +- Minecraft.World/WallTile.cpp | 4 +- Minecraft.World/WallTile.h | 2 +- Minecraft.World/WaterAnimal.cpp | 2 +- Minecraft.World/WaterAnimal.h | 2 +- Minecraft.World/WaterLevelChunk.cpp | 18 +- Minecraft.World/WaterLevelChunk.h | 16 +- Minecraft.World/WaterLilyTile.cpp | 2 +- Minecraft.World/WaterLilyTile.h | 2 +- Minecraft.World/WaterLilyTileItem.cpp | 4 +- Minecraft.World/WaterLilyTileItem.h | 4 +- Minecraft.World/WeaponItem.cpp | 18 +- Minecraft.World/WeaponItem.h | 16 +- Minecraft.World/WebTile.cpp | 2 +- Minecraft.World/WebTile.h | 2 +- Minecraft.World/WeighedTreasure.cpp | 16 +- Minecraft.World/WeighedTreasure.h | 8 +- Minecraft.World/Wolf.cpp | 148 ++-- Minecraft.World/Wolf.h | 12 +- Minecraft.World/WoodSlabTile.cpp | 4 +- Minecraft.World/WoodSlabTile.h | 8 +- Minecraft.World/WoolCarpetTile.cpp | 2 +- Minecraft.World/WoolCarpetTile.h | 2 +- Minecraft.World/WorkbenchTile.cpp | 2 +- Minecraft.World/WorkbenchTile.h | 2 +- Minecraft.World/XZPacket.h | 2 +- Minecraft.World/Zombie.cpp | 14 +- Minecraft.World/Zombie.h | 6 +- Minecraft.World/ZonedChunkStorage.cpp | 12 +- Minecraft.World/ZoomLayer.cpp | 8 +- Minecraft.World/ZoomLayer.h | 4 +- .../net.minecraft.world.ContainerListener.h | 4 +- ...ecraft.world.inventory.ContainerListener.h | 6 +- 1373 files changed, 12054 insertions(+), 12054 deletions(-) diff --git a/Minecraft.Client/AbstractContainerScreen.cpp b/Minecraft.Client/AbstractContainerScreen.cpp index 2b3e0837..d199f726 100644 --- a/Minecraft.Client/AbstractContainerScreen.cpp +++ b/Minecraft.Client/AbstractContainerScreen.cpp @@ -52,7 +52,7 @@ void AbstractContainerScreen::render(int xm, int ym, float a) glEnable(GL_RESCALE_NORMAL); Slot *hoveredSlot = NULL; - + AUTO_VAR(itEnd, menu->slots->end()); for (AUTO_VAR(it, menu->slots->begin()); it != itEnd; it++) { @@ -75,7 +75,7 @@ void AbstractContainerScreen::render(int xm, int ym, float a) } } - shared_ptr inventory = minecraft->player->inventory; + std::shared_ptr inventory = minecraft->player->inventory; if (inventory->getCarried() != NULL) { glTranslatef(0, 0, 32); @@ -128,7 +128,7 @@ void AbstractContainerScreen::renderSlot(Slot *slot) #if 0 int x = slot->x; int y = slot->y; - shared_ptr item = slot->getItem(); + std::shared_ptr item = slot->getItem(); if (item == NULL) { @@ -218,7 +218,7 @@ void AbstractContainerScreen::removed() if (minecraft->player == NULL) return; } -void AbstractContainerScreen::slotsChanged(shared_ptr container) +void AbstractContainerScreen::slotsChanged(std::shared_ptr container) { } diff --git a/Minecraft.Client/AbstractContainerScreen.h b/Minecraft.Client/AbstractContainerScreen.h index 2ba9cdcd..dc78db27 100644 --- a/Minecraft.Client/AbstractContainerScreen.h +++ b/Minecraft.Client/AbstractContainerScreen.h @@ -32,7 +32,7 @@ protected: virtual void keyPressed(wchar_t eventCharacter, int eventKey); public: virtual void removed(); - virtual void slotsChanged(shared_ptr container); + virtual void slotsChanged(std::shared_ptr container); virtual bool isPauseScreen(); virtual void tick(); }; \ No newline at end of file diff --git a/Minecraft.Client/ArrowRenderer.cpp b/Minecraft.Client/ArrowRenderer.cpp index 65c4ee71..b717552b 100644 --- a/Minecraft.Client/ArrowRenderer.cpp +++ b/Minecraft.Client/ArrowRenderer.cpp @@ -3,11 +3,11 @@ #include "..\Minecraft.World\net.minecraft.world.entity.projectile.h" #include "..\Minecraft.World\Mth.h" -void ArrowRenderer::render(shared_ptr _arrow, double x, double y, double z, float rot, float a) +void ArrowRenderer::render(std::shared_ptr _arrow, double x, double y, double z, float rot, float a) { - // 4J - original version used generics and thus had an input parameter of type Arrow rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Arrow rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr arrow = dynamic_pointer_cast(_arrow); + std::shared_ptr arrow = dynamic_pointer_cast(_arrow); bindTexture(TN_ITEM_ARROWS); // 4J - was L"/item/arrows.png" glPushMatrix(); diff --git a/Minecraft.Client/ArrowRenderer.h b/Minecraft.Client/ArrowRenderer.h index 2731f7c2..3348fc33 100644 --- a/Minecraft.Client/ArrowRenderer.h +++ b/Minecraft.Client/ArrowRenderer.h @@ -4,5 +4,5 @@ class ArrowRenderer : public EntityRenderer { public: - virtual void render(shared_ptr _arrow, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _arrow, double x, double y, double z, float rot, float a); }; diff --git a/Minecraft.Client/BlazeModel.cpp b/Minecraft.Client/BlazeModel.cpp index 5af894ac..e1a7747b 100644 --- a/Minecraft.Client/BlazeModel.cpp +++ b/Minecraft.Client/BlazeModel.cpp @@ -7,7 +7,7 @@ BlazeModel::BlazeModel() : Model() { upperBodyParts = ModelPartArray(12); - for (unsigned int i = 0; i < upperBodyParts.length; i++) + for (unsigned int i = 0; i < upperBodyParts.length; i++) { upperBodyParts[i] = new ModelPart(this, 0, 16); upperBodyParts[i]->addBox(0, 0, 0, 2, 8, 2); @@ -18,34 +18,34 @@ BlazeModel::BlazeModel() : Model() // 4J added - compile now to avoid random performance hit first time cubes are rendered // 4J Stu - Not just performance, but alpha+depth tests don't work right unless we compile here - for (unsigned int i = 0; i < upperBodyParts.length; i++) + for (unsigned int i = 0; i < upperBodyParts.length; i++) { upperBodyParts[i]->compile(1.0f/16.0f); } head->compile(1.0f/16.0f); } -int BlazeModel::modelVersion() +int BlazeModel::modelVersion() { return 8; } -void BlazeModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void BlazeModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); head->render(scale,usecompiled); - for (unsigned int i = 0; i < upperBodyParts.length; i++) + for (unsigned int i = 0; i < upperBodyParts.length; i++) { upperBodyParts[i]->render(scale, usecompiled); } } -void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim) +void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim) { float angle = bob * PI * -.1f; - for (int i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { upperBodyParts[i]->y = -2 + Mth::cos((i * 2 + bob) * .25f); upperBodyParts[i]->x = Mth::cos(angle) * 9.0f; @@ -53,7 +53,7 @@ void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRo angle += PI * 0.5f; } angle = .25f * PI + bob * PI * .03f; - for (int i = 4; i < 8; i++) + for (int i = 4; i < 8; i++) { upperBodyParts[i]->y = 2 + Mth::cos((i * 2 + bob) * .25f); upperBodyParts[i]->x = Mth::cos(angle) * 7.0f; @@ -62,7 +62,7 @@ void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRo } angle = .15f * PI + bob * PI * -.05f; - for (int i = 8; i < 12; i++) + for (int i = 8; i < 12; i++) { upperBodyParts[i]->y = 11 + Mth::cos((i * 1.5f + bob) * .5f); upperBodyParts[i]->x = Mth::cos(angle) * 5.0f; diff --git a/Minecraft.Client/BlazeModel.h b/Minecraft.Client/BlazeModel.h index 27ee2060..e710ebf6 100644 --- a/Minecraft.Client/BlazeModel.h +++ b/Minecraft.Client/BlazeModel.h @@ -1,7 +1,7 @@ #pragma once #include "Model.h" -class BlazeModel : public Model +class BlazeModel : public Model { private: @@ -11,6 +11,6 @@ private: public: BlazeModel(); int modelVersion(); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; diff --git a/Minecraft.Client/BlazeRenderer.cpp b/Minecraft.Client/BlazeRenderer.cpp index 7d5210dc..f3878c1d 100644 --- a/Minecraft.Client/BlazeRenderer.cpp +++ b/Minecraft.Client/BlazeRenderer.cpp @@ -8,11 +8,11 @@ BlazeRenderer::BlazeRenderer() : MobRenderer(new BlazeModel(), 0.5f) this->modelVersion = ((BlazeModel *) model)->modelVersion(); } -void BlazeRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void BlazeRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { - // 4J - original version used generics and thus had an input parameter of type Blaze rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Blaze rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); int modelVersion = ((BlazeModel *) model)->modelVersion(); if (modelVersion != this->modelVersion) diff --git a/Minecraft.Client/BlazeRenderer.h b/Minecraft.Client/BlazeRenderer.h index fc575e9b..0ee973ca 100644 --- a/Minecraft.Client/BlazeRenderer.h +++ b/Minecraft.Client/BlazeRenderer.h @@ -10,5 +10,5 @@ private: public: BlazeRenderer(); - virtual void render(shared_ptr mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr mob, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/BoatModel.cpp b/Minecraft.Client/BoatModel.cpp index d0d465e5..096d243e 100644 --- a/Minecraft.Client/BoatModel.cpp +++ b/Minecraft.Client/BoatModel.cpp @@ -16,19 +16,19 @@ BoatModel::BoatModel() : Model() cubes[0]->addBox((float)(-w / 2), (float)(-h / 2 + 2), -3, w, h - 4, 4, 0); cubes[0]->setPos(0, (float)(0 + yOff), 0); - + cubes[1]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[1]->setPos((float)(-w / 2 + 1), (float)(0 + yOff), 0); - + cubes[2]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[2]->setPos((float)(+w / 2 - 1), (float)(0 + yOff), 0); - + cubes[3]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[3]->setPos(0, (float)(0 + yOff), (float)(-h / 2 + 1)); - + cubes[4]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[4]->setPos(0, (float)(0 + yOff), (float)(+h / 2 - 1)); - + cubes[0]->xRot = PI / 2; cubes[1]->yRot = PI / 2 * 3; cubes[2]->yRot = PI / 2 * 1; @@ -42,7 +42,7 @@ BoatModel::BoatModel() : Model() cubes[4]->compile(1.0f/16.0f); } -void BoatModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void BoatModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { for (int i = 0; i < 5; i++) { diff --git a/Minecraft.Client/BoatModel.h b/Minecraft.Client/BoatModel.h index 4298b643..192e140f 100644 --- a/Minecraft.Client/BoatModel.h +++ b/Minecraft.Client/BoatModel.h @@ -7,5 +7,5 @@ class BoatModel : public Model public: ModelPart *cubes[5]; BoatModel(); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); }; \ No newline at end of file diff --git a/Minecraft.Client/BoatRenderer.cpp b/Minecraft.Client/BoatRenderer.cpp index f1367ae4..33ffc322 100644 --- a/Minecraft.Client/BoatRenderer.cpp +++ b/Minecraft.Client/BoatRenderer.cpp @@ -10,11 +10,11 @@ BoatRenderer::BoatRenderer() : EntityRenderer() model = new BoatModel(); } -void BoatRenderer::render(shared_ptr _boat, double x, double y, double z, float rot, float a) +void BoatRenderer::render(std::shared_ptr _boat, double x, double y, double z, float rot, float a) { - // 4J - original version used generics and thus had an input parameter of type Boat rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Boat rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr boat = dynamic_pointer_cast(_boat); + std::shared_ptr boat = dynamic_pointer_cast(_boat); glPushMatrix(); diff --git a/Minecraft.Client/BoatRenderer.h b/Minecraft.Client/BoatRenderer.h index 1cc9c1d9..c4bb0312 100644 --- a/Minecraft.Client/BoatRenderer.h +++ b/Minecraft.Client/BoatRenderer.h @@ -9,5 +9,5 @@ protected: public: BoatRenderer(); - virtual void render(shared_ptr boat, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr boat, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/BookModel.cpp b/Minecraft.Client/BookModel.cpp index bc4769bd..dec3d6ac 100644 --- a/Minecraft.Client/BookModel.cpp +++ b/Minecraft.Client/BookModel.cpp @@ -3,7 +3,7 @@ #include "BookModel.h" #include "ModelPart.h" -BookModel::BookModel() +BookModel::BookModel() { leftLid = (new ModelPart(this))->texOffs(0, 0)->addBox(-6, -5, 0, 6, 10, 0); rightLid = (new ModelPart(this))->texOffs(16, 0)->addBox(0, -5, 0, 6, 10, 0); @@ -33,7 +33,7 @@ BookModel::BookModel() } -void BookModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void BookModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); diff --git a/Minecraft.Client/BookModel.h b/Minecraft.Client/BookModel.h index 8b367a34..3e6cee00 100644 --- a/Minecraft.Client/BookModel.h +++ b/Minecraft.Client/BookModel.h @@ -2,7 +2,7 @@ #pragma once #include "Model.h" -class BookModel : public Model +class BookModel : public Model { public: ModelPart *leftLid, *rightLid; @@ -11,6 +11,6 @@ public: ModelPart *seam; BookModel(); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; diff --git a/Minecraft.Client/Camera.cpp b/Minecraft.Client/Camera.cpp index db6072b2..6c5a3649 100644 --- a/Minecraft.Client/Camera.cpp +++ b/Minecraft.Client/Camera.cpp @@ -21,7 +21,7 @@ float Camera::za = 0.0f; float Camera::xa2 = 0.0f; float Camera::za2 = 0.0f; -void Camera::prepare(shared_ptr player, bool mirror) +void Camera::prepare(std::shared_ptr player, bool mirror) { glGetFloat(GL_MODELVIEW_MATRIX, modelview); glGetFloat(GL_PROJECTION_MATRIX, projection); @@ -88,12 +88,12 @@ void Camera::prepare(shared_ptr player, bool mirror) ya = cosf(xRot * PI / 180.0f); } -TilePos *Camera::getCameraTilePos(shared_ptr player, double alpha) +TilePos *Camera::getCameraTilePos(std::shared_ptr player, double alpha) { return new TilePos(getCameraPos(player, alpha)); } -Vec3 *Camera::getCameraPos(shared_ptr player, double alpha) +Vec3 *Camera::getCameraPos(std::shared_ptr player, double alpha) { double xx = player->xo + (player->x - player->xo) * alpha; double yy = player->yo + (player->y - player->yo) * alpha + player->getHeadHeight(); @@ -106,7 +106,7 @@ Vec3 *Camera::getCameraPos(shared_ptr player, double alpha) return Vec3::newTemp(xt, yt, zt); } -int Camera::getBlockAt(Level *level, shared_ptr player, float alpha) +int Camera::getBlockAt(Level *level, std::shared_ptr player, float alpha) { Vec3 *p = Camera::getCameraPos(player, alpha); TilePos tp = TilePos(p); diff --git a/Minecraft.Client/Camera.h b/Minecraft.Client/Camera.h index cccb0b2d..7e00540d 100644 --- a/Minecraft.Client/Camera.h +++ b/Minecraft.Client/Camera.h @@ -24,9 +24,9 @@ private: public: static float xa, ya, za, xa2, za2; - static void prepare(shared_ptr player, bool mirror); + static void prepare(std::shared_ptr player, bool mirror); - static TilePos *getCameraTilePos(shared_ptr player, double alpha); - static Vec3 *getCameraPos(shared_ptr player, double alpha); - static int getBlockAt(Level *level, shared_ptr player, float alpha); + static TilePos *getCameraTilePos(std::shared_ptr player, double alpha); + static Vec3 *getCameraPos(std::shared_ptr player, double alpha); + static int getBlockAt(Level *level, std::shared_ptr player, float alpha); }; \ No newline at end of file diff --git a/Minecraft.Client/ChestRenderer.cpp b/Minecraft.Client/ChestRenderer.cpp index d1b5cf91..d895d782 100644 --- a/Minecraft.Client/ChestRenderer.cpp +++ b/Minecraft.Client/ChestRenderer.cpp @@ -18,10 +18,10 @@ ChestRenderer::~ChestRenderer() delete largeChestModel; } -void ChestRenderer::render(shared_ptr _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +void ChestRenderer::render(std::shared_ptr _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) { // 4J Convert as we aren't using a templated class - shared_ptr chest = dynamic_pointer_cast(_chest); + std::shared_ptr chest = dynamic_pointer_cast(_chest); int data; diff --git a/Minecraft.Client/ChestRenderer.h b/Minecraft.Client/ChestRenderer.h index 06c6bfff..c52598e4 100644 --- a/Minecraft.Client/ChestRenderer.h +++ b/Minecraft.Client/ChestRenderer.h @@ -11,8 +11,8 @@ private: ChestModel *largeChestModel; public: - ChestRenderer(); + ChestRenderer(); ~ChestRenderer(); - void render(shared_ptr _chest, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param + void render(std::shared_ptr _chest, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param }; diff --git a/Minecraft.Client/ChickenModel.cpp b/Minecraft.Client/ChickenModel.cpp index 21dc2059..2a88fac6 100644 --- a/Minecraft.Client/ChickenModel.cpp +++ b/Minecraft.Client/ChickenModel.cpp @@ -49,10 +49,10 @@ ChickenModel::ChickenModel() : Model() wing1->compile(1.0f/16.0f); } -void ChickenModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void ChickenModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); - if (young) + if (young) { float ss = 2; glPushMatrix(); @@ -70,8 +70,8 @@ void ChickenModel::render(shared_ptr entity, float time, float r, float wing0->render(scale,usecompiled); wing1->render(scale,usecompiled); glPopMatrix(); - } - else + } + else { head->render(scale,usecompiled); beak->render(scale,usecompiled); @@ -88,13 +88,13 @@ void ChickenModel::setupAnim(float time, float r, float bob, float yRot, float x { head->xRot = xRot / (float) (180 / PI); head->yRot = yRot / (float) (180 / PI); - + beak->xRot = head->xRot; beak->yRot = head->yRot; - + redThing->xRot = head->xRot; redThing->yRot = head->yRot; - + body->xRot = 90 / (float) (180 / PI); leg0->xRot = (Mth::cos(time * 0.6662f) * 1.4f) * r; diff --git a/Minecraft.Client/ChickenModel.h b/Minecraft.Client/ChickenModel.h index 9ee0858e..81d83d99 100644 --- a/Minecraft.Client/ChickenModel.h +++ b/Minecraft.Client/ChickenModel.h @@ -6,6 +6,6 @@ public: ModelPart *head, *hair, *body, *leg0, *leg1, *wing0,* wing1, *beak, *redThing; ChickenModel(); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; diff --git a/Minecraft.Client/ChickenRenderer.cpp b/Minecraft.Client/ChickenRenderer.cpp index 908ba506..2e84a450 100644 --- a/Minecraft.Client/ChickenRenderer.cpp +++ b/Minecraft.Client/ChickenRenderer.cpp @@ -7,18 +7,18 @@ ChickenRenderer::ChickenRenderer(Model *model, float shadow) : MobRenderer(model { } -void ChickenRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void ChickenRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { MobRenderer::render(_mob, x, y, z, rot, a); } -float ChickenRenderer::getBob(shared_ptr _mob, float a) +float ChickenRenderer::getBob(std::shared_ptr _mob, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); float flap = mob->oFlap+(mob->flap-mob->oFlap)*a; float flapSpeed = mob->oFlapSpeed+(mob->flapSpeed-mob->oFlapSpeed)*a; - + return (Mth::sin(flap)+1)*flapSpeed; } \ No newline at end of file diff --git a/Minecraft.Client/ChickenRenderer.h b/Minecraft.Client/ChickenRenderer.h index b81c9133..2c33176d 100644 --- a/Minecraft.Client/ChickenRenderer.h +++ b/Minecraft.Client/ChickenRenderer.h @@ -5,7 +5,7 @@ class ChickenRenderer : public MobRenderer { public: ChickenRenderer(Model *model, float shadow); - virtual void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); protected: - virtual float getBob(shared_ptr _mob, float a); + virtual float getBob(std::shared_ptr _mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/Chunk.cpp b/Minecraft.Client/Chunk.cpp index 99933db3..fcc540ad 100644 --- a/Minecraft.Client/Chunk.cpp +++ b/Minecraft.Client/Chunk.cpp @@ -103,7 +103,7 @@ void Chunk::setPos(int x, int y, int z) { bb = AABB::newPermanent(-g, -g, -g, XZSIZE+g, SIZE+g, XZSIZE+g); } - else + else { // 4J MGH - bounds are relative to the position now, so the AABB will be setup already, either above, or from the tesselator bounds. // bb->set(-g, -g, -g, SIZE+g, SIZE+g, SIZE+g); @@ -141,7 +141,7 @@ void Chunk::setPos(int x, int y, int z) LeaveCriticalSection(&levelRenderer->m_csDirtyChunks); - + } void Chunk::translateToPos() @@ -173,7 +173,7 @@ void Chunk::makeCopyForRebuild(Chunk *source) this->clipChunk = NULL; this->id = source->id; this->globalRenderableTileEntities = source->globalRenderableTileEntities; - this->globalRenderableTileEntities_cs = source->globalRenderableTileEntities_cs; + this->globalRenderableTileEntities_cs = source->globalRenderableTileEntities_cs; } void Chunk::rebuild() @@ -186,7 +186,7 @@ void Chunk::rebuild() // if (!dirty) return; PIXBeginNamedEvent(0,"Rebuild section A"); - + #ifdef _LARGE_WORLDS Tesselator *t = Tesselator::getInstance(); #else @@ -204,10 +204,10 @@ void Chunk::rebuild() LevelChunk::touchedSky = false; -// unordered_set > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line +// unordered_set > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line // renderableTileEntities.clear(); - vector > renderableTileEntities; // 4J - added + vector > renderableTileEntities; // 4J - added int r = 1; @@ -223,7 +223,7 @@ void Chunk::rebuild() // Get the data for the level chunk that this render chunk is it (level chunk is 16 x 16 x 128, // render chunk is 16 x 16 x 16. We wouldn't have to actually get all of it if the data was ordered differently, but currently // it is ordered by x then z then y so just getting a small range of y out of it would involve getting the whole thing into - // the cache anyway. + // the cache anyway. #ifdef _LARGE_WORLDS unsigned char *tileIds = GetTileIdsStorage(); @@ -237,9 +237,9 @@ void Chunk::rebuild() TileRenderer *tileRenderer = new TileRenderer(region, this->x, this->y, this->z, tileIds); // AP - added a caching system for Chunk::rebuild to take advantage of - // Basically we're storing of copy of the tileIDs array inside the region so that calls to Region::getTile can grab data - // more quickly from this array rather than calling CompressedTileStorage. On the Vita the total thread time spent in - // Region::getTile went from 20% to 4%. + // Basically we're storing of copy of the tileIDs array inside the region so that calls to Region::getTile can grab data + // more quickly from this array rather than calling CompressedTileStorage. On the Vita the total thread time spent in + // Region::getTile went from 20% to 4%. #ifdef __PSVITA__ int xc = x >> 4; int zc = z >> 4; @@ -275,7 +275,7 @@ void Chunk::rebuild() if( yy == (Level::maxBuildHeight - 1) ) continue; if(( xx == 0 ) || ( xx == 15 )) continue; if(( zz == 0 ) || ( zz == 15 )) continue; - + // Establish whether this tile and its neighbours are all made of rock, dirt, unbreakable tiles, or have already // been determined to meet this criteria themselves and have a tile of 255 set. if( !( ( tileId == Tile::rock_Id ) || ( tileId == Tile::dirt_Id ) || ( tileId == Tile::unbreakable_Id ) || ( tileId == 255) ) ) continue; @@ -337,7 +337,7 @@ void Chunk::rebuild() PIXBeginNamedEvent(0,"Rebuild section C"); Tesselator::Bounds bounds; // 4J MGH - added { - // this was the old default clip bounds for the chunk, set in Chunk::setPos. + // this was the old default clip bounds for the chunk, set in Chunk::setPos. float g = 6.0f; bounds.boundingBox[0] = -g; bounds.boundingBox[1] = -g; @@ -398,11 +398,11 @@ void Chunk::rebuild() t->begin(); t->offset((float)(-this->x), (float)(-this->y), (float)(-this->z)); } - + Tile *tile = Tile::tiles[tileId]; if (currentLayer == 0 && tile->isEntityTile()) { - shared_ptr et = region->getTileEntity(x, y, z); + std::shared_ptr et = region->getTileEntity(x, y, z); if (TileEntityRenderDispatcher::instance->hasRenderer(et)) { renderableTileEntities.push_back(et); @@ -465,7 +465,7 @@ void Chunk::rebuild() { levelRenderer->setGlobalChunkFlag(this->x, this->y, this->z, level, LevelRenderer::CHUNK_FLAG_EMPTY1); RenderManager.CBuffClear(lists + 1); - break; + break; } } @@ -552,12 +552,12 @@ void Chunk::rebuild() oldTileEntities.removeAll(renderableTileEntities); globalRenderableTileEntities.removeAll(oldTileEntities); */ - - unordered_set > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); - + + unordered_set > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); + AUTO_VAR(endIt, oldTileEntities.end()); - for( unordered_set >::iterator it = oldTileEntities.begin(); it != endIt; it++ ) + for( unordered_set >::iterator it = oldTileEntities.begin(); it != endIt; it++ ) { newTileEntities.erase(*it); } @@ -566,7 +566,7 @@ void Chunk::rebuild() EnterCriticalSection(globalRenderableTileEntities_cs); endIt = newTileEntities.end(); - for( unordered_set >::iterator it = newTileEntities.begin(); it != endIt; it++ ) + for( unordered_set >::iterator it = newTileEntities.begin(); it != endIt; it++ ) { globalRenderableTileEntities->push_back(*it); } @@ -574,12 +574,12 @@ void Chunk::rebuild() // 4J - All these new things added to globalRenderableTileEntities AUTO_VAR(endItRTE, renderableTileEntities.end()); - for( vector >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ ) + for( vector >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ ) { oldTileEntities.erase(*it); } // 4J - oldTileEntities is now the removed items - vector >::iterator it = globalRenderableTileEntities->begin(); + vector >::iterator it = globalRenderableTileEntities->begin(); while( it != globalRenderableTileEntities->end() ) { if( oldTileEntities.find(*it) != oldTileEntities.end() ) @@ -656,10 +656,10 @@ void Chunk::rebuild_SPU() LevelChunk::touchedSky = false; -// unordered_set > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line +// unordered_set > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line // renderableTileEntities.clear(); - vector > renderableTileEntities; // 4J - added + vector > renderableTileEntities; // 4J - added // List newTileEntities = new ArrayList(); // newTileEntities.clear(); @@ -679,13 +679,13 @@ void Chunk::rebuild_SPU() // Get the data for the level chunk that this render chunk is it (level chunk is 16 x 16 x 128, // render chunk is 16 x 16 x 16. We wouldn't have to actually get all of it if the data was ordered differently, but currently // it is ordered by x then z then y so just getting a small range of y out of it would involve getting the whole thing into - // the cache anyway. + // the cache anyway. ChunkRebuildData* pOutData = NULL; g_rebuildDataIn.buildForChunk(®ion, level, x0, y0, z0); Tesselator::Bounds bounds; { - // this was the old default clip bounds for the chunk, set in Chunk::setPos. + // this was the old default clip bounds for the chunk, set in Chunk::setPos. float g = 6.0f; bounds.boundingBox[0] = -g; bounds.boundingBox[1] = -g; @@ -750,7 +750,7 @@ void Chunk::rebuild_SPU() { if (currentLayer == 0 && Tile::tiles[tileId]->isEntityTile()) { - shared_ptr et = region.getTileEntity(x, y, z); + std::shared_ptr et = region.getTileEntity(x, y, z); if (TileEntityRenderDispatcher::instance->hasRenderer(et)) { renderableTileEntities.push_back(et); @@ -881,12 +881,12 @@ void Chunk::rebuild_SPU() oldTileEntities.removeAll(renderableTileEntities); globalRenderableTileEntities.removeAll(oldTileEntities); */ - - unordered_set > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); - + + unordered_set > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); + AUTO_VAR(endIt, oldTileEntities.end()); - for( unordered_set >::iterator it = oldTileEntities.begin(); it != endIt; it++ ) + for( unordered_set >::iterator it = oldTileEntities.begin(); it != endIt; it++ ) { newTileEntities.erase(*it); } @@ -895,7 +895,7 @@ void Chunk::rebuild_SPU() EnterCriticalSection(globalRenderableTileEntities_cs); endIt = newTileEntities.end(); - for( unordered_set >::iterator it = newTileEntities.begin(); it != endIt; it++ ) + for( unordered_set >::iterator it = newTileEntities.begin(); it != endIt; it++ ) { globalRenderableTileEntities.push_back(*it); } @@ -903,12 +903,12 @@ void Chunk::rebuild_SPU() // 4J - All these new things added to globalRenderableTileEntities AUTO_VAR(endItRTE, renderableTileEntities.end()); - for( vector >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ ) + for( vector >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ ) { oldTileEntities.erase(*it); } // 4J - oldTileEntities is now the removed items - vector >::iterator it = globalRenderableTileEntities->begin(); + vector >::iterator it = globalRenderableTileEntities->begin(); while( it != globalRenderableTileEntities->end() ) { if( oldTileEntities.find(*it) != oldTileEntities.end() ) @@ -941,7 +941,7 @@ void Chunk::rebuild_SPU() #endif // _PS3_ -float Chunk::distanceToSqr(shared_ptr player) const +float Chunk::distanceToSqr(std::shared_ptr player) const { float xd = (float) (player->x - xm); float yd = (float) (player->y - ym); @@ -949,7 +949,7 @@ float Chunk::distanceToSqr(shared_ptr player) const return xd * xd + yd * yd + zd * zd; } -float Chunk::squishedDistanceToSqr(shared_ptr player) +float Chunk::squishedDistanceToSqr(std::shared_ptr player) { float xd = (float) (player->x - xm); float yd = (float) (player->y - ym) * 2; diff --git a/Minecraft.Client/Chunk.h b/Minecraft.Client/Chunk.h index f7947156..276372db 100644 --- a/Minecraft.Client/Chunk.h +++ b/Minecraft.Client/Chunk.h @@ -38,22 +38,22 @@ public: static void ReleaseThreadStorage(); static unsigned char *GetTileIdsStorage(); #endif - + public: static int updates; int x, y, z; int xRender, yRender, zRender; int xRenderOffs, yRenderOffs, zRenderOffs; - + int xm, ym, zm; AABB *bb; ClipChunk *clipChunk; int id; //public: -// vector > renderableTileEntities; // 4J - removed - +// vector > renderableTileEntities; // 4J - removed + private: LevelRenderer::rteMap *globalRenderableTileEntities; CRITICAL_SECTION *globalRenderableTileEntities_cs; @@ -71,8 +71,8 @@ public: #ifdef __PS3__ void rebuild_SPU(); #endif // __PS3__ - float distanceToSqr(shared_ptr player) const; - float squishedDistanceToSqr(shared_ptr player); + float distanceToSqr(std::shared_ptr player) const; + float squishedDistanceToSqr(std::shared_ptr player); void reset(); void _delete(); diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index 5ba3cb85..f2fbf3fc 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -150,16 +150,16 @@ INetworkPlayer *ClientConnection::getNetworkPlayer() else return NULL; } -void ClientConnection::handleLogin(shared_ptr packet) +void ClientConnection::handleLogin(std::shared_ptr packet) { if (done) return; PlayerUID OnlineXuid; ProfileManager.GetXUID(m_userIndex,&OnlineXuid,true); // online xuid MOJANG_DATA *pMojangData = NULL; - + if(!g_NetworkManager.IsLocalGame()) - { + { pMojangData=app.GetMojangDataForXuid(OnlineXuid); } @@ -211,7 +211,7 @@ void ClientConnection::handleLogin(shared_ptr packet) // check the file is not already in bRes=app.IsFileInMemoryTextures(wstr); if(!bRes) - { + { #ifdef _XBOX C4JStorage::ETMSStatus eTMSStatus; eTMSStatus=StorageManager.ReadTMSFile(iUserID,C4JStorage::eGlobalStorage_Title,C4JStorage::eTMS_FileType_Graphic,pMojangData->wchSkin,&pBuffer, &dwSize); @@ -223,17 +223,17 @@ void ClientConnection::handleLogin(shared_ptr packet) if(bRes) { app.AddMemoryTextureFile(wstr,pBuffer,dwSize); - } + } } // a cloak? if(pMojangData->wchCape[0]!=0L) - { + { wstring wstr=pMojangData->wchCape; // check the file is not already in bRes=app.IsFileInMemoryTextures(wstr); if(!bRes) - { + { #ifdef _XBOX C4JStorage::ETMSStatus eTMSStatus; eTMSStatus=StorageManager.ReadTMSFile(iUserID,C4JStorage::eGlobalStorage_Title,C4JStorage::eTMS_FileType_Graphic,pMojangData->wchCape,&pBuffer, &dwSize); @@ -291,7 +291,7 @@ void ClientConnection::handleLogin(shared_ptr packet) app.DebugPrintf("ClientConnection - DIFFICULTY --- %d\n",packet->difficulty); level->difficulty = packet->difficulty; // 4J Added level->isClientSide = true; - minecraft->setLevel(level); + minecraft->setLevel(level); } minecraft->player->setPlayerIndex( packet->m_playerIndex ); @@ -328,7 +328,7 @@ void ClientConnection::handleLogin(shared_ptr packet) // 4J-PB - this isn't the level we want //level = (MultiPlayerLevel *)minecraft->level; level = (MultiPlayerLevel *)minecraft->getLevel( packet->dimension ); - shared_ptr player; + std::shared_ptr player; if(level==NULL) { @@ -351,11 +351,11 @@ void ClientConnection::handleLogin(shared_ptr packet) // 4J Stu - At time of writing ProfileManager.GetGamertag() does not always return the correct name, // if sign-ins are turned off while the player signed in. Using the qnetPlayer instead. // need to have a level before create extra local player - MultiPlayerLevel *levelpassedin=(MultiPlayerLevel *)level; + MultiPlayerLevel *levelpassedin=(MultiPlayerLevel *)level; player = minecraft->createExtraLocalPlayer(m_userIndex, networkPlayer->GetOnlineName(), m_userIndex, packet->dimension, this,levelpassedin); // need to have a player before the setlevel - shared_ptr lastPlayer = minecraft->player; + std::shared_ptr lastPlayer = minecraft->player; minecraft->player = minecraft->localplayers[m_userIndex]; minecraft->setLevel(level); minecraft->player = lastPlayer; @@ -373,7 +373,7 @@ void ClientConnection::handleLogin(shared_ptr packet) player->setPlayerIndex( packet->m_playerIndex ); player->setCustomSkin( app.GetPlayerSkinId(m_userIndex) ); player->setCustomCape( app.GetPlayerCapeId(m_userIndex) ); - + BYTE networkSmallId = getSocket()->getSmallId(); app.UpdatePlayerInfo(networkSmallId, packet->m_playerIndex, packet->m_uiGamePrivileges); @@ -385,50 +385,50 @@ void ClientConnection::handleLogin(shared_ptr packet) displayPrivilegeChanges(minecraft->localplayers[m_userIndex],startingPrivileges); } - + maxPlayers = packet->maxPlayers; - + // need to have a player before the setLocalCreativeMode - shared_ptr lastPlayer = minecraft->player; + std::shared_ptr lastPlayer = minecraft->player; minecraft->player = minecraft->localplayers[m_userIndex]; ((MultiPlayerGameMode *)minecraft->localgameModes[m_userIndex])->setLocalMode(GameType::byId(packet->gameType)); minecraft->player = lastPlayer; - + // make sure the UI offsets for this player are set correctly if(iUserID!=-1) { ui.UpdateSelectedItemPos(iUserID); } - + TelemetryManager->RecordLevelStart(m_userIndex, eSen_FriendOrMatch_Playing_With_Invited_Friends, eSen_CompeteOrCoop_Coop_and_Competitive, Minecraft::GetInstance()->getLevel(packet->dimension)->difficulty, app.GetLocalPlayerCount(), g_NetworkManager.GetOnlinePlayerCount()); } -void ClientConnection::handleAddEntity(shared_ptr packet) +void ClientConnection::handleAddEntity(std::shared_ptr packet) { double x = packet->x / 32.0; double y = packet->y / 32.0; double z = packet->z / 32.0; - shared_ptr e; + std::shared_ptr e; boolean setRot = true; // 4J-PB - replacing this massive if nest with switch switch(packet->type) { case AddEntityPacket::MINECART_RIDEABLE: - e = shared_ptr( new Minecart(level, x, y, z, Minecart::RIDEABLE) ); + e = std::shared_ptr( new Minecart(level, x, y, z, Minecart::RIDEABLE) ); break; case AddEntityPacket::MINECART_CHEST: - e = shared_ptr( new Minecart(level, x, y, z, Minecart::CHEST) ); + e = std::shared_ptr( new Minecart(level, x, y, z, Minecart::CHEST) ); break; case AddEntityPacket::MINECART_FURNACE: - e = shared_ptr( new Minecart(level, x, y, z, Minecart::FURNACE) ); + e = std::shared_ptr( new Minecart(level, x, y, z, Minecart::FURNACE) ); break; case AddEntityPacket::FISH_HOOK: { // 4J Stu - Brought forward from 1.4 to be able to drop XP from fishing - shared_ptr owner = getEntity(packet->data); + std::shared_ptr owner = getEntity(packet->data); // 4J - check all local players to find match if( owner == NULL ) @@ -446,10 +446,10 @@ void ClientConnection::handleAddEntity(shared_ptr packet) } } } - shared_ptr player = dynamic_pointer_cast(owner); + std::shared_ptr player = dynamic_pointer_cast(owner); if (player != NULL) { - shared_ptr hook = shared_ptr( new FishingHook(level, x, y, z, player) ); + std::shared_ptr hook = std::shared_ptr( new FishingHook(level, x, y, z, player) ); e = hook; // 4J Stu - Move the player->fishing out of the ctor as we cannot reference 'this' player->fishing = hook; @@ -458,10 +458,10 @@ void ClientConnection::handleAddEntity(shared_ptr packet) } break; case AddEntityPacket::ARROW: - e = shared_ptr( new Arrow(level, x, y, z) ); + e = std::shared_ptr( new Arrow(level, x, y, z) ); break; case AddEntityPacket::SNOWBALL: - e = shared_ptr( new Snowball(level, x, y, z) ); + e = std::shared_ptr( new Snowball(level, x, y, z) ); break; case AddEntityPacket::ITEM_FRAME: { @@ -470,66 +470,66 @@ void ClientConnection::handleAddEntity(shared_ptr packet) int iz = (int) z; app.DebugPrintf("ClientConnection ITEM_FRAME xyz %d,%d,%d\n",ix,iy,iz); } - e = shared_ptr(new ItemFrame(level, (int) x, (int) y, (int) z, packet->data)); + e = std::shared_ptr(new ItemFrame(level, (int) x, (int) y, (int) z, packet->data)); packet->data = 0; setRot = false; break; case AddEntityPacket::THROWN_ENDERPEARL: - e = shared_ptr( new ThrownEnderpearl(level, x, y, z) ); + e = std::shared_ptr( new ThrownEnderpearl(level, x, y, z) ); break; case AddEntityPacket::EYEOFENDERSIGNAL: - e = shared_ptr( new EyeOfEnderSignal(level, x, y, z) ); + e = std::shared_ptr( new EyeOfEnderSignal(level, x, y, z) ); break; case AddEntityPacket::FIREBALL: - e = shared_ptr( new Fireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); + e = std::shared_ptr( new Fireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); packet->data = 0; break; case AddEntityPacket::SMALL_FIREBALL: - e = shared_ptr( new SmallFireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); + e = std::shared_ptr( new SmallFireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); packet->data = 0; break; case AddEntityPacket::DRAGON_FIRE_BALL: - e = shared_ptr( new DragonFireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); + e = std::shared_ptr( new DragonFireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); packet->data = 0; break; case AddEntityPacket::EGG: - e = shared_ptr( new ThrownEgg(level, x, y, z) ); + e = std::shared_ptr( new ThrownEgg(level, x, y, z) ); break; case AddEntityPacket::THROWN_POTION: - e = shared_ptr( new ThrownPotion(level, x, y, z, packet->data) ); + e = std::shared_ptr( new ThrownPotion(level, x, y, z, packet->data) ); packet->data = 0; break; case AddEntityPacket::THROWN_EXPBOTTLE: - e = shared_ptr( new ThrownExpBottle(level, x, y, z) ); + e = std::shared_ptr( new ThrownExpBottle(level, x, y, z) ); packet->data = 0; break; case AddEntityPacket::BOAT: - e = shared_ptr( new Boat(level, x, y, z) ); + e = std::shared_ptr( new Boat(level, x, y, z) ); break; case AddEntityPacket::PRIMED_TNT: - e = shared_ptr( new PrimedTnt(level, x, y, z) ); + e = std::shared_ptr( new PrimedTnt(level, x, y, z) ); break; case AddEntityPacket::ENDER_CRYSTAL: - e = shared_ptr( new EnderCrystal(level, x, y, z) ); + e = std::shared_ptr( new EnderCrystal(level, x, y, z) ); break; case AddEntityPacket::ITEM: - e = shared_ptr( new ItemEntity(level, x, y, z) ); + e = std::shared_ptr( new ItemEntity(level, x, y, z) ); break; case AddEntityPacket::FALLING: - e = shared_ptr( new FallingTile(level, x, y, z, packet->data & 0xFFFF, packet->data >> 16) ); + e = std::shared_ptr( new FallingTile(level, x, y, z, packet->data & 0xFFFF, packet->data >> 16) ); packet->data = 0; break; } - /* if (packet->type == AddEntityPacket::MINECART_RIDEABLE) e = shared_ptr( new Minecart(level, x, y, z, Minecart::RIDEABLE) ); - if (packet->type == AddEntityPacket::MINECART_CHEST) e = shared_ptr( new Minecart(level, x, y, z, Minecart::CHEST) ); - if (packet->type == AddEntityPacket::MINECART_FURNACE) e = shared_ptr( new Minecart(level, x, y, z, Minecart::FURNACE) ); + /* if (packet->type == AddEntityPacket::MINECART_RIDEABLE) e = std::shared_ptr( new Minecart(level, x, y, z, Minecart::RIDEABLE) ); + if (packet->type == AddEntityPacket::MINECART_CHEST) e = std::shared_ptr( new Minecart(level, x, y, z, Minecart::CHEST) ); + if (packet->type == AddEntityPacket::MINECART_FURNACE) e = std::shared_ptr( new Minecart(level, x, y, z, Minecart::FURNACE) ); if (packet->type == AddEntityPacket::FISH_HOOK) { // 4J Stu - Brought forward from 1.4 to be able to drop XP from fishing - shared_ptr owner = getEntity(packet->data); + std::shared_ptr owner = getEntity(packet->data); // 4J - check all local players to find match if( owner == NULL ) @@ -547,48 +547,48 @@ void ClientConnection::handleAddEntity(shared_ptr packet) } } } - shared_ptr player = dynamic_pointer_cast(owner); + std::shared_ptr player = dynamic_pointer_cast(owner); if (player != NULL) { - shared_ptr hook = shared_ptr( new FishingHook(level, x, y, z, player) ); + std::shared_ptr hook = std::shared_ptr( new FishingHook(level, x, y, z, player) ); e = hook; // 4J Stu - Move the player->fishing out of the ctor as we cannot reference 'this' player->fishing = hook; } packet->data = 0; } - - if (packet->type == AddEntityPacket::ARROW) e = shared_ptr( new Arrow(level, x, y, z) ); - if (packet->type == AddEntityPacket::SNOWBALL) e = shared_ptr( new Snowball(level, x, y, z) ); - if (packet->type == AddEntityPacket::THROWN_ENDERPEARL) e = shared_ptr( new ThrownEnderpearl(level, x, y, z) ); - if (packet->type == AddEntityPacket::EYEOFENDERSIGNAL) e = shared_ptr( new EyeOfEnderSignal(level, x, y, z) ); + + if (packet->type == AddEntityPacket::ARROW) e = std::shared_ptr( new Arrow(level, x, y, z) ); + if (packet->type == AddEntityPacket::SNOWBALL) e = std::shared_ptr( new Snowball(level, x, y, z) ); + if (packet->type == AddEntityPacket::THROWN_ENDERPEARL) e = std::shared_ptr( new ThrownEnderpearl(level, x, y, z) ); + if (packet->type == AddEntityPacket::EYEOFENDERSIGNAL) e = std::shared_ptr( new EyeOfEnderSignal(level, x, y, z) ); if (packet->type == AddEntityPacket::FIREBALL) { - e = shared_ptr( new Fireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); + e = std::shared_ptr( new Fireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); packet->data = 0; } if (packet->type == AddEntityPacket::SMALL_FIREBALL) { - e = shared_ptr( new SmallFireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); + e = std::shared_ptr( new SmallFireball(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0) ); packet->data = 0; } - if (packet->type == AddEntityPacket::EGG) e = shared_ptr( new ThrownEgg(level, x, y, z) ); + if (packet->type == AddEntityPacket::EGG) e = std::shared_ptr( new ThrownEgg(level, x, y, z) ); if (packet->type == AddEntityPacket::THROWN_POTION) { - e = shared_ptr( new ThrownPotion(level, x, y, z, packet->data) ); + e = std::shared_ptr( new ThrownPotion(level, x, y, z, packet->data) ); packet->data = 0; } if (packet->type == AddEntityPacket::THROWN_EXPBOTTLE) { - e = shared_ptr( new ThrownExpBottle(level, x, y, z) ); + e = std::shared_ptr( new ThrownExpBottle(level, x, y, z) ); packet->data = 0; } - if (packet->type == AddEntityPacket::BOAT) e = shared_ptr( new Boat(level, x, y, z) ); - if (packet->type == AddEntityPacket::PRIMED_TNT) e = shared_ptr( new PrimedTnt(level, x, y, z) ); - if (packet->type == AddEntityPacket::ENDER_CRYSTAL) e = shared_ptr( new EnderCrystal(level, x, y, z) ); - if (packet->type == AddEntityPacket::FALLING_SAND) e = shared_ptr( new FallingTile(level, x, y, z, Tile::sand->id) ); - if (packet->type == AddEntityPacket::FALLING_GRAVEL) e = shared_ptr( new FallingTile(level, x, y, z, Tile::gravel->id) ); - if (packet->type == AddEntityPacket::FALLING_EGG) e = shared_ptr( new FallingTile(level, x, y, z, Tile::dragonEgg_Id) ); + if (packet->type == AddEntityPacket::BOAT) e = std::shared_ptr( new Boat(level, x, y, z) ); + if (packet->type == AddEntityPacket::PRIMED_TNT) e = std::shared_ptr( new PrimedTnt(level, x, y, z) ); + if (packet->type == AddEntityPacket::ENDER_CRYSTAL) e = std::shared_ptr( new EnderCrystal(level, x, y, z) ); + if (packet->type == AddEntityPacket::FALLING_SAND) e = std::shared_ptr( new FallingTile(level, x, y, z, Tile::sand->id) ); + if (packet->type == AddEntityPacket::FALLING_GRAVEL) e = std::shared_ptr( new FallingTile(level, x, y, z, Tile::gravel->id) ); + if (packet->type == AddEntityPacket::FALLING_EGG) e = std::shared_ptr( new FallingTile(level, x, y, z, Tile::dragonEgg_Id) ); */ @@ -603,13 +603,13 @@ void ClientConnection::handleAddEntity(shared_ptr packet) e->yRotp = packet->yRot; e->xRotp = packet->xRot; - if (setRot) + if (setRot) { e->yRot = 0.0f; e->xRot = 0.0f; } - vector > *subEntities = e->getSubEntities(); + vector > *subEntities = e->getSubEntities(); if (subEntities != NULL) { int offs = packet->id - e->entityId; @@ -635,7 +635,7 @@ void ClientConnection::handleAddEntity(shared_ptr packet) if (packet->type == AddEntityPacket::ARROW) { - shared_ptr owner = getEntity(packet->data); + std::shared_ptr owner = getEntity(packet->data); // 4J - check all local players to find match if( owner == NULL ) @@ -659,15 +659,15 @@ void ClientConnection::handleAddEntity(shared_ptr packet) } } - e->lerpMotion(packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0); + e->lerpMotion(packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0); } } } -void ClientConnection::handleAddExperienceOrb(shared_ptr packet) +void ClientConnection::handleAddExperienceOrb(std::shared_ptr packet) { - shared_ptr e = shared_ptr( new ExperienceOrb(level, packet->x / 32.0, packet->y / 32.0, packet->z / 32.0, packet->value) ); + std::shared_ptr e = std::shared_ptr( new ExperienceOrb(level, packet->x / 32.0, packet->y / 32.0, packet->z / 32.0, packet->value) ); e->xp = packet->x; e->yp = packet->y; e->zp = packet->z; @@ -677,13 +677,13 @@ void ClientConnection::handleAddExperienceOrb(shared_ptr level->putEntity(packet->id, e); } -void ClientConnection::handleAddGlobalEntity(shared_ptr packet) +void ClientConnection::handleAddGlobalEntity(std::shared_ptr packet) { double x = packet->x / 32.0; double y = packet->y / 32.0; double z = packet->z / 32.0; - shared_ptr e;// = nullptr; - if (packet->type == AddGlobalEntityPacket::LIGHTNING) e = shared_ptr( new LightningBolt(level, x, y, z) ); + std::shared_ptr e;// = nullptr; + if (packet->type == AddGlobalEntityPacket::LIGHTNING) e = std::shared_ptr( new LightningBolt(level, x, y, z) ); if (e != NULL) { e->xp = packet->x; @@ -696,29 +696,29 @@ void ClientConnection::handleAddGlobalEntity(shared_ptr p } } -void ClientConnection::handleAddPainting(shared_ptr packet) +void ClientConnection::handleAddPainting(std::shared_ptr packet) { - shared_ptr painting = shared_ptr( new Painting(level, packet->x, packet->y, packet->z, packet->dir, packet->motive) ); + std::shared_ptr painting = std::shared_ptr( new Painting(level, packet->x, packet->y, packet->z, packet->dir, packet->motive) ); level->putEntity(packet->id, painting); } -void ClientConnection::handleSetEntityMotion(shared_ptr packet) +void ClientConnection::handleSetEntityMotion(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e == NULL) return; e->lerpMotion(packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0); } -void ClientConnection::handleSetEntityData(shared_ptr packet) +void ClientConnection::handleSetEntityData(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e != NULL && packet->getUnpackedData() != NULL) { e->getEntityData()->assignValues(packet->getUnpackedData()); } } -void ClientConnection::handleAddPlayer(shared_ptr packet) +void ClientConnection::handleAddPlayer(std::shared_ptr packet) { // Some remote players could actually be local players that are already added for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) @@ -755,7 +755,7 @@ void ClientConnection::handleAddPlayer(shared_ptr packet) double z = packet->z / 32.0; float yRot = packet->yRot * 360 / 256.0f; float xRot = packet->xRot * 360 / 256.0f; - shared_ptr player = shared_ptr( new RemotePlayer(minecraft->level, packet->name) ); + std::shared_ptr player = std::shared_ptr( new RemotePlayer(minecraft->level, packet->name) ); player->xo = player->xOld = player->xp = packet->x; player->yo = player->yOld = player->yp = packet->y; player->zo = player->zOld = player->zp = packet->z; @@ -778,11 +778,11 @@ void ClientConnection::handleAddPlayer(shared_ptr packet) int item = packet->carriedItem; if (item == 0) { - player->inventory->items[player->inventory->selected] = shared_ptr(); // NULL; + player->inventory->items[player->inventory->selected] = std::shared_ptr(); // NULL; } else { - player->inventory->items[player->inventory->selected] = shared_ptr( new ItemInstance(item, 1, 0) ); + player->inventory->items[player->inventory->selected] = std::shared_ptr( new ItemInstance(item, 1, 0) ); } player->absMoveTo(x, y, z, yRot, xRot); @@ -790,14 +790,14 @@ void ClientConnection::handleAddPlayer(shared_ptr packet) player->setCustomSkin( packet->m_skinId ); player->setCustomCape( packet->m_capeId ); player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges); - + if(!player->customTextureUrl.empty() && player->customTextureUrl.substr(0,3).compare(L"def") != 0 && !app.IsFileInMemoryTextures(player->customTextureUrl)) { if( minecraft->addPendingClientTextureRequest(player->customTextureUrl) ) { app.DebugPrintf("Client sending TextureAndGeometryPacket to get custom skin %ls for player %ls\n",player->customTextureUrl.c_str(), player->name.c_str()); - send(shared_ptr( new TextureAndGeometryPacket(player->customTextureUrl,NULL,0) ) ); + send(std::shared_ptr( new TextureAndGeometryPacket(player->customTextureUrl,NULL,0) ) ); } } else if(!player->customTextureUrl.empty() && app.IsFileInMemoryTextures(player->customTextureUrl)) @@ -807,13 +807,13 @@ void ClientConnection::handleAddPlayer(shared_ptr packet) } app.DebugPrintf("Custom skin for player %ls is %ls\n",player->name.c_str(),player->customTextureUrl.c_str()); - + if(!player->customTextureUrl2.empty() && player->customTextureUrl2.substr(0,3).compare(L"def") != 0 && !app.IsFileInMemoryTextures(player->customTextureUrl2)) { if( minecraft->addPendingClientTextureRequest(player->customTextureUrl2) ) { app.DebugPrintf("Client sending texture packet to get custom cape %ls for player %ls\n",player->customTextureUrl2.c_str(), player->name.c_str()); - send(shared_ptr( new TexturePacket(player->customTextureUrl2,NULL,0) ) ); + send(std::shared_ptr( new TexturePacket(player->customTextureUrl2,NULL,0) ) ); } } else if(!player->customTextureUrl2.empty() && app.IsFileInMemoryTextures(player->customTextureUrl2)) @@ -826,7 +826,7 @@ void ClientConnection::handleAddPlayer(shared_ptr packet) level->putEntity(packet->id, player); - vector > *unpackedData = packet->getUnpackedData(); + vector > *unpackedData = packet->getUnpackedData(); if (unpackedData != NULL) { player->getEntityData()->assignValues(unpackedData); @@ -834,9 +834,9 @@ void ClientConnection::handleAddPlayer(shared_ptr packet) } -void ClientConnection::handleTeleportEntity(shared_ptr packet) +void ClientConnection::handleTeleportEntity(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e == NULL) return; e->xp = packet->x; e->yp = packet->y; @@ -856,9 +856,9 @@ void ClientConnection::handleTeleportEntity(shared_ptr pac e->lerpTo(x, y, z, yRot, xRot, 3); } -void ClientConnection::handleMoveEntity(shared_ptr packet) +void ClientConnection::handleMoveEntity(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e == NULL) return; e->xp += packet->xa; e->yp += packet->ya; @@ -877,17 +877,17 @@ void ClientConnection::handleMoveEntity(shared_ptr packet) e->lerpTo(x, y, z, yRot, xRot, 3); } -void ClientConnection::handleRotateMob(shared_ptr packet) +void ClientConnection::handleRotateMob(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e == NULL) return; float yHeadRot = packet->yHeadRot * 360 / 256.f; e->setYHeadRot(yHeadRot); } -void ClientConnection::handleMoveEntitySmall(shared_ptr packet) +void ClientConnection::handleMoveEntitySmall(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e == NULL) return; e->xp += packet->xa; e->yp += packet->ya; @@ -906,7 +906,7 @@ void ClientConnection::handleMoveEntitySmall(shared_ptr p e->lerpTo(x, y, z, yRot, xRot, 3); } -void ClientConnection::handleRemoveEntity(shared_ptr packet) +void ClientConnection::handleRemoveEntity(std::shared_ptr packet) { for (int i = 0; i < packet->ids.length; i++) { @@ -914,9 +914,9 @@ void ClientConnection::handleRemoveEntity(shared_ptr packe } } -void ClientConnection::handleMovePlayer(shared_ptr packet) +void ClientConnection::handleMovePlayer(std::shared_ptr packet) { - shared_ptr player = minecraft->localplayers[m_userIndex]; //minecraft->player; + std::shared_ptr player = minecraft->localplayers[m_userIndex]; //minecraft->player; double x = player->x; double y = player->y; @@ -945,7 +945,7 @@ void ClientConnection::handleMovePlayer(shared_ptr packet) packet->yView = player->y; connection->send(packet); if (!started) - { + { if(!g_NetworkManager.IsHost() ) { @@ -961,7 +961,7 @@ void ClientConnection::handleMovePlayer(shared_ptr packet) started = true; minecraft->setScreen(NULL); - + // Fix for #105852 - TU12: Content: Gameplay: Local splitscreen Players are spawned at incorrect places after re-joining previously saved and loaded "Mass Effect World". // Move this check from Minecraft::createExtraLocalPlayer // 4J-PB - can't call this when this function is called from the qnet thread (GetGameStarted will be false) @@ -974,19 +974,19 @@ void ClientConnection::handleMovePlayer(shared_ptr packet) } // 4J Added -void ClientConnection::handleChunkVisibilityArea(shared_ptr packet) +void ClientConnection::handleChunkVisibilityArea(std::shared_ptr packet) { for(int z = packet->m_minZ; z <= packet->m_maxZ; ++z) for(int x = packet->m_minX; x <= packet->m_maxX; ++x) level->setChunkVisible(x, z, true); } -void ClientConnection::handleChunkVisibility(shared_ptr packet) +void ClientConnection::handleChunkVisibility(std::shared_ptr packet) { level->setChunkVisible(packet->x, packet->z, packet->visible); } -void ClientConnection::handleChunkTilesUpdate(shared_ptr packet) +void ClientConnection::handleChunkTilesUpdate(std::shared_ptr packet) { // 4J - changed to encode level in packet MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx]; @@ -1035,7 +1035,7 @@ void ClientConnection::handleChunkTilesUpdate(shared_ptr // Don't bother setting this to dirty if it isn't going to visually change - we get a lot of // water changing from static to dynamic for instance if(!( ( ( prevTile == Tile::water_Id ) && ( tile == Tile::calmWater_Id ) ) || - ( ( prevTile == Tile::calmWater_Id ) && ( tile == Tile::water_Id ) ) || + ( ( prevTile == Tile::calmWater_Id ) && ( tile == Tile::water_Id ) ) || ( ( prevTile == Tile::lava_Id ) && ( tile == Tile::calmLava_Id ) ) || ( ( prevTile == Tile::calmLava_Id ) && ( tile == Tile::calmLava_Id ) ) || ( ( prevTile == Tile::calmLava_Id ) && ( tile == Tile::lava_Id ) ) ) ) @@ -1055,7 +1055,7 @@ void ClientConnection::handleChunkTilesUpdate(shared_ptr } } -void ClientConnection::handleBlockRegionUpdate(shared_ptr packet) +void ClientConnection::handleBlockRegionUpdate(std::shared_ptr packet) { // 4J - changed to encode level in packet MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx]; @@ -1090,7 +1090,7 @@ void ClientConnection::handleBlockRegionUpdate(shared_ptr packet) +void ClientConnection::handleTileUpdate(std::shared_ptr packet) { // 4J added - using a block of 255 to signify that this is a packet for destroying a tile, where we need to inform the level renderer that we are about to do so. // This is used in creative mode as the point where a tile is first destroyed at the client end of things. Packets formed like this are potentially sent from @@ -1147,11 +1147,11 @@ void ClientConnection::handleTileUpdate(shared_ptr packet) } } -void ClientConnection::handleDisconnect(shared_ptr packet) +void ClientConnection::handleDisconnect(std::shared_ptr packet) { connection->close(DisconnectPacket::eDisconnect_Kicked); done = true; - + Minecraft *pMinecraft = Minecraft::GetInstance(); pMinecraft->connectionDisconnected( m_userIndex , packet->reason ); app.SetDisconnectReason( packet->reason ); @@ -1191,23 +1191,23 @@ void ClientConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason, //minecraft->setScreen(new DisconnectedScreen(L"disconnect.lost", reason, reasonObjects)); } -void ClientConnection::sendAndDisconnect(shared_ptr packet) +void ClientConnection::sendAndDisconnect(std::shared_ptr packet) { if (done) return; connection->send(packet); connection->sendAndQuit(); } -void ClientConnection::send(shared_ptr packet) +void ClientConnection::send(std::shared_ptr packet) { if (done) return; connection->send(packet); } -void ClientConnection::handleTakeItemEntity(shared_ptr packet) +void ClientConnection::handleTakeItemEntity(std::shared_ptr packet) { - shared_ptr from = getEntity(packet->itemId); - shared_ptr to = dynamic_pointer_cast(getEntity(packet->playerId)); + std::shared_ptr from = getEntity(packet->itemId); + std::shared_ptr to = dynamic_pointer_cast(getEntity(packet->playerId)); // 4J - the original game could assume that if getEntity didn't find the player, it must be the local player. We // need to search all local players @@ -1235,12 +1235,12 @@ void ClientConnection::handleTakeItemEntity(shared_ptr pac if (from != NULL) { - // If this is a local player, then we only want to do processing for it if this connection is associated with the player it is for. In + // If this is a local player, then we only want to do processing for it if this connection is associated with the player it is for. In // particular, we don't want to remove the item entity until we are processing it for the right connection, or else we won't have a valid // "from" reference if we've already removed the item for an earlier processed connection if( isLocalPlayer ) { - shared_ptr player = dynamic_pointer_cast(to); + std::shared_ptr player = dynamic_pointer_cast(to); // 4J Stu - Fix for #10213 - UI: Local clients cannot progress through the tutorial normally. // We only send this packet once if many local players can see the event, so make sure we update @@ -1261,7 +1261,7 @@ void ClientConnection::handleTakeItemEntity(shared_ptr pac level->playSound(from, eSoundType_RANDOM_POP, 0.2f, ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f); } - minecraft->particleEngine->add( shared_ptr( new TakeAnimationParticle(minecraft->level, from, to, -0.5f) ) ); + minecraft->particleEngine->add( std::shared_ptr( new TakeAnimationParticle(minecraft->level, from, to, -0.5f) ) ); level->removeEntity(packet->itemId); } else @@ -1274,14 +1274,14 @@ void ClientConnection::handleTakeItemEntity(shared_ptr pac else { level->playSound(from, eSoundType_RANDOM_POP, 0.2f, ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f); - minecraft->particleEngine->add( shared_ptr( new TakeAnimationParticle(minecraft->level, from, to, -0.5f) ) ); + minecraft->particleEngine->add( std::shared_ptr( new TakeAnimationParticle(minecraft->level, from, to, -0.5f) ) ); level->removeEntity(packet->itemId); } } } -void ClientConnection::handleChat(shared_ptr packet) +void ClientConnection::handleChat(std::shared_ptr packet) { wstring message; int iPos; @@ -1316,7 +1316,7 @@ void ClientConnection::handleChat(shared_ptr packet) case ChatPacket::e_ChatBedMeSleep: message=app.GetString(IDS_TILE_BED_MESLEEP); break; - case ChatPacket::e_ChatPlayerJoinedGame: + case ChatPacket::e_ChatPlayerJoinedGame: message=app.GetString(IDS_PLAYER_JOINED); iPos=message.find(L"%s"); message.replace(iPos,2,playerDisplayName); @@ -1514,7 +1514,7 @@ void ClientConnection::handleChat(shared_ptr packet) message=app.GetString(IDS_MAX_WOLVES_BRED); break; - // can't shear the mooshroom + // can't shear the mooshroom case ChatPacket::e_ChatPlayerCantShearMooshroom: message=app.GetString(IDS_CANT_SHEAR_MOOSHROOM); break; @@ -1522,16 +1522,16 @@ void ClientConnection::handleChat(shared_ptr packet) // Paintings/Item Frames case ChatPacket::e_ChatPlayerMaxHangingEntities: message=app.GetString(IDS_MAX_HANGINGENTITIES); - break; + break; // Enemy spawn eggs in peaceful case ChatPacket::e_ChatPlayerCantSpawnInPeaceful: message=app.GetString(IDS_CANT_SPAWN_IN_PEACEFUL); - break; + break; // Enemy spawn eggs in peaceful case ChatPacket::e_ChatPlayerMaxBoats: message=app.GetString(IDS_MAX_BOATS); - break; + break; case ChatPacket::e_ChatCommandTeleportSuccess: message=app.GetString(IDS_COMMAND_TELEPORT_SUCCESS); @@ -1565,13 +1565,13 @@ void ClientConnection::handleChat(shared_ptr packet) if( displayOnGui ) minecraft->gui->addMessage(message,m_userIndex, bIsDeathMessage); } -void ClientConnection::handleAnimate(shared_ptr packet) +void ClientConnection::handleAnimate(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e == NULL) return; if (packet->action == AnimatePacket::SWING) { - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); if(player != NULL) player->swing(); } else if (packet->action == AnimatePacket::HURT) @@ -1580,7 +1580,7 @@ void ClientConnection::handleAnimate(shared_ptr packet) } else if (packet->action == AnimatePacket::WAKE_UP) { - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); if(player != NULL) player->stopSleepInBed(false, false, false); } else if (packet->action == AnimatePacket::RESPAWN) @@ -1588,13 +1588,13 @@ void ClientConnection::handleAnimate(shared_ptr packet) } else if (packet->action == AnimatePacket::CRITICAL_HIT) { - shared_ptr critParticle = shared_ptr( new CritParticle(minecraft->level, e) ); + std::shared_ptr critParticle = std::shared_ptr( new CritParticle(minecraft->level, e) ); critParticle->CritParticlePostConstructor(); minecraft->particleEngine->add( critParticle ); } else if (packet->action == AnimatePacket::MAGIC_CRITICAL_HIT) { - shared_ptr critParticle = shared_ptr( new CritParticle(minecraft->level, e, eParticleType_magicCrit) ); + std::shared_ptr critParticle = std::shared_ptr( new CritParticle(minecraft->level, e, eParticleType_magicCrit) ); critParticle->CritParticlePostConstructor(); minecraft->particleEngine->add(critParticle); } @@ -1604,13 +1604,13 @@ void ClientConnection::handleAnimate(shared_ptr packet) } -void ClientConnection::handleEntityActionAtPosition(shared_ptr packet) +void ClientConnection::handleEntityActionAtPosition(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e == NULL) return; if (packet->action == EntityActionAtPositionPacket::START_SLEEP) { - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); player->startSleepInBed(packet->x, packet->y, packet->z); if( player == minecraft->localplayers[m_userIndex] ) @@ -1620,7 +1620,7 @@ void ClientConnection::handleEntityActionAtPosition(shared_ptr packet) +void ClientConnection::handlePreLogin(std::shared_ptr packet) { // printf("Client: handlePreLogin\n"); #if 1 @@ -1630,7 +1630,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) BOOL isAtLeastOneFriend = g_NetworkManager.IsHost(); BOOL isFriendsWithHost = TRUE; BOOL cantPlayContentRestricted = FALSE; - + if(!g_NetworkManager.IsHost()) { // set the game host settings @@ -1664,7 +1664,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) } if( playerXuid != INVALID_XUID ) { - // Is this user friends with the host player? + // Is this user friends with the host player? BOOL result; DWORD error; error = XUserAreUsersFriends(idx,&packet->m_playerXuids[packet->m_hostIndex],1,&result,NULL); @@ -1694,7 +1694,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) } if( playerXuid != INVALID_XUID ) { - // Is this user friends with the host player? + // Is this user friends with the host player? BOOL result; DWORD error; error = XUserAreUsersFriends(m_userIndex,&packet->m_playerXuids[packet->m_hostIndex],1,&result,NULL); @@ -1809,7 +1809,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) if(m_userIndex == ProfileManager.GetPrimaryPad() ) { - // Is this user friends with the host player? + // Is this user friends with the host player? bool isFriend = true; unsigned int friendCount = 0; #ifdef __PS3__ @@ -1839,7 +1839,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) requestParam.offset = 0; requestParam.userInfo.userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad()); - int ret = sce::Toolkit::NP::Friends::Interface::getFriendslist(&friendList, &requestParam, false); + int ret = sce::Toolkit::NP::Friends::Interface::getFriendslist(&friendList, &requestParam, false); if( ret == 0 ) { if( friendList.hasResult() ) @@ -1849,7 +1849,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) } #endif if( ret == 0 ) - { + { isFriend = false; SceNpId npid; for( unsigned int i = 0; i < friendCount; i++ ) @@ -1932,7 +1932,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) isAtLeastOneFriend = true; break; } - } + } } app.DebugPrintf("ClientConnection::handlePreLogin: User has at least one friend? %s\n", isAtLeastOneFriend ? "Yes" : "No"); @@ -1974,8 +1974,8 @@ void ClientConnection::handlePreLogin(shared_ptr packet) DisconnectPacket::eDisconnectReason reason = DisconnectPacket::eDisconnect_NoUGC_Remote; #else DisconnectPacket::eDisconnectReason reason = DisconnectPacket::eDisconnect_None; -#endif - if(m_userIndex == ProfileManager.GetPrimaryPad()) +#endif + if(m_userIndex == ProfileManager.GetPrimaryPad()) { if(!isFriendsWithHost) reason = DisconnectPacket::eDisconnect_NotFriendsWithHost; else if(!isAtLeastOneFriend) reason = DisconnectPacket::eDisconnect_NoFriendsInGame; @@ -1987,7 +1987,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) app.SetAction(ProfileManager.GetPrimaryPad(),eAppAction_ExitWorld,(void *)TRUE); } else - { + { if(!isFriendsWithHost) reason = DisconnectPacket::eDisconnect_NotFriendsWithHost; else if(!canPlayLocal) reason = DisconnectPacket::eDisconnect_NoUGC_Single_Local; else if(cantPlayContentRestricted) reason = DisconnectPacket::eDisconnect_ContentRestricted_Single_Local; @@ -2000,7 +2000,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) app.SetDisconnectReason( reason ); - // 4J-PB - this locks up on the read and write threads not closing down, because they are trying to lock the incoming critsec when it's already locked by this thread + // 4J-PB - this locks up on the read and write threads not closing down, because they are trying to lock the incoming critsec when it's already locked by this thread // Minecraft::GetInstance()->connectionDisconnected( m_userIndex , reason ); // done = true; // connection->flush(); @@ -2055,7 +2055,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) #endif // On PS3, all non-signed in players (even guests) can get a useful offlineXUID -#if !(defined __PS3__ || defined _DURANGO ) +#if !(defined __PS3__ || defined _DURANGO ) if( !ProfileManager.IsGuest( m_userIndex ) ) #endif { @@ -2064,7 +2064,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) } BOOL allAllowed, friendsAllowed; ProfileManager.AllowedPlayerCreatedContent(m_userIndex,true,&allAllowed,&friendsAllowed); - send( shared_ptr( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=TRUE && friendsAllowed==TRUE), + send( std::shared_ptr( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=TRUE && friendsAllowed==TRUE), packet->m_ugcPlayersVersion, app.GetPlayerSkinId(m_userIndex), app.GetPlayerCapeId(m_userIndex), ProfileManager.IsGuest( m_userIndex )))); if(!g_NetworkManager.IsHost() ) @@ -2105,7 +2105,7 @@ void ClientConnection::close() connection->close(DisconnectPacket::eDisconnect_Closed); } -void ClientConnection::handleAddMob(shared_ptr packet) +void ClientConnection::handleAddMob(std::shared_ptr packet) { double x = packet->x / 32.0; double y = packet->y / 32.0; @@ -2113,7 +2113,7 @@ void ClientConnection::handleAddMob(shared_ptr packet) float yRot = packet->yRot * 360 / 256.0f; float xRot = packet->xRot * 360 / 256.0f; - shared_ptr mob = dynamic_pointer_cast(EntityIO::newById(packet->type, level)); + std::shared_ptr mob = dynamic_pointer_cast(EntityIO::newById(packet->type, level)); mob->xp = packet->x; mob->yp = packet->y; mob->zp = packet->z; @@ -2121,7 +2121,7 @@ void ClientConnection::handleAddMob(shared_ptr packet) mob->yRotp = packet->yRot; mob->xRotp = packet->xRot; - vector > *subEntities = mob->getSubEntities(); + vector > *subEntities = mob->getSubEntities(); if (subEntities != NULL) { int offs = packet->id - mob->entityId; @@ -2143,7 +2143,7 @@ void ClientConnection::handleAddMob(shared_ptr packet) mob->zd = packet->zd / 8000.0f; level->putEntity(packet->id, mob); - vector > *unpackedData = packet->getUnpackedData(); + vector > *unpackedData = packet->getUnpackedData(); if (unpackedData != NULL) { mob->getEntityData()->assignValues(unpackedData); @@ -2153,17 +2153,17 @@ void ClientConnection::handleAddMob(shared_ptr packet) // 4J Stu - Slimes have a different BB depending on their size which is set in the entity data, so update the BB if(mob->GetType() == eTYPE_SLIME || mob->GetType() == eTYPE_LAVASLIME) { - shared_ptr slime = dynamic_pointer_cast(mob); + std::shared_ptr slime = dynamic_pointer_cast(mob); slime->setSize( slime->getSize() ); } } -void ClientConnection::handleSetTime(shared_ptr packet) +void ClientConnection::handleSetTime(std::shared_ptr packet) { minecraft->level->setTime(packet->time); } -void ClientConnection::handleSetSpawn(shared_ptr packet) +void ClientConnection::handleSetSpawn(std::shared_ptr packet) { //minecraft->player->setRespawnPosition(new Pos(packet->x, packet->y, packet->z)); minecraft->localplayers[m_userIndex]->setRespawnPosition(new Pos(packet->x, packet->y, packet->z)); @@ -2171,12 +2171,12 @@ void ClientConnection::handleSetSpawn(shared_ptr packet) } -void ClientConnection::handleRidePacket(shared_ptr packet) +void ClientConnection::handleRidePacket(std::shared_ptr packet) { - shared_ptr rider = getEntity(packet->riderId); - shared_ptr ridden = getEntity(packet->riddenId); + std::shared_ptr rider = getEntity(packet->riderId); + std::shared_ptr ridden = getEntity(packet->riddenId); - shared_ptr boat = dynamic_pointer_cast(ridden); + std::shared_ptr boat = dynamic_pointer_cast(ridden); //if (packet->riderId == minecraft->player->entityId) rider = minecraft->player; if (packet->riderId == minecraft->localplayers[m_userIndex]->entityId) { @@ -2193,13 +2193,13 @@ void ClientConnection::handleRidePacket(shared_ptr packet) rider->ride(ridden); } -void ClientConnection::handleEntityEvent(shared_ptr packet) +void ClientConnection::handleEntityEvent(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->entityId); + std::shared_ptr e = getEntity(packet->entityId); if (e != NULL) e->handleEntityEvent(packet->eventId); } -shared_ptr ClientConnection::getEntity(int entityId) +std::shared_ptr ClientConnection::getEntity(int entityId) { //if (entityId == minecraft->player->entityId) if(entityId == minecraft->localplayers[m_userIndex]->entityId) @@ -2210,7 +2210,7 @@ shared_ptr ClientConnection::getEntity(int entityId) return level->getEntity(entityId); } -void ClientConnection::handleSetHealth(shared_ptr packet) +void ClientConnection::handleSetHealth(std::shared_ptr packet) { //minecraft->player->hurtTo(packet->health); minecraft->localplayers[m_userIndex]->hurtTo(packet->health,packet->damageSource); @@ -2227,12 +2227,12 @@ void ClientConnection::handleSetHealth(shared_ptr packet) } } -void ClientConnection::handleSetExperience(shared_ptr packet) +void ClientConnection::handleSetExperience(std::shared_ptr packet) { minecraft->localplayers[m_userIndex]->setExperienceValues(packet->experienceProgress, packet->totalExperience, packet->experienceLevel); } -void ClientConnection::handleTexture(shared_ptr packet) +void ClientConnection::handleTexture(std::shared_ptr packet) { // Both PlayerConnection and ClientConnection should handle this mostly the same way // Server side also needs to store a list of those clients waiting to get a texture the server doesn't have yet @@ -2245,12 +2245,12 @@ void ClientConnection::handleTexture(shared_ptr packet) wprintf(L"Client received request for custom texture %ls\n",packet->textureName.c_str()); #endif PBYTE pbData=NULL; - DWORD dwBytes=0; + DWORD dwBytes=0; app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes); if(dwBytes!=0) { - send( shared_ptr( new TexturePacket(packet->textureName,pbData,dwBytes) ) ); + send( std::shared_ptr( new TexturePacket(packet->textureName,pbData,dwBytes) ) ); } } else @@ -2264,7 +2264,7 @@ void ClientConnection::handleTexture(shared_ptr packet) } } -void ClientConnection::handleTextureAndGeometry(shared_ptr packet) +void ClientConnection::handleTextureAndGeometry(std::shared_ptr packet) { // Both PlayerConnection and ClientConnection should handle this mostly the same way // Server side also needs to store a list of those clients waiting to get a texture the server doesn't have yet @@ -2277,7 +2277,7 @@ void ClientConnection::handleTextureAndGeometry(shared_ptrtextureName.c_str()); #endif PBYTE pbData=NULL; - DWORD dwBytes=0; + DWORD dwBytes=0; app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes); DLCSkinFile *pDLCSkinFile = app.m_dlcManager.getSkinFile(packet->textureName); @@ -2287,18 +2287,18 @@ void ClientConnection::handleTextureAndGeometry(shared_ptrgetAdditionalBoxesCount()!=0) { - send( shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwBytes,pDLCSkinFile) ) ); + send( std::shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwBytes,pDLCSkinFile) ) ); } else { - send( shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwBytes) ) ); + send( std::shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwBytes) ) ); } } else { unsigned int uiAnimOverrideBitmask= app.GetAnimOverrideBitmask(packet->dwSkinID); - send( shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwBytes,app.GetAdditionalSkinBoxes(packet->dwSkinID),uiAnimOverrideBitmask) ) ); + send( std::shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwBytes,app.GetAdditionalSkinBoxes(packet->dwSkinID),uiAnimOverrideBitmask) ) ); } } } @@ -2311,9 +2311,9 @@ void ClientConnection::handleTextureAndGeometry(shared_ptrtextureName,packet->pbData,packet->dwTextureBytes); // Add the geometry data - if(packet->dwBoxC!=0) + if(packet->dwBoxC!=0) { - app.SetAdditionalSkinBoxes(packet->dwSkinID,packet->BoxDataA,packet->dwBoxC); + app.SetAdditionalSkinBoxes(packet->dwSkinID,packet->BoxDataA,packet->dwBoxC); } // Add the anim override app.SetAnimOverrideBitmask(packet->dwSkinID,packet->uiAnimOverrideBitmask); @@ -2323,11 +2323,11 @@ void ClientConnection::handleTextureAndGeometry(shared_ptr packet) +void ClientConnection::handleTextureChange(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e == NULL) return; - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); if( e == NULL) return; bool isLocalPlayer = false; @@ -2360,7 +2360,7 @@ void ClientConnection::handleTextureChange(shared_ptr packe #endif break; } - + if(!packet->path.empty() && packet->path.substr(0,3).compare(L"def") != 0 && !app.IsFileInMemoryTextures(packet->path)) { if( minecraft->addPendingClientTextureRequest(packet->path) ) @@ -2368,7 +2368,7 @@ void ClientConnection::handleTextureChange(shared_ptr packe #ifndef _CONTENT_PACKAGE wprintf(L"handleTextureChange - Client sending texture packet to get custom skin %ls for player %ls\n",packet->path.c_str(), player->name.c_str()); #endif - send(shared_ptr( new TexturePacket(packet->path,NULL,0) ) ); + send(std::shared_ptr( new TexturePacket(packet->path,NULL,0) ) ); } } else if(!packet->path.empty() && app.IsFileInMemoryTextures(packet->path)) @@ -2378,11 +2378,11 @@ void ClientConnection::handleTextureChange(shared_ptr packe } } -void ClientConnection::handleTextureAndGeometryChange(shared_ptr packet) +void ClientConnection::handleTextureAndGeometryChange(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->id); + std::shared_ptr e = getEntity(packet->id); if (e == NULL) return; - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); if( e == NULL) return; bool isLocalPlayer = false; @@ -2413,7 +2413,7 @@ void ClientConnection::handleTextureAndGeometryChange(shared_ptrpath.c_str(), player->name.c_str()); #endif - send(shared_ptr( new TextureAndGeometryPacket(packet->path,NULL,0) ) ); + send(std::shared_ptr( new TextureAndGeometryPacket(packet->path,NULL,0) ) ); } } else if(!packet->path.empty() && app.IsFileInMemoryTextures(packet->path)) @@ -2424,7 +2424,7 @@ void ClientConnection::handleTextureAndGeometryChange(shared_ptr packet) +void ClientConnection::handleRespawn(std::shared_ptr packet) { //if (packet->dimension != minecraft->player->dimension) if( packet->dimension != minecraft->localplayers[m_userIndex]->dimension || packet->mapSeed != minecraft->localplayers[m_userIndex]->level->getSeed() ) @@ -2459,19 +2459,19 @@ void ClientConnection::handleRespawn(shared_ptr packet) } // Remove the player entity from the current level - level->removeEntity( shared_ptr(minecraft->localplayers[m_userIndex]) ); + level->removeEntity( std::shared_ptr(minecraft->localplayers[m_userIndex]) ); level = dimensionLevel; - + // Whilst calling setLevel, make sure that minecraft::player is set up to be correct for this // connection - shared_ptr lastPlayer = minecraft->player; + std::shared_ptr lastPlayer = minecraft->player; minecraft->player = minecraft->localplayers[m_userIndex]; minecraft->setLevel(dimensionLevel); minecraft->player = lastPlayer; TelemetryManager->RecordLevelExit(m_userIndex, eSen_LevelExitStatus_Succeeded); - + //minecraft->player->dimension = packet->dimension; minecraft->localplayers[m_userIndex]->dimension = packet->dimension; //minecraft->setScreen(new ReceivingLevelScreen(this)); @@ -2522,12 +2522,12 @@ void ClientConnection::handleRespawn(shared_ptr packet) { ui.NavigateToScene(m_userIndex, eUIScene_ConnectingProgress, param); } - + app.SetAction( m_userIndex, eAppAction_WaitForDimensionChangeComplete); } //minecraft->respawnPlayer(minecraft->player->GetXboxPad(),true, packet->dimension); - + // Wrap respawnPlayer call up in code to set & restore the player/gamemode etc. as some things // in there assume that we are set up for the player that the respawn is coming in for int oldIndex = minecraft->getLocalPlayerIdx(); @@ -2537,7 +2537,7 @@ void ClientConnection::handleRespawn(shared_ptr packet) minecraft->setLocalPlayerIdx(oldIndex); } -void ClientConnection::handleExplosion(shared_ptr packet) +void ClientConnection::handleExplosion(std::shared_ptr packet) { if(!packet->m_bKnockbackOnly) { @@ -2552,7 +2552,7 @@ void ClientConnection::handleExplosion(shared_ptr packet) MultiPlayerLevel *mpLevel = (MultiPlayerLevel *)minecraft->level; mpLevel->enableResetChanges(false); // 4J - now directly pass a pointer to the toBlow array in the packet rather than copying around - e->finalizeExplosion(true, &packet->toBlow); + e->finalizeExplosion(true, &packet->toBlow); mpLevel->enableResetChanges(true); PIXEndNamedEvent(); PIXEndNamedEvent(); @@ -2569,57 +2569,57 @@ void ClientConnection::handleExplosion(shared_ptr packet) minecraft->localplayers[m_userIndex]->zd += packet->getKnockbackZ(); } -void ClientConnection::handleContainerOpen(shared_ptr packet) +void ClientConnection::handleContainerOpen(std::shared_ptr packet) { bool failed = false; - shared_ptr player = minecraft->localplayers[m_userIndex]; + std::shared_ptr player = minecraft->localplayers[m_userIndex]; switch(packet->type) { case ContainerOpenPacket::CONTAINER: { - if( player->openContainer(shared_ptr( new SimpleContainer(packet->title, packet->size) ))) + if( player->openContainer(std::shared_ptr( new SimpleContainer(packet->title, packet->size) ))) { player->containerMenu->containerId = packet->containerId; } else { - failed = true; + failed = true; } } break; case ContainerOpenPacket::FURNACE: { - if( player->openFurnace(shared_ptr( new FurnaceTileEntity() )) ) + if( player->openFurnace(std::shared_ptr( new FurnaceTileEntity() )) ) { player->containerMenu->containerId = packet->containerId; } else { - failed = true; + failed = true; } } break; case ContainerOpenPacket::BREWING_STAND: { - if( player->openBrewingStand(shared_ptr( new BrewingStandTileEntity() )) ) + if( player->openBrewingStand(std::shared_ptr( new BrewingStandTileEntity() )) ) { player->containerMenu->containerId = packet->containerId; } else { - failed = true; + failed = true; } } break; case ContainerOpenPacket::TRAP: { - if( player->openTrap(shared_ptr( new DispenserTileEntity() )) ) + if( player->openTrap(std::shared_ptr( new DispenserTileEntity() )) ) { player->containerMenu->containerId = packet->containerId; } else { - failed = true; + failed = true; } } break; @@ -2631,7 +2631,7 @@ void ClientConnection::handleContainerOpen(shared_ptr packe } else { - failed = true; + failed = true; } } break; @@ -2643,13 +2643,13 @@ void ClientConnection::handleContainerOpen(shared_ptr packe } else { - failed = true; + failed = true; } } break; case ContainerOpenPacket::TRADER_NPC: { - shared_ptr csm = shared_ptr(new ClientSideMerchant(player,packet->title)); + std::shared_ptr csm = std::shared_ptr(new ClientSideMerchant(player,packet->title)); csm->createContainer(); if(player->openTrading(csm)) { @@ -2657,7 +2657,7 @@ void ClientConnection::handleContainerOpen(shared_ptr packe } else { - failed = true; + failed = true; } } break; @@ -2669,7 +2669,7 @@ void ClientConnection::handleContainerOpen(shared_ptr packe } else { - failed = true; + failed = true; } } break; @@ -2686,14 +2686,14 @@ void ClientConnection::handleContainerOpen(shared_ptr packe } else { - send(shared_ptr(new ContainerClosePacket(packet->containerId))); + send(std::shared_ptr(new ContainerClosePacket(packet->containerId))); } } } -void ClientConnection::handleContainerSetSlot(shared_ptr packet) +void ClientConnection::handleContainerSetSlot(std::shared_ptr packet) { - shared_ptr player = minecraft->localplayers[m_userIndex]; + std::shared_ptr player = minecraft->localplayers[m_userIndex]; if (packet->containerId == AbstractContainerMenu::CONTAINER_ID_CARRIED ) { player->inventory->setCarried(packet->item); @@ -2705,7 +2705,7 @@ void ClientConnection::handleContainerSetSlot(shared_ptr // 4J Stu - Reworked a bit to fix a bug where things being collected while the creative menu was up replaced items in the creative menu if(packet->slot >= 36 && packet->slot < 36 + 9) { - shared_ptr lastItem = player->inventoryMenu->getSlot(packet->slot)->getItem(); + std::shared_ptr lastItem = player->inventoryMenu->getSlot(packet->slot)->getItem(); if (packet->item != NULL) { if (lastItem == NULL || lastItem->count < packet->item->count) @@ -2723,9 +2723,9 @@ void ClientConnection::handleContainerSetSlot(shared_ptr } } -void ClientConnection::handleContainerAck(shared_ptr packet) +void ClientConnection::handleContainerAck(std::shared_ptr packet) { - shared_ptr player = minecraft->localplayers[m_userIndex]; + std::shared_ptr player = minecraft->localplayers[m_userIndex]; AbstractContainerMenu *menu = NULL; if (packet->containerId == AbstractContainerMenu::CONTAINER_ID_INVENTORY) { @@ -2739,15 +2739,15 @@ void ClientConnection::handleContainerAck(shared_ptr packet) { if (!packet->accepted) { - send( shared_ptr( new ContainerAckPacket(packet->containerId, packet->uid, true) )); + send( std::shared_ptr( new ContainerAckPacket(packet->containerId, packet->uid, true) )); } } } -void ClientConnection::handleContainerContent(shared_ptr packet) +void ClientConnection::handleContainerContent(std::shared_ptr packet) { - shared_ptr player = minecraft->localplayers[m_userIndex]; - if (packet->containerId == AbstractContainerMenu::CONTAINER_ID_INVENTORY) + std::shared_ptr player = minecraft->localplayers[m_userIndex]; + if (packet->containerId == AbstractContainerMenu::CONTAINER_ID_INVENTORY) { player->inventoryMenu->setAll(&packet->items); } @@ -2757,17 +2757,17 @@ void ClientConnection::handleContainerContent(shared_ptr packet) +void ClientConnection::handleSignUpdate(std::shared_ptr packet) { app.DebugPrintf("ClientConnection::handleSignUpdate - "); if (minecraft->level->hasChunkAt(packet->x, packet->y, packet->z)) { - shared_ptr te = minecraft->level->getTileEntity(packet->x, packet->y, packet->z); + std::shared_ptr te = minecraft->level->getTileEntity(packet->x, packet->y, packet->z); // 4J-PB - on a client connecting, the line below fails if (dynamic_pointer_cast(te) != NULL) { - shared_ptr ste = dynamic_pointer_cast(te); + std::shared_ptr ste = dynamic_pointer_cast(te); for (int i = 0; i < MAX_SIGN_LINES; i++) { ste->SetMessage(i,packet->lines[i]); @@ -2790,11 +2790,11 @@ void ClientConnection::handleSignUpdate(shared_ptr packet) } } -void ClientConnection::handleTileEntityData(shared_ptr packet) +void ClientConnection::handleTileEntityData(std::shared_ptr packet) { if (minecraft->level->hasChunkAt(packet->x, packet->y, packet->z)) { - shared_ptr te = minecraft->level->getTileEntity(packet->x, packet->y, packet->z); + std::shared_ptr te = minecraft->level->getTileEntity(packet->x, packet->y, packet->z); if (te != NULL) { @@ -2809,7 +2809,7 @@ void ClientConnection::handleTileEntityData(shared_ptr pac //else if (packet.type == TileEntityDataPacket.TYPE_BEACON && (te instanceof BeaconTileEntity)) //{ // ((BeaconTileEntity) te).load(packet.tag); - //} + //} else if (packet->type == TileEntityDataPacket::TYPE_SKULL && dynamic_pointer_cast(te) != NULL) { dynamic_pointer_cast(te)->load(packet->tag); @@ -2818,7 +2818,7 @@ void ClientConnection::handleTileEntityData(shared_ptr pac } } -void ClientConnection::handleContainerSetData(shared_ptr packet) +void ClientConnection::handleContainerSetData(std::shared_ptr packet) { onUnhandledPacket(packet); if (minecraft->localplayers[m_userIndex]->containerMenu != NULL && minecraft->localplayers[m_userIndex]->containerMenu->containerId == packet->containerId) @@ -2827,9 +2827,9 @@ void ClientConnection::handleContainerSetData(shared_ptr } } -void ClientConnection::handleSetEquippedItem(shared_ptr packet) +void ClientConnection::handleSetEquippedItem(std::shared_ptr packet) { - shared_ptr entity = getEntity(packet->entity); + std::shared_ptr entity = getEntity(packet->entity); if (entity != NULL) { // 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game @@ -2837,19 +2837,19 @@ void ClientConnection::handleSetEquippedItem(shared_ptr p } } -void ClientConnection::handleContainerClose(shared_ptr packet) +void ClientConnection::handleContainerClose(std::shared_ptr packet) { minecraft->localplayers[m_userIndex]->closeContainer(); } -void ClientConnection::handleTileEvent(shared_ptr packet) +void ClientConnection::handleTileEvent(std::shared_ptr packet) { PIXBeginNamedEvent(0,"Handle tile event\n"); minecraft->level->tileEvent(packet->x, packet->y, packet->z, packet->tile, packet->b0, packet->b1); PIXEndNamedEvent(); } -void ClientConnection::handleTileDestruction(shared_ptr packet) +void ClientConnection::handleTileDestruction(std::shared_ptr packet) { minecraft->level->destroyTileProgress(packet->getEntityId(), packet->getX(), packet->getY(), packet->getZ(), packet->getState()); } @@ -2859,7 +2859,7 @@ bool ClientConnection::canHandleAsyncPackets() return minecraft != NULL && minecraft->level != NULL && minecraft->localplayers[m_userIndex] != NULL && level != NULL; } -void ClientConnection::handleGameEvent(shared_ptr gameEventPacket) +void ClientConnection::handleGameEvent(std::shared_ptr gameEventPacket) { int event = gameEventPacket->_event; int param = gameEventPacket->param; @@ -2887,7 +2887,7 @@ void ClientConnection::handleGameEvent(shared_ptr gameEventPack else if (event == GameEventPacket::WIN_GAME) { ui.SetWinUserIndex( (BYTE)gameEventPacket->param ); - + #ifdef _XBOX // turn off the gamertags in splitscreen for the primary player, since they are about to be made fullscreen @@ -2925,7 +2925,7 @@ void ClientConnection::handleGameEvent(shared_ptr gameEventPack } } -void ClientConnection::handleComplexItemData(shared_ptr packet) +void ClientConnection::handleComplexItemData(std::shared_ptr packet) { if (packet->itemType == Item::map->id) { @@ -2939,7 +2939,7 @@ void ClientConnection::handleComplexItemData(shared_ptr p -void ClientConnection::handleLevelEvent(shared_ptr packet) +void ClientConnection::handleLevelEvent(std::shared_ptr packet) { switch(packet->type) { @@ -2963,22 +2963,22 @@ void ClientConnection::handleLevelEvent(shared_ptr packet) } } -void ClientConnection::handleAwardStat(shared_ptr packet) +void ClientConnection::handleAwardStat(std::shared_ptr packet) { minecraft->localplayers[m_userIndex]->awardStatFromServer(GenericStats::stat(packet->statId), packet->getParamData()); } -void ClientConnection::handleUpdateMobEffect(shared_ptr packet) +void ClientConnection::handleUpdateMobEffect(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->entityId); + std::shared_ptr e = getEntity(packet->entityId); if (e == NULL || dynamic_pointer_cast(e) == NULL) return; ( dynamic_pointer_cast(e) )->addEffect(new MobEffectInstance(packet->effectId, packet->effectDurationTicks, packet->effectAmplifier)); } -void ClientConnection::handleRemoveMobEffect(shared_ptr packet) +void ClientConnection::handleRemoveMobEffect(std::shared_ptr packet) { - shared_ptr e = getEntity(packet->entityId); + std::shared_ptr e = getEntity(packet->entityId); if (e == NULL || dynamic_pointer_cast(e) == NULL) return; ( dynamic_pointer_cast(e) )->removeEffectNoUpdate(packet->effectId); @@ -2989,7 +2989,7 @@ bool ClientConnection::isServerPacketListener() return false; } -void ClientConnection::handlePlayerInfo(shared_ptr packet) +void ClientConnection::handlePlayerInfo(std::shared_ptr packet) { unsigned int startingPrivileges = app.GetPlayerPrivileges(packet->m_networkSmallId); @@ -3005,17 +3005,17 @@ void ClientConnection::handlePlayerInfo(shared_ptr packet) // 4J Stu - Repurposed this packet for player info that we want app.UpdatePlayerInfo(packet->m_networkSmallId, packet->m_playerColourIndex, packet->m_playerPrivileges); - shared_ptr entity = getEntity(packet->m_entityId); + std::shared_ptr entity = getEntity(packet->m_entityId); if(entity != NULL && entity->GetType() == eTYPE_PLAYER) { - shared_ptr player = dynamic_pointer_cast(entity); + std::shared_ptr player = dynamic_pointer_cast(entity); player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_playerPrivileges); } if(networkPlayer != NULL && networkPlayer->IsLocal()) { for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - shared_ptr localPlayer = minecraft->localplayers[i]; + std::shared_ptr localPlayer = minecraft->localplayers[i]; if(localPlayer != NULL && localPlayer->connection != NULL && localPlayer->connection->getNetworkPlayer() == networkPlayer ) { localPlayer->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All,packet->m_playerPrivileges); @@ -3044,7 +3044,7 @@ void ClientConnection::handlePlayerInfo(shared_ptr packet) } -void ClientConnection::displayPrivilegeChanges(shared_ptr player, unsigned int oldPrivileges) +void ClientConnection::displayPrivilegeChanges(std::shared_ptr player, unsigned int oldPrivileges) { int userIndex = player->GetXboxPad(); unsigned int newPrivileges = player->getAllPlayerGamePrivileges(); @@ -3117,7 +3117,7 @@ void ClientConnection::displayPrivilegeChanges(shared_ptr packet) +void ClientConnection::handleKeepAlive(std::shared_ptr packet) { - send(shared_ptr(new KeepAlivePacket(packet->id))); + send(std::shared_ptr(new KeepAlivePacket(packet->id))); } -void ClientConnection::handlePlayerAbilities(shared_ptr playerAbilitiesPacket) +void ClientConnection::handlePlayerAbilities(std::shared_ptr playerAbilitiesPacket) { - shared_ptr player = minecraft->localplayers[m_userIndex]; + std::shared_ptr player = minecraft->localplayers[m_userIndex]; player->abilities.flying = playerAbilitiesPacket->isFlying(); player->abilities.instabuild = playerAbilitiesPacket->canInstabuild(); player->abilities.invulnerable = playerAbilitiesPacket->isInvulnerable(); @@ -3156,12 +3156,12 @@ void ClientConnection::handlePlayerAbilities(shared_ptr p player->abilities.setFlyingSpeed(playerAbilitiesPacket->getFlyingSpeed()); } -void ClientConnection::handleSoundEvent(shared_ptr packet) +void ClientConnection::handleSoundEvent(std::shared_ptr packet) { minecraft->level->playLocalSound(packet->getX(), packet->getY(), packet->getZ(), packet->getSound(), packet->getVolume(), packet->getPitch()); } -void ClientConnection::handleCustomPayload(shared_ptr customPayloadPacket) +void ClientConnection::handleCustomPayload(std::shared_ptr customPayloadPacket) { if (CustomPayloadPacket::TRADER_LIST_PACKET.compare(customPayloadPacket->identifier) == 0) { @@ -3170,7 +3170,7 @@ void ClientConnection::handleCustomPayload(shared_ptr custo int containerId = input.readInt(); if (ui.IsSceneInStack(m_userIndex, eUIScene_TradingMenu) && containerId == minecraft->localplayers[m_userIndex]->containerMenu->containerId) { - shared_ptr trader = nullptr; + std::shared_ptr trader = nullptr; #ifdef _XBOX HXUIOBJ scene = app.GetCurrentScene(m_userIndex); @@ -3190,7 +3190,7 @@ void ClientConnection::handleCustomPayload(shared_ptr custo UIScene_TradingMenu *screen = (UIScene_TradingMenu *)scene; trader = screen->getMerchant(); #endif - + MerchantRecipeList *recipeList = MerchantRecipeList::createFromStream(&input); trader->overrideOffers(recipeList); } @@ -3203,7 +3203,7 @@ Connection *ClientConnection::getConnection() } // 4J Added -void ClientConnection::handleServerSettingsChanged(shared_ptr packet) +void ClientConnection::handleServerSettingsChanged(std::shared_ptr packet) { if(packet->action==ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS) { @@ -3229,7 +3229,7 @@ void ClientConnection::handleServerSettingsChanged(shared_ptr packet) +void ClientConnection::handleXZ(std::shared_ptr packet) { if(packet->action==XZPacket::STRONGHOLD) { @@ -3239,12 +3239,12 @@ void ClientConnection::handleXZ(shared_ptr packet) } } -void ClientConnection::handleUpdateProgress(shared_ptr packet) +void ClientConnection::handleUpdateProgress(std::shared_ptr packet) { if(!g_NetworkManager.IsHost() ) Minecraft::GetInstance()->progressRenderer->progressStagePercentage( packet->m_percentage ); } -void ClientConnection::handleUpdateGameRuleProgressPacket(shared_ptr packet) +void ClientConnection::handleUpdateGameRuleProgressPacket(std::shared_ptr packet) { LPCWSTR string = app.GetGameRulesString(packet->m_messageId); if(string != NULL) @@ -3277,7 +3277,7 @@ int ClientConnection::HostDisconnectReturned(void *pParam,int iPad,C4JStorage::E DLCPack *pDLCPack=pDLCTexPack->getDLCInfoParentPack();//tPack->getDLCPack(); if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) - { + { // no upsell, we're about to quit MinecraftServer::getInstance()->setSaveOnExit( false ); // flag a app action of exit game @@ -3331,7 +3331,7 @@ int ClientConnection::HostDisconnectReturned(void *pParam,int iPad,C4JStorage::E int ClientConnection::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { // results switched for this dialog - if(result==C4JStorage::EMessage_ResultDecline) + if(result==C4JStorage::EMessage_ResultDecline) { //INT saveOrCheckpointId = 0; //bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); @@ -3350,7 +3350,7 @@ int ClientConnection::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage:: return 0; } -// +// wstring ClientConnection::GetDisplayNameByGamertag(wstring gamertag) { #ifdef _DURANGO diff --git a/Minecraft.Client/ClientConnection.h b/Minecraft.Client/ClientConnection.h index 2ce46ce0..53c3ff22 100644 --- a/Minecraft.Client/ClientConnection.h +++ b/Minecraft.Client/ClientConnection.h @@ -49,92 +49,92 @@ public: ~ClientConnection(); void tick(); INetworkPlayer *getNetworkPlayer(); - virtual void handleLogin(shared_ptr packet); - virtual void handleAddEntity(shared_ptr packet); - virtual void handleAddExperienceOrb(shared_ptr packet); - virtual void handleAddGlobalEntity(shared_ptr packet); - virtual void handleAddPainting(shared_ptr packet); - virtual void handleSetEntityMotion(shared_ptr packet); - virtual void handleSetEntityData(shared_ptr packet); - virtual void handleAddPlayer(shared_ptr packet); - virtual void handleTeleportEntity(shared_ptr packet); - virtual void handleMoveEntity(shared_ptr packet); - virtual void handleRotateMob(shared_ptr packet); - virtual void handleMoveEntitySmall(shared_ptr packet); - virtual void handleRemoveEntity(shared_ptr packet); - virtual void handleMovePlayer(shared_ptr packet); + virtual void handleLogin(std::shared_ptr packet); + virtual void handleAddEntity(std::shared_ptr packet); + virtual void handleAddExperienceOrb(std::shared_ptr packet); + virtual void handleAddGlobalEntity(std::shared_ptr packet); + virtual void handleAddPainting(std::shared_ptr packet); + virtual void handleSetEntityMotion(std::shared_ptr packet); + virtual void handleSetEntityData(std::shared_ptr packet); + virtual void handleAddPlayer(std::shared_ptr packet); + virtual void handleTeleportEntity(std::shared_ptr packet); + virtual void handleMoveEntity(std::shared_ptr packet); + virtual void handleRotateMob(std::shared_ptr packet); + virtual void handleMoveEntitySmall(std::shared_ptr packet); + virtual void handleRemoveEntity(std::shared_ptr packet); + virtual void handleMovePlayer(std::shared_ptr packet); Random *random; - - // 4J Added - virtual void handleChunkVisibilityArea(shared_ptr packet); - virtual void handleChunkVisibility(shared_ptr packet); - virtual void handleChunkTilesUpdate(shared_ptr packet); - virtual void handleBlockRegionUpdate(shared_ptr packet); - virtual void handleTileUpdate(shared_ptr packet); - virtual void handleDisconnect(shared_ptr packet); + // 4J Added + virtual void handleChunkVisibilityArea(std::shared_ptr packet); + + virtual void handleChunkVisibility(std::shared_ptr packet); + virtual void handleChunkTilesUpdate(std::shared_ptr packet); + virtual void handleBlockRegionUpdate(std::shared_ptr packet); + virtual void handleTileUpdate(std::shared_ptr packet); + virtual void handleDisconnect(std::shared_ptr packet); virtual void onDisconnect(DisconnectPacket::eDisconnectReason reason, void *reasonObjects); - void sendAndDisconnect(shared_ptr packet); - void send(shared_ptr packet); - virtual void handleTakeItemEntity(shared_ptr packet); - virtual void handleChat(shared_ptr packet); - virtual void handleAnimate(shared_ptr packet); - virtual void handleEntityActionAtPosition(shared_ptr packet); - virtual void handlePreLogin(shared_ptr packet); + void sendAndDisconnect(std::shared_ptr packet); + void send(std::shared_ptr packet); + virtual void handleTakeItemEntity(std::shared_ptr packet); + virtual void handleChat(std::shared_ptr packet); + virtual void handleAnimate(std::shared_ptr packet); + virtual void handleEntityActionAtPosition(std::shared_ptr packet); + virtual void handlePreLogin(std::shared_ptr packet); void close(); - virtual void handleAddMob(shared_ptr packet); - virtual void handleSetTime(shared_ptr packet); - virtual void handleSetSpawn(shared_ptr packet); - virtual void handleRidePacket(shared_ptr packet); - virtual void handleEntityEvent(shared_ptr packet); + virtual void handleAddMob(std::shared_ptr packet); + virtual void handleSetTime(std::shared_ptr packet); + virtual void handleSetSpawn(std::shared_ptr packet); + virtual void handleRidePacket(std::shared_ptr packet); + virtual void handleEntityEvent(std::shared_ptr packet); private: - shared_ptr getEntity(int entityId); + std::shared_ptr getEntity(int entityId); wstring GetDisplayNameByGamertag(wstring gamertag); public: - virtual void handleSetHealth(shared_ptr packet); - virtual void handleSetExperience(shared_ptr packet); - virtual void handleRespawn(shared_ptr packet); - virtual void handleExplosion(shared_ptr packet); - virtual void handleContainerOpen(shared_ptr packet); - virtual void handleContainerSetSlot(shared_ptr packet); - virtual void handleContainerAck(shared_ptr packet); - virtual void handleContainerContent(shared_ptr packet); - virtual void handleSignUpdate(shared_ptr packet); - virtual void handleTileEntityData(shared_ptr packet); - virtual void handleContainerSetData(shared_ptr packet); - virtual void handleSetEquippedItem(shared_ptr packet); - virtual void handleContainerClose(shared_ptr packet); - virtual void handleTileEvent(shared_ptr packet); - virtual void handleTileDestruction(shared_ptr packet); + virtual void handleSetHealth(std::shared_ptr packet); + virtual void handleSetExperience(std::shared_ptr packet); + virtual void handleRespawn(std::shared_ptr packet); + virtual void handleExplosion(std::shared_ptr packet); + virtual void handleContainerOpen(std::shared_ptr packet); + virtual void handleContainerSetSlot(std::shared_ptr packet); + virtual void handleContainerAck(std::shared_ptr packet); + virtual void handleContainerContent(std::shared_ptr packet); + virtual void handleSignUpdate(std::shared_ptr packet); + virtual void handleTileEntityData(std::shared_ptr packet); + virtual void handleContainerSetData(std::shared_ptr packet); + virtual void handleSetEquippedItem(std::shared_ptr packet); + virtual void handleContainerClose(std::shared_ptr packet); + virtual void handleTileEvent(std::shared_ptr packet); + virtual void handleTileDestruction(std::shared_ptr packet); virtual bool canHandleAsyncPackets(); - virtual void handleGameEvent(shared_ptr gameEventPacket); - virtual void handleComplexItemData(shared_ptr packet); - virtual void handleLevelEvent(shared_ptr packet); - virtual void handleAwardStat(shared_ptr packet); - virtual void handleUpdateMobEffect(shared_ptr packet); - virtual void handleRemoveMobEffect(shared_ptr packet); + virtual void handleGameEvent(std::shared_ptr gameEventPacket); + virtual void handleComplexItemData(std::shared_ptr packet); + virtual void handleLevelEvent(std::shared_ptr packet); + virtual void handleAwardStat(std::shared_ptr packet); + virtual void handleUpdateMobEffect(std::shared_ptr packet); + virtual void handleRemoveMobEffect(std::shared_ptr packet); virtual bool isServerPacketListener(); - virtual void handlePlayerInfo(shared_ptr packet); - virtual void handleKeepAlive(shared_ptr packet); - virtual void handlePlayerAbilities(shared_ptr playerAbilitiesPacket); - virtual void handleSoundEvent(shared_ptr packet); - virtual void handleCustomPayload(shared_ptr customPayloadPacket); + virtual void handlePlayerInfo(std::shared_ptr packet); + virtual void handleKeepAlive(std::shared_ptr packet); + virtual void handlePlayerAbilities(std::shared_ptr playerAbilitiesPacket); + virtual void handleSoundEvent(std::shared_ptr packet); + virtual void handleCustomPayload(std::shared_ptr customPayloadPacket); virtual Connection *getConnection(); // 4J Added - virtual void handleServerSettingsChanged(shared_ptr packet); - virtual void handleTexture(shared_ptr packet); - virtual void handleTextureAndGeometry(shared_ptr packet); - virtual void handleUpdateProgress(shared_ptr packet); + virtual void handleServerSettingsChanged(std::shared_ptr packet); + virtual void handleTexture(std::shared_ptr packet); + virtual void handleTextureAndGeometry(std::shared_ptr packet); + virtual void handleUpdateProgress(std::shared_ptr packet); // 4J Added static int HostDisconnectReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - virtual void handleTextureChange(shared_ptr packet); - virtual void handleTextureAndGeometryChange(shared_ptr packet); - virtual void handleUpdateGameRuleProgressPacket(shared_ptr packet); - virtual void handleXZ(shared_ptr packet); + virtual void handleTextureChange(std::shared_ptr packet); + virtual void handleTextureAndGeometryChange(std::shared_ptr packet); + virtual void handleUpdateGameRuleProgressPacket(std::shared_ptr packet); + virtual void handleXZ(std::shared_ptr packet); - void displayPrivilegeChanges(shared_ptr player, unsigned int oldPrivileges); + void displayPrivilegeChanges(std::shared_ptr player, unsigned int oldPrivileges); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/Audio/Consoles_SoundEngine.h b/Minecraft.Client/Common/Audio/Consoles_SoundEngine.h index 4ec76036..607a24c6 100644 --- a/Minecraft.Client/Common/Audio/Consoles_SoundEngine.h +++ b/Minecraft.Client/Common/Audio/Consoles_SoundEngine.h @@ -43,7 +43,7 @@ class ConsoleSoundEngine public: ConsoleSoundEngine() : m_bIsPlayingStreamingCDMusic(false),m_bIsPlayingStreamingGameMusic(false), m_bIsPlayingEndMusic(false),m_bIsPlayingNetherMusic(false){}; - virtual void tick(shared_ptr *players, float a) =0; + virtual void tick(std::shared_ptr *players, float a) =0; virtual void destroy()=0; virtual void play(int iSound, float x, float y, float z, float volume, float pitch) =0; virtual void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true) =0; diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index 43d2059d..7bf10b40 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -22,17 +22,17 @@ #ifdef __ORBIS__ #include //#define __DISABLE_MILES__ // MGH disabled for now as it crashes if we call sceNpMatching2Initialize -#endif +#endif // take out Orbis until they are done -#if defined _XBOX +#if defined _XBOX SoundEngine::SoundEngine() {} void SoundEngine::init(Options *pOptions) { } -void SoundEngine::tick(shared_ptr *players, float a) +void SoundEngine::tick(std::shared_ptr *players, float a) { } void SoundEngine::destroy() {} @@ -95,7 +95,7 @@ char SoundEngine::m_szRedistName[]={"redist"}; #endif -F32 AILCALLBACK custom_falloff_function (HSAMPLE S, +F32 AILCALLBACK custom_falloff_function (HSAMPLE S, F32 distance, F32 rolloff_factor, F32 min_dist, @@ -124,7 +124,7 @@ char *SoundEngine::m_szStreamFileA[eStream_Max]= "menu2", "menu3", "menu4", -#endif +#endif "piano1", "piano2", "piano3", @@ -209,7 +209,7 @@ void SoundEngine::init(Options *pOptions) #endif #ifdef __ORBIS__ C4JThread::PushAffinityAllCores(); -#endif +#endif #if defined _DURANGO || defined __ORBIS__ || defined __PS3__ || defined __PSVITA__ Register_RIB(BinkADec); #endif @@ -226,8 +226,8 @@ void SoundEngine::init(Options *pOptions) int iNumberOfChannels=initAudioHardware(8); // Create a driver to render our audio - 44khz, 16 bit, -#ifdef __PS3__ - // On the Sony PS3, the driver is always opened in 48 kHz, 32-bit floating point. The only meaningful configurations are MSS_MC_STEREO, MSS_MC_51_DISCRETE, and MSS_MC_71_DISCRETE. +#ifdef __PS3__ + // On the Sony PS3, the driver is always opened in 48 kHz, 32-bit floating point. The only meaningful configurations are MSS_MC_STEREO, MSS_MC_51_DISCRETE, and MSS_MC_71_DISCRETE. m_hDriver = AIL_open_digital_driver( 48000, 16, iNumberOfChannels, AIL_OPEN_DIGITAL_USE_SPU0 ); #elif defined __PSVITA__ @@ -236,7 +236,7 @@ void SoundEngine::init(Options *pOptions) m_hDriver = AIL_open_digital_driver( 48000, 16, MSS_MC_STEREO, 0 ); - // AP - For some reason the submit thread defaults to a priority of zero (invalid). Make sure it has the highest priority to avoid audio breakup. + // AP - For some reason the submit thread defaults to a priority of zero (invalid). Make sure it has the highest priority to avoid audio breakup. SceUID threadID; AIL_platform_property( m_hDriver, PSP2_SUBMIT_THREAD, &threadID, 0, 0); S32 g_DefaultCPU = sceKernelGetThreadCpuAffinityMask(threadID); @@ -260,7 +260,7 @@ void SoundEngine::init(Options *pOptions) AIL_shutdown(); #ifdef __ORBIS__ C4JThread::PopAffinity(); -#endif +#endif return; } app.DebugPrintf("---SoundEngine::init - driver opened\n"); @@ -289,12 +289,12 @@ void SoundEngine::init(Options *pOptions) AIL_shutdown(); #ifdef __ORBIS__ C4JThread::PopAffinity(); -#endif +#endif app.DebugPrintf("---SoundEngine::init - AIL_startup_event_system failed\n"); return; } char szBankName[255]; -#if defined __PS3__ +#if defined __PS3__ if(app.GetBootedFromDiscPatch()) { char szTempSoundFilename[255]; @@ -308,7 +308,7 @@ void SoundEngine::init(Options *pOptions) { sprintf(szBankName,"%s/%s",getUsrDirPath(), m_szSoundPath ); } - + #elif defined __PSVITA__ sprintf(szBankName,"%s/%s",getUsrDirPath(), m_szSoundPath ); #elif defined __ORBIS__ @@ -329,7 +329,7 @@ void SoundEngine::init(Options *pOptions) AIL_shutdown(); #ifdef __ORBIS__ C4JThread::PopAffinity(); -#endif +#endif return; } @@ -362,7 +362,7 @@ void SoundEngine::init(Options *pOptions) #endif #ifdef __PSVITA__ - // AP - By default the mixer won't start up and nothing will process. Kick off a blank sample to force the mixer to start up. + // AP - By default the mixer won't start up and nothing will process. Kick off a blank sample to force the mixer to start up. HSAMPLE Sample = AIL_allocate_sample_handle(m_hDriver); AIL_init_sample(Sample, DIG_F_STEREO_16); static U64 silence = 0; @@ -403,7 +403,7 @@ void SoundEngine::SetStreamingSounds(int iOverworldMin, int iOverWorldMax, int i // AP - moved to a separate function so it can be called from the mixer callback on Vita void SoundEngine::updateMiles() { -#ifdef __PSVITA__ +#ifdef __PSVITA__ //CD - We must check for Background Music [BGM] at any point //If it's playing disable our audio, otherwise enable int NoBGMPlaying = sceAudioOutGetAdopt(SCE_AUDIO_OUT_PORT_TYPE_BGM); @@ -463,7 +463,7 @@ void SoundEngine::updateMiles() { isThunder = true; } - if(game_data->volume>1) + if(game_data->volume>1) { game_data->volume=1; } @@ -477,7 +477,7 @@ void SoundEngine::updateMiles() AIL_register_falloff_function_callback(SoundInfo.Sample,&custom_falloff_function); if(game_data->bIs3D) - { + { AIL_set_sample_is_3D( SoundInfo.Sample, 1 ); int iSound = game_data->iSound - eSFX_MAX; @@ -518,7 +518,7 @@ void SoundEngine::updateMiles() } if(game_data->bIs3D) - { + { if(m_validListenerCount>1) { float fClosest=10000.0f; @@ -562,7 +562,7 @@ void SoundEngine::updateMiles() default: if(game_data->bIs3D) - { + { if(m_validListenerCount>1) { float fClosest=10000.0f; @@ -600,9 +600,9 @@ void SoundEngine::updateMiles() { AIL_set_sample_3D_position( SoundInfo.Sample, game_data->x, game_data->y, -game_data->z ); // Flipped sign of z as Miles is expecting left handed coord system } - } + } break; - } + } } } AIL_complete_event_queue_processing(); @@ -622,7 +622,7 @@ static float fVal=0.0f; static S32 running = AIL_ms_count(); #endif -void SoundEngine::tick(shared_ptr *players, float a) +void SoundEngine::tick(std::shared_ptr *players, float a) { #ifdef __DISABLE_MILES__ return; @@ -657,7 +657,7 @@ void SoundEngine::tick(shared_ptr *players, float a) // store the listener positions for splitscreen m_ListenerA[i].vPosition.x = x; m_ListenerA[i].vPosition.y = y; - m_ListenerA[i].vPosition.z = z; + m_ListenerA[i].vPosition.z = z; m_ListenerA[i].vOrientFront.x = ySin; m_ListenerA[i].vOrientFront.y = 0; @@ -707,7 +707,7 @@ SoundEngine::SoundEngine() m_hStream=0; m_StreamState=eMusicStreamState_Idle; m_iMusicDelay=0; - m_validListenerCount=0; + m_validListenerCount=0; m_bHeardTrackA=NULL; @@ -763,7 +763,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa // AP removed old counting system. Now relying on Miles' Play Count Limit /* // if we are already playing loads of this sounds ignore this one - if(CurrentSoundsPlaying[iSound+eSFX_MAX]>MAX_SAME_SOUNDS_PLAYING) + if(CurrentSoundsPlaying[iSound+eSFX_MAX]>MAX_SAME_SOUNDS_PLAYING) { // wstring name = wchSoundNames[iSound]; // char *SoundName = (char *)ConvertSoundPathToName(name); @@ -810,7 +810,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa // playUI // ///////////////////////////////////////////// -void SoundEngine::playUI(int iSound, float volume, float pitch) +void SoundEngine::playUI(int iSound, float volume, float pitch) { U8 szSoundName[256]; wstring name; @@ -956,7 +956,7 @@ int SoundEngine::GetRandomishTrack(int iStart,int iEnd) int iVal=iStart; for(int i=iStart;i<=iEnd;i++) { - if(m_bHeardTrackA[i]==false) + if(m_bHeardTrackA[i]==false) { bAllTracksHeard=false; app.DebugPrintf("Not heard all tracks yet\n"); @@ -974,7 +974,7 @@ int SoundEngine::GetRandomishTrack(int iStart,int iEnd) } } - // trying to get a track we haven't heard, but not too hard + // trying to get a track we haven't heard, but not too hard for(int i=0;i<=((iEnd-iStart)/2);i++) { // random->nextInt(1) will always return 0 @@ -1111,7 +1111,7 @@ void SoundEngine::updateSystemMusicPlaying(bool isPlaying) // updateSoundEffectVolume // ///////////////////////////////////////////// -void SoundEngine::updateSoundEffectVolume(float fVal) +void SoundEngine::updateSoundEffectVolume(float fVal) { m_MasterEffectsVolume=fVal; //AIL_set_variable_float(0,"UserEffectVol",fVal); @@ -1137,7 +1137,7 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter ) // playMusicTick // ///////////////////////////////////////////// -void SoundEngine::playMusicTick() +void SoundEngine::playMusicTick() { // AP - vita will update the music during the mixer callback #ifndef __PSVITA__ @@ -1146,7 +1146,7 @@ void SoundEngine::playMusicTick() } // AP - moved to a separate function so it can be called from the mixer callback on Vita -void SoundEngine::playMusicUpdate() +void SoundEngine::playMusicUpdate() { //return; static bool firstCall = true; @@ -1179,7 +1179,7 @@ void SoundEngine::playMusicUpdate() // 4J-PB - Need to check if we are a patched BD build if(app.GetBootedFromDiscPatch()) { - sprintf(m_szStreamName,"%s/%s",app.GetBDUsrDirPath(m_szMusicPath), m_szMusicPath ); + sprintf(m_szStreamName,"%s/%s",app.GetBDUsrDirPath(m_szMusicPath), m_szMusicPath ); app.DebugPrintf("SoundEngine::playMusicUpdate - (booted from disc patch) music path - %s",m_szStreamName); } else @@ -1214,7 +1214,7 @@ void SoundEngine::playMusicUpdate() SetIsPlayingStreamingCDMusic(false); m_MusicType=eMusicType_Game; m_StreamingAudioInfo.bIs3D=false; - + #ifdef _XBOX_ONE wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID); wstring wstrFile=L"TPACK:\\Data\\" + wstrSoundName +L".binka"; @@ -1244,7 +1244,7 @@ void SoundEngine::playMusicUpdate() } } else - { + { // 4J-PB - if this is a PS3 disc patch, we have to check if the music file is in the patch data #ifdef __PS3__ if(app.GetBootedFromDiscPatch() && (m_musicIDRun(); m_StreamState = eMusicStreamState_Opening; @@ -1335,7 +1335,7 @@ void SoundEngine::playMusicUpdate() delete m_openStreamThread; m_openStreamThread = NULL; - HSAMPLE hSample = AIL_stream_sample_handle( m_hStream); + HSAMPLE hSample = AIL_stream_sample_handle( m_hStream); // 4J-PB - causes the falloff to be calculated on the PPU instead of the SPU, and seems to resolve our distorted sound issue AIL_register_falloff_function_callback(hSample,&custom_falloff_function); @@ -1383,12 +1383,12 @@ void SoundEngine::playMusicUpdate() else { // clear the 3d flag on the stream after a jukebox finishes and streaming music starts - AIL_set_sample_is_3D( hSample, 0 ); + AIL_set_sample_is_3D( hSample, 0 ); } // set the pitch app.DebugPrintf("Sample rate:%d\n", AIL_sample_playback_rate(hSample)); AIL_set_sample_playback_rate_factor(hSample,m_StreamingAudioInfo.pitch); - // set the volume + // set the volume AIL_set_sample_volume_levels( hSample, m_StreamingAudioInfo.volume*getMasterMusicVolume(), m_StreamingAudioInfo.volume*getMasterMusicVolume()); AIL_start_stream( m_hStream ); @@ -1447,7 +1447,7 @@ void SoundEngine::playMusicUpdate() // Set the end track m_musicID = getMusicID(LevelData::DIMENSION_END); SetIsPlayingEndMusic(true); - SetIsPlayingNetherMusic(false); + SetIsPlayingNetherMusic(false); } else if(!playerInEnd && GetIsPlayingEndMusic()) { @@ -1458,7 +1458,7 @@ void SoundEngine::playMusicUpdate() // Set the end track m_musicID = getMusicID(LevelData::DIMENSION_NETHER); SetIsPlayingEndMusic(false); - SetIsPlayingNetherMusic(true); + SetIsPlayingNetherMusic(true); } else { @@ -1467,7 +1467,7 @@ void SoundEngine::playMusicUpdate() // Set the end track m_musicID = getMusicID(LevelData::DIMENSION_OVERWORLD); SetIsPlayingEndMusic(false); - SetIsPlayingNetherMusic(false); + SetIsPlayingNetherMusic(false); } } else if (playerInNether && !GetIsPlayingNetherMusic()) @@ -1502,7 +1502,7 @@ void SoundEngine::playMusicUpdate() if(fMusicVol!=getMasterMusicVolume()) { fMusicVol=getMasterMusicVolume(); - HSAMPLE hSample = AIL_stream_sample_handle( m_hStream); + HSAMPLE hSample = AIL_stream_sample_handle( m_hStream); //AIL_set_sample_3D_position( hSample, m_StreamingAudioInfo.x, m_StreamingAudioInfo.y, m_StreamingAudioInfo.z ); AIL_set_sample_volume_levels( hSample, fMusicVol, fMusicVol); } @@ -1545,7 +1545,7 @@ void SoundEngine::playMusicUpdate() } // our distances in the world aren't very big, so floats rather than casts to doubles should be fine - HSAMPLE hSample = AIL_stream_sample_handle( m_hStream); + HSAMPLE hSample = AIL_stream_sample_handle( m_hStream); fDist=sqrtf((fClosestX*fClosestX)+(fClosestY*fClosestY)+(fClosestZ*fClosestZ)); AIL_set_sample_3D_position( hSample, 0, 0, fDist ); } @@ -1555,7 +1555,7 @@ void SoundEngine::playMusicUpdate() break; case eMusicStreamState_Completed: - { + { // random delay of up to 3 minutes for music m_iMusicDelay = random->nextInt(20 * 60 * 3);//random->nextInt(20 * 60 * 10) + 20 * 60 * 10; // Check if we have a local player in The Nether or in The End, and play that music if they are @@ -1644,7 +1644,7 @@ char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpac #endif -F32 AILCALLBACK custom_falloff_function (HSAMPLE S, +F32 AILCALLBACK custom_falloff_function (HSAMPLE S, F32 distance, F32 rolloff_factor, F32 min_dist, diff --git a/Minecraft.Client/Common/Audio/SoundEngine.h b/Minecraft.Client/Common/Audio/SoundEngine.h index 92c99d23..8dc50e7c 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.h +++ b/Minecraft.Client/Common/Audio/SoundEngine.h @@ -78,8 +78,8 @@ typedef struct { F32 x,y,z,volume,pitch; int iSound; - bool bIs3D; - bool bUseSoundsPitchVal; + bool bIs3D; + bool bUseSoundsPitchVal; #ifdef _DEBUG char chName[64]; #endif @@ -103,7 +103,7 @@ public: virtual void updateSystemMusicPlaying(bool isPlaying); virtual void updateSoundEffectVolume(float fVal); virtual void init(Options *); - virtual void tick(shared_ptr *players, float a); // 4J - updated to take array of local players rather than single one + virtual void tick(std::shared_ptr *players, float a); // 4J - updated to take array of local players rather than single one virtual void add(const wstring& name, File *file); virtual void addMusic(const wstring& name, File *file); virtual void addStreaming(const wstring& name, File *file); @@ -123,7 +123,7 @@ private: #else int initAudioHardware(int iMinSpeakers) { return iMinSpeakers;} #endif - + int GetRandomishTrack(int iStart,int iEnd); HMSOUNDBANK m_hBank; @@ -165,4 +165,4 @@ private: #ifdef __ORBIS__ int32_t m_hBGMAudio; #endif -}; +}; diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 0e55ec9f..a1cb78d8 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -365,7 +365,7 @@ void CMinecraftApp::HandleButtonPresses(int iPad) // ProfileManager.WriteToProfile(iPad,true); } -bool CMinecraftApp::LoadInventoryMenu(int iPad,shared_ptr player,bool bNavigateBack) +bool CMinecraftApp::LoadInventoryMenu(int iPad,std::shared_ptr player,bool bNavigateBack) { bool success = true; @@ -388,7 +388,7 @@ bool CMinecraftApp::LoadInventoryMenu(int iPad,shared_ptr player,bo return success; } -bool CMinecraftApp::LoadCreativeMenu(int iPad,shared_ptr player,bool bNavigateBack) +bool CMinecraftApp::LoadCreativeMenu(int iPad,std::shared_ptr player,bool bNavigateBack) { bool success = true; @@ -411,7 +411,7 @@ bool CMinecraftApp::LoadCreativeMenu(int iPad,shared_ptr player,boo return success; } -bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,shared_ptr player) +bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,std::shared_ptr player) { bool success = true; @@ -437,7 +437,7 @@ bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,shared_ptr player) return success; } -bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,shared_ptr player, int x, int y, int z) +bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,std::shared_ptr player, int x, int y, int z) { bool success = true; @@ -463,7 +463,7 @@ bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,shared_ptr player, return success; } -bool CMinecraftApp::LoadEnchantingMenu(int iPad,shared_ptr inventory, int x, int y, int z, Level *level) +bool CMinecraftApp::LoadEnchantingMenu(int iPad,std::shared_ptr inventory, int x, int y, int z, Level *level) { bool success = true; @@ -489,7 +489,7 @@ bool CMinecraftApp::LoadEnchantingMenu(int iPad,shared_ptr inventory, return success; } -bool CMinecraftApp::LoadFurnaceMenu(int iPad,shared_ptr inventory, shared_ptr furnace) +bool CMinecraftApp::LoadFurnaceMenu(int iPad,std::shared_ptr inventory, std::shared_ptr furnace) { bool success = true; @@ -514,7 +514,7 @@ bool CMinecraftApp::LoadFurnaceMenu(int iPad,shared_ptr inventory, sh return success; } -bool CMinecraftApp::LoadBrewingStandMenu(int iPad,shared_ptr inventory, shared_ptr brewingStand) +bool CMinecraftApp::LoadBrewingStandMenu(int iPad,std::shared_ptr inventory, std::shared_ptr brewingStand) { bool success = true; @@ -540,7 +540,7 @@ bool CMinecraftApp::LoadBrewingStandMenu(int iPad,shared_ptr inventor } -bool CMinecraftApp::LoadContainerMenu(int iPad,shared_ptr inventory, shared_ptr container) +bool CMinecraftApp::LoadContainerMenu(int iPad,std::shared_ptr inventory, std::shared_ptr container) { bool success = true; @@ -574,7 +574,7 @@ bool CMinecraftApp::LoadContainerMenu(int iPad,shared_ptr inventory, return success; } -bool CMinecraftApp::LoadTrapMenu(int iPad,shared_ptr inventory, shared_ptr trap) +bool CMinecraftApp::LoadTrapMenu(int iPad,std::shared_ptr inventory, std::shared_ptr trap) { bool success = true; @@ -599,7 +599,7 @@ bool CMinecraftApp::LoadTrapMenu(int iPad,shared_ptr inventory, share return success; } -bool CMinecraftApp::LoadSignEntryMenu(int iPad,shared_ptr sign) +bool CMinecraftApp::LoadSignEntryMenu(int iPad,std::shared_ptr sign) { bool success = true; @@ -615,7 +615,7 @@ bool CMinecraftApp::LoadSignEntryMenu(int iPad,shared_ptr sign) return success; } -bool CMinecraftApp::LoadRepairingMenu(int iPad,shared_ptr inventory, Level *level, int x, int y, int z) +bool CMinecraftApp::LoadRepairingMenu(int iPad,std::shared_ptr inventory, Level *level, int x, int y, int z) { bool success = true; @@ -634,7 +634,7 @@ bool CMinecraftApp::LoadRepairingMenu(int iPad,shared_ptr inventory, return success; } -bool CMinecraftApp::LoadTradingMenu(int iPad, shared_ptr inventory, shared_ptr trader, Level *level) +bool CMinecraftApp::LoadTradingMenu(int iPad, std::shared_ptr inventory, std::shared_ptr trader, Level *level) { bool success = true; @@ -1272,7 +1272,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) PlayerList *players = MinecraftServer::getInstance()->getPlayerList(); for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3) { - shared_ptr decorationPlayer = *it3; + std::shared_ptr decorationPlayer = *it3; decorationPlayer->setShowOnMaps((app.GetGameHostOption(eGameHostOption_Gamertags)!=0)?true:false); } } @@ -2240,7 +2240,7 @@ unsigned int CMinecraftApp::GetGameSettingsDebugMask(int iPad,bool bOverridePlay } if(iPad < 0) iPad = 0; - shared_ptr player = Minecraft::GetInstance()->localplayers[iPad]; + std::shared_ptr player = Minecraft::GetInstance()->localplayers[iPad]; if(bOverridePlayer || player==NULL) { @@ -2260,7 +2260,7 @@ void CMinecraftApp::SetGameSettingsDebugMask(int iPad, unsigned int uiVal) GameSettingsA[iPad]->uiDebugBitmask=uiVal; // update the value so the network server can use it - shared_ptr player = Minecraft::GetInstance()->localplayers[iPad]; + std::shared_ptr player = Minecraft::GetInstance()->localplayers[iPad]; if(player) { @@ -2427,7 +2427,7 @@ void CMinecraftApp::HandleXuiActions(void) eTMSAction eTMS; LPVOID param; Minecraft *pMinecraft=Minecraft::GetInstance(); - shared_ptr player; + std::shared_ptr player; // are there any global actions to deal with? eAction = app.GetGlobalXuiAction(); diff --git a/Minecraft.Client/Common/Consoles_App.h b/Minecraft.Client/Common/Consoles_App.h index 68f4ccd4..fd517d73 100644 --- a/Minecraft.Client/Common/Consoles_App.h +++ b/Minecraft.Client/Common/Consoles_App.h @@ -125,18 +125,18 @@ public: bool GetGameStarted() {return m_bGameStarted;} void SetGameStarted(bool bVal) { if(bVal) DebugPrintf("SetGameStarted - true\n"); else DebugPrintf("SetGameStarted - false\n"); m_bGameStarted = bVal; m_bIsAppPaused = !bVal;} int GetLocalPlayerCount(void); - bool LoadInventoryMenu(int iPad,shared_ptr player, bool bNavigateBack=false); - bool LoadCreativeMenu(int iPad,shared_ptr player,bool bNavigateBack=false); - bool LoadEnchantingMenu(int iPad,shared_ptr inventory, int x, int y, int z, Level *level); - bool LoadFurnaceMenu(int iPad,shared_ptr inventory, shared_ptr furnace); - bool LoadBrewingStandMenu(int iPad,shared_ptr inventory, shared_ptr brewingStand); - bool LoadContainerMenu(int iPad,shared_ptr inventory, shared_ptr container); - bool LoadTrapMenu(int iPad,shared_ptr inventory, shared_ptr trap); - bool LoadCrafting2x2Menu(int iPad,shared_ptr player); - bool LoadCrafting3x3Menu(int iPad,shared_ptr player, int x, int y, int z); - bool LoadSignEntryMenu(int iPad,shared_ptr sign); - bool LoadRepairingMenu(int iPad,shared_ptr inventory, Level *level, int x, int y, int z); - bool LoadTradingMenu(int iPad, shared_ptr inventory, shared_ptr trader, Level *level); + bool LoadInventoryMenu(int iPad,std::shared_ptr player, bool bNavigateBack=false); + bool LoadCreativeMenu(int iPad,std::shared_ptr player,bool bNavigateBack=false); + bool LoadEnchantingMenu(int iPad,std::shared_ptr inventory, int x, int y, int z, Level *level); + bool LoadFurnaceMenu(int iPad,std::shared_ptr inventory, std::shared_ptr furnace); + bool LoadBrewingStandMenu(int iPad,std::shared_ptr inventory, std::shared_ptr brewingStand); + bool LoadContainerMenu(int iPad,std::shared_ptr inventory, std::shared_ptr container); + bool LoadTrapMenu(int iPad,std::shared_ptr inventory, std::shared_ptr trap); + bool LoadCrafting2x2Menu(int iPad,std::shared_ptr player); + bool LoadCrafting3x3Menu(int iPad,std::shared_ptr player, int x, int y, int z); + bool LoadSignEntryMenu(int iPad,std::shared_ptr sign); + bool LoadRepairingMenu(int iPad,std::shared_ptr inventory, Level *level, int x, int y, int z); + bool LoadTradingMenu(int iPad, std::shared_ptr inventory, std::shared_ptr trader, Level *level); bool GetTutorialMode() { return m_bTutorialMode;} void SetTutorialMode(bool bSet) {m_bTutorialMode=bSet;} diff --git a/Minecraft.Client/Common/GameRules/AddEnchantmentRuleDefinition.cpp b/Minecraft.Client/Common/GameRules/AddEnchantmentRuleDefinition.cpp index eabc1401..b2687619 100644 --- a/Minecraft.Client/Common/GameRules/AddEnchantmentRuleDefinition.cpp +++ b/Minecraft.Client/Common/GameRules/AddEnchantmentRuleDefinition.cpp @@ -43,14 +43,14 @@ void AddEnchantmentRuleDefinition::addAttribute(const wstring &attributeName, co } } -bool AddEnchantmentRuleDefinition::enchantItem(shared_ptr item) +bool AddEnchantmentRuleDefinition::enchantItem(std::shared_ptr item) { bool enchanted = false; if (item != NULL) { // 4J-JEV: Ripped code from enchantmenthelpers // Maybe we want to add an addEnchantment method to EnchantmentHelpers - if (item->id == Item::enchantedBook_Id) + if (item->id == Item::enchantedBook_Id) { Item::enchantedBook->addEnchantment( item, new EnchantmentInstance(m_enchantmentId, m_enchantmentLevel) ); } diff --git a/Minecraft.Client/Common/GameRules/AddEnchantmentRuleDefinition.h b/Minecraft.Client/Common/GameRules/AddEnchantmentRuleDefinition.h index 3beece10..0ec2ff44 100644 --- a/Minecraft.Client/Common/GameRules/AddEnchantmentRuleDefinition.h +++ b/Minecraft.Client/Common/GameRules/AddEnchantmentRuleDefinition.h @@ -19,5 +19,5 @@ public: virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); - bool enchantItem(shared_ptr item); + bool enchantItem(std::shared_ptr item); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.cpp b/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.cpp index 0d14884a..6b99c59e 100644 --- a/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.cpp +++ b/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.cpp @@ -94,13 +94,13 @@ void AddItemRuleDefinition::addAttribute(const wstring &attributeName, const wst } } -bool AddItemRuleDefinition::addItemToContainer(shared_ptr container, int slotId) +bool AddItemRuleDefinition::addItemToContainer(std::shared_ptr container, int slotId) { bool added = false; if(Item::items[m_itemId] != NULL) { int quantity = min(m_quantity, Item::items[m_itemId]->getMaxStackSize()); - shared_ptr newItem = shared_ptr(new ItemInstance(m_itemId,quantity,m_auxValue) ); + std::shared_ptr newItem = std::shared_ptr(new ItemInstance(m_itemId,quantity,m_auxValue) ); newItem->set4JData(m_dataTag); for(AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); ++it) diff --git a/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.h b/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.h index 602f2d82..bd8c466a 100644 --- a/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.h +++ b/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.h @@ -26,5 +26,5 @@ public: virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); - bool addItemToContainer(shared_ptr container, int slotId); + bool addItemToContainer(std::shared_ptr container, int slotId); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/GameRules/CollectItemRuleDefinition.cpp b/Minecraft.Client/Common/GameRules/CollectItemRuleDefinition.cpp index 66abefbb..d94ce63b 100644 --- a/Minecraft.Client/Common/GameRules/CollectItemRuleDefinition.cpp +++ b/Minecraft.Client/Common/GameRules/CollectItemRuleDefinition.cpp @@ -74,7 +74,7 @@ void CollectItemRuleDefinition::populateGameRule(GameRulesInstance::EGameRulesIn GameRuleDefinition::populateGameRule(type, rule); } -bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, shared_ptr item) +bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr item) { bool statusChanged = false; if(item != NULL && item->id == m_itemId && item->getAuxValue() == m_auxValue && item->get4JData() == m_4JDataValue) @@ -94,7 +94,7 @@ bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, shared_ptrgetConnection() != NULL) { - rule->getConnection()->send( shared_ptr( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId, m_itemId, m_auxValue, this->m_4JDataValue,NULL,0))); + rule->getConnection()->send( std::shared_ptr( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId, m_itemId, m_auxValue, this->m_4JDataValue,NULL,0))); } } } @@ -102,7 +102,7 @@ bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, shared_ptr item) +wstring CollectItemRuleDefinition::generateXml(std::shared_ptr item) { // 4J Stu - This should be kept in sync with the GameRulesDefinition.xsd wstring xml = L""; diff --git a/Minecraft.Client/Common/GameRules/CollectItemRuleDefinition.h b/Minecraft.Client/Common/GameRules/CollectItemRuleDefinition.h index 5ee6f4c5..1c6821e4 100644 --- a/Minecraft.Client/Common/GameRules/CollectItemRuleDefinition.h +++ b/Minecraft.Client/Common/GameRules/CollectItemRuleDefinition.h @@ -25,16 +25,16 @@ public: virtual int getGoal(); virtual int getProgress(GameRule *rule); - + virtual int getIcon() { return m_itemId; } virtual int getAuxValue() { return m_auxValue; } void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule); - bool onCollectItem(GameRule *rule, shared_ptr item); + bool onCollectItem(GameRule *rule, std::shared_ptr item); - static wstring generateXml(shared_ptr item); + static wstring generateXml(std::shared_ptr item); -private: +private: //static wstring generateXml(CollectItemRuleDefinition *ruleDef); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/GameRules/CompleteAllRuleDefinition.cpp b/Minecraft.Client/Common/GameRules/CompleteAllRuleDefinition.cpp index adaf70c8..f0362f48 100644 --- a/Minecraft.Client/Common/GameRules/CompleteAllRuleDefinition.cpp +++ b/Minecraft.Client/Common/GameRules/CompleteAllRuleDefinition.cpp @@ -17,7 +17,7 @@ bool CompleteAllRuleDefinition::onUseTile(GameRule *rule, int tileId, int x, int return statusChanged; } -bool CompleteAllRuleDefinition::onCollectItem(GameRule *rule, shared_ptr item) +bool CompleteAllRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr item) { bool statusChanged = CompoundGameRuleDefinition::onCollectItem(rule,item); if(statusChanged) updateStatus(rule); @@ -44,14 +44,14 @@ void CompleteAllRuleDefinition::updateStatus(GameRule *rule) int icon = -1; int auxValue = 0; - + if(m_lastRuleStatusChanged != NULL) - { + { icon = m_lastRuleStatusChanged->getIcon(); auxValue = m_lastRuleStatusChanged->getAuxValue(); m_lastRuleStatusChanged = NULL; } - rule->getConnection()->send( shared_ptr( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId,icon, auxValue, 0,&data,sizeof(PacketData)))); + rule->getConnection()->send( std::shared_ptr( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId,icon, auxValue, 0,&data,sizeof(PacketData)))); } app.DebugPrintf("Updated CompleteAllRule - Completed %d of %d\n", progress, goal); } diff --git a/Minecraft.Client/Common/GameRules/CompleteAllRuleDefinition.h b/Minecraft.Client/Common/GameRules/CompleteAllRuleDefinition.h index b2cb8847..2ecbc303 100644 --- a/Minecraft.Client/Common/GameRules/CompleteAllRuleDefinition.h +++ b/Minecraft.Client/Common/GameRules/CompleteAllRuleDefinition.h @@ -17,7 +17,7 @@ public: virtual void getChildren(vector *children); virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z); - virtual bool onCollectItem(GameRule *rule, shared_ptr item); + virtual bool onCollectItem(GameRule *rule, std::shared_ptr item); static wstring generateDescriptionString(const wstring &description, void *data, int dataLength); diff --git a/Minecraft.Client/Common/GameRules/CompoundGameRuleDefinition.cpp b/Minecraft.Client/Common/GameRules/CompoundGameRuleDefinition.cpp index 0481a54b..106302ee 100644 --- a/Minecraft.Client/Common/GameRules/CompoundGameRuleDefinition.cpp +++ b/Minecraft.Client/Common/GameRules/CompoundGameRuleDefinition.cpp @@ -40,7 +40,7 @@ GameRuleDefinition *CompoundGameRuleDefinition::addChild(ConsoleGameRules::EGame rule = new UseTileRuleDefinition(); } else if(ruleType == ConsoleGameRules::eGameRuleType_UpdatePlayerRule) - { + { rule = new UpdatePlayerRuleDefinition(); } else @@ -91,7 +91,7 @@ bool CompoundGameRuleDefinition::onUseTile(GameRule *rule, int tileId, int x, in return statusChanged; } -bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, shared_ptr item) +bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr item) { bool statusChanged = false; for(AUTO_VAR(it, rule->m_parameters.begin()); it != rule->m_parameters.end(); ++it) @@ -100,7 +100,7 @@ bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, shared_ptrsecond.gr->getGameRuleDefinition()->onCollectItem(it->second.gr,item); if(!statusChanged && changed) - { + { m_lastRuleStatusChanged = it->second.gr->getGameRuleDefinition(); statusChanged = true; } @@ -109,7 +109,7 @@ bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, shared_ptr player) +void CompoundGameRuleDefinition::postProcessPlayer(std::shared_ptr player) { for(AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it) { diff --git a/Minecraft.Client/Common/GameRules/CompoundGameRuleDefinition.h b/Minecraft.Client/Common/GameRules/CompoundGameRuleDefinition.h index bfedfd09..4b91cda8 100644 --- a/Minecraft.Client/Common/GameRules/CompoundGameRuleDefinition.h +++ b/Minecraft.Client/Common/GameRules/CompoundGameRuleDefinition.h @@ -18,6 +18,6 @@ public: virtual void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule); virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z); - virtual bool onCollectItem(GameRule *rule, shared_ptr item); - virtual void postProcessPlayer(shared_ptr player); + virtual bool onCollectItem(GameRule *rule, std::shared_ptr item); + virtual void postProcessPlayer(std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp index 0eef096b..5f4bc737 100644 --- a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp @@ -116,7 +116,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis) for (int i = 0; i < tileEntityTags->size(); i++) { CompoundTag *teTag = tileEntityTags->get(i); - shared_ptr te = TileEntity::loadStatic(teTag); + std::shared_ptr te = TileEntity::loadStatic(teTag); if(te == NULL) { @@ -433,7 +433,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, { for(AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end();++it) { - shared_ptr te = *it; + std::shared_ptr te = *it; double targetX = te->x; double targetY = te->y + destinationBox->y0; @@ -444,7 +444,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, Vec3 *pos = Vec3::newTemp(targetX,targetY,targetZ); if( chunkBox->containsIncludingLowerBound(pos) ) { - shared_ptr teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 ); + std::shared_ptr teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 ); if ( teCopy != NULL ) { @@ -495,11 +495,11 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, } CompoundTag *eTag = it->second; - shared_ptr e = EntityIO::loadStatic(eTag, NULL); + std::shared_ptr e = EntityIO::loadStatic(eTag, NULL); if( e->GetType() == eTYPE_PAINTING ) { - shared_ptr painting = dynamic_pointer_cast(e); + std::shared_ptr painting = dynamic_pointer_cast(e); double tileX = painting->xTile; double tileZ = painting->zTile; @@ -512,7 +512,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, } else if( e->GetType() == eTYPE_ITEM_FRAME ) { - shared_ptr frame = dynamic_pointer_cast(e); + std::shared_ptr frame = dynamic_pointer_cast(e); double tileX = frame->xTile; double tileZ = frame->zTile; @@ -678,12 +678,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l { for (int zc = zc0; zc <= zc1; zc++) { - vector > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize); + vector > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize); for(AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end(); ++it) { - shared_ptr te = *it; + std::shared_ptr te = *it; CompoundTag *teTag = new CompoundTag(); - shared_ptr teCopy = te->clone(); + std::shared_ptr teCopy = te->clone(); // Adjust the tileEntity position to schematic coords from world co-ords teCopy->x -= xStart; @@ -698,12 +698,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l tag.put(L"TileEntities", tileEntitiesTag); AABB *bb = AABB::newTemp(xStart,yStart,zStart,xEnd,yEnd,zEnd); - vector > *entities = level->getEntities(nullptr, bb); + vector > *entities = level->getEntities(nullptr, bb); ListTag *entitiesTag = new ListTag(L"entities"); for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - shared_ptr e = *it; + std::shared_ptr e = *it; bool mobCanBeSaved = false; if(bSaveMobs) @@ -1005,12 +1005,12 @@ void ConsoleSchematicFile::setBlocksAndData(LevelChunk *chunk, byteArray blockDa } } -vector > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1) +vector > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1) { - vector > *result = new vector >; + vector > *result = new vector >; for (AUTO_VAR(it, chunk->tileEntities.begin()); it != chunk->tileEntities.end(); ++it) { - shared_ptr te = it->second; + std::shared_ptr te = it->second; if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && te->y < y1 && te->z < z1) { result->push_back(te); diff --git a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h index b0eebf9e..299f81d4 100644 --- a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h +++ b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h @@ -55,7 +55,7 @@ public: } XboxSchematicInitParam; private: int m_xSize, m_ySize, m_zSize; - vector > m_tileEntities; + vector > m_tileEntities; vector< pair > m_entities; public: @@ -83,7 +83,7 @@ private: void load_tags(DataInputStream *dis); static void getBlocksAndData(LevelChunk *chunk, byteArray *data, int x0, int y0, int z0, int x1, int y1, int z1, int &blocksP, int &dataP, int &blockLightP, int &skyLightP); - static vector > *getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1); + static vector > *getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1); void chunkCoordToSchematicCoord(AABB *destinationBox, int chunkX, int chunkZ, ESchematicRotation rot, int &schematicX, int &schematicZ); void schematicCoordToChunkCoord(AABB *destinationBox, double schematicX, double schematicZ, ESchematicRotation rot, double &chunkX, double &chunkZ); diff --git a/Minecraft.Client/Common/GameRules/GameRule.cpp b/Minecraft.Client/Common/GameRules/GameRule.cpp index 34d6196c..310d6d65 100644 --- a/Minecraft.Client/Common/GameRules/GameRule.cpp +++ b/Minecraft.Client/Common/GameRules/GameRule.cpp @@ -53,7 +53,7 @@ GameRuleDefinition *GameRule::getGameRuleDefinition() } void GameRule::onUseTile(int tileId, int x, int y, int z) { m_definition->onUseTile(this,tileId,x,y,z); } -void GameRule::onCollectItem(shared_ptr item) { m_definition->onCollectItem(this,item); } +void GameRule::onCollectItem(std::shared_ptr item) { m_definition->onCollectItem(this,item); } void GameRule::write(DataOutputStream *dos) { @@ -63,7 +63,7 @@ void GameRule::write(DataOutputStream *dos) { wstring pName = (*it).first; ValueType vType = (*it).second; - + dos->writeUTF( (*it).first ); dos->writeBoolean( vType.isPointer ); @@ -80,7 +80,7 @@ void GameRule::read(DataInputStream *dis) for (int i = 0; i < savedParams; i++) { wstring pNames = dis->readUTF(); - + ValueType vType = getParameter(pNames); if (dis->readBoolean()) diff --git a/Minecraft.Client/Common/GameRules/GameRule.h b/Minecraft.Client/Common/GameRules/GameRule.h index 3b9dba7e..c2b6c826 100644 --- a/Minecraft.Client/Common/GameRules/GameRule.h +++ b/Minecraft.Client/Common/GameRules/GameRule.h @@ -51,7 +51,7 @@ public: // All the hooks go here void onUseTile(int tileId, int x, int y, int z); - void onCollectItem(shared_ptr item); + void onCollectItem(std::shared_ptr item); // 4J-JEV: For saving. //CompoundTag *toTags(unordered_map *map); diff --git a/Minecraft.Client/Common/GameRules/GameRuleDefinition.h b/Minecraft.Client/Common/GameRules/GameRuleDefinition.h index afec8fbc..ea7647bf 100644 --- a/Minecraft.Client/Common/GameRules/GameRuleDefinition.h +++ b/Minecraft.Client/Common/GameRules/GameRuleDefinition.h @@ -39,7 +39,7 @@ public: virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); - + virtual void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule); bool getComplete(GameRule *rule); @@ -53,8 +53,8 @@ public: // Here we should have functions for all the hooks, with a GameRule* as the first parameter virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z) { return false; } - virtual bool onCollectItem(GameRule *rule, shared_ptr item) { return false; } - virtual void postProcessPlayer(shared_ptr player) { } + virtual bool onCollectItem(GameRule *rule, std::shared_ptr item) { return false; } + virtual void postProcessPlayer(std::shared_ptr player) { } vector *enumerate(); unordered_map *enumerateMap(); diff --git a/Minecraft.Client/Common/GameRules/UpdatePlayerRuleDefinition.cpp b/Minecraft.Client/Common/GameRules/UpdatePlayerRuleDefinition.cpp index 6e55cd45..7ef8e577 100644 --- a/Minecraft.Client/Common/GameRules/UpdatePlayerRuleDefinition.cpp +++ b/Minecraft.Client/Common/GameRules/UpdatePlayerRuleDefinition.cpp @@ -11,7 +11,7 @@ UpdatePlayerRuleDefinition::UpdatePlayerRuleDefinition() { m_bUpdateHealth = m_bUpdateFood = m_bUpdateYRot = false;; m_health = 0; - m_food = 0; + m_food = 0; m_spawnPos = NULL; m_yRot = 0.0f; } @@ -130,7 +130,7 @@ void UpdatePlayerRuleDefinition::addAttribute(const wstring &attributeName, cons } } -void UpdatePlayerRuleDefinition::postProcessPlayer(shared_ptr player) +void UpdatePlayerRuleDefinition::postProcessPlayer(std::shared_ptr player) { if(m_bUpdateHealth) { diff --git a/Minecraft.Client/Common/GameRules/UpdatePlayerRuleDefinition.h b/Minecraft.Client/Common/GameRules/UpdatePlayerRuleDefinition.h index 538aefa1..f02ba848 100644 --- a/Minecraft.Client/Common/GameRules/UpdatePlayerRuleDefinition.h +++ b/Minecraft.Client/Common/GameRules/UpdatePlayerRuleDefinition.h @@ -13,7 +13,7 @@ private: bool m_bUpdateHealth, m_bUpdateFood, m_bUpdateYRot, m_bUpdateInventory; int m_health; - int m_food; + int m_food; Pos *m_spawnPos; float m_yRot; @@ -22,12 +22,12 @@ public: ~UpdatePlayerRuleDefinition(); virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_UpdatePlayerRule; } - + virtual void getChildren(vector *children); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); - virtual void postProcessPlayer(shared_ptr player); + virtual void postProcessPlayer(std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceContainer.cpp b/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceContainer.cpp index 8184f45b..25b7f6ab 100644 --- a/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceContainer.cpp +++ b/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceContainer.cpp @@ -22,7 +22,7 @@ XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer() // 4J-JEV: Super class handles attr-facing fine. //void XboxStructureActionPlaceContainer::writeAttributes(DataOutputStream *dos, UINT numAttrs) - + void XboxStructureActionPlaceContainer::getChildren(vector *children) { @@ -78,8 +78,8 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel(StructurePiece *st } level->setTile( worldX, worldY, worldZ, m_tile ); - shared_ptr container = dynamic_pointer_cast(level->getTileEntity( worldX, worldY, worldZ )); - + std::shared_ptr container = dynamic_pointer_cast(level->getTileEntity( worldX, worldY, worldZ )); + app.DebugPrintf("XboxStructureActionPlaceContainer - placing a container at (%d,%d,%d)\n", worldX, worldY, worldZ); if ( container != NULL ) { diff --git a/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp b/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp index 1eca3342..fcb8a018 100644 --- a/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp +++ b/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp @@ -54,7 +54,7 @@ bool XboxStructureActionPlaceSpawner::placeSpawnerInLevel(StructurePiece *struct } level->setTile( worldX, worldY, worldZ, m_tile ); - shared_ptr entity = dynamic_pointer_cast(level->getTileEntity( worldX, worldY, worldZ )); + std::shared_ptr entity = dynamic_pointer_cast(level->getTileEntity( worldX, worldY, worldZ )); #ifndef _CONTENT_PACKAGE wprintf(L"XboxStructureActionPlaceSpawner - placing a %ls spawner at (%d,%d,%d)\n", m_entityId.c_str(), worldX, worldY, worldZ); diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Network/GameNetworkManager.cpp index 5fd72e40..f52bd4e7 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Common/Network/GameNetworkManager.cpp @@ -316,7 +316,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame return false; } - connection->send( shared_ptr( new PreLoginPacket(minecraft->user->name) ) ); + connection->send( std::shared_ptr( new PreLoginPacket(minecraft->user->name) ) ); // Tick connection until we're ready to go. The stages involved in this are: // (1) Creating the ClientConnection sends a prelogin packet to the server @@ -403,7 +403,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame // Open the socket on the server end to accept incoming data Socket::addIncomingSocket(socket); - connection->send( shared_ptr( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) ); + connection->send( std::shared_ptr( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) ); createdConnections.push_back( connection ); @@ -1134,7 +1134,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) PlayerList *players = pServer->getPlayers(); for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it) { - shared_ptr servPlayer = *it; + std::shared_ptr servPlayer = *it; if( servPlayer->connection->isLocal() && !servPlayer->connection->isGuest() ) { servPlayer->connection->connection->getSocket()->setPlayer(NULL); @@ -1202,7 +1202,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) PlayerList *players = pServer->getPlayers(); for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it) { - shared_ptr servPlayer = *it; + std::shared_ptr servPlayer = *it; if( servPlayer->getXuid() == localPlayerXuid ) { servPlayer->connection->connection->getSocket()->setPlayer( g_NetworkManager.GetLocalPlayerByUserIndex(index) ); @@ -1391,7 +1391,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc Minecraft *pMinecraft = Minecraft::GetInstance(); Socket *socket = NULL; - shared_ptr mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()]; + std::shared_ptr mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()]; if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL) { // If we already have a MultiplayerLocalPlayer here then we are doing a session type change @@ -1428,7 +1428,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc if( connection->createdOk ) { - connection->send( shared_ptr( new PreLoginPacket( pNetworkPlayer->GetOnlineName() ) ) ); + connection->send( std::shared_ptr( new PreLoginPacket( pNetworkPlayer->GetOnlineName() ) ) ); pMinecraft->addPendingLocalConnection(idx, connection); } else diff --git a/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.cpp b/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.cpp index f01db84e..f495cca0 100644 --- a/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.cpp +++ b/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.cpp @@ -24,7 +24,7 @@ ChangeStateConstraint::ChangeStateConstraint( Tutorial *tutorial, eTutorial_Stat m_tutorial = tutorial; m_targetState = targetState; m_sourceStatesCount = sourceStatesCount; - + m_bHasChanged = false; m_changedFromState = e_Tutorial_State_None; @@ -59,11 +59,11 @@ void ChangeStateConstraint::tick(int iPad) if(originalPrivileges != playerPrivs) { // Send update settings packet to server - Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = minecraft->localplayers[iPad]; + Minecraft *pMinecraft = Minecraft::GetInstance(); + std::shared_ptr player = minecraft->localplayers[iPad]; if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL) { - player->connection->send( shared_ptr( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); + player->connection->send( std::shared_ptr( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); } } } @@ -100,11 +100,11 @@ void ChangeStateConstraint::tick(int iPad) if(originalPrivileges != playerPrivs) { // Send update settings packet to server - Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = minecraft->localplayers[iPad]; + Minecraft *pMinecraft = Minecraft::GetInstance(); + std::shared_ptr player = minecraft->localplayers[iPad]; if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL) { - player->connection->send( shared_ptr( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); + player->connection->send( std::shared_ptr( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); } } } @@ -124,11 +124,11 @@ void ChangeStateConstraint::tick(int iPad) if(originalPrivileges != playerPrivs) { // Send update settings packet to server - Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = minecraft->localplayers[iPad]; + Minecraft *pMinecraft = Minecraft::GetInstance(); + std::shared_ptr player = minecraft->localplayers[iPad]; if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL) { - player->connection->send( shared_ptr( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); + player->connection->send( std::shared_ptr( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); } } } diff --git a/Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp b/Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp index 43b2f7f3..fbd6ddf3 100644 --- a/Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp +++ b/Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp @@ -4,7 +4,7 @@ CompleteUsingItemTask::CompleteUsingItemTask(Tutorial *tutorial, int descriptionId, int itemIds[], unsigned int itemIdsLength, bool enablePreCompletion) : TutorialTask( tutorial, descriptionId, enablePreCompletion, NULL) -{ +{ m_iValidItemsA= new int [itemIdsLength]; for(int i=0;i item) +void CompleteUsingItemTask::completeUsingItem(std::shared_ptr item) { if(!hasBeenActivated() && !isPreCompletionEnabled()) return; for(int i=0;i item); + virtual void completeUsingItem(std::shared_ptr item); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/Tutorial/CraftTask.cpp b/Minecraft.Client/Common/Tutorial/CraftTask.cpp index 6749d030..ca462aa5 100644 --- a/Minecraft.Client/Common/Tutorial/CraftTask.cpp +++ b/Minecraft.Client/Common/Tutorial/CraftTask.cpp @@ -40,7 +40,7 @@ CraftTask::~CraftTask() delete[] m_auxValues; } -void CraftTask::onCrafted(shared_ptr item) +void CraftTask::onCrafted(std::shared_ptr item) { #ifndef _CONTENT_PACKAGE wprintf(L"CraftTask::onCrafted - %ls\n", item->toString().c_str() ); diff --git a/Minecraft.Client/Common/Tutorial/CraftTask.h b/Minecraft.Client/Common/Tutorial/CraftTask.h index 1496f07a..c841c96b 100644 --- a/Minecraft.Client/Common/Tutorial/CraftTask.h +++ b/Minecraft.Client/Common/Tutorial/CraftTask.h @@ -14,7 +14,7 @@ public: ~CraftTask(); virtual bool isCompleted() { return bIsCompleted; } - virtual void onCrafted(shared_ptr item); + virtual void onCrafted(std::shared_ptr item); private: int *m_items; diff --git a/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp b/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp index 1367f411..fcfec29d 100644 --- a/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp +++ b/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp @@ -20,7 +20,7 @@ DiggerItemHint::DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descri tutorial->addMessage(IDS_TUTORIAL_HINT_ATTACK_WITH_TOOL, true); } -int DiggerItemHint::startDestroyBlock(shared_ptr item, Tile *tile) +int DiggerItemHint::startDestroyBlock(std::shared_ptr item, Tile *tile) { if(item != NULL) { @@ -46,7 +46,7 @@ int DiggerItemHint::startDestroyBlock(shared_ptr item, Tile *tile) return -1; } -int DiggerItemHint::attack(shared_ptr item, shared_ptr entity) +int DiggerItemHint::attack(std::shared_ptr item, std::shared_ptr entity) { if(item != NULL) { diff --git a/Minecraft.Client/Common/Tutorial/DiggerItemHint.h b/Minecraft.Client/Common/Tutorial/DiggerItemHint.h index cb71742e..b23a8be3 100644 --- a/Minecraft.Client/Common/Tutorial/DiggerItemHint.h +++ b/Minecraft.Client/Common/Tutorial/DiggerItemHint.h @@ -13,6 +13,6 @@ private: public: DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, int items[], unsigned int itemsLength); - virtual int startDestroyBlock(shared_ptr item, Tile *tile); - virtual int attack(shared_ptr item, shared_ptr entity); + virtual int startDestroyBlock(std::shared_ptr item, Tile *tile); + virtual int attack(std::shared_ptr item, std::shared_ptr entity); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/Tutorial/PickupTask.cpp b/Minecraft.Client/Common/Tutorial/PickupTask.cpp index 00bc9d1f..742ed08c 100644 --- a/Minecraft.Client/Common/Tutorial/PickupTask.cpp +++ b/Minecraft.Client/Common/Tutorial/PickupTask.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "PickupTask.h" -void PickupTask::onTake(shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) +void PickupTask::onTake(std::shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { if(item->id == m_itemId) { diff --git a/Minecraft.Client/Common/Tutorial/PickupTask.h b/Minecraft.Client/Common/Tutorial/PickupTask.h index 68e1d479..26ef3a21 100644 --- a/Minecraft.Client/Common/Tutorial/PickupTask.h +++ b/Minecraft.Client/Common/Tutorial/PickupTask.h @@ -17,7 +17,7 @@ public: {} virtual bool isCompleted() { return bIsCompleted; } - virtual void onTake(shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux); + virtual void onTake(std::shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux); private: int m_itemId; diff --git a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.cpp b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.cpp index 8603f765..39daa72a 100644 --- a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.cpp +++ b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.cpp @@ -111,7 +111,7 @@ bool ProcedureCompoundTask::isCompleted() return allCompleted; } -void ProcedureCompoundTask::onCrafted(shared_ptr item) +void ProcedureCompoundTask::onCrafted(std::shared_ptr item) { AUTO_VAR(itEnd, m_taskSequence.end()); for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) @@ -222,7 +222,7 @@ bool ProcedureCompoundTask::AllowFade() return allowFade; } -void ProcedureCompoundTask::useItemOn(Level *level, shared_ptr item, int x, int y, int z,bool bTestUseOnly) +void ProcedureCompoundTask::useItemOn(Level *level, std::shared_ptr item, int x, int y, int z,bool bTestUseOnly) { AUTO_VAR(itEnd, m_taskSequence.end()); for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) @@ -232,7 +232,7 @@ void ProcedureCompoundTask::useItemOn(Level *level, shared_ptr ite } } -void ProcedureCompoundTask::useItem(shared_ptr item, bool bTestUseOnly) +void ProcedureCompoundTask::useItem(std::shared_ptr item, bool bTestUseOnly) { AUTO_VAR(itEnd, m_taskSequence.end()); for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) @@ -242,7 +242,7 @@ void ProcedureCompoundTask::useItem(shared_ptr item, bool bTestUse } } -void ProcedureCompoundTask::onTake(shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) +void ProcedureCompoundTask::onTake(std::shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { AUTO_VAR(itEnd, m_taskSequence.end()); for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it) diff --git a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h index 36b32798..e60bcfb0 100644 --- a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h +++ b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h @@ -18,7 +18,7 @@ public: virtual int getDescriptionId(); virtual int getPromptId(); virtual bool isCompleted(); - virtual void onCrafted(shared_ptr item); + virtual void onCrafted(std::shared_ptr item); virtual void handleUIInput(int iAction); virtual void setAsCurrentTask(bool active = true); virtual bool ShowMinimumTime(); @@ -26,9 +26,9 @@ public: virtual void setShownForMinimumTime(); virtual bool AllowFade(); - virtual void useItemOn(Level *level, shared_ptr item, int x, int y, int z, bool bTestUseOnly=false); - virtual void useItem(shared_ptr item, bool bTestUseOnly=false); - virtual void onTake(shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux); + virtual void useItemOn(Level *level, std::shared_ptr item, int x, int y, int z, bool bTestUseOnly=false); + virtual void useItem(std::shared_ptr item, bool bTestUseOnly=false); + virtual void onTake(std::shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux); virtual void onStateChange(eTutorial_State newState); private: diff --git a/Minecraft.Client/Common/Tutorial/TakeItemHint.cpp b/Minecraft.Client/Common/Tutorial/TakeItemHint.cpp index a1a5c37a..5a5c0ea5 100644 --- a/Minecraft.Client/Common/Tutorial/TakeItemHint.cpp +++ b/Minecraft.Client/Common/Tutorial/TakeItemHint.cpp @@ -17,7 +17,7 @@ TakeItemHint::TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], u } } -bool TakeItemHint::onTake(shared_ptr item) +bool TakeItemHint::onTake(std::shared_ptr item) { if(item != NULL) { diff --git a/Minecraft.Client/Common/Tutorial/TakeItemHint.h b/Minecraft.Client/Common/Tutorial/TakeItemHint.h index f001d4c7..25d43eac 100644 --- a/Minecraft.Client/Common/Tutorial/TakeItemHint.h +++ b/Minecraft.Client/Common/Tutorial/TakeItemHint.h @@ -15,5 +15,5 @@ public: TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], unsigned int itemsLength); ~TakeItemHint(); - virtual bool onTake( shared_ptr item ); + virtual bool onTake( std::shared_ptr item ); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/Tutorial/Tutorial.cpp b/Minecraft.Client/Common/Tutorial/Tutorial.cpp index f7e44b17..fa865b90 100644 --- a/Minecraft.Client/Common/Tutorial/Tutorial.cpp +++ b/Minecraft.Client/Common/Tutorial/Tutorial.cpp @@ -1681,7 +1681,7 @@ void Tutorial::showTutorialPopup(bool show) } } -void Tutorial::useItemOn(Level *level, shared_ptr item, int x, int y, int z, bool bTestUseOnly) +void Tutorial::useItemOn(Level *level, std::shared_ptr item, int x, int y, int z, bool bTestUseOnly) { for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it) { @@ -1690,7 +1690,7 @@ void Tutorial::useItemOn(Level *level, shared_ptr item, int x, int } } -void Tutorial::useItemOn(shared_ptr item, bool bTestUseOnly) +void Tutorial::useItemOn(std::shared_ptr item, bool bTestUseOnly) { for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it) { @@ -1699,7 +1699,7 @@ void Tutorial::useItemOn(shared_ptr item, bool bTestUseOnly) } } -void Tutorial::completeUsingItem(shared_ptr item) +void Tutorial::completeUsingItem(std::shared_ptr item) { for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it) { @@ -1718,7 +1718,7 @@ void Tutorial::completeUsingItem(shared_ptr item) } } -void Tutorial::startDestroyBlock(shared_ptr item, Tile *tile) +void Tutorial::startDestroyBlock(std::shared_ptr item, Tile *tile) { int hintNeeded = -1; for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it) @@ -1754,7 +1754,7 @@ void Tutorial::destroyBlock(Tile *tile) } } -void Tutorial::attack(shared_ptr player, shared_ptr entity) +void Tutorial::attack(std::shared_ptr player, std::shared_ptr entity) { int hintNeeded = -1; for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it) @@ -1772,7 +1772,7 @@ void Tutorial::attack(shared_ptr player, shared_ptr entity) } } -void Tutorial::itemDamaged(shared_ptr item) +void Tutorial::itemDamaged(std::shared_ptr item) { int hintNeeded = -1; for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it) @@ -1803,7 +1803,7 @@ void Tutorial::handleUIInput(int iAction) currentTask[m_CurrentState]->handleUIInput(iAction); } -void Tutorial::createItemSelected(shared_ptr item, bool canMake) +void Tutorial::createItemSelected(std::shared_ptr item, bool canMake) { int hintNeeded = -1; for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it) @@ -1821,7 +1821,7 @@ void Tutorial::createItemSelected(shared_ptr item, bool canMake) } } -void Tutorial::onCrafted(shared_ptr item) +void Tutorial::onCrafted(std::shared_ptr item) { for(unsigned int state = 0; state < e_Tutorial_State_Max; ++state) { @@ -1833,7 +1833,7 @@ void Tutorial::onCrafted(shared_ptr item) } } -void Tutorial::onTake(shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) +void Tutorial::onTake(std::shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { if( !m_hintDisplayed ) { @@ -1860,7 +1860,7 @@ void Tutorial::onTake(shared_ptr item, unsigned int invItemCountAn } } -void Tutorial::onSelectedItemChanged(shared_ptr item) +void Tutorial::onSelectedItemChanged(std::shared_ptr item) { // We only handle this if we are in a state that allows changing based on the selected item // Menus and states like riding in a minecart will NOT allow this diff --git a/Minecraft.Client/Common/Tutorial/Tutorial.h b/Minecraft.Client/Common/Tutorial/Tutorial.h index aaaaba0a..e942ff32 100644 --- a/Minecraft.Client/Common/Tutorial/Tutorial.h +++ b/Minecraft.Client/Common/Tutorial/Tutorial.h @@ -11,7 +11,7 @@ using namespace std; // #define TUTORIAL_MINIMUM_DISPLAY_MESSAGE_TIME 2000 // #define TUTORIAL_REMINDER_TIME (TUTORIAL_DISPLAY_MESSAGE_TIME + 20000) // #define TUTORIAL_CONSTRAINT_DELAY_REMOVE_TICKS 15 -// +// // // 0-24000 // #define TUTORIAL_FREEZE_TIME_VALUE 8000 @@ -151,19 +151,19 @@ public: void showTutorialPopup(bool show); - void useItemOn(Level *level, shared_ptr item, int x, int y, int z,bool bTestUseOnly=false); - void useItemOn(shared_ptr item, bool bTestUseOnly=false); - void completeUsingItem(shared_ptr item); - void startDestroyBlock(shared_ptr item, Tile *tile); + void useItemOn(Level *level, std::shared_ptr item, int x, int y, int z,bool bTestUseOnly=false); + void useItemOn(std::shared_ptr item, bool bTestUseOnly=false); + void completeUsingItem(std::shared_ptr item); + void startDestroyBlock(std::shared_ptr item, Tile *tile); void destroyBlock(Tile *tile); - void attack(shared_ptr player, shared_ptr entity); - void itemDamaged(shared_ptr item); + void attack(std::shared_ptr player, std::shared_ptr entity); + void itemDamaged(std::shared_ptr item); void handleUIInput(int iAction); - void createItemSelected(shared_ptr item, bool canMake); - void onCrafted(shared_ptr item); - void onTake(shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux); - void onSelectedItemChanged(shared_ptr item); + void createItemSelected(std::shared_ptr item, bool canMake); + void onCrafted(std::shared_ptr item); + void onTake(std::shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux); + void onSelectedItemChanged(std::shared_ptr item); void onLookAt(int id, int iData=0); void onLookAtEntity(eINSTANCEOF type); void onEffectChanged(MobEffect *effect, bool bRemoved=false); diff --git a/Minecraft.Client/Common/Tutorial/TutorialHint.cpp b/Minecraft.Client/Common/Tutorial/TutorialHint.cpp index 5f0808bf..ecd6fe29 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialHint.cpp +++ b/Minecraft.Client/Common/Tutorial/TutorialHint.cpp @@ -7,14 +7,14 @@ #include "..\..\Minecraft.h" #include "..\..\MultiplayerLocalPlayer.h" -TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, eHintType type, bool allowFade /*= true*/) +TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, eHintType type, bool allowFade /*= true*/) : m_id( id ), m_tutorial(tutorial), m_descriptionId( descriptionId ), m_type( type ), m_counter( 0 ), m_lastTile( NULL ), m_hintNeeded( true ), m_allowFade(allowFade) { tutorial->addMessage(descriptionId, type != e_Hint_NoIngredients); } -int TutorialHint::startDestroyBlock(shared_ptr item, Tile *tile) +int TutorialHint::startDestroyBlock(std::shared_ptr item, Tile *tile) { int returnVal = -1; switch(m_type) @@ -59,7 +59,7 @@ int TutorialHint::destroyBlock(Tile *tile) return returnVal; } -int TutorialHint::attack(shared_ptr item, shared_ptr entity) +int TutorialHint::attack(std::shared_ptr item, std::shared_ptr entity) { /* switch(m_type) @@ -71,7 +71,7 @@ int TutorialHint::attack(shared_ptr item, shared_ptr entit return -1; } -int TutorialHint::createItemSelected(shared_ptr item, bool canMake) +int TutorialHint::createItemSelected(std::shared_ptr item, bool canMake) { int returnVal = -1; switch(m_type) @@ -86,7 +86,7 @@ int TutorialHint::createItemSelected(shared_ptr item, bool canMake return returnVal; } -int TutorialHint::itemDamaged(shared_ptr item) +int TutorialHint::itemDamaged(std::shared_ptr item) { int returnVal = -1; switch(m_type) @@ -100,7 +100,7 @@ int TutorialHint::itemDamaged(shared_ptr item) return returnVal; } -bool TutorialHint::onTake( shared_ptr item ) +bool TutorialHint::onTake( std::shared_ptr item ) { return false; } @@ -121,7 +121,7 @@ int TutorialHint::tick() switch(m_type) { case e_Hint_SwimUp: - if( Minecraft::GetInstance()->localplayers[m_tutorial->getPad()]->isUnderLiquid(Material::water) ) returnVal = m_descriptionId; + if( Minecraft::GetInstance()->localplayers[m_tutorial->getPad()]->isUnderLiquid(Material::water) ) returnVal = m_descriptionId; break; } return returnVal; diff --git a/Minecraft.Client/Common/Tutorial/TutorialHint.h b/Minecraft.Client/Common/Tutorial/TutorialHint.h index 8ca543cc..8c33156f 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialHint.h +++ b/Minecraft.Client/Common/Tutorial/TutorialHint.h @@ -10,7 +10,7 @@ class Tutorial; class TutorialHint { -public: +public: enum eHintType { e_Hint_DiggerItem, @@ -40,12 +40,12 @@ public: eTutorial_Hint getId() { return m_id; } - virtual int startDestroyBlock(shared_ptr item, Tile *tile); + virtual int startDestroyBlock(std::shared_ptr item, Tile *tile); virtual int destroyBlock(Tile *tile); - virtual int attack(shared_ptr item, shared_ptr entity); - virtual int createItemSelected(shared_ptr item, bool canMake); - virtual int itemDamaged(shared_ptr item); - virtual bool onTake( shared_ptr item ); + virtual int attack(std::shared_ptr item, std::shared_ptr entity); + virtual int createItemSelected(std::shared_ptr item, bool canMake); + virtual int itemDamaged(std::shared_ptr item); + virtual bool onTake( std::shared_ptr item ); virtual bool onLookAt(int id, int iData=0); virtual bool onLookAtEntity(eINSTANCEOF type); virtual int tick(); diff --git a/Minecraft.Client/Common/Tutorial/TutorialMode.cpp b/Minecraft.Client/Common/Tutorial/TutorialMode.cpp index 82c81598..774e9c73 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialMode.cpp +++ b/Minecraft.Client/Common/Tutorial/TutorialMode.cpp @@ -36,7 +36,7 @@ bool TutorialMode::destroyBlock(int x, int y, int z, int face) int t = minecraft->level->getTile(x, y, z); tutorial->destroyBlock(Tile::tiles[t]); } - shared_ptr item = minecraft->player->getSelectedItem(); + std::shared_ptr item = minecraft->player->getSelectedItem(); int damageBefore; if(item != NULL) { @@ -47,7 +47,7 @@ bool TutorialMode::destroyBlock(int x, int y, int z, int face) if(!tutorial->m_allTutorialsComplete) { if ( item != NULL && item->isDamageableItem() ) - { + { int max = item->getMaxDamage(); int damageNow = item->getDamageValue(); @@ -78,7 +78,7 @@ void TutorialMode::tick() */ } -bool TutorialMode::useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem) +bool TutorialMode::useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem) { bool haveItem = false; int itemCount = 0; @@ -87,7 +87,7 @@ bool TutorialMode::useItemOn(shared_ptr player, Level *level, shared_ptr tutorial->useItemOn(level, item, x, y, z, bTestUseOnly); if(!bTestUseOnly) - { + { if(item != NULL) { haveItem = true; @@ -110,7 +110,7 @@ bool TutorialMode::useItemOn(shared_ptr player, Level *level, shared_ptr return result; } -void TutorialMode::attack(shared_ptr player, shared_ptr entity) +void TutorialMode::attack(std::shared_ptr player, std::shared_ptr entity) { if(!tutorial->m_allTutorialsComplete) tutorial->attack(player, entity); diff --git a/Minecraft.Client/Common/Tutorial/TutorialMode.h b/Minecraft.Client/Common/Tutorial/TutorialMode.h index 75e24edf..330b0d51 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialMode.h +++ b/Minecraft.Client/Common/Tutorial/TutorialMode.h @@ -19,8 +19,8 @@ public: virtual void startDestroyBlock(int x, int y, int z, int face); virtual bool destroyBlock(int x, int y, int z, int face); virtual void tick(); - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL); - virtual void attack(shared_ptr player, shared_ptr entity); + virtual bool useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL); + virtual void attack(std::shared_ptr player, std::shared_ptr entity); virtual bool isInputAllowed(int mapping); diff --git a/Minecraft.Client/Common/Tutorial/TutorialTask.h b/Minecraft.Client/Common/Tutorial/TutorialTask.h index 92cb5999..adeaab6d 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialTask.h +++ b/Minecraft.Client/Common/Tutorial/TutorialTask.h @@ -26,7 +26,7 @@ protected: bool m_bAllowFade; bool m_bTaskReminders; bool m_bShowMinimumTime; - + protected: bool bIsCompleted; bool m_bShownForMinimumTime; @@ -43,7 +43,7 @@ public: virtual eTutorial_CompletionAction getCompletionAction() { return e_Tutorial_Completion_None; } virtual bool isPreCompletionEnabled() { return enablePreCompletion; } virtual void taskCompleted(); - virtual void enableConstraints(bool enable, bool delayRemove = false); + virtual void enableConstraints(bool enable, bool delayRemove = false); virtual void setAsCurrentTask(bool active = true); virtual void setShownForMinimumTime() { m_bShownForMinimumTime = true; } @@ -52,12 +52,12 @@ public: bool TaskReminders() { return m_bTaskReminders;} virtual bool ShowMinimumTime() { return m_bShowMinimumTime;} - virtual void useItemOn(Level *level, shared_ptr item, int x, int y, int z, bool bTestUseOnly=false) { } - virtual void useItem(shared_ptr item,bool bTestUseOnly=false) { } - virtual void completeUsingItem(shared_ptr item) { } + virtual void useItemOn(Level *level, std::shared_ptr item, int x, int y, int z, bool bTestUseOnly=false) { } + virtual void useItem(std::shared_ptr item,bool bTestUseOnly=false) { } + virtual void completeUsingItem(std::shared_ptr item) { } virtual void handleUIInput(int iAction) { } - virtual void onCrafted(shared_ptr item) { } - virtual void onTake(shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { } + virtual void onCrafted(std::shared_ptr item) { } + virtual void onTake(std::shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { } virtual void onStateChange(eTutorial_State newState) { } virtual void onEffectChanged(MobEffect *effect, bool bRemoved=false) { } }; \ No newline at end of file diff --git a/Minecraft.Client/Common/Tutorial/UseItemTask.cpp b/Minecraft.Client/Common/Tutorial/UseItemTask.cpp index 09bac4d1..8f53f14d 100644 --- a/Minecraft.Client/Common/Tutorial/UseItemTask.cpp +++ b/Minecraft.Client/Common/Tutorial/UseItemTask.cpp @@ -16,7 +16,7 @@ bool UseItemTask::isCompleted() return bIsCompleted; } -void UseItemTask::useItem(shared_ptr item,bool bTestUseOnly) +void UseItemTask::useItem(std::shared_ptr item,bool bTestUseOnly) { if(bTestUseOnly) return; diff --git a/Minecraft.Client/Common/Tutorial/UseItemTask.h b/Minecraft.Client/Common/Tutorial/UseItemTask.h index 46d71be4..2982412e 100644 --- a/Minecraft.Client/Common/Tutorial/UseItemTask.h +++ b/Minecraft.Client/Common/Tutorial/UseItemTask.h @@ -16,5 +16,5 @@ public: UseItemTask(const int itemId, Tutorial *tutorial, int descriptionId, bool enablePreCompletion = false, vector *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true ); virtual bool isCompleted(); - virtual void useItem(shared_ptr item, bool bTestUseOnly=false); + virtual void useItem(std::shared_ptr item, bool bTestUseOnly=false); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/Tutorial/UseTileTask.cpp b/Minecraft.Client/Common/Tutorial/UseTileTask.cpp index 1f4ed4cb..57e67cad 100644 --- a/Minecraft.Client/Common/Tutorial/UseTileTask.cpp +++ b/Minecraft.Client/Common/Tutorial/UseTileTask.cpp @@ -25,7 +25,7 @@ bool UseTileTask::isCompleted() return bIsCompleted; } -void UseTileTask::useItemOn(Level *level, shared_ptr item, int x, int y, int z,bool bTestUseOnly) +void UseTileTask::useItemOn(Level *level, std::shared_ptr item, int x, int y, int z,bool bTestUseOnly) { if(bTestUseOnly) return; diff --git a/Minecraft.Client/Common/Tutorial/UseTileTask.h b/Minecraft.Client/Common/Tutorial/UseTileTask.h index 74b3a40c..b20c4b84 100644 --- a/Minecraft.Client/Common/Tutorial/UseTileTask.h +++ b/Minecraft.Client/Common/Tutorial/UseTileTask.h @@ -20,5 +20,5 @@ public: UseTileTask(const int tileId, Tutorial *tutorial, int descriptionId, bool enablePreCompletion = false, vector *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true); virtual bool isCompleted(); - virtual void useItemOn(Level *level, shared_ptr item, int x, int y, int z, bool bTestUseOnly=false); + virtual void useItemOn(Level *level, std::shared_ptr item, int x, int y, int z, bool bTestUseOnly=false); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp index 29ddcf71..2bdf8ae9 100644 --- a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp @@ -73,7 +73,7 @@ void IUIScene_AbstractContainerMenu::Initialize(int iPad, AbstractContainerMenu* m_iCurrSlotX = 0; m_iCurrSlotY = 0; #endif // TAP_DETECTION - // + // // for(int i=0;itouch[0].x)-m_oldvTouchPos.x) * m_fTouchPadMulX; float fNewY=(((float)pTouchPadData->touch[0].y)-m_oldvTouchPos.y) * m_fTouchPadMulY; - // relative positions - needs a deadzone + // relative positions - needs a deadzone if(fNewX>m_fTouchPadDeadZoneX) { @@ -320,11 +320,11 @@ void IUIScene_AbstractContainerMenu::onMouseTick() if(fNewY>m_fTouchPadDeadZoneY) { - vPointerPos.y=m_oldvPointerPos.y+((fNewY-m_fTouchPadDeadZoneY)*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f)); + vPointerPos.y=m_oldvPointerPos.y+((fNewY-m_fTouchPadDeadZoneY)*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f)); } else if(fNewY<-m_fTouchPadDeadZoneY) { - vPointerPos.y=m_oldvPointerPos.y+((fNewY+m_fTouchPadDeadZoneY)*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f)); + vPointerPos.y=m_oldvPointerPos.y+((fNewY+m_fTouchPadDeadZoneY)*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f)); } // Clamp to pointer extents. @@ -334,7 +334,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() else if ( vPointerPos.y > m_fPointerMaxY ) vPointerPos.y = m_fPointerMaxY; bStickInput = true; - m_eCurrTapState=eTapStateNoInput; + m_eCurrTapState=eTapStateNoInput; } else { @@ -408,7 +408,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() fInputX *= fInputScale; fInputY *= fInputScale; -#ifdef USE_POINTER_ACCEL +#ifdef USE_POINTER_ACCEL m_fPointerAccelX += fInputX / 50.0f; m_fPointerAccelY += fInputY / 50.0f; @@ -451,12 +451,12 @@ void IUIScene_AbstractContainerMenu::onMouseTick() else { m_iConsectiveInputTicks = 0; -#ifdef USE_POINTER_ACCEL +#ifdef USE_POINTER_ACCEL m_fPointerVelX = 0.0f; m_fPointerVelY = 0.0f; m_fPointerAccelX = 0.0f; m_fPointerAccelY = 0.0f; -#endif +#endif } #ifdef __ORBIS__ @@ -501,7 +501,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() ( vPointerPos.y >= sectionPos.y ) && ( vPointerPos.y <= itemMax.y ) ) { // Pointer is over this control! - eSectionUnderPointer = eSection; + eSectionUnderPointer = eSection; vSnapPos.x = itemPos.x + ( itemSize.x / 2.0f ); vSnapPos.y = itemPos.y + ( itemSize.y / 2.0f ); @@ -590,7 +590,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() } // If we are not over any slot, set focus elsewhere. - if ( eSectionUnderPointer == eSectionNone ) + if ( eSectionUnderPointer == eSectionNone ) { setFocusToPointer( getPad() ); #ifdef TAP_DETECTION @@ -704,11 +704,11 @@ void IUIScene_AbstractContainerMenu::onMouseTick() // Determine appropriate context sensitive tool tips, based on what is carried on the pointer and what is under the pointer. // What are we carrying on pointer. - shared_ptr player = Minecraft::GetInstance()->localplayers[getPad()]; - shared_ptr carriedItem = nullptr; + std::shared_ptr player = Minecraft::GetInstance()->localplayers[getPad()]; + std::shared_ptr carriedItem = nullptr; if(player != NULL) carriedItem = player->inventory->getCarried(); - shared_ptr slotItem = nullptr; + std::shared_ptr slotItem = nullptr; Slot *slot = NULL; int slotIndex = 0; if(bPointerIsOverSlot) @@ -790,7 +790,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() if ( bSlotHasItem ) { // Item in hand and item in slot ... is item in slot the same as in out hand? If so, can we stack on to it? - if ( bCarriedIsSameAsSlot ) + if ( bCarriedIsSameAsSlot ) { // Can we stack more into this slot? if ( iSlotStackSizeRemaining == 0 ) @@ -889,7 +889,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() if((eSectionUnderPointer==eSectionInventoryUsing)||(eSectionUnderPointer==eSectionInventoryInventory)) { - shared_ptr item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); + std::shared_ptr item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); ArmorRecipes::_eArmorType eArmourType=ArmorRecipes::GetArmorType(item->id); if(eArmourType==ArmorRecipes::eArmorType_None) @@ -919,7 +919,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() else { buttonY = eToolTipQuickMove; - } + } break; case ArmorRecipes::eArmorType_Leggings: if(isSlotEmpty(eSectionInventoryArmor,2)) @@ -952,7 +952,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() else if((eSectionUnderPointer==eSectionFurnaceUsing)||(eSectionUnderPointer==eSectionFurnaceInventory)) { // Get the info on this item. - shared_ptr item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); + std::shared_ptr item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); bool bValidFuel = FurnaceTileEntity::isFuel(item); bool bValidIngredient = FurnaceRecipes::getInstance()->getResult(item->getItem()->id) != NULL; @@ -962,7 +962,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() if(!isSlotEmpty(eSectionFurnaceIngredient,0)) { // is it the same as this item - shared_ptr IngredientItem = getSlotItem(eSectionFurnaceIngredient,0); + std::shared_ptr IngredientItem = getSlotItem(eSectionFurnaceIngredient,0); if(IngredientItem->id == item->id) { buttonY = eToolTipQuickMoveIngredient; @@ -991,7 +991,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() if(!isSlotEmpty(eSectionFurnaceFuel,0)) { // is it the same as this item - shared_ptr fuelItem = getSlotItem(eSectionFurnaceFuel,0); + std::shared_ptr fuelItem = getSlotItem(eSectionFurnaceFuel,0); if(fuelItem->id == item->id) { buttonY = eToolTipQuickMoveFuel; @@ -1002,7 +1002,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() if(!isSlotEmpty(eSectionFurnaceIngredient,0)) { // is it the same as this item - shared_ptr IngredientItem = getSlotItem(eSectionFurnaceIngredient,0); + std::shared_ptr IngredientItem = getSlotItem(eSectionFurnaceIngredient,0); if(IngredientItem->id == item->id) { buttonY = eToolTipQuickMoveIngredient; @@ -1044,7 +1044,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() else if((eSectionUnderPointer==eSectionBrewingUsing)||(eSectionUnderPointer==eSectionBrewingInventory)) { // Get the info on this item. - shared_ptr item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); + std::shared_ptr item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); int iId=item->id; // valid ingredient? @@ -1062,7 +1062,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() if(!isSlotEmpty(eSectionBrewingIngredient,0)) { // is it the same as this item - shared_ptr IngredientItem = getSlotItem(eSectionBrewingIngredient,0); + std::shared_ptr IngredientItem = getSlotItem(eSectionBrewingIngredient,0); if(IngredientItem->id == item->id) { buttonY = eToolTipQuickMoveIngredient; @@ -1077,15 +1077,15 @@ void IUIScene_AbstractContainerMenu::onMouseTick() // ingredient slot empty buttonY = eToolTipQuickMoveIngredient; } - } + } else { // valid potion? Glass bottle with water in it is a 'potion' too. if(iId==Item::potion_Id) { // space available? - if(isSlotEmpty(eSectionBrewingBottle1,0) || - isSlotEmpty(eSectionBrewingBottle2,0) || + if(isSlotEmpty(eSectionBrewingBottle1,0) || + isSlotEmpty(eSectionBrewingBottle2,0) || isSlotEmpty(eSectionBrewingBottle3,0)) { buttonY = eToolTipQuickMoveIngredient; @@ -1104,7 +1104,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() else if((eSectionUnderPointer==eSectionEnchantUsing)||(eSectionUnderPointer==eSectionEnchantInventory)) { // Get the info on this item. - shared_ptr item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); + std::shared_ptr item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); int iId=item->id; // valid enchantable tool? @@ -1112,8 +1112,8 @@ void IUIScene_AbstractContainerMenu::onMouseTick() { // is there already something in the ingredient slot? if(isSlotEmpty(eSectionEnchantSlot,0)) - { - // tool slot empty + { + // tool slot empty switch(iId) { case Item::bow_Id: @@ -1155,7 +1155,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() buttonY = eToolTipQuickMove; break; default: - buttonY=eToolTipQuickMoveTool; + buttonY=eToolTipQuickMoveTool; break; } } @@ -1163,10 +1163,10 @@ void IUIScene_AbstractContainerMenu::onMouseTick() { buttonY = eToolTipQuickMove; } - } + } else { - buttonY=eToolTipQuickMove; + buttonY=eToolTipQuickMove; } } else @@ -1199,7 +1199,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() SetPointerOutsideMenu( false ); } - shared_ptr item = nullptr; + std::shared_ptr item = nullptr; if(bPointerIsOverSlot && bSlotHasItem) item = getSlotItem(eSectionUnderPointer, iNewSlotIndex); overrideTooltips(eSectionUnderPointer, item, bIsItemCarried, bSlotHasItem, bCarriedIsSameAsSlot, iSlotStackSizeRemaining, buttonA, buttonX, buttonY, buttonRT); @@ -1358,7 +1358,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b } else { - ui.CloseUIScenes(iPad); + ui.CloseUIScenes(iPad); } bHandled = true; @@ -1410,7 +1410,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b bool bSlotHasItem = !isSlotEmpty(m_eCurrSection, currentIndex); if ( bSlotHasItem ) { - shared_ptr item = getSlotItem(m_eCurrSection, currentIndex); + std::shared_ptr item = getSlotItem(m_eCurrSection, currentIndex); if( Minecraft::GetInstance()->localgameModes[iPad] != NULL ) { Tutorial::PopupMessageDetails *message = new Tutorial::PopupMessageDetails; @@ -1456,7 +1456,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b { handleOutsideClicked(iPad, buttonNum, quickKeyHeld); } - else // + else // { // over empty space or something else??? handleOtherClicked(iPad,m_eCurrSection,buttonNum,quickKeyHeld?true:false); @@ -1569,7 +1569,7 @@ int IUIScene_AbstractContainerMenu::getCurrentIndex(ESceneSection eSection) return currentIndex + getSectionStartOffset(eSection); } -bool IUIScene_AbstractContainerMenu::IsSameItemAs(shared_ptr itemA, shared_ptr itemB) +bool IUIScene_AbstractContainerMenu::IsSameItemAs(std::shared_ptr itemA, std::shared_ptr itemB) { if(itemA == NULL || itemB == NULL) return false; @@ -1583,7 +1583,7 @@ int IUIScene_AbstractContainerMenu::GetEmptyStackSpace(Slot *slot) if(slot != NULL && slot->hasItem()) { - shared_ptr item = slot->getItem(); + std::shared_ptr item = slot->getItem(); if ( item->isStackable() ) { int iCount = item->GetCount(); @@ -1614,7 +1614,7 @@ wstring IUIScene_AbstractContainerMenu::GetItemDescription(Slot *slot, vectorgetItem()->getRarity()->color; int colour = app.GetHTMLColour(rarityColour); @@ -1624,7 +1624,7 @@ wstring IUIScene_AbstractContainerMenu::GetItemDescription(Slot *slot, vector%ls",colour,thisString.c_str()); + swprintf(formatted, 256, L"%ls",colour,thisString.c_str()); thisString = formatted; } desc.append( thisString ); diff --git a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.h b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.h index bdb8bb4c..57bc8253 100644 --- a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.h @@ -10,7 +10,7 @@ // Uncomment to enable acceleration on pointer input. //#define USE_POINTER_ACCEL -#define POINTER_INPUT_TIMER_ID (0) // Arbitrary timer ID. +#define POINTER_INPUT_TIMER_ID (0) // Arbitrary timer ID. #define POINTER_SPEED_FACTOR (13.0f) // Speed of pointer. //#define POINTER_PANEL_OVER_REACH (42.0f) // Amount beyond edge of panel which pointer can go over to drop items. - comes from the pointer size in the scene @@ -32,19 +32,19 @@ protected: eSectionContainerInventory, eSectionContainerChest, eSectionContainerMax, - + eSectionFurnaceUsing, eSectionFurnaceInventory, eSectionFurnaceIngredient, eSectionFurnaceFuel, eSectionFurnaceResult, eSectionFurnaceMax, - + eSectionInventoryUsing, eSectionInventoryInventory, eSectionInventoryArmor, eSectionInventoryMax, - + eSectionTrapUsing, eSectionTrapInventory, eSectionTrapTrap, @@ -64,7 +64,7 @@ protected: eSectionInventoryCreativeSlider, #endif eSectionInventoryCreativeMax, - + eSectionEnchantUsing, eSectionEnchantInventory, eSectionEnchantSlot, @@ -151,7 +151,7 @@ protected: // 4J - WESTY - Added for pointer prototype. // Current tooltip settings. EToolTipItem m_aeToolTipSettings[ eToolTipNumButtons ]; - + // 4J - WESTY - Added for pointer prototype. // Indicates if pointer is outside UI window (used to drop items). bool m_bPointerOutsideMenu; @@ -159,7 +159,7 @@ protected: bool m_bSplitscreen; bool m_bNavigateBack; // should we exit the xuiscenes or just navigate back on exit? - + virtual bool IsSectionSlotList( ESceneSection eSection ) { return eSection != eSectionNone; } virtual bool CanHaveFocus( ESceneSection eSection ) { return true; } int GetSectionDimensions( ESceneSection eSection, int* piNumColumns, int* piNumRows ); @@ -180,7 +180,7 @@ protected: // 4J - WESTY - Added for pointer prototype. void SetPointerOutsideMenu( bool bOutside ) { m_bPointerOutsideMenu = bOutside; } - + void Initialize(int m_iPad, AbstractContainerMenu* menu, bool autoDeleteMenu, int startIndex,ESceneSection firstSection,ESceneSection maxSection, bool bNavigateBack=FALSE); virtual void PlatformInitialize(int iPad, int startIndex) = 0; virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0) = 0; @@ -201,15 +201,15 @@ protected: virtual void setSectionSelectedSlot(ESceneSection eSection, int x, int y) = 0; virtual void setFocusToPointer(int iPad) = 0; virtual void SetPointerText(const wstring &description, vector &unformattedStrings, bool newSlot) = 0; - virtual shared_ptr getSlotItem(ESceneSection eSection, int iSlot) = 0; + virtual std::shared_ptr getSlotItem(ESceneSection eSection, int iSlot) = 0; virtual bool isSlotEmpty(ESceneSection eSection, int iSlot) = 0; virtual void adjustPointerForSafeZone() = 0; - virtual bool overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining, + virtual bool overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining, EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT) { return false; } private: - bool IsSameItemAs(shared_ptr itemA, shared_ptr itemB); + bool IsSameItemAs(std::shared_ptr itemA, std::shared_ptr itemB); int GetEmptyStackSpace(Slot *slot); wstring GetItemDescription(Slot *slot, vector &unformattedStrings); diff --git a/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.cpp index 81451c7a..990e4d6a 100644 --- a/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.cpp @@ -245,15 +245,15 @@ void IUIScene_AnvilMenu::updateItemName() ByteArrayOutputStream baos; DataOutputStream dos(&baos); dos.writeUTF(m_itemName); - Minecraft::GetInstance()->localplayers[getPad()]->connection->send(shared_ptr(new CustomPayloadPacket(CustomPayloadPacket::SET_ITEM_NAME_PACKET, baos.toByteArray()))); + Minecraft::GetInstance()->localplayers[getPad()]->connection->send(std::shared_ptr(new CustomPayloadPacket(CustomPayloadPacket::SET_ITEM_NAME_PACKET, baos.toByteArray()))); } -void IUIScene_AnvilMenu::refreshContainer(AbstractContainerMenu *container, vector > *items) +void IUIScene_AnvilMenu::refreshContainer(AbstractContainerMenu *container, vector > *items) { slotChanged(container, RepairMenu::INPUT_SLOT, container->getSlot(0)->getItem()); } -void IUIScene_AnvilMenu::slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr item) +void IUIScene_AnvilMenu::slotChanged(AbstractContainerMenu *container, int slotIndex, std::shared_ptr item) { if (slotIndex == RepairMenu::INPUT_SLOT) { diff --git a/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h b/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h index 6c4348f2..aad54abc 100644 --- a/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.h @@ -16,7 +16,7 @@ class RepairMenu; class IUIScene_AnvilMenu : public virtual IUIScene_AbstractContainerMenu, public net_minecraft_world_inventory::ContainerListener { protected: - shared_ptr m_inventory; + std::shared_ptr m_inventory; RepairMenu *m_repairMenu; wstring m_itemName; @@ -24,7 +24,7 @@ protected: IUIScene_AnvilMenu(); virtual ESceneSection GetSectionAndSlotInDirection( ESceneSection eSection, ETapState eTapDirection, int *piTargetX, int *piTargetY ); - int getSectionStartOffset(ESceneSection eSection); + int getSectionStartOffset(ESceneSection eSection); virtual void handleOtherClicked(int iPad, ESceneSection eSection, int buttonNum, bool quickKey); bool IsSectionSlotList( ESceneSection eSection ); @@ -39,7 +39,7 @@ protected: void updateItemName(); // ContainerListenr - void refreshContainer(AbstractContainerMenu *container, vector > *items); - void slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr item); + void refreshContainer(AbstractContainerMenu *container, vector > *items); + void slotChanged(AbstractContainerMenu *container, int slotIndex, std::shared_ptr item); void setContainerData(AbstractContainerMenu *container, int id, int value); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp index f158b174..2c6c69fc 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp @@ -91,7 +91,7 @@ IUIScene_CraftingMenu::_eGroupTab IUIScene_CraftingMenu::m_GroupTabBkgMapping3x3 // eBaseItemType_bow, // eBaseItemType_pockettool, // eBaseItemType_utensil, -// +// // } // eBaseItemType; @@ -180,11 +180,11 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) UpdateTooltips(); break; case ACTION_MENU_PAUSEMENU: - case ACTION_MENU_B: + case ACTION_MENU_B: ui.ShowTooltip( iPad, eToolTipButtonX, false ); ui.ShowTooltip( iPad, eToolTipButtonB, false ); - ui.ShowTooltip( iPad, eToolTipButtonA, false ); - ui.ShowTooltip( iPad, eToolTipButtonRB, false ); + ui.ShowTooltip( iPad, eToolTipButtonA, false ); + ui.ShowTooltip( iPad, eToolTipButtonRB, false ); // kill the crafting xui //ui.PlayUISFX(eSFX_Back); ui.CloseUIScenes(iPad); @@ -197,18 +197,18 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) #endif // Do some crafting! if(m_pPlayer && m_pPlayer->inventory) - { + { //RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED *pRecipeIngredientsRequired=Recipes::getInstance()->getRecipeIngredientsArray(); // Force a make if the debug is on if(app.DebugSettingsOn() && app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L< pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); + std::shared_ptr pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); //int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue()); if( pMinecraft->localgameModes[iPad] != NULL) @@ -244,7 +244,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) iSlot=0; } int iRecipe= CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]; - shared_ptr pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); + std::shared_ptr pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); //int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue()); if( pMinecraft->localgameModes[iPad] != NULL ) @@ -256,7 +256,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) } } - if(pRecipeIngredientsRequired[iRecipe].bCanMake[iPad]) + if(pRecipeIngredientsRequired[iRecipe].bCanMake[iPad]) { pTempItemInst->onCraftedBy(m_pPlayer->level, dynamic_pointer_cast( m_pPlayer->shared_from_this() ), pTempItemInst->count ); // TODO 4J Stu - handleCraftItem should do a lot more than what it does, loads of the "can we craft" code should also probably be @@ -272,7 +272,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) { for(int j=0;j ingItemInst = nullptr; + std::shared_ptr ingItemInst = nullptr; // do we need to remove a specific aux value? if(pRecipeIngredientsRequired[iRecipe].iIngAuxValA[i]!=Recipes::ANY_AUX_VALUE) { @@ -291,7 +291,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) if (ingItemInst->getItem()->hasCraftingRemainingItem()) { // replace item with remaining result - m_pPlayer->inventory->add( shared_ptr( new ItemInstance(ingItemInst->getItem()->getCraftingRemainingItem()) ) ); + m_pPlayer->inventory->add( std::shared_ptr( new ItemInstance(ingItemInst->getItem()->getCraftingRemainingItem()) ) ); } } @@ -337,7 +337,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) break; case ACTION_MENU_LEFT_SCROLL: - // turn off the old group tab + // turn off the old group tab showTabHighlight(m_iGroupIndex,false); if(m_iGroupIndex==0) @@ -431,7 +431,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) // clear the indices iVSlotIndexA[0]=CanBeMadeA[m_iCurrentSlotHIndex].iCount-1; iVSlotIndexA[1]=0; - iVSlotIndexA[2]=1; + iVSlotIndexA[2]=1; UpdateVerticalSlots(); UpdateHighlight(); @@ -482,13 +482,13 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) else { iVSlotIndexA[1]--; - } + } ui.PlayUISFX(eSFX_Focus); } else if(CanBeMadeA[m_iCurrentSlotHIndex].iCount>2) { - { + { if(m_iCurrentSlotVIndex!=0) { // just move the highlight @@ -496,11 +496,11 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) ui.PlayUISFX(eSFX_Focus); } else - { + { //move the slots iVSlotIndexA[2]=iVSlotIndexA[1]; iVSlotIndexA[1]=iVSlotIndexA[0]; - // on 0 and went up, so cycle the values + // on 0 and went up, so cycle the values if(iVSlotIndexA[0]==0) { iVSlotIndexA[0]=CanBeMadeA[m_iCurrentSlotHIndex].iCount-1; @@ -533,7 +533,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) if(CanBeMadeA[m_iCurrentSlotHIndex].iCount>1) { if(bNoScrollSlots) - { + { if(iVSlotIndexA[1]==(CanBeMadeA[m_iCurrentSlotHIndex].iCount-1)) { iVSlotIndexA[1]=0; @@ -574,7 +574,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) { m_iCurrentSlotVIndex++; ui.PlayUISFX(eSFX_Focus); - } + } } UpdateVerticalSlots(); UpdateHighlight(); @@ -624,11 +624,11 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() // for (int i = 0; i < iRecipeC; i++) // { - // shared_ptr pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(NULL); + // std::shared_ptr pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(NULL); // if (pTempItemInst != NULL) // { // wstring itemstring=pTempItemInst->toString(); - // + // // printf("Recipe [%d] = ",i); // OutputDebugStringW(itemstring.c_str()); // if(pTempItemInst->id!=0) @@ -642,7 +642,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() // { // printf("ID\t%d\tAux val\t%d\tBase type\t%d\tMaterial\t%d Count=%d\n",pTempItemInst->id, pTempItemInst->getAuxValue(),pTempItemInst->getItem()->getBaseItemType(),pTempItemInst->getItem()->getMaterial(),pTempItemInst->GetCount()); // } - // + // // } // } // } @@ -683,9 +683,9 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() if (m_pPlayer->inventory->items[k] != NULL) { // do they have the ingredient, and the aux value matches, and enough off it? - if((m_pPlayer->inventory->items[k]->id == pRecipeIngredientsRequired[i].iIngIDA[j]) && + if((m_pPlayer->inventory->items[k]->id == pRecipeIngredientsRequired[i].iIngIDA[j]) && // check if the ingredient required doesn't care about the aux value, or if it does, does the inventory item aux match it - ((pRecipeIngredientsRequired[i].iIngAuxValA[j]==Recipes::ANY_AUX_VALUE) || (pRecipeIngredientsRequired[i].iIngAuxValA[j]==m_pPlayer->inventory->items[k]->getAuxValue())) + ((pRecipeIngredientsRequired[i].iIngAuxValA[j]==Recipes::ANY_AUX_VALUE) || (pRecipeIngredientsRequired[i].iIngAuxValA[j]==m_pPlayer->inventory->items[k]->getAuxValue())) ) { // do they have enough? We need to check the whole inventory, since they may have enough in different slots (milk isn't milkx3, but milk,milk,milk) @@ -721,18 +721,18 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() // 4J Stu - TU-1 hotfix // Fix for #13143 - Players are able to craft items they do not have enough ingredients for if they store the ingredients in multiple, smaller stacks break; - } + } } } // if bFoundA[j] is false, then we didn't have enough of the ingredient required by the recipe, so mark the grid items we're short of if(bFoundA[j]==false) - { + { int iMissing = pRecipeIngredientsRequired[i].iIngValA[j]-iTotalCount; int iGridIndex=0; while(iMissing!=0) { // need to check if there is an aux val and match that - if(((pRecipeIngredientsRequired[i].uiGridA[iGridIndex]&0x00FFFFFF)==pRecipeIngredientsRequired[i].iIngIDA[j]) && + if(((pRecipeIngredientsRequired[i].uiGridA[iGridIndex]&0x00FFFFFF)==pRecipeIngredientsRequired[i].iIngIDA[j]) && ((pRecipeIngredientsRequired[i].iIngAuxValA[j]==Recipes::ANY_AUX_VALUE) ||(pRecipeIngredientsRequired[i].iIngAuxValA[j]== ((pRecipeIngredientsRequired[i].uiGridA[iGridIndex]&0xFF000000)>>24))) ) { // this grid entry is the ingredient we don't have enough of @@ -761,7 +761,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() if(iHSlotBrushControl<=m_iCraftablesMaxHSlotC) { bool bFound=false; - shared_ptr pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(nullptr); + std::shared_ptr pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(nullptr); //int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue()); int iID=pTempItemInst->getItem()->id; int iBaseType; @@ -777,7 +777,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() // ignore for the misc base type - these have not been placed in a base type group if(iBaseType!=Item::eBaseItemType_undefined) - { + { for(int k=0;k pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[iIndex].iRecipeA[0]].pRecipy->assemble(nullptr); + std::shared_ptr pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[iIndex].iRecipeA[0]].pRecipy->assemble(nullptr); assert(pTempItemInst->id!=0); unsigned int uiAlpha; @@ -844,7 +844,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() uiAlpha = 31; } else - { + { if(pRecipeIngredientsRequired[CanBeMadeA[iIndex].iRecipeA[0]].bCanMake[getPad()]) { uiAlpha = 31; @@ -903,7 +903,7 @@ void IUIScene_CraftingMenu::UpdateHighlight() { iSlot=0; } - shared_ptr pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr); + std::shared_ptr pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr); // special case for the torch coal/charcoal int id=pTempItemInstAdditional->getDescriptionId(); @@ -933,10 +933,10 @@ void IUIScene_CraftingMenu::UpdateHighlight() { itemstring=app.GetString( IDS_ITEM_FIREBALLCOAL ); } - } + } break; default: - itemstring=app.GetString(id ); + itemstring=app.GetString(id ); break; } @@ -991,7 +991,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots() { if(i!=1) continue; } - shared_ptr pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iVSlotIndexA[i]]].pRecipy->assemble(nullptr); + std::shared_ptr pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iVSlotIndexA[i]]].pRecipy->assemble(nullptr); assert(pTempItemInstAdditional->id!=0); unsigned int uiAlpha; @@ -1001,7 +1001,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots() uiAlpha = 31; } else - { + { if(pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iVSlotIndexA[i]]].bCanMake[getPad()]) { uiAlpha = 31; @@ -1040,7 +1040,7 @@ void IUIScene_CraftingMenu::DisplayIngredients() hideAllIngredientsSlots(); if(CanBeMadeA[m_iCurrentSlotHIndex].iCount!=0) - { + { int iSlot,iRecipy; if(CanBeMadeA[m_iCurrentSlotHIndex].iCount>1) { @@ -1057,7 +1057,7 @@ void IUIScene_CraftingMenu::DisplayIngredients() int iBoxWidth=(m_iContainerType==RECIPE_TYPE_2x2)?2:3; int iRecipe=CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]; bool bCanMakeRecipe = pRecipeIngredientsRequired[iRecipe].bCanMake[getPad()]; - shared_ptr pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); + std::shared_ptr pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); m_iIngredientsC=pRecipeIngredientsRequired[iRecipe].iIngC; @@ -1077,7 +1077,7 @@ void IUIScene_CraftingMenu::DisplayIngredients() iAuxVal = 0xFF; } - shared_ptr itemInst= shared_ptr(new ItemInstance(item,pRecipeIngredientsRequired[iRecipe].iIngValA[i],iAuxVal)); + std::shared_ptr itemInst= std::shared_ptr(new ItemInstance(item,pRecipeIngredientsRequired[iRecipe].iIngValA[i],iAuxVal)); setIngredientDescriptionItem(getPad(),i,itemInst); setIngredientDescriptionRedBox(i,false); @@ -1124,13 +1124,13 @@ void IUIScene_CraftingMenu::DisplayIngredients() } } - for (int x = 0; x < iBoxWidth; x++) + for (int x = 0; x < iBoxWidth; x++) { - for (int y = 0; y < iBoxWidth; y++) + for (int y = 0; y < iBoxWidth; y++) { int index = x+y*iBoxWidth; if(pRecipeIngredientsRequired[iRecipy].uiGridA[x+y*3]!=0) - { + { int id=pRecipeIngredientsRequired[iRecipy].uiGridA[x+y*3]&0x00FFFFFF; assert(id!=0); int iAuxVal=(pRecipeIngredientsRequired[iRecipy].uiGridA[x+y*3]&0xFF000000)>>24; @@ -1141,7 +1141,7 @@ void IUIScene_CraftingMenu::DisplayIngredients() { iAuxVal = 0xFF; } - shared_ptr itemInst= shared_ptr(new ItemInstance(id,1,iAuxVal)); + std::shared_ptr itemInst= std::shared_ptr(new ItemInstance(id,1,iAuxVal)); setIngredientSlotItem(getPad(),index,itemInst); // show the ingredients we don't have if we can't make the recipe if(app.DebugSettingsOn() && app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<getRecipeIngredientsArray(); if(bCanBeMade) - { + { int iSlot;//,iRecipy; if(CanBeMadeA[m_iCurrentSlotHIndex].iCount>1) { @@ -1218,7 +1218,7 @@ void IUIScene_CraftingMenu::UpdateDescriptionText(bool bCanBeMade) //iRecipy=CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[0]; } - shared_ptr pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr); + std::shared_ptr pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr); int iID=pTempItemInst->getItem()->id; int iAuxVal=pTempItemInst->getAuxValue(); int iBaseType; @@ -1278,13 +1278,13 @@ void IUIScene_CraftingMenu::UpdateDescriptionText(bool bCanBeMade) #ifdef _DEBUG setDescriptionText(L"This is some placeholder description text about the craftable item."); #else - setDescriptionText(L""); + setDescriptionText(L""); #endif - } + } } else { - setDescriptionText(L""); + setDescriptionText(L""); } } @@ -1308,7 +1308,7 @@ void IUIScene_CraftingMenu::UpdateTooltips() { iSlot=iVSlotIndexA[m_iCurrentSlotVIndex]; } - else + else { iSlot=0; } @@ -1348,7 +1348,7 @@ void IUIScene_CraftingMenu::UpdateTooltips() { iSlot=iVSlotIndexA[m_iCurrentSlotVIndex]; } - else + else { iSlot=0; } @@ -1372,7 +1372,7 @@ bool IUIScene_CraftingMenu::isItemSelected(int itemId) { bool isSelected = false; if(m_pPlayer && m_pPlayer->inventory) - { + { //RecipyList *recipes = ((Recipes *)Recipes::getInstance())->getRecipies(); Recipy::INGREDIENTS_REQUIRED *pRecipeIngredientsRequired=Recipes::getInstance()->getRecipeIngredientsArray(); diff --git a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.h b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.h index 05227fff..c3ee07ba 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.h @@ -22,7 +22,7 @@ protected: static const int m_iMaxHSlotC = 12; static const int m_iMaxHCraftingSlotC = 10; - static const int m_iMaxVSlotC = 17; + static const int m_iMaxVSlotC = 17; static const int m_iMaxDisplayedVSlotC = 3; static const int m_iIngredients3x3SlotC = 9; static const int m_iIngredients2x2SlotC = 4; @@ -35,7 +35,7 @@ protected: static int m_iBaseTypeMapA[Item::eBaseItemType_MAXTYPES]; - typedef struct + typedef struct { int iCount; int iItemBaseType; @@ -49,7 +49,7 @@ protected: int m_iCurrentSlotVIndex; int m_iRecipeC; int m_iContainerType; // 2x2 or 3x3 - shared_ptr m_pPlayer; + std::shared_ptr m_pPlayer; int m_iGroupIndex; int iVSlotIndexA[3]; // index of the v slots currently displayed @@ -59,7 +59,7 @@ protected: static Recipy::_eGroupType m_GroupTypeMapping9GridA[m_iMaxGroup3x3]; Recipy::_eGroupType *m_pGroupA; - static LPCWSTR m_GroupTabNameA[3]; + static LPCWSTR m_GroupTabNameA[3]; static _eGroupTab m_GroupTabBkgMapping2x2A[m_iMaxGroup2x2]; static _eGroupTab m_GroupTabBkgMapping3x3A[m_iMaxGroup3x3]; _eGroupTab *m_pGroupTabA; @@ -96,13 +96,13 @@ protected: virtual void hideAllHSlots() = 0; virtual void hideAllVSlots() = 0; virtual void hideAllIngredientsSlots() = 0; - virtual void setCraftHSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha) = 0; - virtual void setCraftVSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha) = 0; - virtual void setCraftingOutputSlotItem(int iPad, shared_ptr item) = 0; + virtual void setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha) = 0; + virtual void setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha) = 0; + virtual void setCraftingOutputSlotItem(int iPad, std::shared_ptr item) = 0; virtual void setCraftingOutputSlotRedBox(bool show) = 0; - virtual void setIngredientSlotItem(int iPad, int index, shared_ptr item) = 0; + virtual void setIngredientSlotItem(int iPad, int index, std::shared_ptr item) = 0; virtual void setIngredientSlotRedBox(int index, bool show) = 0; - virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr item) = 0; + virtual void setIngredientDescriptionItem(int iPad, int index, std::shared_ptr item) = 0; virtual void setIngredientDescriptionRedBox(int index, bool show) = 0; virtual void setIngredientDescriptionText(int index, LPCWSTR text) = 0; virtual void setShowCraftHSlot(int iIndex, bool show) = 0; diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index 7ce33234..0ab9a672 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -12,16 +12,16 @@ // 4J JEV - Images for each tab. IUIScene_CreativeMenu::TabSpec **IUIScene_CreativeMenu::specs = NULL; -vector< shared_ptr > IUIScene_CreativeMenu::categoryGroups[eCreativeInventoryGroupsCount]; +vector< std::shared_ptr > IUIScene_CreativeMenu::categoryGroups[eCreativeInventoryGroupsCount]; -#define ITEM(id) list->push_back( shared_ptr(new ItemInstance(id, 1, 0)) ); -#define ITEM_AUX(id, aux) list->push_back( shared_ptr(new ItemInstance(id, 1, aux)) ); +#define ITEM(id) list->push_back( std::shared_ptr(new ItemInstance(id, 1, 0)) ); +#define ITEM_AUX(id, aux) list->push_back( std::shared_ptr(new ItemInstance(id, 1, aux)) ); #define DEF(index) list = &categoryGroups[index]; void IUIScene_CreativeMenu::staticCtor() { - vector< shared_ptr > *list; + vector< std::shared_ptr > *list; // Building Blocks @@ -56,7 +56,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Tile::treeTrunk_Id, 0) ITEM_AUX(Tile::treeTrunk_Id, TreeTile::DARK_TRUNK) ITEM_AUX(Tile::treeTrunk_Id, TreeTile::BIRCH_TRUNK) - ITEM_AUX(Tile::treeTrunk_Id, TreeTile::JUNGLE_TRUNK) + ITEM_AUX(Tile::treeTrunk_Id, TreeTile::JUNGLE_TRUNK) ITEM(Tile::gravel_Id) ITEM(Tile::redBrick_Id) ITEM(Tile::mossStone_Id) @@ -118,7 +118,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Tile::sponge_Id) ITEM(Tile::melon_Id) ITEM(Tile::pumpkin_Id) - ITEM(Tile::litPumpkin_Id) + ITEM(Tile::litPumpkin_Id) ITEM_AUX(Tile::sapling_Id, Sapling::TYPE_DEFAULT) ITEM_AUX(Tile::sapling_Id, Sapling::TYPE_EVERGREEN) ITEM_AUX(Tile::sapling_Id, Sapling::TYPE_BIRCH) @@ -232,7 +232,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Tile::cobbleWall_Id, WallTile::TYPE_MOSSY) ITEM(Item::bed_Id) ITEM(Item::bucket_empty_Id) - ITEM(Item::bucket_lava_Id) + ITEM(Item::bucket_lava_Id) ITEM(Item::bucket_water_Id) ITEM(Item::milk_Id) ITEM(Item::cauldron_Id) @@ -292,7 +292,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::beef_cooked_Id) ITEM(Item::beef_raw_Id) ITEM(Item::chicken_raw_Id) - ITEM(Item::chicken_cooked_Id) + ITEM(Item::chicken_cooked_Id) ITEM(Item::rotten_flesh_Id) ITEM(Item::spiderEye_Id) ITEM(Item::potato_Id) @@ -314,7 +314,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::pickAxe_wood_Id) ITEM(Item::hatchet_wood_Id) ITEM(Item::hoe_wood_Id) - + ITEM(Item::map_Id) ITEM(Item::helmet_chain_Id) ITEM(Item::chestplate_chain_Id) @@ -325,7 +325,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::pickAxe_stone_Id) ITEM(Item::hatchet_stone_Id) ITEM(Item::hoe_stone_Id) - + ITEM(Item::bow_Id) ITEM(Item::helmet_iron_Id) ITEM(Item::chestplate_iron_Id) @@ -336,7 +336,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::pickAxe_iron_Id) ITEM(Item::hatchet_iron_Id) ITEM(Item::hoe_iron_Id) - + ITEM(Item::arrow_Id) ITEM(Item::helmet_gold_Id) ITEM(Item::chestplate_gold_Id) @@ -384,7 +384,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::brick_Id) ITEM(Item::netherbrick_Id) ITEM(Item::stick_Id) - ITEM(Item::bowl_Id) + ITEM(Item::bowl_Id) ITEM(Item::bone_Id) ITEM(Item::string_Id) ITEM(Item::feather_Id) @@ -393,13 +393,13 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::sulphur_Id) ITEM(Item::clay_Id) ITEM(Item::yellowDust_Id) - ITEM(Item::seeds_wheat_Id) + ITEM(Item::seeds_wheat_Id) ITEM(Item::seeds_melon_Id) ITEM(Item::seeds_pumpkin_Id) ITEM(Item::wheat_Id) ITEM(Item::reeds_Id) ITEM(Item::egg_Id) - ITEM(Item::sugar_Id) + ITEM(Item::sugar_Id) ITEM(Item::slimeBall_Id) ITEM(Item::blazeRod_Id) ITEM(Item::goldNugget_Id) @@ -432,7 +432,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::magmaCream_Id) ITEM(Item::speckledMelon_Id) ITEM(Item::glassBottle_Id) - ITEM_AUX(Item::potion_Id,0) // Water bottle + ITEM_AUX(Item::potion_Id,0) // Water bottle //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_TYPE_AWKWARD)) // Awkward Potion @@ -464,7 +464,7 @@ void IUIScene_CreativeMenu::staticCtor() //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH)) //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_NIGHTVISION)) //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INVISIBILITY)) - + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WEAKNESS)) ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_STRENGTH)) ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SLOWNESS)) @@ -579,7 +579,7 @@ IUIScene_CreativeMenu::IUIScene_CreativeMenu() m_creativeSlotX = m_creativeSlotY = m_inventorySlotX = m_inventorySlotY = 0; // 4J JEV - Settup Tabs - for (int i = 0; i < eCreativeInventoryTab_COUNT; i++) + for (int i = 0; i < eCreativeInventoryTab_COUNT; i++) { m_tabDynamicPos[i] = 0; m_tabPage[i] = 0; @@ -594,7 +594,7 @@ void IUIScene_CreativeMenu::switchTab(ECreativeInventoryTabs tab) if(tab != m_curTab) updateTabHighlightAndText(tab); m_curTab = tab; - + updateScrollCurrentPage(m_tabPage[m_curTab] + 1, specs[m_curTab]->getPageCount()); specs[tab]->populateMenu(itemPickerMenu,m_tabDynamicPos[m_curTab], m_tabPage[m_curTab]); @@ -605,7 +605,7 @@ void IUIScene_CreativeMenu::switchTab(ECreativeInventoryTabs tab) IUIScene_CreativeMenu::TabSpec::TabSpec(LPCWSTR icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount, ECreative_Inventory_Groups *dynamicGroups) : m_icon(icon), m_descriptionId(descriptionId), m_staticGroupsCount(staticGroupsCount), m_dynamicGroupsCount(dynamicGroupsCount) { - + m_pages = 0; m_staticGroupsA = NULL; @@ -708,10 +708,10 @@ unsigned int IUIScene_CreativeMenu::TabSpec::getPageCount() // 4J JEV - Item Picker Menu -IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( shared_ptr smp, shared_ptr inv ) : AbstractContainerMenu() +IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( std::shared_ptr smp, std::shared_ptr inv ) : AbstractContainerMenu() { inventory = inv; - creativeContainer = smp; + creativeContainer = smp; //int startLength = slots->size(); @@ -734,7 +734,7 @@ IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( shared_ptr player) +bool IUIScene_CreativeMenu::ItemPickerMenu::stillValid(std::shared_ptr player) { return true; } @@ -752,7 +752,7 @@ IUIScene_AbstractContainerMenu::ESceneSection IUIScene_CreativeMenu::GetSectionA switch( eSection ) { case eSectionInventoryCreativeSelector: - if (eTapDirection == eTapStateDown || eTapDirection == eTapStateUp) + if (eTapDirection == eTapStateDown || eTapDirection == eTapStateUp) { newSection = eSectionInventoryCreativeUsing; } @@ -794,7 +794,7 @@ bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL qu Minecraft *pMinecraft = Minecraft::GetInstance(); for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i) { - shared_ptr newItem = m_menu->getSlot(i)->getItem(); + std::shared_ptr newItem = m_menu->getSlot(i)->getItem(); if(newItem != NULL) { @@ -813,7 +813,7 @@ void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL q // Drop items. Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr playerInventory = pMinecraft->localplayers[iPad]->inventory; + std::shared_ptr playerInventory = pMinecraft->localplayers[iPad]->inventory; if (playerInventory->getCarried() != NULL) { if (buttonNum == 0) @@ -823,7 +823,7 @@ void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL q } if (buttonNum == 1) { - shared_ptr removedItem = playerInventory->getCarried()->remove(1); + std::shared_ptr removedItem = playerInventory->getCarried()->remove(1); pMinecraft->localgameModes[iPad]->handleCreativeModeItemDrop(removedItem); if (playerInventory->getCarried()->count == 0) playerInventory->setCarried(nullptr); } @@ -841,7 +841,7 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction) dir = -1; // Fall through intentional case ACTION_MENU_RIGHT_SCROLL: - { + { ECreativeInventoryTabs tab = (ECreativeInventoryTabs)(m_curTab + dir); if (tab < 0) tab = (ECreativeInventoryTabs)(eCreativeInventoryTab_COUNT - 1); if (tab >= eCreativeInventoryTab_COUNT) tab = eCreativeInventoryTab_BuildingBlocks; @@ -894,9 +894,9 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu if (buttonNum == 0) { - shared_ptr playerInventory = pMinecraft->localplayers[getPad()]->inventory; - shared_ptr carried = playerInventory->getCarried(); - shared_ptr clicked = m_menu->getSlot(currentIndex)->getItem(); + std::shared_ptr playerInventory = pMinecraft->localplayers[getPad()]->inventory; + std::shared_ptr carried = playerInventory->getCarried(); + std::shared_ptr clicked = m_menu->getSlot(currentIndex)->getItem(); if (clicked != NULL) { playerInventory->setCarried(ItemInstance::clone(clicked)); @@ -928,7 +928,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu quickKeyHeld = FALSE; } m_menu->clicked(currentIndex, buttonNum, quickKeyHeld?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, pMinecraft->localplayers[getPad()]); - shared_ptr newItem = m_menu->getSlot(currentIndex)->getItem(); + std::shared_ptr newItem = m_menu->getSlot(currentIndex)->getItem(); // call this function to synchronize multiplayer item bar pMinecraft->localgameModes[getPad()]->handleCreativeModeItemAdd(newItem, currentIndex - (int)m_menu->slots->size() + 9 + InventoryMenu::USE_ROW_SLOT_START); @@ -941,7 +941,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu m_iCurrSlotX = m_creativeSlotX; m_iCurrSlotY = m_creativeSlotY; - shared_ptr playerInventory = pMinecraft->localplayers[getPad()]->inventory; + std::shared_ptr playerInventory = pMinecraft->localplayers[getPad()]->inventory; playerInventory->setCarried(nullptr); m_bCarryingCreativeItem = false; } @@ -970,14 +970,14 @@ bool IUIScene_CreativeMenu::CanHaveFocus( ESceneSection eSection ) return false; } -bool IUIScene_CreativeMenu::getEmptyInventorySlot(shared_ptr item, int &slotX) +bool IUIScene_CreativeMenu::getEmptyInventorySlot(std::shared_ptr item, int &slotX) { bool sameItemFound = false; bool emptySlotFound = false; // Jump to the slot with this item already on it, if we can stack more for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i) { - shared_ptr slotItem = m_menu->getSlot(i)->getItem(); + std::shared_ptr slotItem = m_menu->getSlot(i)->getItem(); if( slotItem != NULL && slotItem->sameItem(item) && (slotItem->GetCount() + item->GetCount() <= item->getMaxStackSize() )) { sameItemFound = true; @@ -1020,7 +1020,7 @@ int IUIScene_CreativeMenu::getSectionStartOffset(ESceneSection eSection) return offset; } -bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining, +bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining, EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT) { bool _override = false; diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h index 7ab3ff7e..46370773 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h @@ -74,21 +74,21 @@ public: class ItemPickerMenu : public AbstractContainerMenu { protected: - shared_ptr creativeContainer; - shared_ptr inventory; + std::shared_ptr creativeContainer; + std::shared_ptr inventory; public: - ItemPickerMenu( shared_ptr creativeContainer, shared_ptr inventory ); + ItemPickerMenu( std::shared_ptr creativeContainer, std::shared_ptr inventory ); - virtual bool stillValid(shared_ptr player); + virtual bool stillValid(std::shared_ptr player); bool isOverrideResultClick(int slotNum, int buttonNum); protected: // 4J Stu - Brought forward from 1.2 to fix infinite recursion bug in creative - virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, shared_ptr player) { } // do nothing + virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, std::shared_ptr player) { } // do nothing } *itemPickerMenu; protected: - static vector< shared_ptr > categoryGroups[eCreativeInventoryGroupsCount]; + static vector< std::shared_ptr > categoryGroups[eCreativeInventoryGroupsCount]; // 4J JEV - Tabs static TabSpec **specs; @@ -112,11 +112,11 @@ protected: virtual void handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld); virtual void handleAdditionalKeyPress(int iAction); virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld); - bool getEmptyInventorySlot(shared_ptr item, int &slotX); + bool getEmptyInventorySlot(std::shared_ptr item, int &slotX); int getSectionStartOffset(ESceneSection eSection); virtual bool IsSectionSlotList( ESceneSection eSection ); virtual bool CanHaveFocus( ESceneSection eSection ); - virtual bool overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining, + virtual bool overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining, EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/IUIScene_TradingMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_TradingMenu.cpp index 658bcdfb..cd99cb79 100644 --- a/Minecraft.Client/Common/UI/IUIScene_TradingMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_TradingMenu.cpp @@ -16,7 +16,7 @@ IUIScene_TradingMenu::IUIScene_TradingMenu() m_bHasUpdatedOnce = false; } -shared_ptr IUIScene_TradingMenu::getMerchant() +std::shared_ptr IUIScene_TradingMenu::getMerchant() { return m_merchant; } @@ -46,11 +46,11 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) switch(iAction) { - case ACTION_MENU_B: + case ACTION_MENU_B: ui.ShowTooltip( iPad, eToolTipButtonX, false ); ui.ShowTooltip( iPad, eToolTipButtonB, false ); - ui.ShowTooltip( iPad, eToolTipButtonA, false ); - ui.ShowTooltip( iPad, eToolTipButtonRB, false ); + ui.ShowTooltip( iPad, eToolTipButtonA, false ); + ui.ShowTooltip( iPad, eToolTipButtonRB, false ); // kill the crafting xui //ui.PlayUISFX(eSFX_Back); ui.CloseUIScenes(iPad); @@ -70,9 +70,9 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) if(!activeRecipe->isDeprecated()) { // Do we have the ingredients? - shared_ptr buyAItem = activeRecipe->getBuyAItem(); - shared_ptr buyBItem = activeRecipe->getBuyBItem(); - shared_ptr player = Minecraft::GetInstance()->localplayers[getPad()]; + std::shared_ptr buyAItem = activeRecipe->getBuyAItem(); + std::shared_ptr buyBItem = activeRecipe->getBuyBItem(); + std::shared_ptr player = Minecraft::GetInstance()->localplayers[getPad()]; int buyAMatches = player->inventory->countMatches(buyAItem); int buyBMatches = player->inventory->countMatches(buyBItem); if( (buyAItem != NULL && buyAMatches >= buyAItem->count) && (buyBItem == NULL || buyBMatches >= buyBItem->count) ) @@ -84,7 +84,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) player->inventory->removeResources(buyBItem); // Add the item we have purchased - shared_ptr result = activeRecipe->getSellItem()->copy(); + std::shared_ptr result = activeRecipe->getSellItem()->copy(); if(!player->inventory->add( result ) ) { player->drop(result); @@ -92,7 +92,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) // Send a packet to the server int actualShopItem = m_activeOffers.at(selectedShopItem).second; - player->connection->send( shared_ptr( new TradeItemPacket(m_menu->containerId, actualShopItem) ) ); + player->connection->send( std::shared_ptr( new TradeItemPacket(m_menu->containerId, actualShopItem) ) ); updateDisplay(); } @@ -149,7 +149,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) ByteArrayOutputStream rawOutput; DataOutputStream output(&rawOutput); output.writeInt(actualShopItem); - Minecraft::GetInstance()->getConnection(getPad())->send(shared_ptr( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray()))); + Minecraft::GetInstance()->getConnection(getPad())->send(std::shared_ptr( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray()))); } } return handled; @@ -203,7 +203,7 @@ void IUIScene_TradingMenu::updateDisplay() ByteArrayOutputStream rawOutput; DataOutputStream output(&rawOutput); output.writeInt(firstValidTrade); - Minecraft::GetInstance()->getConnection(getPad())->send(shared_ptr( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray()))); + Minecraft::GetInstance()->getConnection(getPad())->send(std::shared_ptr( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray()))); } } @@ -247,9 +247,9 @@ void IUIScene_TradingMenu::updateDisplay() vector unformattedStrings; wstring offerDescription = GetItemDescription(activeRecipe->getSellItem(), unformattedStrings); setOfferDescription(offerDescription, unformattedStrings); - - shared_ptr buyAItem = activeRecipe->getBuyAItem(); - shared_ptr buyBItem = activeRecipe->getBuyBItem(); + + std::shared_ptr buyAItem = activeRecipe->getBuyAItem(); + std::shared_ptr buyBItem = activeRecipe->getBuyBItem(); setRequest1Item(buyAItem); setRequest2Item(buyBItem); @@ -262,7 +262,7 @@ void IUIScene_TradingMenu::updateDisplay() bool canMake = true; - shared_ptr player = Minecraft::GetInstance()->localplayers[getPad()]; + std::shared_ptr player = Minecraft::GetInstance()->localplayers[getPad()]; int buyAMatches = player->inventory->countMatches(buyAItem); if(buyAMatches > 0) { @@ -321,10 +321,10 @@ bool IUIScene_TradingMenu::canMake(MerchantRecipe *recipe) { if(recipe->isDeprecated()) return false; - shared_ptr buyAItem = recipe->getBuyAItem(); - shared_ptr buyBItem = recipe->getBuyBItem(); + std::shared_ptr buyAItem = recipe->getBuyAItem(); + std::shared_ptr buyBItem = recipe->getBuyBItem(); - shared_ptr player = Minecraft::GetInstance()->localplayers[getPad()]; + std::shared_ptr player = Minecraft::GetInstance()->localplayers[getPad()]; int buyAMatches = player->inventory->countMatches(buyAItem); if(buyAMatches > 0) { @@ -349,19 +349,19 @@ bool IUIScene_TradingMenu::canMake(MerchantRecipe *recipe) } -void IUIScene_TradingMenu::setRequest1Item(shared_ptr item) +void IUIScene_TradingMenu::setRequest1Item(std::shared_ptr item) { } -void IUIScene_TradingMenu::setRequest2Item(shared_ptr item) +void IUIScene_TradingMenu::setRequest2Item(std::shared_ptr item) { } -void IUIScene_TradingMenu::setTradeItem(int index, shared_ptr item) +void IUIScene_TradingMenu::setTradeItem(int index, std::shared_ptr item) { } -wstring IUIScene_TradingMenu::GetItemDescription(shared_ptr item, vector &unformattedStrings) +wstring IUIScene_TradingMenu::GetItemDescription(std::shared_ptr item, vector &unformattedStrings) { if(item == NULL) return L""; diff --git a/Minecraft.Client/Common/UI/IUIScene_TradingMenu.h b/Minecraft.Client/Common/UI/IUIScene_TradingMenu.h index c8edda67..b02f1a8b 100644 --- a/Minecraft.Client/Common/UI/IUIScene_TradingMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_TradingMenu.h @@ -7,7 +7,7 @@ class IUIScene_TradingMenu { protected: MerchantMenu *m_menu; - shared_ptr m_merchant; + std::shared_ptr m_merchant; vector< pair > m_activeOffers; int m_validOffersCount; @@ -39,20 +39,20 @@ protected: virtual void setRequest1RedBox(bool show) = 0; virtual void setRequest2RedBox(bool show) = 0; virtual void setTradeRedBox(int index, bool show) = 0; - + virtual void setOfferDescription(const wstring &name, vector &unformattedStrings) = 0; - virtual void setRequest1Item(shared_ptr item); - virtual void setRequest2Item(shared_ptr item); - virtual void setTradeItem(int index, shared_ptr item); + virtual void setRequest1Item(std::shared_ptr item); + virtual void setRequest2Item(std::shared_ptr item); + virtual void setTradeItem(int index, std::shared_ptr item); private: void updateDisplay(); bool canMake(MerchantRecipe *recipe); - wstring GetItemDescription(shared_ptr item, vector &unformattedStrings); + wstring GetItemDescription(std::shared_ptr item, vector &unformattedStrings); public: - shared_ptr getMerchant(); + std::shared_ptr getMerchant(); virtual int getPad() = 0; }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.cpp b/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.cpp index 858a8b43..e27c36da 100644 --- a/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.cpp @@ -126,7 +126,7 @@ void UIComponent_TutorialPopup::handleTimerComplete(int id) } void UIComponent_TutorialPopup::_SetDescription(UIScene *interactScene, const wstring &desc, const wstring &title, bool allowFade, bool isReminder) -{ +{ m_interactScene = interactScene; app.DebugPrintf("Setting m_interactScene to %08x\n", m_interactScene); if( interactScene != m_lastInteractSceneMoved ) m_lastInteractSceneMoved = NULL; @@ -204,12 +204,12 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, wstring temp(desc); bool isFixedIcon = false; - + m_iconIsFoil = isFoil; if( icon != TUTORIAL_NO_ICON ) { m_iconIsFoil = false; - m_iconItem = shared_ptr(new ItemInstance(icon,1,iAuxVal)); + m_iconItem = std::shared_ptr(new ItemInstance(icon,1,iAuxVal)); } else { @@ -238,72 +238,72 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, { iAuxVal = 0; } - m_iconItem = shared_ptr(new ItemInstance(iconId,1,iAuxVal)); + m_iconItem = std::shared_ptr(new ItemInstance(iconId,1,iAuxVal)); temp.replace(iconTagStartPos, iconEndPos - iconTagStartPos + closeTag.length(), L""); } } - + // remove any icon text else if(temp.find(L"{*CraftingTableIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Tile::workBench_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Tile::workBench_Id,1,0)); } else if(temp.find(L"{*SticksIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Item::stick_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Item::stick_Id,1,0)); } else if(temp.find(L"{*PlanksIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Tile::wood_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Tile::wood_Id,1,0)); } else if(temp.find(L"{*WoodenShovelIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Item::shovel_wood_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Item::shovel_wood_Id,1,0)); } else if(temp.find(L"{*WoodenHatchetIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Item::hatchet_wood_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Item::hatchet_wood_Id,1,0)); } else if(temp.find(L"{*WoodenPickaxeIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Item::pickAxe_wood_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Item::pickAxe_wood_Id,1,0)); } else if(temp.find(L"{*FurnaceIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Tile::furnace_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Tile::furnace_Id,1,0)); } else if(temp.find(L"{*WoodenDoorIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Item::door_wood,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Item::door_wood,1,0)); } else if(temp.find(L"{*TorchIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Tile::torch_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Tile::torch_Id,1,0)); } else if(temp.find(L"{*BoatIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Item::boat_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Item::boat_Id,1,0)); } else if(temp.find(L"{*FishingRodIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Item::fishingRod_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Item::fishingRod_Id,1,0)); } else if(temp.find(L"{*FishIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Item::fish_raw_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Item::fish_raw_Id,1,0)); } else if(temp.find(L"{*MinecartIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Item::minecart_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Item::minecart_Id,1,0)); } else if(temp.find(L"{*RailIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Tile::rail_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Tile::rail_Id,1,0)); } else if(temp.find(L"{*PoweredRailIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Tile::goldenRail_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Tile::goldenRail_Id,1,0)); } else if(temp.find(L"{*StructuresIcon*}")!=wstring::npos) { @@ -317,7 +317,7 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, } else if(temp.find(L"{*StoneIcon*}")!=wstring::npos) { - m_iconItem = shared_ptr(new ItemInstance(Tile::rock_Id,1,0)); + m_iconItem = std::shared_ptr(new ItemInstance(Tile::rock_Id,1,0)); } else { @@ -358,7 +358,7 @@ wstring UIComponent_TutorialPopup::_SetImage(wstring &desc) // hide the icon slot m_image.SetShow( FALSE ); } - + BOOL imageShowAtEnd = m_image.IsShown(); if(imageShowAtStart != imageShowAtEnd) { diff --git a/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.h b/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.h index 36f78300..036fc148 100644 --- a/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.h +++ b/Minecraft.Client/Common/UI/UIComponent_TutorialPopup.h @@ -15,7 +15,7 @@ private: bool m_lastSceneMovedLeft; bool m_bAllowFade; Tutorial *m_tutorial; - shared_ptr m_iconItem; + std::shared_ptr m_iconItem; bool m_iconIsFoil; //int m_iLocalPlayerC; diff --git a/Minecraft.Client/Common/UI/UIControl_EnchantmentBook.cpp b/Minecraft.Client/Common/UI/UIControl_EnchantmentBook.cpp index ef7c0e94..32086f39 100644 --- a/Minecraft.Client/Common/UI/UIControl_EnchantmentBook.cpp +++ b/Minecraft.Client/Common/UI/UIControl_EnchantmentBook.cpp @@ -100,7 +100,7 @@ void UIControl_EnchantmentBook::tickBook() { UIScene_EnchantingMenu *m_containerScene = (UIScene_EnchantingMenu *)m_parentScene; EnchantmentMenu *menu = m_containerScene->getMenu(); - shared_ptr current = menu->getSlot(0)->getItem(); + std::shared_ptr current = menu->getSlot(0)->getItem(); if (!ItemInstance::matches(current, last)) { last = current; @@ -122,7 +122,7 @@ void UIControl_EnchantmentBook::tickBook() { shouldBeOpen = true; } - } + } if (shouldBeOpen) open += 0.2f; else open -= 0.2f; diff --git a/Minecraft.Client/Common/UI/UIControl_EnchantmentBook.h b/Minecraft.Client/Common/UI/UIControl_EnchantmentBook.h index cbe2cf2b..5cd78a89 100644 --- a/Minecraft.Client/Common/UI/UIControl_EnchantmentBook.h +++ b/Minecraft.Client/Common/UI/UIControl_EnchantmentBook.h @@ -19,7 +19,7 @@ private: //BOOL m_bDirty; //float m_fScale,m_fAlpha; //int m_iPad; - shared_ptr last; + std::shared_ptr last; //float m_fScreenWidth,m_fScreenHeight; //float m_fRawWidth,m_fRawHeight; diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 75eb3dcf..86a9c3e6 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -597,7 +597,7 @@ void UIScene::customDraw(IggyCustomDrawCallbackRegion *region) app.DebugPrintf("Handling custom draw for scene with no override!\n"); } -void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, shared_ptr item, float fAlpha, bool isFoil, bool bDecorations) +void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, std::shared_ptr item, float fAlpha, bool isFoil, bool bDecorations) { if (item!= NULL) { @@ -608,7 +608,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP //Make sure that pMinecraft->player is the correct player so that player specific rendering // eg clock and compass, are rendered correctly Minecraft *pMinecraft=Minecraft::GetInstance(); - shared_ptr oldPlayer = pMinecraft->player; + std::shared_ptr oldPlayer = pMinecraft->player; if( iPad >= 0 && iPad < XUSER_MAX_COUNT ) pMinecraft->player = pMinecraft->localplayers[iPad]; // Setup GDraw, normal game render states and matrices @@ -688,7 +688,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP //Make sure that pMinecraft->player is the correct player so that player specific rendering // eg clock and compass, are rendered correctly - shared_ptr oldPlayer = pMinecraft->player; + std::shared_ptr oldPlayer = pMinecraft->player; if( iPad >= 0 && iPad < XUSER_MAX_COUNT ) pMinecraft->player = pMinecraft->localplayers[iPad]; _customDrawSlotControl(customDrawRegion, iPad, item, fAlpha, isFoil, bDecorations, false); @@ -701,7 +701,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP } } -void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_ptr item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer) +void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, std::shared_ptr item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer) { Minecraft *pMinecraft=Minecraft::GetInstance(); diff --git a/Minecraft.Client/Common/UI/UIScene.h b/Minecraft.Client/Common/UI/UIScene.h index 1b646ce0..d9490a82 100644 --- a/Minecraft.Client/Common/UI/UIScene.h +++ b/Minecraft.Client/Common/UI/UIScene.h @@ -187,7 +187,7 @@ public: protected: //void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, int iID, int iCount, int iAuxVal, float fAlpha, bool isFoil, bool bDecorations); - void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, shared_ptr item, float fAlpha, bool isFoil, bool bDecorations); + void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, std::shared_ptr item, float fAlpha, bool isFoil, bool bDecorations); bool m_cacheSlotRenders; bool m_needsCacheRendered; @@ -196,14 +196,14 @@ private: typedef struct _CachedSlotDrawData { CustomDrawData *customDrawRegion; - shared_ptr item; + std::shared_ptr item; float fAlpha; bool isFoil; bool bDecorations; } CachedSlotDrawData; vector m_cachedSlotDraw; - void _customDrawSlotControl(CustomDrawData *region, int iPad, shared_ptr item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer); + void _customDrawSlotControl(CustomDrawData *region, int iPad, std::shared_ptr item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer); public: // INPUT diff --git a/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.cpp index 7823fb4e..126f2403 100644 --- a/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.cpp @@ -49,7 +49,7 @@ void UIScene_AbstractContainerMenu::handleDestroy() } // 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss. - // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) + // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) if(pMinecraft->localplayers[m_iPad] != NULL) pMinecraft->localplayers[m_iPad]->closeContainer(); ui.OverrideSFX(m_iPad,ACTION_MENU_A,false); @@ -90,7 +90,7 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex) // We may have varying depths of controls here, so base off the pointers parent #if TO_BE_IMPLEMENTED HXUIOBJ parent; - XuiElementGetBounds( m_pointerControl->m_hObj, &fPointerWidth, &fPointerHeight ); + XuiElementGetBounds( m_pointerControl->m_hObj, &fPointerWidth, &fPointerHeight ); #else fPointerWidth = 50; fPointerHeight = 50; @@ -103,7 +103,7 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex) // Get size of pointer m_fPointerImageOffsetX = 0; //floor(fPointerWidth/2.0f); m_fPointerImageOffsetY = 0; //floor(fPointerHeight/2.0f); - + m_fPanelMinX = fPanelX; m_fPanelMaxX = fPanelX + fPanelWidth; m_fPanelMinY = fPanelY; @@ -111,9 +111,9 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex) #ifdef __ORBIS__ // we need to map the touchpad rectangle to the UI rectangle. While it works great for the creative menu, it is much too sensitive for the smaller menus. - //X coordinate of the touch point (0 to 1919) - //Y coordinate of the touch point (0 to 941: DUALSHOCK�4 wireless controllers and the CUH-ZCT1J/CAP-ZCT1J/CAP-ZCT1U controllers for the PlayStation�4 development tool, - //0 to 753: JDX-1000x series controllers for the PlayStation�4 development tool,) + //X coordinate of the touch point (0 to 1919) + //Y coordinate of the touch point (0 to 941: DUALSHOCK�4 wireless controllers and the CUH-ZCT1J/CAP-ZCT1J/CAP-ZCT1U controllers for the PlayStation�4 development tool, + //0 to 753: JDX-1000x series controllers for the PlayStation�4 development tool,) m_fTouchPadMulX=fPanelWidth/1919.0f; m_fTouchPadMulY=fPanelHeight/941.0f; m_fTouchPadDeadZoneX=15.0f*m_fTouchPadMulX; @@ -161,13 +161,13 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex) S32 width, height; m_parentLayer->getRenderDimensions(width, height); S32 x = m_pointerPos.x*((float)width/m_movieWidth); - S32 y = m_pointerPos.y*((float)height/m_movieHeight); + S32 y = m_pointerPos.y*((float)height/m_movieHeight); IggyMakeEventMouseMove( &mouseEvent, x, y); IggyEventResult result; IggyPlayerDispatchEventRS ( getMovie() , &mouseEvent , &result ); -#ifdef USE_POINTER_ACCEL +#ifdef USE_POINTER_ACCEL m_fPointerVelX = 0.0f; m_fPointerVelY = 0.0f; m_fPointerAccelX = 0.0f; @@ -332,9 +332,9 @@ void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *reg Minecraft *pMinecraft = Minecraft::GetInstance(); if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return; - shared_ptr item = nullptr; + std::shared_ptr item = nullptr; if(wcscmp((wchar_t *)region->name,L"pointerIcon")==0) - { + { m_cacheSlotRenders = false; item = pMinecraft->localplayers[m_iPad]->inventory->getCarried(); } @@ -347,7 +347,7 @@ void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *reg app.DebugPrintf("This is not the control we are looking for\n"); } else - { + { m_cacheSlotRenders = true; Slot *slot = m_menu->getSlot(slotId); item = slot->getItem(); @@ -398,7 +398,7 @@ void UIScene_AbstractContainerMenu::setFocusToPointer(int iPad) m_focusSection = eSectionNone; } -shared_ptr UIScene_AbstractContainerMenu::getSlotItem(ESceneSection eSection, int iSlot) +std::shared_ptr UIScene_AbstractContainerMenu::getSlotItem(ESceneSection eSection, int iSlot) { Slot *slot = m_menu->getSlot( getSectionStartOffset(eSection) + iSlot ); if(slot) return slot->getItem(); diff --git a/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.h b/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.h index 26688dc5..f4411b00 100644 --- a/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.h @@ -31,7 +31,7 @@ protected: UI_MAP_ELEMENT( m_labelInventory, "inventoryLabel") UI_END_MAP_CHILD_ELEMENTS() UI_END_MAP_ELEMENTS_AND_NAMES() - + public: UIScene_AbstractContainerMenu(int iPad, UILayer *parentLayer); ~UIScene_AbstractContainerMenu(); @@ -49,7 +49,7 @@ protected: virtual void setSectionFocus(ESceneSection eSection, int iPad); void setFocusToPointer(int iPad); void SetPointerText(const wstring &description, vector &unformattedStrings, bool newSlot); - virtual shared_ptr getSlotItem(ESceneSection eSection, int iSlot); + virtual std::shared_ptr getSlotItem(ESceneSection eSection, int iSlot); virtual bool isSlotEmpty(ESceneSection eSection, int iSlot); virtual void adjustPointerForSafeZone(); @@ -57,7 +57,7 @@ protected: public: virtual void tick(); - + virtual void render(S32 width, S32 height, C4JRender::eViewportType viewpBort); virtual void customDraw(IggyCustomDrawCallbackRegion *region); diff --git a/Minecraft.Client/Common/UI/UIScene_BrewingStandMenu.h b/Minecraft.Client/Common/UI/UIScene_BrewingStandMenu.h index 5441a1ac..13c8b1de 100644 --- a/Minecraft.Client/Common/UI/UIScene_BrewingStandMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_BrewingStandMenu.h @@ -8,7 +8,7 @@ class InventoryMenu; class UIScene_BrewingStandMenu : public UIScene_AbstractContainerMenu, public IUIScene_BrewingMenu { private: - shared_ptr m_brewingStand; + std::shared_ptr m_brewingStand; public: UIScene_BrewingStandMenu(int iPad, void *initData, UILayer *parentLayer); diff --git a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp index 5b729069..1be78ad6 100644 --- a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp @@ -51,7 +51,7 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p // if we are in splitscreen, then we need to figure out if we want to move this scene if(m_bSplitscreen) { - app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); + app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); } XuiElementSetShow(m_hGrid,TRUE); @@ -76,7 +76,7 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p #if TO_BE_IMPLEMENTED - // display the first group tab + // display the first group tab m_hTabGroupA[m_iGroupIndex].SetShow(TRUE); // store the slot 0 position @@ -196,7 +196,7 @@ void UIScene_CraftingMenu::handleDestroy() if(gameMode != NULL) gameMode->getTutorial()->changeTutorialState(m_previousTutorialState); } - // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) + // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer(); ui.OverrideSFX(m_iPad,ACTION_MENU_A,false); @@ -297,7 +297,7 @@ void UIScene_CraftingMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int else { iVSlotIndexA[1]--; - } + } ui.PlayUISFX(eSFX_Focus); UpdateVerticalSlots(); @@ -349,7 +349,7 @@ void UIScene_CraftingMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int // clear the indices iVSlotIndexA[0]=CanBeMadeA[m_iCurrentSlotHIndex].iCount-1; iVSlotIndexA[1]=0; - iVSlotIndexA[2]=1; + iVSlotIndexA[2]=1; UpdateVerticalSlots(); UpdateHighlight(); @@ -435,7 +435,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region) Minecraft *pMinecraft = Minecraft::GetInstance(); if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return; - shared_ptr item = nullptr; + std::shared_ptr item = nullptr; int slotId = -1; float alpha = 1.0f; bool decorations = true; @@ -606,21 +606,21 @@ void UIScene_CraftingMenu::hideAllIngredientsSlots() } } -void UIScene_CraftingMenu::setCraftHSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha) +void UIScene_CraftingMenu::setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha) { m_hSlotsInfo[iIndex].item = item; m_hSlotsInfo[iIndex].alpha = uiAlpha; m_hSlotsInfo[iIndex].show = true; } -void UIScene_CraftingMenu::setCraftVSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha) +void UIScene_CraftingMenu::setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha) { m_vSlotsInfo[iIndex].item = item; m_vSlotsInfo[iIndex].alpha = uiAlpha; m_vSlotsInfo[iIndex].show = true; } -void UIScene_CraftingMenu::setCraftingOutputSlotItem(int iPad, shared_ptr item) +void UIScene_CraftingMenu::setCraftingOutputSlotItem(int iPad, std::shared_ptr item) { m_craftingOutputSlotInfo.item = item; m_craftingOutputSlotInfo.alpha = 31; @@ -632,7 +632,7 @@ void UIScene_CraftingMenu::setCraftingOutputSlotRedBox(bool show) m_slotListCraftingOutput.showSlotRedBox(0,show); } -void UIScene_CraftingMenu::setIngredientSlotItem(int iPad, int index, shared_ptr item) +void UIScene_CraftingMenu::setIngredientSlotItem(int iPad, int index, std::shared_ptr item) { m_ingredientsSlotsInfo[index].item = item; m_ingredientsSlotsInfo[index].alpha = 31; @@ -644,7 +644,7 @@ void UIScene_CraftingMenu::setIngredientSlotRedBox(int index, bool show) m_slotListIngredientsLayout.showSlotRedBox(index,show); } -void UIScene_CraftingMenu::setIngredientDescriptionItem(int iPad, int index, shared_ptr item) +void UIScene_CraftingMenu::setIngredientDescriptionItem(int iPad, int index, std::shared_ptr item) { m_ingredientsInfo[index].item = item; m_ingredientsInfo[index].alpha = 31; @@ -680,7 +680,7 @@ void UIScene_CraftingMenu::setShowCraftHSlot(int iIndex, bool show) void UIScene_CraftingMenu::showTabHighlight(int iIndex, bool show) { if(show) - { + { IggyDataValue result; IggyDataValue value[1]; @@ -729,7 +729,7 @@ void UIScene_CraftingMenu::scrollDescriptionDown() void UIScene_CraftingMenu::updateHighlightAndScrollPositions() { - { + { IggyDataValue result; IggyDataValue value[2]; diff --git a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h index 44a39d61..dffd4273 100644 --- a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h @@ -32,7 +32,7 @@ class UIScene_CraftingMenu : public UIScene, public IUIScene_CraftingMenu private: typedef struct _SlotInfo { - shared_ptr item; + std::shared_ptr item; unsigned int alpha; bool show; @@ -97,7 +97,7 @@ protected: ETouchInput_TouchPanel_5, ETouchInput_TouchPanel_6, ETouchInput_CraftingHSlots, - + ETouchInput_Count, }; UIControl_Touch m_TouchInput[ETouchInput_Count]; @@ -182,13 +182,13 @@ protected: virtual void hideAllHSlots(); virtual void hideAllVSlots(); virtual void hideAllIngredientsSlots(); - virtual void setCraftHSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha); - virtual void setCraftVSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha); - virtual void setCraftingOutputSlotItem(int iPad, shared_ptr item); + virtual void setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha); + virtual void setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha); + virtual void setCraftingOutputSlotItem(int iPad, std::shared_ptr item); virtual void setCraftingOutputSlotRedBox(bool show); - virtual void setIngredientSlotItem(int iPad, int index, shared_ptr item); + virtual void setIngredientSlotItem(int iPad, int index, std::shared_ptr item); virtual void setIngredientSlotRedBox(int index, bool show); - virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr item); + virtual void setIngredientDescriptionItem(int iPad, int index, std::shared_ptr item); virtual void setIngredientDescriptionRedBox(int index, bool show); virtual void setIngredientDescriptionText(int index, LPCWSTR text); virtual void setShowCraftHSlot(int iIndex, bool show); diff --git a/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp index 569cc8ba..85441877 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp @@ -21,7 +21,7 @@ UIScene_CreativeMenu::UIScene_CreativeMenu(int iPad, void *_initData, UILayer *p InventoryScreenInput *initData = (InventoryScreenInput *)_initData; - shared_ptr creativeContainer = shared_ptr(new SimpleContainer( 0, TabSpec::MAX_SIZE )); + std::shared_ptr creativeContainer = std::shared_ptr(new SimpleContainer( 0, TabSpec::MAX_SIZE )); itemPickerMenu = new ItemPickerMenu(creativeContainer, initData->player->inventory); Initialize( initData->iPad, itemPickerMenu, false, -1, eSectionInventoryCreativeUsing, eSectionInventoryCreativeMax, initData->bNavigateBack); @@ -96,7 +96,7 @@ void UIScene_CreativeMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int { // calculate relative touch position on slider float fPosition = ((float)y - (float)m_TouchInput[ETouchInput_TouchSlider].getYPos() - m_controlMainPanel.getYPos()) / (float)m_TouchInput[ETouchInput_TouchSlider].getHeight(); - + // clamp if(fPosition > 1) fPosition = 1.0f; @@ -105,7 +105,7 @@ void UIScene_CreativeMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int // calculate page position according to page count int iCurrentPage = Math::round(fPosition * (specs[m_curTab]->getPageCount() - 1)); - + // set tab page m_tabPage[m_curTab] = iCurrentPage; @@ -208,7 +208,7 @@ void UIScene_CreativeMenu::handleInput(int iPad, int key, bool repeat, bool pres dir = -1; // Fall through intentional case VK_PAD_RSHOULDER: - { + { ECreativeInventoryTabs tab = (ECreativeInventoryTabs)(m_curTab + dir); if (tab < 0) tab = (ECreativeInventoryTabs)(eCreativeInventoryTab_COUNT - 1); if (tab >= eCreativeInventoryTab_COUNT) tab = eCreativeInventoryTab_BuildingBlocks; diff --git a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp index 44a7e6c5..2dcdf8fe 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp @@ -127,7 +127,7 @@ void UIScene_DebugOverlay::customDraw(IggyCustomDrawCallbackRegion *region) } else { - shared_ptr item = shared_ptr( new ItemInstance(itemId,1,0) ); + std::shared_ptr item = std::shared_ptr( new ItemInstance(itemId,1,0) ); if(item != NULL) customDrawSlotControl(region,m_iPad,item,1.0f,false,false); } } @@ -176,7 +176,7 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId) { int id = childId; if(id m_furnace; + std::shared_ptr m_furnace; public: UIScene_FurnaceMenu(int iPad, void *initData, UILayer *parentLayer); diff --git a/Minecraft.Client/Common/UI/UIScene_HUD.cpp b/Minecraft.Client/Common/UI/UIScene_HUD.cpp index 27eeb76b..37b433cf 100644 --- a/Minecraft.Client/Common/UI/UIScene_HUD.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HUD.cpp @@ -161,7 +161,7 @@ void UIScene_HUD::tick() } else { - shared_ptr boss = EnderDragonRenderer::bossInstance; + std::shared_ptr boss = EnderDragonRenderer::bossInstance; // 4J Stu - Don't clear this here as it's wiped for other players //EnderDragonRenderer::bossInstance = nullptr; m_ticksWithNoBoss = 0; @@ -191,7 +191,7 @@ void UIScene_HUD::customDraw(IggyCustomDrawCallbackRegion *region) else { Slot *invSlot = pMinecraft->localplayers[m_iPad]->inventoryMenu->getSlot(InventoryMenu::USE_ROW_SLOT_START + slot); - shared_ptr item = invSlot->getItem(); + std::shared_ptr item = invSlot->getItem(); if(item != NULL) { unsigned char ucAlpha=app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_InterfaceOpacity); @@ -265,7 +265,7 @@ void UIScene_HUD::handleReload() } m_labelJukebox.init(L""); - int iGuiScale; + int iGuiScale; Minecraft *pMinecraft = Minecraft::GetInstance(); if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localplayers[m_iPad]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN) { @@ -629,7 +629,7 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor } IggyPlayerSetDisplaySize( getMovie(), m_movieWidth, m_movieHeight ); - + m_renderWidth = tileWidth; m_renderHeight = tileHeight; @@ -639,7 +639,7 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor tileYStart , tileXStart + tileWidth , tileYStart + tileHeight , - 0 ); + 0 ); IggyPlayerDrawTilesEnd ( getMovie() ); } else @@ -651,7 +651,7 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor void UIScene_HUD::handleTimerComplete(int id) { Minecraft *pMinecraft = Minecraft::GetInstance(); - + bool anyVisible = false; if(pMinecraft->localplayers[m_iPad]!= NULL) { @@ -735,7 +735,7 @@ void UIScene_HUD::SetDisplayName(const wstring &displayName) if(displayName.compare(m_displayName) != 0) { m_displayName = displayName; - + IggyDataValue result; IggyDataValue value[1]; IggyStringUTF16 stringVal; @@ -775,7 +775,7 @@ void UIScene_HUD::handleGameTick() } m_parentLayer->showComponent(m_iPad, eUIScene_HUD,true); - int iGuiScale; + int iGuiScale; if(pMinecraft->localplayers[m_iPad]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN) { @@ -788,7 +788,7 @@ void UIScene_HUD::handleGameTick() SetHudSize(iGuiScale); SetDisplayName(ProfileManager.GetDisplayName(m_iPad)); - + SetTooltipsEnabled(((ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad())) || (app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_Tooltips) != 0))); #if TO_BE_IMPLEMENTED @@ -797,8 +797,8 @@ void UIScene_HUD::handleGameTick() { int iTooltipsYOffset = 0; // if tooltips are off, set the y offset to zero - if(app.GetGameSettings(m_iPad,eGameSetting_Tooltips)==0) - { + if(app.GetGameSettings(m_iPad,eGameSetting_Tooltips)==0) + { switch(iGuiScale) { case 0: @@ -987,11 +987,11 @@ void UIScene_HUD::handleGameTick() bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(m_iPad) && !(app.GetXuiAction(m_iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(m_iPad,eGameSetting_DisplayHUD)!=0; if(bDisplayGui && pMinecraft->localplayers[m_iPad] != NULL) { - setVisible(true); + setVisible(true); } else { - setVisible(false); + setVisible(false); } } } diff --git a/Minecraft.Client/Common/UI/UIScene_InGameHostOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InGameHostOptionsMenu.cpp index de8af0ac..72c41049 100644 --- a/Minecraft.Client/Common/UI/UIScene_InGameHostOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_InGameHostOptionsMenu.cpp @@ -65,11 +65,11 @@ void UIScene_InGameHostOptionsMenu::handleInput(int iPad, int key, bool repeat, // Send update settings packet to server if(hostOptions != app.GetGameHostOption(eGameHostOption_All) ) { - Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = pMinecraft->localplayers[m_iPad]; + Minecraft *pMinecraft = Minecraft::GetInstance(); + std::shared_ptr player = pMinecraft->localplayers[m_iPad]; if(player->connection) { - player->connection->send( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, hostOptions) ) ); + player->connection->send( std::shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, hostOptions) ) ); } } diff --git a/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.cpp index 5c3f73f6..542834db 100644 --- a/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.cpp @@ -67,7 +67,7 @@ UIScene_InGameInfoMenu::UIScene_InGameInfoMenu(int iPad, void *initData, UILayer m_playersVoiceState[i] = voiceStatus; m_playersColourState[i] = app.GetPlayerColour( m_players[i] ); m_playerNames[i] = playerName; - m_playerList.addItem( playerName, app.GetPlayerColour( m_players[i] ), voiceStatus); + m_playerList.addItem( playerName, app.GetPlayerColour( m_players[i] ), voiceStatus); } } @@ -78,7 +78,7 @@ UIScene_InGameInfoMenu::UIScene_InGameInfoMenu(int iPad, void *initData, UILayer if(thisPlayer != NULL) m_isHostPlayer = thisPlayer->IsHost() == TRUE; Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; if(!m_isHostPlayer && !localPlayer->isModerator() ) { removeControl( &m_buttonGameOptions, false ); @@ -131,7 +131,7 @@ void UIScene_InGameInfoMenu::updateTooltips() int keyA = -1; Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; bool isOp = m_isHostPlayer || localPlayer->isModerator(); bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0; @@ -161,7 +161,7 @@ void UIScene_InGameInfoMenu::updateTooltips() } } } - + #if defined(__PS3__) || defined(__ORBIS__) if(m_iPad == ProfileManager.GetPrimaryPad() ) ikeyY = IDS_TOOLTIPS_GAME_INVITES; #else @@ -243,7 +243,7 @@ void UIScene_InGameInfoMenu::handleReload() m_playersVoiceState[i] = voiceStatus; m_playersColourState[i] = app.GetPlayerColour( m_players[i] ); m_playerNames[i] = playerName; - m_playerList.addItem( playerName, app.GetPlayerColour( m_players[i] ), voiceStatus); + m_playerList.addItem( playerName, app.GetPlayerColour( m_players[i] ), voiceStatus); } } @@ -252,7 +252,7 @@ void UIScene_InGameInfoMenu::handleReload() if(thisPlayer != NULL) m_isHostPlayer = thisPlayer->IsHost() == TRUE; Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; if(!m_isHostPlayer && !localPlayer->isModerator() ) { removeControl( &m_buttonGameOptions, false ); @@ -367,7 +367,7 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr #else // __PS3__ int ret = sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID); app.DebugPrintf("sceNpBasicRecvMessageCustom return %d ( %08x )\n", ret, ret); -#endif +#endif } } #else @@ -397,7 +397,7 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr if(pressed && !repeat && !g_NetworkManager.IsLocalGame() ) { #ifdef __PSVITA__ - if(CGameNetworkManager::usingAdhocMode() == false) + if(CGameNetworkManager::usingAdhocMode() == false) g_NetworkManager.SendInviteGUI(iPad); #else g_NetworkManager.SendInviteGUI(iPad); @@ -431,7 +431,7 @@ void UIScene_InGameInfoMenu::handlePress(F64 controlId, F64 childId) INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId( m_players[ currentSelection ] ); Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; bool isOp = m_isHostPlayer || localPlayer->isModerator(); bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0; @@ -544,7 +544,7 @@ void UIScene_InGameInfoMenu::OnPlayerChanged(void *callbackParam, INetworkPlayer } } - scene->m_playerList.addItem( playerName, app.GetPlayerColour( scene->m_players[scene->m_playersCount - 1] ), voiceStatus); + scene->m_playerList.addItem( playerName, app.GetPlayerColour( scene->m_players[scene->m_playersCount - 1] ), voiceStatus); } } @@ -554,12 +554,12 @@ int UIScene_InGameInfoMenu::KickPlayerReturned(void *pParam,int iPad,C4JStorage: delete pParam; if(result==C4JStorage::EMessage_ResultAccept) - { + { Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[iPad]; if(localPlayer->connection) { - localPlayer->connection->send( shared_ptr( new KickPlayerPacket(smallId) ) ); + localPlayer->connection->send( std::shared_ptr( new KickPlayerPacket(smallId) ) ); } } @@ -571,7 +571,7 @@ int UIScene_InGameInfoMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStora { UIScene_InGameInfoMenu* pClass = (UIScene_InGameInfoMenu*)pParam; - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { #ifdef __PS3__ SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_InGameInfoMenu::ViewInvites_SignInReturned, pClass); diff --git a/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp index 6eb22b09..aa0e1994 100644 --- a/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp @@ -66,7 +66,7 @@ UIScene_InGamePlayerOptionsMenu::UIScene_InGamePlayerOptionsMenu(int iPad, void #else m_checkboxes[eControl_Op].init(L"DEBUG: Creative",eControl_Op,Player::getPlayerGamePrivilege(m_playerPrivileges,Player::ePlayerGamePrivilege_CreativeMode)); #endif - + removeControl( &m_buttonKick, true ); removeControl( &m_checkboxes[eControl_CheatTeleport], true ); @@ -129,7 +129,7 @@ UIScene_InGamePlayerOptionsMenu::UIScene_InGamePlayerOptionsMenu(int iPad, void m_checkboxes[eControl_HostHunger].SetEnable(true); checked = Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanToggleClassicHunger)!=0; m_checkboxes[eControl_HostHunger].init( app.GetString(IDS_CAN_DISABLE_EXHAUSTION), eControl_HostHunger, checked); - + checked = Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanTeleport)!=0; m_checkboxes[eControl_CheatTeleport].init(app.GetString(IDS_ENABLE_TELEPORT),eControl_CheatTeleport,checked); } @@ -315,11 +315,11 @@ void UIScene_InGamePlayerOptionsMenu::handleInput(int iPad, int key, bool repeat if(originalPrivileges != m_playerPrivileges) { // Send update settings packet to server - Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = pMinecraft->localplayers[m_iPad]; + Minecraft *pMinecraft = Minecraft::GetInstance(); + std::shared_ptr player = pMinecraft->localplayers[m_iPad]; if(player->connection) { - player->connection->send( shared_ptr( new PlayerInfoPacket( m_networkSmallId, -1, m_playerPrivileges) ) ); + player->connection->send( std::shared_ptr( new PlayerInfoPacket( m_networkSmallId, -1, m_playerPrivileges) ) ); } } navigateBack(); @@ -364,12 +364,12 @@ int UIScene_InGamePlayerOptionsMenu::KickPlayerReturned(void *pParam,int iPad,C4 delete pParam; if(result==C4JStorage::EMessage_ResultAccept) - { + { Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[iPad]; if(localPlayer->connection) { - localPlayer->connection->send( shared_ptr( new KickPlayerPacket(smallId) ) ); + localPlayer->connection->send( std::shared_ptr( new KickPlayerPacket(smallId) ) ); } // Fix for #61494 - [CRASH]: TU7: Code: Multiplayer: Title may crash while kicking a player from an online game. @@ -405,7 +405,7 @@ void UIScene_InGamePlayerOptionsMenu::resetCheatCheckboxes() m_checkboxes[eControl_HostInvisible].SetEnable(isModerator); m_checkboxes[eControl_HostFly].SetEnable(isModerator); m_checkboxes[eControl_HostHunger].SetEnable(isModerator); - m_checkboxes[eControl_CheatTeleport].SetEnable(isModerator); + m_checkboxes[eControl_CheatTeleport].SetEnable(isModerator); } } diff --git a/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp index 723937d0..e13a9239 100644 --- a/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp @@ -32,7 +32,7 @@ UIScene_InventoryMenu::UIScene_InventoryMenu(int iPad, void *_initData, UILayer m_previousTutorialState = gameMode->getTutorial()->getCurrentState(); gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Inventory_Menu, this); } - + InventoryMenu *menu = (InventoryMenu *)initData->player->inventoryMenu; initData->player->awardStat(GenericStats::openInventory(),GenericStats::param_openInventory()); @@ -251,7 +251,7 @@ void UIScene_InventoryMenu::updateEffectsDisplay() { // Update with the current effects Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = pMinecraft->localplayers[m_iPad]; + std::shared_ptr player = pMinecraft->localplayers[m_iPad]; if(player == NULL) return; @@ -262,7 +262,7 @@ void UIScene_InventoryMenu::updateEffectsDisplay() IggyDataValue *UpdateValue = new IggyDataValue[activeEffects->size()*2]; for(AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); ++it) - { + { MobEffectInstance *effect = *it; if(effect->getDuration() >= m_bEffectTime[effect->getId()]) diff --git a/Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp index 80db57f8..d21c2906 100644 --- a/Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp @@ -9,7 +9,7 @@ #define PLAYER_ONLINE_TIMER_TIME 100 // if the value is greater than 32000, it's an xzp icon that needs displayed, rather than the game icon -const int UIScene_LeaderboardsMenu::TitleIcons[UIScene_LeaderboardsMenu::NUM_LEADERBOARDS][7] = +const int UIScene_LeaderboardsMenu::TitleIcons[UIScene_LeaderboardsMenu::NUM_LEADERBOARDS][7] = { { UIControl_LeaderboardList::e_ICON_TYPE_WALKED, UIControl_LeaderboardList::e_ICON_TYPE_FALLEN, Item::minecart_Id, Item::boat_Id, NULL }, { Tile::dirt_Id, Tile::stoneBrick_Id, Tile::sand_Id, Tile::rock_Id, Tile::gravel_Id, Tile::clay_Id, Tile::obsidian_Id }, @@ -36,7 +36,7 @@ const UIScene_LeaderboardsMenu::LeaderboardDescriptor UIScene_LeaderboardsMenu:: UIScene_LeaderboardsMenu::LeaderboardDescriptor( 6, false, IDS_LEADERBOARD_FARMING_HARD), // Farming Hard }, { - UIScene_LeaderboardsMenu::LeaderboardDescriptor( 0, false, -1), // + UIScene_LeaderboardsMenu::LeaderboardDescriptor( 0, false, -1), // UIScene_LeaderboardsMenu::LeaderboardDescriptor( 7, false, IDS_LEADERBOARD_KILLS_EASY), // Kills Easy UIScene_LeaderboardsMenu::LeaderboardDescriptor( 7, false, IDS_LEADERBOARD_KILLS_NORMAL), // Kills Normal UIScene_LeaderboardsMenu::LeaderboardDescriptor( 7, false, IDS_LEADERBOARD_KILLS_HARD), // Kills Hard @@ -132,7 +132,7 @@ void UIScene_LeaderboardsMenu::updateTooltips() selection < (GetEntryStartIndex() + m_leaderboard.m_entries.size()) ) { #ifdef _XBOX - if( (m_leaderboard.m_entries[selection - (m_leaderboard.m_entryStartIndex-1)].m_bFriend==false) + if( (m_leaderboard.m_entries[selection - (m_leaderboard.m_entryStartIndex-1)].m_bFriend==false) && (m_leaderboard.m_entries[selection - (m_leaderboard.m_entryStartIndex-1)].m_bRequestedFriend==false)) #endif { @@ -267,7 +267,7 @@ void UIScene_LeaderboardsMenu::handleInput(int iPad, int key, bool repeat, bool SetLeaderboardHeader(); - ReadStats(-1); + ReadStats(-1); ui.PlayUISFX(eSFX_Press); } handled = true; @@ -284,7 +284,7 @@ void UIScene_LeaderboardsMenu::handleInput(int iPad, int key, bool repeat, bool if( m_leaderboard.m_totalEntryCount <= 10 ) break; - + sendInputToMovie(key, repeat, pressed, released); #if 0 @@ -441,7 +441,7 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex) } //app.DebugPrintf("Requesting stats read %d - %d - %d\n", m_currentLeaderboard, startIndex == -1 ? m_currentFilter : LeaderboardManager::eFM_TopRank, m_currentDifficulty); - + LeaderboardManager::EFilterMode filtermode; if ( m_currentFilter == LeaderboardManager::eFM_MyScore || m_currentFilter == LeaderboardManager::eFM_TopRank ) @@ -457,8 +457,8 @@ void UIScene_LeaderboardsMenu::ReadStats(int startIndex) switch (filtermode) { case LeaderboardManager::eFM_TopRank: - LeaderboardManager::Instance()->ReadStats_TopRank( this, - m_currentDifficulty, (LeaderboardManager::EStatsType) m_currentLeaderboard, + LeaderboardManager::Instance()->ReadStats_TopRank( this, + m_currentDifficulty, (LeaderboardManager::EStatsType) m_currentLeaderboard, m_newEntryIndex, m_newReadSize ); break; @@ -529,7 +529,7 @@ bool UIScene_LeaderboardsMenu::RetrieveStats() { m_leaderboard.m_totalEntryCount = NUM_ENTRIES; m_leaderboard.m_numColumns = LEADERBOARD_DESCRIPTORS[m_currentLeaderboard][m_currentDifficulty].m_columnCount; - + //For each entry in the leaderboard for(unsigned int entryIndex=0; entryIndex < NUM_ENTRIES; entryIndex++) { @@ -539,7 +539,7 @@ bool UIScene_LeaderboardsMenu::RetrieveStats() m_leaderboard.m_entries[entryIndex].m_row = entryIndex; m_leaderboard.m_entries[entryIndex].m_rank = entryIndex+1; swprintf(m_leaderboard.m_entries[entryIndex].m_wcRank, 12, L"12345678");//(int)m_leaderboard.m_entries[entryIndex].m_rank); - + swprintf(m_leaderboard.m_entries[entryIndex].m_gamerTag, 17, L"WWWWWWWWWWWWWWWW"); //m_leaderboard.m_entries[entryIndex].m_locale = (entryIndex % 37) + 1; @@ -598,7 +598,7 @@ bool UIScene_LeaderboardsMenu::RetrieveStats() //LeaderboardManager::Instance()->SetStatsRetrieved(false); return false; } - + m_leaderboard.m_numColumns = m_stats.m_queries[0].m_statsSize; for( unsigned int entryIndex=0 ; entryIndex < m_newEntriesCount; ++entryIndex ) @@ -676,7 +676,7 @@ bool UIScene_LeaderboardsMenu::RetrieveStats() insertPosition++; } - + if (deleteFront) { // Delete front x entries @@ -865,7 +865,7 @@ void UIScene_LeaderboardsMenu::PopulateLeaderboard(LeaderboardManager::eStatsRet m_labelInfo.setVisible( false ); m_listEntries.initLeaderboard(m_newSel, m_leaderboard.m_totalEntryCount, LEADERBOARD_DESCRIPTORS[m_currentLeaderboard][m_currentDifficulty].m_columnCount); - + int startIndex = m_newEntryIndex; int entryCount = m_newEntriesCount; @@ -874,7 +874,7 @@ void UIScene_LeaderboardsMenu::PopulateLeaderboard(LeaderboardManager::eStatsRet bool isLast = i == ((startIndex + entryCount) - 1); int idsErrorMessage = m_leaderboard.m_entries[i].m_idsErrorMessage; - + if (idsErrorMessage > 0) { m_listEntries.addDataSet( @@ -882,7 +882,7 @@ void UIScene_LeaderboardsMenu::PopulateLeaderboard(LeaderboardManager::eStatsRet m_leaderboard.m_entries[i].m_row, m_leaderboard.m_entries[i].m_rank, m_leaderboard.m_entries[i].m_gamerTag, - + true, // 4J-JEV: Has error message to display. app.GetString(idsErrorMessage), @@ -896,9 +896,9 @@ void UIScene_LeaderboardsMenu::PopulateLeaderboard(LeaderboardManager::eStatsRet m_leaderboard.m_entries[i].m_row, m_leaderboard.m_entries[i].m_rank, m_leaderboard.m_entries[i].m_gamerTag, - - // 4J-TomK | The bDisplayMessage Flag defines if Leaderboard Data should be - // displayed (false) or if a specific message (true - when data is private for example) + + // 4J-TomK | The bDisplayMessage Flag defines if Leaderboard Data should be + // displayed (false) or if a specific message (true - when data is private for example) // should be displayed. The message itself should be passed on in col0! false, @@ -955,7 +955,7 @@ int UIScene_LeaderboardsMenu::SetLeaderboardTitleIcons() m_listEntries.setColumnIcon(i,TitleIcons[m_currentLeaderboard][i]); } } - + return iValidIcons; } @@ -969,7 +969,7 @@ void UIScene_LeaderboardsMenu::customDraw(IggyCustomDrawCallbackRegion *region) } else { - shared_ptr item = shared_ptr( new ItemInstance(TitleIcons[m_currentLeaderboard][slotId], 1, 0) ); + std::shared_ptr item = std::shared_ptr( new ItemInstance(TitleIcons[m_currentLeaderboard][slotId], 1, 0) ); customDrawSlotControl(region,m_iPad,item,1.0f,false,false); } } diff --git a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp index c29bac2d..fec64a98 100644 --- a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp @@ -85,7 +85,7 @@ void UIScene_SignEntryMenu::tick() for(int i=0;i<4;i++) { wstring temp=m_textInputLines[i].getLabel(); - m_sign->SetMessage(i,temp); + m_sign->SetMessage(i,temp); } m_sign->setChanged(); @@ -94,10 +94,10 @@ void UIScene_SignEntryMenu::tick() // need to send the new data if (pMinecraft->level->isClientSide) { - shared_ptr player = pMinecraft->localplayers[m_iPad]; + std::shared_ptr player = pMinecraft->localplayers[m_iPad]; if(player != NULL && player->connection && player->connection->isStarted()) { - player->connection->send( shared_ptr( new SignUpdatePacket(m_sign->x, m_sign->y, m_sign->z, m_sign->IsVerified(), m_sign->IsCensored(), m_sign->GetMessages()) ) ); + player->connection->send( std::shared_ptr( new SignUpdatePacket(m_sign->x, m_sign->y, m_sign->z, m_sign->IsVerified(), m_sign->IsCensored(), m_sign->GetMessages()) ) ); } } ui.CloseUIScenes(m_iPad); diff --git a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h index 28b37d53..b83a8b2d 100644 --- a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h @@ -17,7 +17,7 @@ private: eControl_Confirm }; - shared_ptr m_sign; + std::shared_ptr m_sign; int m_iEditingLine; bool m_bConfirmed; bool m_bIgnoreInput; diff --git a/Minecraft.Client/Common/UI/UIScene_TeleportMenu.cpp b/Minecraft.Client/Common/UI/UIScene_TeleportMenu.cpp index f6916d13..596f5b67 100644 --- a/Minecraft.Client/Common/UI/UIScene_TeleportMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_TeleportMenu.cpp @@ -11,13 +11,13 @@ UIScene_TeleportMenu::UIScene_TeleportMenu(int iPad, void *initData, UILayer *pa { // Setup all the Iggy references we need for this scene initialiseMovie(); - + TeleportMenuInitData *initParam = (TeleportMenuInitData *)initData; m_teleportToPlayer = initParam->teleportToPlayer; delete initParam; - + if(m_teleportToPlayer) { m_labelTitle.init(app.GetString(IDS_TELEPORT_TO_PLAYER)); @@ -81,7 +81,7 @@ UIScene_TeleportMenu::UIScene_TeleportMenu(int iPad, void *initData, UILayer *pa m_playersVoiceState[m_playersCount] = voiceStatus; m_playersColourState[m_playersCount] = app.GetPlayerColour( m_players[m_playersCount] ); m_playerNames[m_playersCount] = playerName; - m_playerList.addItem( playerName, app.GetPlayerColour( m_players[m_playersCount] ), voiceStatus); + m_playerList.addItem( playerName, app.GetPlayerColour( m_players[m_playersCount] ), voiceStatus); } } @@ -171,7 +171,7 @@ void UIScene_TeleportMenu::handleReload() m_playersVoiceState[m_playersCount] = voiceStatus; m_playersColourState[m_playersCount] = app.GetPlayerColour( m_players[m_playersCount] ); m_playerNames[m_playersCount] = playerName; - m_playerList.addItem( playerName, app.GetPlayerColour( m_players[m_playersCount] ), voiceStatus); + m_playerList.addItem( playerName, app.GetPlayerColour( m_players[m_playersCount] ), voiceStatus); } } @@ -257,8 +257,8 @@ void UIScene_TeleportMenu::handlePress(F64 controlId, F64 childId) int currentSelection = (int)childId; INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId( m_players[ currentSelection ] ); INetworkPlayer *thisPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(m_iPad); - - shared_ptr packet; + + std::shared_ptr packet; if(m_teleportToPlayer) { packet = TeleportCommand::preparePacket(thisPlayer->GetUID(),selectedPlayer->GetUID()); @@ -339,6 +339,6 @@ void UIScene_TeleportMenu::OnPlayerChanged(void *callbackParam, INetworkPlayer * } } - scene->m_playerList.addItem( playerName, app.GetPlayerColour( scene->m_players[scene->m_playersCount - 1] ), voiceStatus); + scene->m_playerList.addItem( playerName, app.GetPlayerColour( scene->m_players[scene->m_playersCount - 1] ), voiceStatus); } } diff --git a/Minecraft.Client/Common/UI/UIScene_TradingMenu.cpp b/Minecraft.Client/Common/UI/UIScene_TradingMenu.cpp index dc2bac48..cd630651 100644 --- a/Minecraft.Client/Common/UI/UIScene_TradingMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_TradingMenu.cpp @@ -11,7 +11,7 @@ UIScene_TradingMenu::UIScene_TradingMenu(int iPad, void *_initData, UILayer *par { // Setup all the Iggy references we need for this scene initialiseMovie(); - + m_showingLeftArrow = true; m_showingRightArrow = true; @@ -36,7 +36,7 @@ UIScene_TradingMenu::UIScene_TradingMenu(int iPad, void *_initData, UILayer *par } m_menu = new MerchantMenu( initData->inventory, initData->trader, initData->level ); - + Minecraft::GetInstance()->localplayers[iPad]->containerMenu = m_menu; m_slotListRequest1.addSlots(BUY_A,1); @@ -93,7 +93,7 @@ void UIScene_TradingMenu::handleDestroy() } // 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss. - // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) + // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) if(pMinecraft->localplayers[m_iPad] != NULL) pMinecraft->localplayers[m_iPad]->closeContainer(); ui.OverrideSFX(m_iPad,ACTION_MENU_A,false); @@ -147,12 +147,12 @@ void UIScene_TradingMenu::customDraw(IggyCustomDrawCallbackRegion *region) Minecraft *pMinecraft = Minecraft::GetInstance(); if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return; - shared_ptr item = nullptr; + std::shared_ptr item = nullptr; int slotId = -1; swscanf((wchar_t*)region->name,L"slot_%d",&slotId); if(slotId < MerchantMenu::USE_ROW_SLOT_END) - { + { Slot *slot = m_menu->getSlot(slotId); item = slot->getItem(); } diff --git a/Minecraft.Client/Common/UI/UIStructs.h b/Minecraft.Client/Common/UI/UIStructs.h index 2dd03c8c..0865cbf3 100644 --- a/Minecraft.Client/Common/UI/UIStructs.h +++ b/Minecraft.Client/Common/UI/UIStructs.h @@ -31,8 +31,8 @@ typedef struct _UIVec2D // Brewing typedef struct _BrewingScreenInput { - shared_ptr inventory; - shared_ptr brewingStand; + std::shared_ptr inventory; + std::shared_ptr brewingStand; int iPad; bool bSplitscreen; } BrewingScreenInput; @@ -40,8 +40,8 @@ typedef struct _BrewingScreenInput // Chest typedef struct _ContainerScreenInput { - shared_ptr inventory; - shared_ptr container; + std::shared_ptr inventory; + std::shared_ptr container; int iPad; bool bSplitscreen; } ContainerScreenInput; @@ -49,8 +49,8 @@ typedef struct _ContainerScreenInput // Dispenser typedef struct _TrapScreenInput { - shared_ptr inventory; - shared_ptr trap; + std::shared_ptr inventory; + std::shared_ptr trap; int iPad; bool bSplitscreen; } TrapScreenInput; @@ -58,16 +58,16 @@ typedef struct _TrapScreenInput // Inventory and creative inventory typedef struct _InventoryScreenInput { - shared_ptr player; + std::shared_ptr player; bool bNavigateBack; // If we came here from the crafting screen, go back to it, rather than closing the xui menus int iPad; bool bSplitscreen; } InventoryScreenInput; -// Enchanting +// Enchanting typedef struct _EnchantingScreenInput { - shared_ptr inventory; + std::shared_ptr inventory; Level *level; int x; int y; @@ -79,8 +79,8 @@ typedef struct _EnchantingScreenInput // Furnace typedef struct _FurnaceScreenInput { - shared_ptr inventory; - shared_ptr furnace; + std::shared_ptr inventory; + std::shared_ptr furnace; int iPad; bool bSplitscreen; } FurnaceScreenInput; @@ -88,21 +88,21 @@ typedef struct _FurnaceScreenInput // Crafting typedef struct _CraftingPanelScreenInput { - shared_ptr player; + std::shared_ptr player; int iContainerType; // RECIPE_TYPE_2x2 or RECIPE_TYPE_3x3 bool bSplitscreen; int iPad; int x; int y; int z; -} +} CraftingPanelScreenInput; // Trading typedef struct _TradingScreenInput { - shared_ptr inventory; - shared_ptr trader; + std::shared_ptr inventory; + std::shared_ptr trader; Level *level; int iPad; bool bSplitscreen; @@ -112,7 +112,7 @@ TradingScreenInput; // Anvil typedef struct _AnvilScreenInput { - shared_ptr inventory; + std::shared_ptr inventory; Level *level; int x; int y; @@ -125,7 +125,7 @@ AnvilScreenInput; // Sign typedef struct _SignEntryScreenInput { - shared_ptr sign; + std::shared_ptr sign; int iPad; } SignEntryScreenInput; @@ -179,7 +179,7 @@ typedef struct _CreateWorldMenuInitData BOOL bOnline; BOOL bIsPrivate; int iPad; -} +} CreateWorldMenuInitData; // Join/Load saves list @@ -223,7 +223,7 @@ typedef struct _LoadMenuInitData int iSaveGameInfoIndex; LevelGenerationOptions *levelGen; SaveListDetails *saveDetails; -} +} LoadMenuInitData; // Join Games @@ -276,7 +276,7 @@ typedef struct _LaunchMoreOptionsMenuInitData seed = L""; bDisableSaving = false; } -} +} LaunchMoreOptionsMenuInitData; typedef struct _LoadingInputParams @@ -352,7 +352,7 @@ typedef struct _SignInInfo } SignInInfo; // Credits -typedef struct +typedef struct { LPCWSTR m_Text; // Should contain string, optionally with %s to add in translated string ... e.g. "Andy West - %s" int m_iStringID[2]; // May be NO_TRANSLATED_STRING if we do not require to add any translated string. @@ -379,8 +379,8 @@ typedef struct _DLCOffersParam { int iPad; int iOfferC; - int iType; -} + int iType; +} DLCOffersParam; typedef struct _InGamePlayerOptionsInitData diff --git a/Minecraft.Client/Common/XUI/SlotProgressControl.cpp b/Minecraft.Client/Common/XUI/SlotProgressControl.cpp index 91f362a3..180ade67 100644 --- a/Minecraft.Client/Common/XUI/SlotProgressControl.cpp +++ b/Minecraft.Client/Common/XUI/SlotProgressControl.cpp @@ -20,8 +20,8 @@ int SlotProgressControl::GetValue() if( pvUserData != NULL ) { SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData; - - shared_ptr item = shared_ptr(); + + std::shared_ptr item = std::shared_ptr(); if( pUserDataContainer->slot != NULL ) { @@ -68,8 +68,8 @@ void SlotProgressControl::GetRange(int *pnRangeMin, int *pnRangeMax) if( pvUserData != NULL ) { SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData; - - shared_ptr item = shared_ptr(); + + std::shared_ptr item = std::shared_ptr(); if( pUserDataContainer->slot != NULL ) { diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.cpp b/Minecraft.Client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.cpp index 82b6c3ed..6989aeef 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.cpp @@ -8,7 +8,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -CXuiCtrlCraftIngredientSlot::CXuiCtrlCraftIngredientSlot() +CXuiCtrlCraftIngredientSlot::CXuiCtrlCraftIngredientSlot() { m_iID=0; m_Desc=NULL; @@ -23,7 +23,7 @@ CXuiCtrlCraftIngredientSlot::CXuiCtrlCraftIngredientSlot() HRESULT CXuiCtrlCraftIngredientSlot::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) { HRESULT hr=S_OK; - + return hr; } //----------------------------------------------------------------------------- @@ -48,10 +48,10 @@ HRESULT CXuiCtrlCraftIngredientSlot::OnCustomMessage_GetSlotItem(CustomMessage_G } HRESULT CXuiCtrlCraftIngredientSlot::OnGetSourceText(XUIMessageGetSourceText *pGetSourceTextData,BOOL& bHandled) -{ +{ pGetSourceTextData->szText=m_Desc; bHandled = TRUE; - + return S_OK; } @@ -72,7 +72,7 @@ void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCo m_item = nullptr; m_iID=iId; m_iAuxVal=iAuxVal; - + // 4J Stu - For clocks and compasses we set the aux value to a special one that signals we should use a default texture // rather than the dynamic one for the player // not right... auxvals for diggables are damage values, can be a lot higher @@ -92,7 +92,7 @@ void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCo XuiElementSetShow(m_hObj,bShow); } -void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow) +void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, std::shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow) { if(item == NULL) SetIcon(iPad, 0,0,0,0,0,false,false,bShow); else diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.h b/Minecraft.Client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.h index 5cf7a7f4..0a46227b 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.h +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.h @@ -16,7 +16,7 @@ public: virtual ~CXuiCtrlCraftIngredientSlot() { }; void SetRedBox(BOOL bVal); void SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha, bool bDecorations, bool isFoil = false, BOOL bShow=TRUE); - void SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=TRUE); + void SetIcon(int iPad, std::shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=TRUE); void SetDescription(LPCWSTR Desc); protected: @@ -31,7 +31,7 @@ protected: HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); private: - shared_ptr m_item; + std::shared_ptr m_item; int m_iID; int m_iAuxVal; int m_iCount; diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_EnchantmentBook.cpp b/Minecraft.Client/Common/XUI/XUI_Ctrl_EnchantmentBook.cpp index 8a56a0ea..b05a8fdd 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_EnchantmentBook.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_EnchantmentBook.cpp @@ -100,7 +100,7 @@ HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &b // Annoyingly, XUI renders everything to a z of 0 so if we want to render anything that needs the z-buffer on top of it, then we need to clear it. // Clear just the region required for this control. - D3DRECT clearRect; + D3DRECT clearRect; clearRect.x1 = (int)(matrix._41) - 2; clearRect.y1 = (int)(matrix._42) - 2; clearRect.x2 = (int)(matrix._41 + ( bwidth * matrix._11 )) + 2; @@ -201,7 +201,7 @@ HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &b //HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &bHandled ) //{ // HXUIDC hDC = pRenderData->hDC; -// +// // RenderManager.Set_matrixDirty(); // // Minecraft *minecraft = Minecraft::GetInstance(); @@ -306,7 +306,7 @@ HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &b void CXuiCtrlEnchantmentBook::tickBook() { EnchantmentMenu *menu = m_containerScene->getMenu(); - shared_ptr current = menu->getSlot(0)->getItem(); + std::shared_ptr current = menu->getSlot(0)->getItem(); if (!ItemInstance::matches(current, last)) { last = current; @@ -328,7 +328,7 @@ void CXuiCtrlEnchantmentBook::tickBook() { shouldBeOpen = true; } - } + } if (shouldBeOpen) open += 0.2f; else open -= 0.2f; diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_EnchantmentBook.h b/Minecraft.Client/Common/XUI/XUI_Ctrl_EnchantmentBook.h index 93da0768..8d22eed9 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_EnchantmentBook.h +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_EnchantmentBook.h @@ -42,7 +42,7 @@ private: float m_fScale,m_fAlpha; int m_iPad; CXuiSceneEnchant *m_containerScene; - shared_ptr last; + std::shared_ptr last; float m_fScreenWidth,m_fScreenHeight; float m_fRawWidth,m_fRawHeight; diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.cpp b/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.cpp index 84273eb5..08e9fdd7 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.cpp @@ -124,7 +124,7 @@ HRESULT CXuiCtrlMinecraftSlot::OnGetSourceImage(XUIMessageGetSourceImage* pData, // if the id is greater than or equal to 32000, then it's an xzp icon, not a game icon if(m_iID<32000) - { + { // 4J Stu - Some parent controls may overide this, others will leave it as what we passed in m_iPad = GET_SLOTDISPLAY_USERINDEX_FROM_DATA_BITMASK(MsgGetSlotItem.iDataBitField); @@ -188,7 +188,7 @@ HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHa { HXUIDC hDC = pRenderData->hDC; CXuiControl xuiControl(m_hObj); - if(m_item == NULL) m_item = shared_ptr( new ItemInstance(m_iID, m_iCount, m_iAuxVal) ); + if(m_item == NULL) m_item = std::shared_ptr( new ItemInstance(m_iID, m_iCount, m_iAuxVal) ); // build and render with the game call @@ -208,15 +208,15 @@ HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHa // we might want separate x & y scales here float scaleX = bwidth / 16.0f; - float scaleY = bheight / 16.0f; + float scaleY = bheight / 16.0f; // apply any scale in the matrix too scaleX *= matrix._11; - scaleY *= matrix._22; + scaleY *= matrix._22; // Annoyingly, XUI renders everything to a z of 0 so if we want to render anything that needs the z-buffer on top of it, then we need to clear it. // Clear just the region required for this control. - D3DRECT clearRect; + D3DRECT clearRect; clearRect.x1 = (int)(matrix._41) - 2; clearRect.y1 = (int)(matrix._42) - 2; clearRect.x2 = (int)(matrix._41 + ( bwidth * matrix._11 )) + 2; @@ -253,7 +253,7 @@ HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHa //Make sure that pMinecraft->player is the correct player so that player specific rendering // eg clock and compass, are rendered correctly - shared_ptr oldPlayer = pMinecraft->player; + std::shared_ptr oldPlayer = pMinecraft->player; if( m_iPad >= 0 && m_iPad < XUSER_MAX_COUNT ) pMinecraft->player = pMinecraft->localplayers[m_iPad]; @@ -281,8 +281,8 @@ HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHa if(m_bDecorations) { if((scaleX!=1.0f) ||(scaleY!=1.0f)) - { - glPushMatrix(); + { + glPushMatrix(); glScalef(scaleX, scaleY, 1.0f); int iX= (int)(0.5f+((float)x)/scaleX); int iY= (int)(0.5f+((float)y)/scaleY); @@ -317,7 +317,7 @@ void CXuiCtrlMinecraftSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCount, i // aux value for diggers can go as high as 1561 //const _Tier *_Tier::DIAMOND = new _Tier(3, 1561, 8, 3); // - // setMaxDamage(tier->getUses()); + // setMaxDamage(tier->getUses()); // int ItemInstance::getDamageValue() // { @@ -343,7 +343,7 @@ void CXuiCtrlMinecraftSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCount, i XuiElementSetShow(m_hObj,bShow); } -void CXuiCtrlMinecraftSlot::SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow) +void CXuiCtrlMinecraftSlot::SetIcon(int iPad, std::shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow) { m_item = item; m_isFoil = item->isFoil(); diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.h b/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.h index 5dafec53..02d06ae6 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.h +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_MinecraftSlot.h @@ -23,7 +23,7 @@ public: void renderGuiItem(Font *font, Textures *textures,ItemInstance *item, int x, int y); void RenderItem(); void SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha,bool bDecorations,BOOL bShow, bool isFoil); - void SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=TRUE); + void SetIcon(int iPad, std::shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=TRUE); protected: @@ -38,7 +38,7 @@ protected: HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); private: - shared_ptr m_item; + std::shared_ptr m_item; BOOL m_bDirty; INT m_iPassThroughDataAssociation; INT m_iPassThroughIdAssociation; diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp b/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp index 87abbcd3..eb5bf366 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp @@ -36,7 +36,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnDestroy( HXUIOBJ hObj ) HRESULT CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem(HXUIOBJ hObj, CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) { - shared_ptr item = shared_ptr(); + std::shared_ptr item = std::shared_ptr(); void* pvUserData; XuiElementGetUserData( hObj, &pvUserData ); @@ -49,7 +49,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem(HXUIOBJ hObj, Cust } else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL) item = player->inventory->getCarried(); } @@ -64,7 +64,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem(HXUIOBJ hObj, Cust // 11 bits - auxval // 6 bits - count // 6 bits - scale - pData->iDataBitField = MAKE_SLOTDISPLAY_DATA_BITMASK(pUserDataContainer->m_iPad, (int)(31*pUserDataContainer->m_fAlpha),true,item->GetCount(),7,item->popTime); + pData->iDataBitField = MAKE_SLOTDISPLAY_DATA_BITMASK(pUserDataContainer->m_iPad, (int)(31*pUserDataContainer->m_fAlpha),true,item->GetCount(),7,item->popTime); } else { @@ -93,7 +93,7 @@ void CXuiCtrlSlotItemCtrlBase::SetUserIndex( HXUIOBJ hObj, int iPad ) XuiElementGetUserData( hObj, &pvUserData ); SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData; - + pUserDataContainer->m_iPad = iPad; } @@ -103,7 +103,7 @@ void CXuiCtrlSlotItemCtrlBase::SetAlpha( HXUIOBJ hObj, float fAlpha ) XuiElementGetUserData( hObj, &pvUserData ); SlotControlUserDataContainer* pUserDataContainer = (SlotControlUserDataContainer*)pvUserData; - + pUserDataContainer->m_fAlpha = fAlpha; } @@ -119,7 +119,7 @@ bool CXuiCtrlSlotItemCtrlBase::isEmpty( HXUIOBJ hObj ) } else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL) return player->inventory->getCarried() == NULL; } @@ -146,7 +146,7 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vectorslot->getItem()->getRarity()->color; int colour = app.GetHTMLColour(rarityColour); @@ -156,7 +156,7 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vector%s",colour,thisString.c_str()); + swprintf(formatted, 256, L"%s",colour,thisString.c_str()); thisString = formatted; } desc.append( thisString ); @@ -167,10 +167,10 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vectorm_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL) { - shared_ptr item = player->inventory->getCarried(); + std::shared_ptr item = player->inventory->getCarried(); if(item != NULL) return app.GetString( item->getDescriptionId() ); } @@ -178,7 +178,7 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vector CXuiCtrlSlotItemCtrlBase::getItemInstance( HXUIOBJ hObj ) +std::shared_ptr CXuiCtrlSlotItemCtrlBase::getItemInstance( HXUIOBJ hObj ) { void* pvUserData; XuiElementGetUserData( hObj, &pvUserData ); @@ -190,7 +190,7 @@ shared_ptr CXuiCtrlSlotItemCtrlBase::getItemInstance( HXUIOBJ hObj } else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL) return player->inventory->getCarried(); } @@ -221,7 +221,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnKeyDown(HXUIOBJ hObj, XUIMessageInput *pInpu XUIMessage message; XUIMessageInput messageInput; - + XuiMessageInput( &message, &messageInput, XUI_KEYDOWN, pInputData->dwKeyCode, pInputData->wch, pInputData->dwFlags, pInputData->UserIndex ); if (HRESULT_SUCCEEDED(hr)) @@ -268,7 +268,7 @@ int CXuiCtrlSlotItemCtrlBase::GetObjectCount( HXUIOBJ hObj ) } else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL && player->inventory->getCarried() != NULL) { iCount = player->inventory->getCarried()->count; @@ -309,7 +309,7 @@ bool CXuiCtrlSlotItemCtrlBase::IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj } else if(pThisUserDataContainer->m_iPad >= 0 && pThisUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pThisUserDataContainer->m_iPad] ); + std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pThisUserDataContainer->m_iPad] ); if(player != NULL && player->inventory->getCarried() != NULL) { iThisID = player->inventory->getCarried()->id; @@ -336,7 +336,7 @@ bool CXuiCtrlSlotItemCtrlBase::IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj } else if(pOtherUserDataContainer->m_iPad >= 0 && pOtherUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pOtherUserDataContainer->m_iPad] ); + std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->localplayers[pOtherUserDataContainer->m_iPad] ); if(player != NULL && player->inventory->getCarried() != NULL) { iOtherID = player->inventory->getCarried()->id; @@ -358,7 +358,7 @@ bool CXuiCtrlSlotItemCtrlBase::IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj // 4J WESTY : Pointer Prototype : Added to support prototype only. // Returns number of items that can still be stacked into this slot. -int CXuiCtrlSlotItemCtrlBase::GetEmptyStackSpace( HXUIOBJ hObj ) +int CXuiCtrlSlotItemCtrlBase::GetEmptyStackSpace( HXUIOBJ hObj ) { int iResult = 0; diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.h b/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.h index 2fd21749..3fe436ad 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.h +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.h @@ -29,9 +29,9 @@ private: public: // We define a lot of functions as virtual. These should be implemented to call the protected version by // passing in the HXUIOBJ of the control as the first parameter. We do not have access to that normally - // due to the inheritance structure + // due to the inheritance structure virtual HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) = 0; - + virtual HRESULT OnDestroy() = 0; virtual HRESULT OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) = 0; @@ -49,7 +49,7 @@ public: wstring GetItemDescription( HXUIOBJ hObj, vector &unformattedStrings ); - shared_ptr getItemInstance( HXUIOBJ hObj ); + std::shared_ptr getItemInstance( HXUIOBJ hObj ); Slot *getSlot( HXUIOBJ hObj ); // 4J WESTY : Pointer Prototype : Added to support prototype only. @@ -64,9 +64,9 @@ public: // 4J WESTY : Pointer Prototype : Added to support prototype only. bool IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj ); -protected: +protected: HRESULT OnInit( HXUIOBJ hObj, XUIMessageInit* pInitData, BOOL& bHandled ); - + HRESULT OnDestroy( HXUIOBJ hObj ); HRESULT OnCustomMessage_GetSlotItem(HXUIOBJ hObj, CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled); diff --git a/Minecraft.Client/Common/XUI/XUI_CustomMessages.h b/Minecraft.Client/Common/XUI/XUI_CustomMessages.h index 888f8ad0..0744f826 100644 --- a/Minecraft.Client/Common/XUI/XUI_CustomMessages.h +++ b/Minecraft.Client/Common/XUI/XUI_CustomMessages.h @@ -8,13 +8,13 @@ #define XM_INVENTORYUPDATED_MESSAGE XM_USER + 5 #define XM_TMS_DLCFILE_RETRIEVED_MESSAGE XM_USER + 6 #define XM_TMS_BANFILE_RETRIEVED_MESSAGE XM_USER + 7 -#define XM_TMS_ALLFILES_RETRIEVED_MESSAGE XM_USER + 8 +#define XM_TMS_ALLFILES_RETRIEVED_MESSAGE XM_USER + 8 #define XM_CUSTOMTICKSCENE_MESSAGE XM_USER + 9 #define XM_GETSLOTITEM_MESSAGE XM_USER + 10 typedef struct { - shared_ptr item; + std::shared_ptr item; // Legacy values for compatibility int iDataBitField; diff --git a/Minecraft.Client/Common/XUI/XUI_DebugItemEditor.cpp b/Minecraft.Client/Common/XUI/XUI_DebugItemEditor.cpp index 56b41267..0931f50d 100644 --- a/Minecraft.Client/Common/XUI/XUI_DebugItemEditor.cpp +++ b/Minecraft.Client/Common/XUI/XUI_DebugItemEditor.cpp @@ -9,7 +9,7 @@ #include "..\..\Common\GameRules\ConsoleGameRules.h" #include "XUI_DebugItemEditor.h" -#ifdef _DEBUG_MENUS_ENABLED +#ifdef _DEBUG_MENUS_ENABLED HRESULT CScene_DebugItemEditor::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) { MapChildControls(); @@ -22,7 +22,7 @@ HRESULT CScene_DebugItemEditor::OnInit( XUIMessageInit *pInitData, BOOL &bHandle if(m_item!=NULL) { - m_icon->SetIcon(m_iPad, m_item->id,m_item->getAuxValue(),m_item->count,10,31,false,m_item->isFoil()); + m_icon->SetIcon(m_iPad, m_item->id,m_item->getAuxValue(),m_item->count,10,31,false,m_item->isFoil()); m_itemName.SetText( app.GetString( Item::items[m_item->id]->getDescriptionId(m_item) ) ); m_itemId .SetText( _toString(m_item->id).c_str() ); @@ -59,8 +59,8 @@ HRESULT CScene_DebugItemEditor::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfH m_slot->set(m_item); Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = pMinecraft->localplayers[m_iPad]; - if(player != NULL && player->connection) player->connection->send( shared_ptr( new ContainerSetSlotPacket(m_menu->containerId, m_slot->index, m_item) ) ); + std::shared_ptr player = pMinecraft->localplayers[m_iPad]; + if(player != NULL && player->connection) player->connection->send( std::shared_ptr( new ContainerSetSlotPacket(m_menu->containerId, m_slot->index, m_item) ) ); } // kill the crafting xui app.NavigateBack(m_iPad); @@ -76,7 +76,7 @@ HRESULT CScene_DebugItemEditor::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfH HRESULT CScene_DebugItemEditor::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled) { - if(m_item == NULL) m_item = shared_ptr( new ItemInstance(0,1,0) ); + if(m_item == NULL) m_item = std::shared_ptr( new ItemInstance(0,1,0) ); if(hObjSource == m_itemId) { int id = 0; @@ -107,7 +107,7 @@ HRESULT CScene_DebugItemEditor::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINot if(!value.empty()) data = _fromString( value ); m_item->set4JData(data); } - + m_icon->SetIcon(m_iPad, m_item->id,m_item->getAuxValue(),m_item->count,10,31,false,m_item->isFoil()); m_itemName.SetText( app.GetString( Item::items[m_item->id]->getDescriptionId(m_item) ) ); diff --git a/Minecraft.Client/Common/XUI/XUI_DebugItemEditor.h b/Minecraft.Client/Common/XUI/XUI_DebugItemEditor.h index 2e2f5b5a..0445a679 100644 --- a/Minecraft.Client/Common/XUI/XUI_DebugItemEditor.h +++ b/Minecraft.Client/Common/XUI/XUI_DebugItemEditor.h @@ -8,7 +8,7 @@ using namespace std; class CScene_DebugItemEditor : public CXuiSceneImpl { -#ifdef _DEBUG_MENUS_ENABLED +#ifdef _DEBUG_MENUS_ENABLED public: typedef struct _ItemEditorInput { @@ -18,7 +18,7 @@ public: } ItemEditorInput; private: int m_iPad; - shared_ptr m_item; + std::shared_ptr m_item; Slot *m_slot; AbstractContainerMenu *m_menu; diff --git a/Minecraft.Client/Common/XUI/XUI_InGameHostOptions.cpp b/Minecraft.Client/Common/XUI/XUI_InGameHostOptions.cpp index f0561745..53e400a8 100644 --- a/Minecraft.Client/Common/XUI/XUI_InGameHostOptions.cpp +++ b/Minecraft.Client/Common/XUI/XUI_InGameHostOptions.cpp @@ -50,7 +50,7 @@ HRESULT CScene_InGameHostOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHand CXuiSceneBase::ShowLogo( m_iPad, FALSE ); - + //SentientManager.RecordMenuShown(m_iPad, eUIScene_CreateWorldMenu, 0); return S_OK; @@ -74,11 +74,11 @@ HRESULT CScene_InGameHostOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& r // Send update settings packet to server if(hostOptions != app.GetGameHostOption(eGameHostOption_All) ) { - Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = pMinecraft->localplayers[m_iPad]; + Minecraft *pMinecraft = Minecraft::GetInstance(); + std::shared_ptr player = pMinecraft->localplayers[m_iPad]; if(player != NULL && player->connection) { - player->connection->send( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, hostOptions) ) ); + player->connection->send( std::shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, hostOptions) ) ); } } diff --git a/Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp b/Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp index 4839013c..c9b9f76f 100644 --- a/Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp +++ b/Minecraft.Client/Common/XUI/XUI_InGameInfo.cpp @@ -58,7 +58,7 @@ HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) if(thisPlayer != NULL) m_isHostPlayer = thisPlayer->IsHost() == TRUE; Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; if(!m_isHostPlayer && !localPlayer->isModerator() ) { m_gameOptionsButton.SetEnable(FALSE); @@ -77,7 +77,7 @@ HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) int keyA = -1; ui.SetTooltips( m_iPad, keyA,IDS_TOOLTIPS_BACK,keyX,-1); - + CXuiSceneBase::ShowDarkOverlay( m_iPad, TRUE ); SetTimer( TOOLTIP_TIMERID , INGAME_INFO_TOOLTIP_TIMER ); @@ -179,11 +179,11 @@ HRESULT CScene_InGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); if( hObjPressed == playersList ) - { + { INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId( m_players[ playersList.GetCurSel() ] ); - + Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; bool isOp = m_isHostPlayer || localPlayer->isModerator(); bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0; @@ -220,7 +220,7 @@ HRESULT CScene_InGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* } } else if( hObjPressed == m_gameOptionsButton ) - { + { app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_InGameHostOptionsMenu); } return S_OK; @@ -330,7 +330,7 @@ HRESULT CScene_InGameInfo::OnGetSourceDataText(XUIMessageGetSourceText *pGetSour } HRESULT hr; - HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon; + HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon; hButton = playersList.GetItemControl(pGetSourceTextData->iItem); hr=XuiControlGetVisual(hButton,&hVisual); @@ -415,7 +415,7 @@ HRESULT CScene_InGameInfo::OnGetSourceDataText(XUIMessageGetSourceText *pGetSour XuiElementFindNamedFrame(hVoiceIcon, L"NotSpeaking", &playFrame); } } - + if(playFrame < 0) { XuiElementFindNamedFrame(hVoiceIcon, L"Normal", &playFrame); @@ -465,8 +465,8 @@ void CScene_InGameInfo::updateTooltips() int keyA = -1; Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; - + std::shared_ptr localPlayer = pMinecraft->localplayers[m_iPad]; + bool isOp = m_isHostPlayer || localPlayer->isModerator(); bool cheats = app.GetGameHostOption(eGameHostOption_CheatsEnabled) != 0; bool trust = app.GetGameHostOption(eGameHostOption_TrustPlayers) != 0; @@ -524,12 +524,12 @@ int CScene_InGameInfo::KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMes delete pParam; if(result==C4JStorage::EMessage_ResultAccept) - { + { Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[iPad]; if(localPlayer != NULL && localPlayer->connection) { - localPlayer->connection->send( shared_ptr( new KickPlayerPacket(smallId) ) ); + localPlayer->connection->send( std::shared_ptr( new KickPlayerPacket(smallId) ) ); } } diff --git a/Minecraft.Client/Common/XUI/XUI_InGamePlayerOptions.cpp b/Minecraft.Client/Common/XUI/XUI_InGamePlayerOptions.cpp index 156cd092..6334574f 100644 --- a/Minecraft.Client/Common/XUI/XUI_InGamePlayerOptions.cpp +++ b/Minecraft.Client/Common/XUI/XUI_InGamePlayerOptions.cpp @@ -141,7 +141,7 @@ HRESULT CScene_InGamePlayerOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHa m_checkboxes[eControl_HostInvisible].SetText( app.GetString(IDS_CAN_INVISIBLE) ); m_checkboxes[eControl_HostInvisible].SetCheck(checked); - + bool inCreativeMode = Player::getPlayerGamePrivilege(m_playerPrivileges,Player::ePlayerGamePrivilege_CreativeMode) != 0; if(inCreativeMode) { @@ -191,7 +191,7 @@ HRESULT CScene_InGamePlayerOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHa ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK); - CXuiSceneBase::ShowLogo( m_iPad, FALSE ); + CXuiSceneBase::ShowLogo( m_iPad, FALSE ); g_NetworkManager.RegisterPlayerChangedCallback(m_iPad, &CScene_InGamePlayerOptions::OnPlayerChanged, this); @@ -276,11 +276,11 @@ HRESULT CScene_InGamePlayerOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& if(originalPrivileges != m_playerPrivileges) { // Send update settings packet to server - Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = pMinecraft->localplayers[m_iPad]; + Minecraft *pMinecraft = Minecraft::GetInstance(); + std::shared_ptr player = pMinecraft->localplayers[m_iPad]; if(player != NULL && player->connection) { - player->connection->send( shared_ptr( new PlayerInfoPacket( m_networkSmallId, -1, m_playerPrivileges) ) ); + player->connection->send( std::shared_ptr( new PlayerInfoPacket( m_networkSmallId, -1, m_playerPrivileges) ) ); } } @@ -334,12 +334,12 @@ int CScene_InGamePlayerOptions::KickPlayerReturned(void *pParam,int iPad,C4JStor delete pParam; if(result==C4JStorage::EMessage_ResultAccept) - { + { Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr localPlayer = pMinecraft->localplayers[iPad]; + std::shared_ptr localPlayer = pMinecraft->localplayers[iPad]; if(localPlayer != NULL && localPlayer->connection) { - localPlayer->connection->send( shared_ptr( new KickPlayerPacket(smallId) ) ); + localPlayer->connection->send( std::shared_ptr( new KickPlayerPacket(smallId) ) ); } // Fix for #61494 - [CRASH]: TU7: Code: Multiplayer: Title may crash while kicking a player from an online game. @@ -478,22 +478,22 @@ void CScene_InGamePlayerOptions::resetCheatCheckboxes() if (!m_editingSelf) { m_checkboxes[eControl_HostInvisible].SetEnable(isModerator); - m_checkboxes[eControl_HostInvisible].SetCheck( isModerator + m_checkboxes[eControl_HostInvisible].SetCheck( isModerator && (Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanToggleInvisible) != 0) ); // NOT CREATIVE MODE. { m_checkboxes[eControl_HostFly].SetEnable(isModerator); - m_checkboxes[eControl_HostFly].SetCheck( isModerator + m_checkboxes[eControl_HostFly].SetCheck( isModerator && (Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanToggleFly) != 0) ); m_checkboxes[eControl_HostHunger].SetEnable(isModerator); - m_checkboxes[eControl_HostHunger].SetCheck( isModerator + m_checkboxes[eControl_HostHunger].SetCheck( isModerator && (Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanToggleClassicHunger) != 0) ); } m_checkboxes[eControl_CheatTeleport].SetEnable(isModerator); - m_checkboxes[eControl_CheatTeleport].SetCheck( isModerator + m_checkboxes[eControl_CheatTeleport].SetCheck( isModerator && (Player::getPlayerGamePrivilege(m_playerPrivileges, Player::ePlayerGamePrivilege_CanTeleport) != 0) ); } } \ No newline at end of file diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.cpp index 10369d5e..ecdc358a 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.cpp @@ -24,7 +24,7 @@ #include "XUI_Ctrl_SlotItem.h" #include "XUI_Ctrl_SlotItemListItem.h" #include "XUI_Scene_AbstractContainer.h" -#ifdef _DEBUG_MENUS_ENABLED +#ifdef _DEBUG_MENUS_ENABLED #include "XUI_DebugItemEditor.h" #endif @@ -44,14 +44,14 @@ void CXuiSceneAbstractContainer::PlatformInitialize(int iPad, int startIndex) // We may have varying depths of controls here, so base off the pointers parent HXUIOBJ parent; - XuiElementGetBounds( m_pointerControl->m_hObj, &fPointerWidth, &fPointerHeight ); + XuiElementGetBounds( m_pointerControl->m_hObj, &fPointerWidth, &fPointerHeight ); XuiElementGetParent( m_pointerControl->m_hObj, &parent ); m_pointerControl->SetShow(TRUE); - XuiElementGetBounds( parent, &fPanelWidth, &fPanelHeight ); + XuiElementGetBounds( parent, &fPanelWidth, &fPanelHeight ); // Get size of pointer m_fPointerImageOffsetX = floor(fPointerWidth/2.0f); m_fPointerImageOffsetY = floor(fPointerHeight/2.0f); - + m_fPanelMinX = 0.0f; m_fPanelMaxX = fPanelWidth; m_fPanelMinY = 0.0f; @@ -97,13 +97,13 @@ void CXuiSceneAbstractContainer::PlatformInitialize(int iPad, int startIndex) m_pointerPos.x = newPointerPos.x; m_pointerPos.y = newPointerPos.y; -#ifdef USE_POINTER_ACCEL +#ifdef USE_POINTER_ACCEL m_fPointerVelX = 0.0f; m_fPointerVelY = 0.0f; m_fPointerAccelX = 0.0f; m_fPointerAccelY = 0.0f; #endif - + // Add timer to poll controller stick input at 60Hz HRESULT timerResult = SetTimer( POINTER_INPUT_TIMER_ID, ( 1000 / 60 ) ); assert( timerResult == S_OK ); @@ -114,7 +114,7 @@ void CXuiSceneAbstractContainer::PlatformInitialize(int iPad, int startIndex) for ( int iSection = m_eFirstSection; iSection < m_eMaxSection; ++iSection ) { ESceneSection eSection = ( ESceneSection )( iSection ); - + if(!IsSectionSlotList(eSection)) continue; // Get dimensions of this section. @@ -153,7 +153,7 @@ int CXuiSceneAbstractContainer::getSectionRows(ESceneSection eSection) return GetSectionSlotList( eSection )->GetRows(); } -// Adding this so we can turn off the pointer text background, since it flickers on then off at the start of a scene where a tutorial popup is +// Adding this so we can turn off the pointer text background, since it flickers on then off at the start of a scene where a tutorial popup is HRESULT CXuiSceneAbstractContainer::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) { if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -306,7 +306,7 @@ void CXuiSceneAbstractContainer::GetItemScreenData( ESceneSection eSection, int } } -shared_ptr CXuiSceneAbstractContainer::getSlotItem(ESceneSection eSection, int iSlot) +std::shared_ptr CXuiSceneAbstractContainer::getSlotItem(ESceneSection eSection, int iSlot) { CXuiCtrlSlotItemListItem* pCXuiCtrlSlotItem; GetSectionSlotList( eSection )->GetCXuiCtrlSlotItem( iSlot, &( pCXuiCtrlSlotItem ) ); @@ -327,7 +327,7 @@ HRESULT CXuiSceneAbstractContainer::OnTimer( XUIMessageTimer *pTimer, BOOL& bHan // Update pointer from stick input on timer. if ( pTimer->nId == POINTER_INPUT_TIMER_ID ) { - + onMouseTick(); D3DXVECTOR3 pointerPos; pointerPos.x = m_pointerPos.x; @@ -348,7 +348,7 @@ HRESULT CXuiSceneAbstractContainer::OnTimer( XUIMessageTimer *pTimer, BOOL& bHan hr = handleCustomTimer( pTimer, bHandled ); } return hr; -} +} HRESULT CXuiSceneAbstractContainer::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) { @@ -443,7 +443,7 @@ void CXuiSceneAbstractContainer::adjustPointerForSafeZone() D3DXVECTOR2 baseSceneOrigin; float baseWidth, baseHeight; if(CXuiSceneBase::GetBaseSceneSafeZone( m_iPad, baseSceneOrigin, baseWidth, baseHeight)) - { + { D3DXMATRIX pointerBackgroundMatrix; XuiElementGetFullXForm( m_hPointerTextBkg, &pointerBackgroundMatrix); diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.h b/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.h index ca191db5..939dda0b 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.h +++ b/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.h @@ -25,7 +25,7 @@ protected: CXuiCtrlSlotList* m_useRowControl; CXuiCtrlSlotItem* m_pointerControl; CXuiControl m_InventoryText; - + HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); // Timer function to poll stick input and update pointer position. HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); @@ -64,7 +64,7 @@ public: HXUIOBJ m_hPointerText; HXUIOBJ m_hPointerTextBkg; HXUIOBJ m_hPointerImg; - + virtual int getSectionColumns(ESceneSection eSection); virtual int getSectionRows(ESceneSection eSection); virtual CXuiControl* GetSectionControl( ESceneSection eSection ) = 0; @@ -77,7 +77,7 @@ public: void setSectionSelectedSlot(ESceneSection eSection, int x, int y); void setFocusToPointer(int iPad); void SetPointerText(const wstring &description, vector &unformattedStrings, bool newSlot); - virtual shared_ptr getSlotItem(ESceneSection eSection, int iSlot); + virtual std::shared_ptr getSlotItem(ESceneSection eSection, int iSlot); virtual bool isSlotEmpty(ESceneSection eSection, int iSlot); virtual void adjustPointerForSafeZone(); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp index 1a679f58..3f53bfe0 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp @@ -215,7 +215,7 @@ void CXuiSceneBase::_TickAllBaseScenes() } else { - shared_ptr boss = EnderDragonRenderer::bossInstance; + std::shared_ptr boss = EnderDragonRenderer::bossInstance; EnderDragonRenderer::bossInstance = nullptr; m_ticksWithNoBoss = 0; diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Container.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_Container.cpp index 39b836d2..9c556e72 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_Container.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Container.cpp @@ -30,12 +30,12 @@ HRESULT CXuiSceneContainer::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) Minecraft *pMinecraft = Minecraft::GetInstance(); ContainerScreenInput* initData = (ContainerScreenInput*)pInitData->pvInitData; - + XuiControlSetText(m_ChestText,app.GetString(initData->container->getName())); ContainerMenu* menu = new ContainerMenu( initData->inventory, initData->container ); - shared_ptr container = initData->container; + std::shared_ptr container = initData->container; m_iPad=initData->iPad; m_bSplitscreen=initData->bSplitscreen; @@ -61,7 +61,7 @@ HRESULT CXuiSceneContainer::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) // Adjust the height to show the correct number of container rows float height, width; - this->GetBounds( &width, &height ); + this->GetBounds( &width, &height ); int rowDiff = CONTAINER_DEFAULT_ROWS - rows; //height = height - (rowDiff * ROW_HEIGHT); height = height - (rowDiff * fPointerHeight); @@ -103,7 +103,7 @@ HRESULT CXuiSceneContainer::OnDestroy() #endif // 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss. - // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) + // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer(); return S_OK; } @@ -156,7 +156,7 @@ void CXuiSceneContainer::InitDataAssociations(int iPad, AbstractContainerMenu *m // TODO Inventory dimensions need defined as constants m_containerControl->SetData( iPad, menu, rows, 9, 0 ); - + CXuiSceneAbstractContainer::InitDataAssociations(iPad, menu, containerSize); } diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_CraftingPanel.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_CraftingPanel.cpp index a5dc6584..90b4b87d 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_CraftingPanel.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_CraftingPanel.cpp @@ -22,7 +22,7 @@ ////////////////////////////////////////////////////////////////////////// // -// +// // ////////////////////////////////////////////////////////////////////////// CXuiSceneCraftingPanel::CXuiSceneCraftingPanel() @@ -46,10 +46,10 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle m_iPad=pCraftingPanelData->iPad; m_bSplitscreen=pCraftingPanelData->bSplitscreen; - HRESULT hr = S_OK; + HRESULT hr = S_OK; MapChildControls(); - + if(m_iContainerType==RECIPE_TYPE_2x2) { // TODO Inventory dimensions need defined as constants @@ -74,7 +74,7 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle // if we are in splitscreen, then we need to figure out if we want to move this scene if(m_bSplitscreen) { - app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); + app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); } XuiElementSetShow(m_hGrid,TRUE); @@ -84,7 +84,7 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle if(m_iContainerType==RECIPE_TYPE_3x3) { m_pCursors=m_pHSlotsCraftingTableCursors; - + m_iIngredientsMaxSlotC = m_iIngredients3x3SlotC; for(int i=0;idwTransAction==XUI_TRANSITION_ACTION_DESTROY ) + // are we being destroyed? If so, don't do anything + if(pTransData->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) { return S_OK; } @@ -222,7 +222,7 @@ HRESULT CXuiSceneCraftingPanel::OnTransitionEnd( XUIMessageTransition *pTransDat // Display the tooltips ui.SetTooltips(m_iPad, IDS_TOOLTIPS_CREATE,IDS_TOOLTIPS_EXIT, IDS_TOOLTIPS_SHOW_INVENTORY,-1,-1,-1,-2, IDS_TOOLTIPS_CHANGE_GROUP); - CXuiSceneBase::EnableTooltip(m_iPad, BUTTON_TOOLTIP_A, FALSE ); + CXuiSceneBase::EnableTooltip(m_iPad, BUTTON_TOOLTIP_A, FALSE ); // Check which recipes are available with the resources we have CheckRecipesAvailable(); @@ -241,7 +241,7 @@ HRESULT CXuiSceneCraftingPanel::OnCustomMessage_InventoryUpdated() { // Display the tooltips ui.SetTooltips(m_iPad, IDS_TOOLTIPS_CREATE,IDS_TOOLTIPS_EXIT, IDS_TOOLTIPS_SHOW_INVENTORY,-1,-1,-1,-2, IDS_TOOLTIPS_CHANGE_GROUP); - CXuiSceneBase::EnableTooltip(m_iPad, BUTTON_TOOLTIP_A, FALSE ); + CXuiSceneBase::EnableTooltip(m_iPad, BUTTON_TOOLTIP_A, FALSE ); // Check which recipes are available with the resources we have CheckRecipesAvailable(); @@ -359,7 +359,7 @@ HRESULT CXuiSceneCraftingPanel::OnDestroy() } #endif - // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) + // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer(); return S_OK; @@ -417,21 +417,21 @@ void CXuiSceneCraftingPanel::hideAllIngredientsSlots() } } -void CXuiSceneCraftingPanel::setCraftHSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha) +void CXuiSceneCraftingPanel::setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha) { m_pHSlotsBrushImageControl[iIndex]->SetIcon(iPad, item, 9, uiAlpha, false); //m_pHSlotsBrushImageControl[iIndex]->SetPassThroughDataAssociation(MAKE_SLOTDISPLAY_ITEM_BITMASK(item->id,item->getAuxValue(),item->isFoil()),MAKE_SLOTDISPLAY_DATA_BITMASK (iPad, uiAlpha, false, item->GetCount(), 9,0) ); //m_pHSlotsBrushImageControl[iIndex]->SetShow(TRUE); } -void CXuiSceneCraftingPanel::setCraftVSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha) +void CXuiSceneCraftingPanel::setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha) { m_pVSlotsBrushImageControl[iIndex]->SetIcon(iPad, item, 9, uiAlpha, false); //m_pVSlotsBrushImageControl[iIndex]->SetPassThroughDataAssociation(MAKE_SLOTDISPLAY_ITEM_BITMASK(item->id,item->getAuxValue(),item->isFoil()),MAKE_SLOTDISPLAY_DATA_BITMASK (iPad, uiAlpha, false, item->GetCount(), 9,0) ); //m_pVSlotsBrushImageControl[iIndex]->SetShow(TRUE); } -void CXuiSceneCraftingPanel::setCraftingOutputSlotItem(int iPad, shared_ptr item) +void CXuiSceneCraftingPanel::setCraftingOutputSlotItem(int iPad, std::shared_ptr item) { if(item == NULL) { @@ -448,7 +448,7 @@ void CXuiSceneCraftingPanel::setCraftingOutputSlotRedBox(bool show) m_pCraftingOutput->SetRedBox(show?TRUE:FALSE); } -void CXuiSceneCraftingPanel::setIngredientSlotItem(int iPad, int index, shared_ptr item) +void CXuiSceneCraftingPanel::setIngredientSlotItem(int iPad, int index, std::shared_ptr item) { if(item == NULL) { @@ -465,7 +465,7 @@ void CXuiSceneCraftingPanel::setIngredientSlotRedBox(int index, bool show) m_pCraftingIngredientA[index]->SetRedBox(show?TRUE:FALSE); } -void CXuiSceneCraftingPanel::setIngredientDescriptionItem(int iPad, int index, shared_ptr item) +void CXuiSceneCraftingPanel::setIngredientDescriptionItem(int iPad, int index, std::shared_ptr item) { m_pCraftIngredientDescA[index]->SetIcon(iPad, item->id,item->getAuxValue(),item->GetCount(),8,31,TRUE,item->isFoil(),FALSE); } @@ -524,7 +524,7 @@ void CXuiSceneCraftingPanel::UpdateMultiPanel() // turn off the inventory XuiElementSetShow(m_hGridInventory,FALSE); XuiElementSetShow(m_DescriptionText,TRUE); - XuiElementSetShow(m_InventoryText,FALSE); + XuiElementSetShow(m_InventoryText,FALSE); break; case DISPLAY_INGREDIENTS: // turn off all the descriptions @@ -544,7 +544,7 @@ void CXuiSceneCraftingPanel::UpdateMultiPanel() { XuiControlSetText(m_InventoryText,app.GetString(IDS_INGREDIENTS)); XuiElementSetShow(m_InventoryText,TRUE); - } + } break; } } diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_CraftingPanel.h b/Minecraft.Client/Common/XUI/XUI_Scene_CraftingPanel.h index 0c6e22ff..df2090ec 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_CraftingPanel.h +++ b/Minecraft.Client/Common/XUI/XUI_Scene_CraftingPanel.h @@ -3,7 +3,7 @@ using namespace std; #include "../media/xuiscene_craftingpanel_2x2.h" #include "XUI_Ctrl_MinecraftSlot.h" -#include "..\..\..\Minecraft.World\Recipy.h" +#include "..\..\..\Minecraft.World\Recipy.h" #include "XUI_Ctrl_CraftIngredientSlot.h" #include "..\..\..\Minecraft.World\Item.h" #include "XUI_CustomMessages.h" @@ -137,7 +137,7 @@ public: MAP_CONTROL(IDC_CraftingOutputRed,m_hCraftOutput) END_MAP_CHILD_CONTROLS() - + MAP_CONTROL(IDC_InventoryGrid, m_hGridInventory) BEGIN_MAP_CHILD_CONTROLS(m_hGridInventory) MAP_OVERRIDE(IDC_Inventory, m_inventoryControl) @@ -182,13 +182,13 @@ protected: virtual void hideAllHSlots(); virtual void hideAllVSlots(); virtual void hideAllIngredientsSlots(); - virtual void setCraftHSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha); - virtual void setCraftVSlotItem(int iPad, int iIndex, shared_ptr item, unsigned int uiAlpha); - virtual void setCraftingOutputSlotItem(int iPad, shared_ptr item); + virtual void setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha); + virtual void setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr item, unsigned int uiAlpha); + virtual void setCraftingOutputSlotItem(int iPad, std::shared_ptr item); virtual void setCraftingOutputSlotRedBox(bool show); - virtual void setIngredientSlotItem(int iPad, int index, shared_ptr item); + virtual void setIngredientSlotItem(int iPad, int index, std::shared_ptr item); virtual void setIngredientSlotRedBox(int index, bool show); - virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr item); + virtual void setIngredientDescriptionItem(int iPad, int index, std::shared_ptr item); virtual void setIngredientDescriptionRedBox(int index, bool show); virtual void setIngredientDescriptionText(int index, LPCWSTR text); virtual void setShowCraftHSlot(int iIndex, bool show); @@ -200,6 +200,6 @@ protected: virtual void scrollDescriptionDown(); virtual void updateHighlightAndScrollPositions(); virtual void updateVSlotPositions(int iSlots, int i); - + virtual void UpdateMultiPanel(); }; diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Inventory.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_Inventory.cpp index 04e77e5e..c715bba5 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_Inventory.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Inventory.cpp @@ -33,7 +33,7 @@ HRESULT CXuiSceneInventory::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) { if(m_bSplitscreen) { - app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); + app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); } } @@ -57,7 +57,7 @@ HRESULT CXuiSceneInventory::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) initData->player->awardStat(GenericStats::openInventory(), GenericStats::param_noArgs()); CXuiSceneAbstractContainer::Initialize( initData->iPad, menu, false, InventoryMenu::INV_SLOT_START, eSectionInventoryUsing, eSectionInventoryMax, initData->bNavigateBack ); - + delete initData; float fWidth; @@ -86,7 +86,7 @@ HRESULT CXuiSceneInventory::OnDestroy() } // 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss. - // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) + // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer(); return S_OK; } @@ -154,7 +154,7 @@ void CXuiSceneInventory::updateEffectsDisplay() { // Update with the current effects Minecraft *pMinecraft = Minecraft::GetInstance(); - shared_ptr player = pMinecraft->localplayers[m_iPad]; + std::shared_ptr player = pMinecraft->localplayers[m_iPad]; if(player == NULL) return; @@ -185,7 +185,7 @@ void CXuiSceneInventory::updateEffectsDisplay() if(i > 0) position.y -= fNextEffectYOffset; // Stack from the bottom m_hEffectDisplayA[i]->SetPosition(&position); - + MobEffectInstance *effect = *it; MobEffect *mobEffect = MobEffect::effects[effect->getId()]; diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Inventory_Creative.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_Inventory_Creative.cpp index 0793fc9e..bb5319a3 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_Inventory_Creative.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Inventory_Creative.cpp @@ -43,7 +43,7 @@ HRESULT CXuiSceneInventoryCreative::OnInit( XUIMessageInit *pInitData, BOOL &bHa { if(m_bSplitscreen) { - app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); + app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); } } @@ -60,12 +60,12 @@ HRESULT CXuiSceneInventoryCreative::OnInit( XUIMessageInit *pInitData, BOOL &bHa initData->player->awardStat(GenericStats::openInventory(), GenericStats::param_noArgs()); // 4J JEV - Item Picker Menu - shared_ptr creativeContainer = shared_ptr(new SimpleContainer( 0, TabSpec::MAX_SIZE + 9 )); + std::shared_ptr creativeContainer = std::shared_ptr(new SimpleContainer( 0, TabSpec::MAX_SIZE + 9 )); itemPickerMenu = new ItemPickerMenu(creativeContainer, initData->player->inventory); - + // 4J JEV - InitDataAssociations. m_containerControl->SetData( initData->iPad, itemPickerMenu, TabSpec::rows, TabSpec::columns, 0, TabSpec::MAX_SIZE ); - m_useRowControl->SetData( initData->iPad, itemPickerMenu, 1, 9, TabSpec::MAX_SIZE, TabSpec::MAX_SIZE + 9 ); + m_useRowControl->SetData( initData->iPad, itemPickerMenu, 1, 9, TabSpec::MAX_SIZE, TabSpec::MAX_SIZE + 9 ); m_pointerControl->SetUserIndex(m_pointerControl->m_hObj, initData->iPad); // Initialize superclass. @@ -79,7 +79,7 @@ HRESULT CXuiSceneInventoryCreative::OnInit( XUIMessageInit *pInitData, BOOL &bHa m_fPointerMinY += containerPos.y; // 4J JEV - Settup Tabs - for (int i = 0; i < eCreativeInventoryTab_COUNT; i++) + for (int i = 0; i < eCreativeInventoryTab_COUNT; i++) { m_hTabGroupA[i].SetShow(FALSE); } @@ -103,7 +103,7 @@ HRESULT CXuiSceneInventoryCreative::OnDestroy() #endif // 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss. - // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) + // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer(); return S_OK; } @@ -115,8 +115,8 @@ HRESULT CXuiSceneInventoryCreative::OnDestroy() ////////////////////////////////////////////////////////////////////////// HRESULT CXuiSceneInventoryCreative::OnTransitionEnd( XUIMessageTransition *pTransData, BOOL& bHandled ) { - // are we being destroyed? If so, don't do anything - if(pTransData->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) + // are we being destroyed? If so, don't do anything + if(pTransData->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) { return S_OK; } @@ -199,7 +199,7 @@ void CXuiSceneInventoryCreative::updateScrollCurrentPage(int currentPage, int pa m_scrollUp.SetShow(currentPage > 1); m_scrollUp.PlayOptionalVisual(L"ScrollMore",L"EndScrollMore"); - + m_scrollDown.SetShow(currentPage < pageCount); m_scrollDown.PlayOptionalVisual(L"ScrollMore",L"EndScrollMore"); diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Trading.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_Trading.cpp index fec13460..b4b936c2 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_Trading.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Trading.cpp @@ -19,11 +19,11 @@ HRESULT CXuiSceneTrading::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) { MapChildControls(); - + //XuiControlSetText(m_villagerText,app.GetString(IDS_VILLAGER)); XuiControlSetText(m_inventoryLabel,app.GetString(IDS_INVENTORY)); XuiControlSetText(m_requiredLabel,app.GetString(IDS_REQUIRED_ITEMS_FOR_TRADE)); - + Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -36,7 +36,7 @@ HRESULT CXuiSceneTrading::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) if(m_bSplitscreen) { - app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); + app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); } if( pMinecraft->localgameModes[m_iPad] != NULL ) @@ -65,7 +65,7 @@ HRESULT CXuiSceneTrading::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) // store the slot 0 highlight position m_tradingSelector.GetPosition(&m_vSelectorInitialPos); - + //app.SetRichPresenceContextValue(m_iPad,CONTEXT_GAME_STATE_FORGING); XuiSetTimer(m_hObj,TRADING_UPDATE_TIMER_ID,TRADING_UPDATE_TIMER_TIME); @@ -86,7 +86,7 @@ HRESULT CXuiSceneTrading::OnDestroy() } // 4J Stu - Fix for #11302 - TCR 001: Network Connectivity: Host crashed after being killed by the client while accessing a chest during burst packet loss. - // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) + // We need to make sure that we call closeContainer() anytime this menu is closed, even if it is forced to close by some other reason (like the player dying) if(Minecraft::GetInstance()->localplayers[m_iPad] != NULL) Minecraft::GetInstance()->localplayers[m_iPad]->closeContainer(); return S_OK; } @@ -245,17 +245,17 @@ void CXuiSceneTrading::setTradeRedBox(int index, bool show) m_tradeHSlots[index]->SetRedBox(show?TRUE:FALSE); } -void CXuiSceneTrading::setRequest1Item(shared_ptr item) +void CXuiSceneTrading::setRequest1Item(std::shared_ptr item) { m_request1Control->SetIcon(getPad(), item, 12, 31, true); } -void CXuiSceneTrading::setRequest2Item(shared_ptr item) +void CXuiSceneTrading::setRequest2Item(std::shared_ptr item) { m_request2Control->SetIcon(getPad(), item, 12, 31, true); } -void CXuiSceneTrading::setTradeItem(int index, shared_ptr item) +void CXuiSceneTrading::setTradeItem(int index, std::shared_ptr item) { m_tradeHSlots[index]->SetIcon(getPad(), item, 12, 31, true); } @@ -299,7 +299,7 @@ void CXuiSceneTrading::setOfferDescription(const wstring &name, vector XuiElementSetBounds(m_hOfferInfoText,xuiRect.right+4.0f+4.0f,xuiRect.bottom+4.0f+4.0f); // edge graphics are 8 pixels, text is centred m_offerInfoControl.SetShow(TRUE); - + D3DXVECTOR3 highlightPos, offerInfoPos; float highlightWidth, highlightHeight; m_tradingSelector.GetPosition(&highlightPos); diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Trading.h b/Minecraft.Client/Common/XUI/XUI_Scene_Trading.h index 72194cbc..5ca08b83 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_Trading.h +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Trading.h @@ -83,7 +83,7 @@ protected: MAP_OVERRIDE(IDC_Inventory, m_inventoryControl) MAP_OVERRIDE(IDC_UseRow, m_useRowControl) END_MAP_CHILD_CONTROLS() - END_MAP_CHILD_CONTROLS() + END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); @@ -120,9 +120,9 @@ protected: virtual void setRequest2RedBox(bool show); virtual void setTradeRedBox(int index, bool show); - virtual void setRequest1Item(shared_ptr item); - virtual void setRequest2Item(shared_ptr item); - virtual void setTradeItem(int index, shared_ptr item); - + virtual void setRequest1Item(std::shared_ptr item); + virtual void setRequest2Item(std::shared_ptr item); + virtual void setTradeItem(int index, std::shared_ptr item); + virtual void setOfferDescription(const wstring &name, vector &unformattedStrings); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/XUI/XUI_SignEntry.cpp b/Minecraft.Client/Common/XUI/XUI_SignEntry.cpp index 378ac147..8fb6678c 100644 --- a/Minecraft.Client/Common/XUI/XUI_SignEntry.cpp +++ b/Minecraft.Client/Common/XUI/XUI_SignEntry.cpp @@ -11,13 +11,13 @@ HRESULT CScene_SignEntry::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) { MapChildControls(); - + XuiControlSetText(m_ButtonDone,app.GetString(IDS_DONE)); XuiControlSetText(m_labelEditSign,app.GetString(IDS_EDIT_SIGN_MESSAGE)); SignEntryScreenInput* initData = (SignEntryScreenInput*)pInitData->pvInitData; m_sign = initData->sign; - + CXuiSceneBase::ShowDarkOverlay( initData->iPad, TRUE ); CXuiSceneBase::ShowLogo( initData->iPad, FALSE); ui.SetTooltips( initData->iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK); @@ -65,7 +65,7 @@ HRESULT CScene_SignEntry::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* p for(int i=0;i<4;i++) { wstring temp=m_signRows[i].GetText(); - m_sign->SetMessage(i,temp); + m_sign->SetMessage(i,temp); } m_sign->setChanged(); @@ -74,10 +74,10 @@ HRESULT CScene_SignEntry::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* p // need to send the new data if (pMinecraft->level->isClientSide) { - shared_ptr player = pMinecraft->localplayers[pNotifyPressData->UserIndex]; + std::shared_ptr player = pMinecraft->localplayers[pNotifyPressData->UserIndex]; if(player != NULL && player->connection && player->connection->isStarted()) { - player->connection->send( shared_ptr( new SignUpdatePacket(m_sign->x, m_sign->y, m_sign->z, m_sign->IsVerified(), m_sign->IsCensored(), m_sign->GetMessages()) ) ); + player->connection->send( std::shared_ptr( new SignUpdatePacket(m_sign->x, m_sign->y, m_sign->z, m_sign->IsVerified(), m_sign->IsCensored(), m_sign->GetMessages()) ) ); } } app.CloseXuiScenes(pNotifyPressData->UserIndex); @@ -103,7 +103,7 @@ HRESULT CScene_SignEntry::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled app.CloseXuiScenes(pInputData->UserIndex); rfHandled = TRUE; - + CXuiSceneBase::PlayUISFX(eSFX_Back); break; } diff --git a/Minecraft.Client/Common/XUI/XUI_SignEntry.h b/Minecraft.Client/Common/XUI/XUI_SignEntry.h index 4f8c44d2..c8d5aae2 100644 --- a/Minecraft.Client/Common/XUI/XUI_SignEntry.h +++ b/Minecraft.Client/Common/XUI/XUI_SignEntry.h @@ -43,7 +43,7 @@ public: XUI_IMPLEMENT_CLASS( CScene_SignEntry, L"CScene_SignEntry", XUI_CLASS_SCENE ) private: - shared_ptr m_sign; + std::shared_ptr m_sign; D3DXVECTOR3 m_OriginalPosition; }; \ No newline at end of file diff --git a/Minecraft.Client/Common/XUI/XUI_Teleport.cpp b/Minecraft.Client/Common/XUI/XUI_Teleport.cpp index 1d6ac3bf..90b4b5fa 100644 --- a/Minecraft.Client/Common/XUI/XUI_Teleport.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Teleport.cpp @@ -61,7 +61,7 @@ HRESULT CScene_Teleport::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) g_NetworkManager.RegisterPlayerChangedCallback(m_iPad, &CScene_Teleport::OnPlayerChanged, this); ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK); - + CXuiSceneBase::ShowDarkOverlay( m_iPad, TRUE ); return S_OK; @@ -104,11 +104,11 @@ HRESULT CScene_Teleport::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pN ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); if( hObjPressed == playersList ) - { + { INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId( m_players[ playersList.GetCurSel() ] ); INetworkPlayer *thisPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(m_iPad); - - shared_ptr packet; + + std::shared_ptr packet; if(m_teleportToPlayer) { packet = TeleportCommand::preparePacket(thisPlayer->GetUID(),selectedPlayer->GetUID()); @@ -186,7 +186,7 @@ HRESULT CScene_Teleport::OnGetSourceDataText(XUIMessageGetSourceText *pGetSource } HRESULT hr; - HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon; + HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon; hButton = playersList.GetItemControl(pGetSourceTextData->iItem); hr=XuiControlGetVisual(hButton,&hVisual); @@ -271,7 +271,7 @@ HRESULT CScene_Teleport::OnGetSourceDataText(XUIMessageGetSourceText *pGetSource XuiElementFindNamedFrame(hVoiceIcon, L"NotSpeaking", &playFrame); } } - + if(playFrame < 0) { XuiElementFindNamedFrame(hVoiceIcon, L"Normal", &playFrame); diff --git a/Minecraft.Client/Common/XUI/XUI_TextEntry.cpp b/Minecraft.Client/Common/XUI/XUI_TextEntry.cpp index 8934350d..19c2b34e 100644 --- a/Minecraft.Client/Common/XUI/XUI_TextEntry.cpp +++ b/Minecraft.Client/Common/XUI/XUI_TextEntry.cpp @@ -53,7 +53,7 @@ HRESULT CScene_TextEntry::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyVal if(pValueChangedData->nValue==10) { LPCWSTR pText = m_EditText.GetText(); - + if(pText) { wstring wText = pText; @@ -61,7 +61,7 @@ HRESULT CScene_TextEntry::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyVal } app.NavigateBack(m_iPad); - rfHandled = TRUE; + rfHandled = TRUE; } return S_OK; @@ -86,7 +86,7 @@ HRESULT CScene_TextEntry::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled app.NavigateBack(m_iPad); rfHandled = TRUE; - } + } break; case VK_PAD_B: @@ -125,7 +125,7 @@ HRESULT CScene_TextEntry::InterpretString(wstring &wsText) case eCommand_Teleport: { int x,z; - + #ifdef __PS3__ // 4J Stu - The Xbox version uses swscanf_s which isn't available in GCC. swscanf(wsText.c_str(), L"%40s%c%d%c%d", wchCommand,wchSep,&x,wchSep,&z); @@ -146,9 +146,9 @@ HRESULT CScene_TextEntry::InterpretString(wstring &wsText) } break; case eCommand_Give: - { + { int iItem,iCount; - + #ifdef __PS3__ // 4J Stu - The Xbox version uses swscanf_s which isn't available in GCC. swscanf(wsText.c_str(), L"%40s%c%d%c%d", wchCommand,wchSep,&iItem,wchSep,&iCount); @@ -158,7 +158,7 @@ HRESULT CScene_TextEntry::InterpretString(wstring &wsText) app.DebugPrintf("eCommand_Give, item=%d count=%d\n",iItem,iCount); Minecraft *pMinecraft=Minecraft::GetInstance(); for(int i=0;ilocalplayers[m_iPad]->drop(); // shared_ptr(new ItemInstance( iItem, 1, 0 )) ); + pMinecraft->localplayers[m_iPad]->drop(); // std::shared_ptr(new ItemInstance( iItem, 1, 0 )) ); } break; diff --git a/Minecraft.Client/Common/XUI/XUI_TutorialPopup.cpp b/Minecraft.Client/Common/XUI/XUI_TutorialPopup.cpp index 98951d81..bea3e055 100644 --- a/Minecraft.Client/Common/XUI/XUI_TutorialPopup.cpp +++ b/Minecraft.Client/Common/XUI/XUI_TutorialPopup.cpp @@ -23,7 +23,7 @@ HRESULT CScene_TutorialPopup::OnInit( XUIMessageInit* pInitData, BOOL& bHandled // if we are in splitscreen, then we need to figure out if we want to move this scene if(app.GetLocalPlayerCount()>1) { - app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); + app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); } m_textFontSize = _fromString( m_fontSizeControl.GetText() ); @@ -143,7 +143,7 @@ void CScene_TutorialPopup::UpdateInteractScenePosition(bool visible) } HRESULT CScene_TutorialPopup::_SetDescription(CXuiScene *interactScene, LPCWSTR desc, LPCWSTR title, bool allowFade, bool isReminder) -{ +{ HRESULT hr = S_OK; m_interactScene = interactScene; if( interactScene != m_lastInteractSceneMoved ) m_lastInteractSceneMoved = NULL; @@ -289,7 +289,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS if( icon != TUTORIAL_NO_ICON ) { bool itemIsFoil = false; - itemIsFoil = (shared_ptr(new ItemInstance(icon,1,iAuxVal)))->isFoil(); + itemIsFoil = (std::shared_ptr(new ItemInstance(icon,1,iAuxVal)))->isFoil(); if(!itemIsFoil) itemIsFoil = isFoil; m_pCraftingPic->SetIcon(m_iPad, icon,iAuxVal,1,10,31,false,itemIsFoil); @@ -322,7 +322,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS } bool itemIsFoil = false; - itemIsFoil = (shared_ptr(new ItemInstance(iconId,1,iAuxVal)))->isFoil(); + itemIsFoil = (std::shared_ptr(new ItemInstance(iconId,1,iAuxVal)))->isFoil(); if(!itemIsFoil) itemIsFoil = isFoil; m_pCraftingPic->SetIcon(m_iPad, iconId,iAuxVal,1,10,31,false,itemIsFoil); @@ -330,7 +330,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS temp.replace(iconTagStartPos, iconEndPos - iconTagStartPos + closeTag.length(), L""); } } - + // remove any icon text else if(temp.find(L"{*CraftingTableIcon*}")!=wstring::npos) { @@ -410,7 +410,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS m_pCraftingPic->SetIcon(m_iPad, 0,0,0,0,0,false,false,FALSE); } } - + BOOL iconShowAtEnd = m_pCraftingPic->IsShown(); if(iconShowAtStart != iconShowAtEnd) { @@ -432,7 +432,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS } m_description.SetBounds(fDescWidth, fDescHeight); } - + return temp; } @@ -463,7 +463,7 @@ wstring CScene_TutorialPopup::_SetImage(wstring &desc) // hide the icon slot m_image.SetShow( FALSE ); } - + BOOL imageShowAtEnd = m_image.IsShown(); if(imageShowAtStart != imageShowAtEnd) { @@ -485,7 +485,7 @@ wstring CScene_TutorialPopup::_SetImage(wstring &desc) } m_description.SetBounds(fDescWidth, fDescHeight); } - + return desc; } diff --git a/Minecraft.Client/ConnectScreen.cpp b/Minecraft.Client/ConnectScreen.cpp index 2cf005b6..3f93a5b0 100644 --- a/Minecraft.Client/ConnectScreen.cpp +++ b/Minecraft.Client/ConnectScreen.cpp @@ -17,7 +17,7 @@ ConnectScreen::ConnectScreen(Minecraft *minecraft, const wstring& ip, int port) // 4J - removed from separate thread, but need to investigate what we actually need here connection = new ClientConnection(minecraft, ip, port); if (aborted) return; - connection->send( shared_ptr( new PreLoginPacket(minecraft->user->name) ) ); + connection->send( std::shared_ptr( new PreLoginPacket(minecraft->user->name) ) ); #else new Thread() { diff --git a/Minecraft.Client/ContainerScreen.cpp b/Minecraft.Client/ContainerScreen.cpp index 17b45406..0cee4bf5 100644 --- a/Minecraft.Client/ContainerScreen.cpp +++ b/Minecraft.Client/ContainerScreen.cpp @@ -3,7 +3,7 @@ #include "Textures.h" #include "..\Minecraft.World\net.minecraft.world.inventory.h" -ContainerScreen::ContainerScreen(shared_ptr inventory, shared_ptr container) : AbstractContainerScreen(new ContainerMenu(inventory, container)) +ContainerScreen::ContainerScreen(std::shared_ptr inventory, std::shared_ptr container) : AbstractContainerScreen(new ContainerMenu(inventory, container)) { this->inventory = inventory; this->container = container; diff --git a/Minecraft.Client/ContainerScreen.h b/Minecraft.Client/ContainerScreen.h index 38806c1e..314026ae 100644 --- a/Minecraft.Client/ContainerScreen.h +++ b/Minecraft.Client/ContainerScreen.h @@ -5,13 +5,13 @@ class Container; class ContainerScreen : public AbstractContainerScreen { private: - shared_ptr inventory; - shared_ptr container; + std::shared_ptr inventory; + std::shared_ptr container; int containerRows; public: - ContainerScreen(shared_ptrinventory, shared_ptrcontainer); + ContainerScreen(std::shared_ptrinventory, std::shared_ptrcontainer); protected: virtual void renderLabels(); diff --git a/Minecraft.Client/CowModel.h b/Minecraft.Client/CowModel.h index 617bb94f..b3ffba6a 100644 --- a/Minecraft.Client/CowModel.h +++ b/Minecraft.Client/CowModel.h @@ -1,10 +1,10 @@ #pragma once #include "QuadrupedModel.h" -class CowModel : public QuadrupedModel +class CowModel : public QuadrupedModel { public: CowModel(); -// virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); +// virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); // virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale); }; diff --git a/Minecraft.Client/CowRenderer.cpp b/Minecraft.Client/CowRenderer.cpp index c4eaf261..57b0bbb4 100644 --- a/Minecraft.Client/CowRenderer.cpp +++ b/Minecraft.Client/CowRenderer.cpp @@ -5,7 +5,7 @@ CowRenderer::CowRenderer(Model *model, float shadow) : MobRenderer(model, shadow { } -void CowRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void CowRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { MobRenderer::render(_mob, x, y, z, rot, a); } \ No newline at end of file diff --git a/Minecraft.Client/CowRenderer.h b/Minecraft.Client/CowRenderer.h index e99e1c12..0dabaf29 100644 --- a/Minecraft.Client/CowRenderer.h +++ b/Minecraft.Client/CowRenderer.h @@ -5,5 +5,5 @@ class CowRenderer : public MobRenderer { public: CowRenderer(Model *model, float shadow); - virtual void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/CraftingScreen.cpp b/Minecraft.Client/CraftingScreen.cpp index c28df18d..edbc7ec5 100644 --- a/Minecraft.Client/CraftingScreen.cpp +++ b/Minecraft.Client/CraftingScreen.cpp @@ -4,7 +4,7 @@ #include "MultiplayerLocalPlayer.h" #include "..\Minecraft.World\net.minecraft.world.inventory.h" -CraftingScreen::CraftingScreen(shared_ptr inventory, Level *level, int x, int y, int z) : AbstractContainerScreen(new CraftingMenu(inventory, level, x, y, z)) +CraftingScreen::CraftingScreen(std::shared_ptr inventory, Level *level, int x, int y, int z) : AbstractContainerScreen(new CraftingMenu(inventory, level, x, y, z)) { } diff --git a/Minecraft.Client/CraftingScreen.h b/Minecraft.Client/CraftingScreen.h index 2de1681f..42b2623a 100644 --- a/Minecraft.Client/CraftingScreen.h +++ b/Minecraft.Client/CraftingScreen.h @@ -6,7 +6,7 @@ class Level; class CraftingScreen : public AbstractContainerScreen { public: - CraftingScreen(shared_ptr inventory, Level *level, int x, int y, int z); + CraftingScreen(std::shared_ptr inventory, Level *level, int x, int y, int z); virtual void removed(); protected: virtual void renderLabels(); diff --git a/Minecraft.Client/CreativeMode.cpp b/Minecraft.Client/CreativeMode.cpp index 48342ebc..78183c81 100644 --- a/Minecraft.Client/CreativeMode.cpp +++ b/Minecraft.Client/CreativeMode.cpp @@ -19,7 +19,7 @@ void CreativeMode::init() // initPlayer(); } -void CreativeMode::enableCreativeForPlayer(shared_ptr player) +void CreativeMode::enableCreativeForPlayer(std::shared_ptr player) { // please check ServerPlayerGameMode.java if you change these player->abilities.mayfly = true; @@ -27,7 +27,7 @@ void CreativeMode::enableCreativeForPlayer(shared_ptr player) player->abilities.invulnerable = true; } -void CreativeMode::disableCreativeForPlayer(shared_ptr player) +void CreativeMode::disableCreativeForPlayer(std::shared_ptr player) { player->abilities.mayfly = false; player->abilities.flying = false; @@ -35,7 +35,7 @@ void CreativeMode::disableCreativeForPlayer(shared_ptr player) player->abilities.invulnerable = false; } -void CreativeMode::adjustPlayer(shared_ptr player) +void CreativeMode::adjustPlayer(std::shared_ptr player) { enableCreativeForPlayer(player); @@ -43,7 +43,7 @@ void CreativeMode::adjustPlayer(shared_ptr player) { if (player->inventory->items[i] == NULL) { - player->inventory->items[i] = shared_ptr( new ItemInstance(User::allowedTiles[i]) ); + player->inventory->items[i] = std::shared_ptr( new ItemInstance(User::allowedTiles[i]) ); } else { @@ -61,7 +61,7 @@ void CreativeMode::creativeDestroyBlock(Minecraft *minecraft, GameMode *gameMode } } -bool CreativeMode::useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly, bool *pbUsedItem) +bool CreativeMode::useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly, bool *pbUsedItem) { int t = level->getTile(x, y, z); if (t > 0) diff --git a/Minecraft.Client/CreativeMode.h b/Minecraft.Client/CreativeMode.h index 10b27a53..9732cfd0 100644 --- a/Minecraft.Client/CreativeMode.h +++ b/Minecraft.Client/CreativeMode.h @@ -9,11 +9,11 @@ private: public: CreativeMode(Minecraft *minecraft); virtual void init(); - static void enableCreativeForPlayer(shared_ptr player); - static void disableCreativeForPlayer(shared_ptr player); - virtual void adjustPlayer(shared_ptr player); + static void enableCreativeForPlayer(std::shared_ptr player); + static void disableCreativeForPlayer(std::shared_ptr player); + virtual void adjustPlayer(std::shared_ptr player); static void creativeDestroyBlock(Minecraft *minecraft, GameMode *gameMode, int x, int y, int z, int face); - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem = NULL); + virtual bool useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem = NULL); virtual void startDestroyBlock(int x, int y, int z, int face); virtual void continueDestroyBlock(int x, int y, int z, int face); virtual void stopDestroyBlock(); diff --git a/Minecraft.Client/CreeperModel.cpp b/Minecraft.Client/CreeperModel.cpp index 51237ce6..6c2737d3 100644 --- a/Minecraft.Client/CreeperModel.cpp +++ b/Minecraft.Client/CreeperModel.cpp @@ -56,7 +56,7 @@ CreeperModel::CreeperModel(float g) : Model() _init(g); } -void CreeperModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void CreeperModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); diff --git a/Minecraft.Client/CreeperModel.h b/Minecraft.Client/CreeperModel.h index 06231d0e..0c4e9448 100644 --- a/Minecraft.Client/CreeperModel.h +++ b/Minecraft.Client/CreeperModel.h @@ -9,6 +9,6 @@ public: void _init(float g); // 4J added CreeperModel(); CreeperModel(float g); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; \ No newline at end of file diff --git a/Minecraft.Client/CreeperRenderer.cpp b/Minecraft.Client/CreeperRenderer.cpp index 483d14e3..4afa22a8 100644 --- a/Minecraft.Client/CreeperRenderer.cpp +++ b/Minecraft.Client/CreeperRenderer.cpp @@ -9,9 +9,9 @@ CreeperRenderer::CreeperRenderer() : MobRenderer( new CreeperModel(), 0.5f ) armorModel = new CreeperModel(2); } -void CreeperRenderer::scale(shared_ptr mob, float a) +void CreeperRenderer::scale(std::shared_ptr mob, float a) { - shared_ptr creeper = dynamic_pointer_cast(mob); + std::shared_ptr creeper = dynamic_pointer_cast(mob); float g = creeper->getSwelling(a); @@ -25,9 +25,9 @@ void CreeperRenderer::scale(shared_ptr mob, float a) glScalef(s, hs, s); } -int CreeperRenderer::getOverlayColor(shared_ptr mob, float br, float a) +int CreeperRenderer::getOverlayColor(std::shared_ptr mob, float br, float a) { - shared_ptr creeper = dynamic_pointer_cast(mob); + std::shared_ptr creeper = dynamic_pointer_cast(mob); float step = creeper->getSwelling(a); @@ -44,10 +44,10 @@ int CreeperRenderer::getOverlayColor(shared_ptr mob, float br, float a) return (_a << 24) | (r << 16) | (g << 8) | b; } -int CreeperRenderer::prepareArmor(shared_ptr _mob, int layer, float a) +int CreeperRenderer::prepareArmor(std::shared_ptr _mob, int layer, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); if (mob->isPowered()) { if (mob->isInvisible()) glDepthMask(false); @@ -84,7 +84,7 @@ int CreeperRenderer::prepareArmor(shared_ptr _mob, int layer, float a) } -int CreeperRenderer::prepareArmorOverlay(shared_ptr mob, int layer, float a) +int CreeperRenderer::prepareArmorOverlay(std::shared_ptr mob, int layer, float a) { return -1; } \ No newline at end of file diff --git a/Minecraft.Client/CreeperRenderer.h b/Minecraft.Client/CreeperRenderer.h index 4d0fac10..3afd511b 100644 --- a/Minecraft.Client/CreeperRenderer.h +++ b/Minecraft.Client/CreeperRenderer.h @@ -9,8 +9,8 @@ private: public: CreeperRenderer(); protected: - virtual void scale(shared_ptr _mob, float a); - virtual int getOverlayColor(shared_ptr mob, float br, float a); - virtual int prepareArmor(shared_ptr mob, int layer, float a); - virtual int prepareArmorOverlay(shared_ptr _mob, int layer, float a); + virtual void scale(std::shared_ptr _mob, float a); + virtual int getOverlayColor(std::shared_ptr mob, float br, float a); + virtual int prepareArmor(std::shared_ptr mob, int layer, float a); + virtual int prepareArmorOverlay(std::shared_ptr _mob, int layer, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/CritParticle.cpp b/Minecraft.Client/CritParticle.cpp index 6c71b027..ec99d248 100644 --- a/Minecraft.Client/CritParticle.cpp +++ b/Minecraft.Client/CritParticle.cpp @@ -5,7 +5,7 @@ #include "..\Minecraft.World\net.minecraft.world.phys.h" #include "..\Minecraft.World\net.minecraft.world.level.h" -void CritParticle::_init(Level *level, shared_ptr entity, ePARTICLE_TYPE type) +void CritParticle::_init(Level *level, std::shared_ptr entity, ePARTICLE_TYPE type) { life = 0; this->entity = entity; @@ -15,17 +15,17 @@ void CritParticle::_init(Level *level, shared_ptr entity, ePARTICLE_TYPE //tick(); } -CritParticle::CritParticle(Level *level, shared_ptr entity) : Particle(level, entity->x, entity->bb->y0 + entity->bbHeight / 2, entity->z, entity->xd, entity->yd, entity->zd) +CritParticle::CritParticle(Level *level, std::shared_ptr entity) : Particle(level, entity->x, entity->bb->y0 + entity->bbHeight / 2, entity->z, entity->xd, entity->yd, entity->zd) { _init(level,entity,eParticleType_crit); } -CritParticle::CritParticle(Level *level, shared_ptr entity, ePARTICLE_TYPE type) : Particle(level, entity->x, entity->bb->y0 + entity->bbHeight / 2, entity->z, entity->xd, entity->yd, entity->zd) +CritParticle::CritParticle(Level *level, std::shared_ptr entity, ePARTICLE_TYPE type) : Particle(level, entity->x, entity->bb->y0 + entity->bbHeight / 2, entity->z, entity->xd, entity->yd, entity->zd) { _init(level, entity, type); } -// 4J - Added this so that we can use some shared_ptr functions that were needed in the ctor +// 4J - Added this so that we can use some std::shared_ptr functions that were needed in the ctor void CritParticle::CritParticlePostConstructor(void) { tick(); @@ -49,7 +49,7 @@ void CritParticle::tick() level->addParticle(particleName, x, y, z, xa, ya+0.2, za); } life++; - if (life >= lifeTime) + if (life >= lifeTime) { remove(); } diff --git a/Minecraft.Client/CritParticle.h b/Minecraft.Client/CritParticle.h index 23f30339..5bad1c25 100644 --- a/Minecraft.Client/CritParticle.h +++ b/Minecraft.Client/CritParticle.h @@ -7,17 +7,17 @@ class Entity; class CritParticle : public Particle { private: - shared_ptr entity; + std::shared_ptr entity; int life; int lifeTime; ePARTICLE_TYPE particleName; - void _init(Level *level, shared_ptr entity, ePARTICLE_TYPE type); + void _init(Level *level, std::shared_ptr entity, ePARTICLE_TYPE type); public: virtual eINSTANCEOF GetType() { return eType_CRITPARTICLE; } - CritParticle(Level *level, shared_ptr entity); - CritParticle(Level *level, shared_ptr entity, ePARTICLE_TYPE type); + CritParticle(Level *level, std::shared_ptr entity); + CritParticle(Level *level, std::shared_ptr entity, ePARTICLE_TYPE type); void CritParticlePostConstructor(void); void render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2); void tick(); diff --git a/Minecraft.Client/DefaultRenderer.cpp b/Minecraft.Client/DefaultRenderer.cpp index d4c15737..f6cb38ee 100644 --- a/Minecraft.Client/DefaultRenderer.cpp +++ b/Minecraft.Client/DefaultRenderer.cpp @@ -2,7 +2,7 @@ #include "DefaultRenderer.h" #include "..\Minecraft.World\net.minecraft.world.entity.h" -void DefaultRenderer::render(shared_ptr entity, double x, double y, double z, float rot, float a) +void DefaultRenderer::render(std::shared_ptr entity, double x, double y, double z, float rot, float a) { glPushMatrix(); // 4J - removed following line as doesn't really make any sense diff --git a/Minecraft.Client/DefaultRenderer.h b/Minecraft.Client/DefaultRenderer.h index dcb5a9c3..651a99c1 100644 --- a/Minecraft.Client/DefaultRenderer.h +++ b/Minecraft.Client/DefaultRenderer.h @@ -4,5 +4,5 @@ class DefaultRenderer : public EntityRenderer { public: - virtual void render(shared_ptr entity, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr entity, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/DemoLevel.cpp b/Minecraft.Client/DemoLevel.cpp index 52edc0ba..f112aed4 100644 --- a/Minecraft.Client/DemoLevel.cpp +++ b/Minecraft.Client/DemoLevel.cpp @@ -2,7 +2,7 @@ #include "DemoLevel.h" #include "..\Minecraft.World\net.minecraft.world.level.storage.h" -DemoLevel::DemoLevel(shared_ptr levelStorage, const wstring& levelName) : Level(levelStorage, levelName, DEMO_LEVEL_SEED) +DemoLevel::DemoLevel(std::shared_ptr levelStorage, const wstring& levelName) : Level(levelStorage, levelName, DEMO_LEVEL_SEED) { } diff --git a/Minecraft.Client/DemoLevel.h b/Minecraft.Client/DemoLevel.h index 6464c32b..4c1ef110 100644 --- a/Minecraft.Client/DemoLevel.h +++ b/Minecraft.Client/DemoLevel.h @@ -9,7 +9,7 @@ private: static const int DEMO_SPAWN_Y = 72; static const int DEMO_SPAWN_Z = -731; public: - DemoLevel(shared_ptr levelStorage, const wstring& levelName); + DemoLevel(std::shared_ptr levelStorage, const wstring& levelName); DemoLevel(Level *level, Dimension *dimension); protected: virtual void setInitialSpawn(); diff --git a/Minecraft.Client/DemoMode.cpp b/Minecraft.Client/DemoMode.cpp index 0816023b..798f7bd4 100644 --- a/Minecraft.Client/DemoMode.cpp +++ b/Minecraft.Client/DemoMode.cpp @@ -95,7 +95,7 @@ bool DemoMode::destroyBlock(int x, int y, int z, int face) return SurvivalMode::destroyBlock(x, y, z, face); } -bool DemoMode::useItem(shared_ptr player, Level *level, shared_ptr item) +bool DemoMode::useItem(std::shared_ptr player, Level *level, std::shared_ptr item) { if (demoHasEnded) { @@ -105,7 +105,7 @@ bool DemoMode::useItem(shared_ptr player, Level *level, shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face) +bool DemoMode::useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face) { if (demoHasEnded) { outputDemoReminder(); @@ -114,7 +114,7 @@ bool DemoMode::useItemOn(shared_ptr player, Level *level, shared_ptr player, shared_ptr entity) +void DemoMode::attack(std::shared_ptr player, std::shared_ptr entity) { if (demoHasEnded) { diff --git a/Minecraft.Client/DemoMode.h b/Minecraft.Client/DemoMode.h index 429c9ec3..9b5f1940 100644 --- a/Minecraft.Client/DemoMode.h +++ b/Minecraft.Client/DemoMode.h @@ -21,7 +21,7 @@ public: virtual void startDestroyBlock(int x, int y, int z, int face); virtual void continueDestroyBlock(int x, int y, int z, int face); virtual bool destroyBlock(int x, int y, int z, int face); - virtual bool useItem(shared_ptr player, Level *level, shared_ptr item); - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face); - virtual void attack(shared_ptr player, shared_ptr entity); + virtual bool useItem(std::shared_ptr player, Level *level, std::shared_ptr item); + virtual bool useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face); + virtual void attack(std::shared_ptr player, std::shared_ptr entity); }; diff --git a/Minecraft.Client/DerivedServerLevel.cpp b/Minecraft.Client/DerivedServerLevel.cpp index a67408d7..114a7d45 100644 --- a/Minecraft.Client/DerivedServerLevel.cpp +++ b/Minecraft.Client/DerivedServerLevel.cpp @@ -3,7 +3,7 @@ #include "..\Minecraft.World\SavedDataStorage.h" #include "..\Minecraft.World\DerivedLevelData.h" -DerivedServerLevel::DerivedServerLevel(MinecraftServer *server, shared_ptr levelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped) +DerivedServerLevel::DerivedServerLevel(MinecraftServer *server, std::shared_ptr levelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped) : ServerLevel(server, levelStorage, levelName, dimension, levelSettings) { // 4J-PB - we're going to override the savedDataStorage, so we need to delete the current one diff --git a/Minecraft.Client/DerivedServerLevel.h b/Minecraft.Client/DerivedServerLevel.h index 2d49e4fa..ada362f4 100644 --- a/Minecraft.Client/DerivedServerLevel.h +++ b/Minecraft.Client/DerivedServerLevel.h @@ -4,7 +4,7 @@ class DerivedServerLevel : public ServerLevel { public: - DerivedServerLevel(MinecraftServer *server, shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped); + DerivedServerLevel(MinecraftServer *server, std::shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings, ServerLevel *wrapped); ~DerivedServerLevel(); protected: diff --git a/Minecraft.Client/DirtyChunkSorter.cpp b/Minecraft.Client/DirtyChunkSorter.cpp index 1a7c10cc..0dd07a2a 100644 --- a/Minecraft.Client/DirtyChunkSorter.cpp +++ b/Minecraft.Client/DirtyChunkSorter.cpp @@ -3,7 +3,7 @@ #include "../Minecraft.World/net.minecraft.world.entity.player.h" #include "Chunk.h" -DirtyChunkSorter::DirtyChunkSorter(shared_ptr cameraEntity, int playerIndex) // 4J - added player index +DirtyChunkSorter::DirtyChunkSorter(std::shared_ptr cameraEntity, int playerIndex) // 4J - added player index { this->cameraEntity = cameraEntity; this->playerIndex = playerIndex; diff --git a/Minecraft.Client/DirtyChunkSorter.h b/Minecraft.Client/DirtyChunkSorter.h index 4caa2fac..6d13c4e5 100644 --- a/Minecraft.Client/DirtyChunkSorter.h +++ b/Minecraft.Client/DirtyChunkSorter.h @@ -2,13 +2,13 @@ class Chunk; class Mob; -class DirtyChunkSorter : public std::binary_function +class DirtyChunkSorter : public std::binary_function { private: - shared_ptr cameraEntity; + std::shared_ptr cameraEntity; int playerIndex; // 4J added public: - DirtyChunkSorter(shared_ptr cameraEntity, int playerIndex); // 4J - added player index + DirtyChunkSorter(std::shared_ptr cameraEntity, int playerIndex); // 4J - added player index bool operator()(const Chunk *a, const Chunk *b) const; }; \ No newline at end of file diff --git a/Minecraft.Client/DistanceChunkSorter.cpp b/Minecraft.Client/DistanceChunkSorter.cpp index 80ac0cdf..6bfeb6d9 100644 --- a/Minecraft.Client/DistanceChunkSorter.cpp +++ b/Minecraft.Client/DistanceChunkSorter.cpp @@ -3,7 +3,7 @@ #include "../Minecraft.World/net.minecraft.world.entity.player.h" #include "Chunk.h" -DistanceChunkSorter::DistanceChunkSorter(shared_ptr player) +DistanceChunkSorter::DistanceChunkSorter(std::shared_ptr player) { ix = -player->x; iy = -player->y; @@ -15,7 +15,7 @@ bool DistanceChunkSorter::operator()(const Chunk *c0, const Chunk *c1) const double xd0 = c0->xm + ix; double yd0 = c0->ym + iy; double zd0 = c0->zm + iz; - + double xd1 = c1->xm + ix; double yd1 = c1->ym + iy; double zd1 = c1->zm + iz; diff --git a/Minecraft.Client/DistanceChunkSorter.h b/Minecraft.Client/DistanceChunkSorter.h index 4789070d..952c1656 100644 --- a/Minecraft.Client/DistanceChunkSorter.h +++ b/Minecraft.Client/DistanceChunkSorter.h @@ -2,12 +2,12 @@ class Entity; class Chunk; -class DistanceChunkSorter : public std::binary_function +class DistanceChunkSorter : public std::binary_function { private: double ix, iy, iz; public: - DistanceChunkSorter(shared_ptr player); + DistanceChunkSorter(std::shared_ptr player); bool operator()(const Chunk *a, const Chunk *b) const; }; \ No newline at end of file diff --git a/Minecraft.Client/DragonModel.cpp b/Minecraft.Client/DragonModel.cpp index 39861829..e3ff4c53 100644 --- a/Minecraft.Client/DragonModel.cpp +++ b/Minecraft.Client/DragonModel.cpp @@ -106,15 +106,15 @@ DragonModel::DragonModel(float g) : Model() rearFoot->compile(1.0f/16.0f); } -void DragonModel::prepareMobModel(shared_ptr mob, float time, float r, float a) +void DragonModel::prepareMobModel(std::shared_ptr mob, float time, float r, float a) { this->a = a; } -void DragonModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void DragonModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { glPushMatrix(); - shared_ptr dragon = dynamic_pointer_cast(entity); + std::shared_ptr dragon = dynamic_pointer_cast(entity); float ttt = dragon->oFlapTime + (dragon->flapTime - dragon->oFlapTime) * a; jaw->xRot = (float) (Mth::sin(ttt * PI * 2) + 1) * 0.2f; @@ -153,7 +153,7 @@ void DragonModel::render(shared_ptr entity, float time, float r, float b double pComponents[3]; doubleArray p = doubleArray(pComponents,3); - for (int i = 0; i < 5; i++) + for (int i = 0; i < 5; i++) { dragon->getLatencyPos(p, 5 - i, a); @@ -185,9 +185,9 @@ void DragonModel::render(shared_ptr entity, float time, float r, float b glTranslatef(0, -1, 0); body->zRot = 0; body->render(scale,usecompiled); - + glEnable(GL_CULL_FACE); - for (int i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) { float flapTime = ttt * PI * 2; wing->xRot = 0.125f - (float) (Mth::cos(flapTime)) * 0.2f; @@ -206,7 +206,7 @@ void DragonModel::render(shared_ptr entity, float time, float r, float b frontLeg->render(scale,usecompiled); rearLeg->render(scale,usecompiled); glScalef(-1, 1, 1); - if (i == 0) + if (i == 0) { glCullFace(GL_FRONT); } @@ -221,7 +221,7 @@ void DragonModel::render(shared_ptr entity, float time, float r, float b zz = 60; xx = 0; dragon->getLatencyPos(start, 11, a); - for (int i = 0; i < 12; i++) + for (int i = 0; i < 12; i++) { dragon->getLatencyPos(p, 12 + i, a); rr += Mth::sin(i * 0.45f + roff) * 0.05f; @@ -238,7 +238,7 @@ void DragonModel::render(shared_ptr entity, float time, float r, float b } glPopMatrix(); } -float DragonModel::rotWrap(double d) +float DragonModel::rotWrap(double d) { while (d >= 180) d -= 360; diff --git a/Minecraft.Client/DragonModel.h b/Minecraft.Client/DragonModel.h index 47c20cba..baee83de 100644 --- a/Minecraft.Client/DragonModel.h +++ b/Minecraft.Client/DragonModel.h @@ -26,8 +26,8 @@ public: ModelPart *cubes[5]; DragonModel(float g); - void prepareMobModel(shared_ptr mob, float time, float r, float a); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + void prepareMobModel(std::shared_ptr mob, float time, float r, float a); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); private: float rotWrap(double d); diff --git a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp index 232b4dd3..a3b3c981 100644 --- a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp +++ b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.cpp @@ -12,7 +12,7 @@ using namespace Windows::Foundation; using namespace Windows::Xbox::System; -// To integrate the Chat DLL in your game, you can use this ChatIntegrationLayer class with modifications, +// To integrate the Chat DLL in your game, you can use this ChatIntegrationLayer class with modifications, // or create your own design your own class using the code in this file a guide. std::shared_ptr GetChatIntegrationLayer() { @@ -25,12 +25,12 @@ std::shared_ptr GetChatIntegrationLayer() return chatIntegrationLayerInstance; } -ChatIntegrationLayer::ChatIntegrationLayer() +ChatIntegrationLayer::ChatIntegrationLayer() { ZeroMemory( m_chatVoicePacketsStatistic, sizeof(m_chatVoicePacketsStatistic) ); } -void ChatIntegrationLayer::InitializeChatManager( +void ChatIntegrationLayer::InitializeChatManager( __in bool combineCaptureBuffersIntoSinglePacket, __in bool useKinectAsCaptureSource, __in bool applySoundEffectsToCapturedAudio, @@ -69,9 +69,9 @@ void ChatIntegrationLayer::InitializeChatManager( m_chatManager->ChatSettings->PerformanceCountersEnabled = true; #endif - // Upon enter constrained mode, mute everyone. + // Upon enter constrained mode, mute everyone. // Upon leaving constrained mode, unmute everyone who was previously muted. - m_tokenResourceAvailabilityChanged = Windows::ApplicationModel::Core::CoreApplication::ResourceAvailabilityChanged += + m_tokenResourceAvailabilityChanged = Windows::ApplicationModel::Core::CoreApplication::ResourceAvailabilityChanged += ref new EventHandler< Platform::Object^ >( [weakPtrToThis] (Platform::Object^, Platform::Object^ ) { // Using a std::weak_ptr instead of 'this' to avoid dangling pointer if caller class is released. @@ -99,7 +99,7 @@ void ChatIntegrationLayer::InitializeChatManager( } }); - m_tokenOnDebugMessage = m_chatManager->OnDebugMessage += + m_tokenOnDebugMessage = m_chatManager->OnDebugMessage += ref new Windows::Foundation::EventHandler( [weakPtrToThis] ( Platform::Object^, Microsoft::Xbox::GameChat::DebugMessageEventArgs^ args ) { @@ -112,8 +112,8 @@ void ChatIntegrationLayer::InitializeChatManager( } }); - m_tokenOnOutgoingChatPacketReady = m_chatManager->OnOutgoingChatPacketReady += - ref new Windows::Foundation::EventHandler( + m_tokenOnOutgoingChatPacketReady = m_chatManager->OnOutgoingChatPacketReady += + ref new Windows::Foundation::EventHandler( [weakPtrToThis] ( Platform::Object^, Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args ) { // Using a std::weak_ptr instead of 'this' to avoid dangling pointer if caller class is released. @@ -125,16 +125,16 @@ void ChatIntegrationLayer::InitializeChatManager( } }); - m_tokenOnCompareUniqueConsoleIdentifiers = m_chatManager->OnCompareUniqueConsoleIdentifiers += - ref new Microsoft::Xbox::GameChat::CompareUniqueConsoleIdentifiersHandler( - [weakPtrToThis] ( Platform::Object^ obj1, Platform::Object^ obj2 ) - { + m_tokenOnCompareUniqueConsoleIdentifiers = m_chatManager->OnCompareUniqueConsoleIdentifiers += + ref new Microsoft::Xbox::GameChat::CompareUniqueConsoleIdentifiersHandler( + [weakPtrToThis] ( Platform::Object^ obj1, Platform::Object^ obj2 ) + { // Using a std::weak_ptr instead of 'this' to avoid dangling pointer if caller class is released. // Simply unregistering the callback in the destructor isn't enough to prevent a dangling pointer std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); if( sharedPtrToThis != nullptr ) { - return sharedPtrToThis->CompareUniqueConsoleIdentifiers(obj1, obj2); + return sharedPtrToThis->CompareUniqueConsoleIdentifiers(obj1, obj2); } else { @@ -142,10 +142,10 @@ void ChatIntegrationLayer::InitializeChatManager( } }); - m_tokenUserAudioDeviceAdded = WXS::User::AudioDeviceAdded += + m_tokenUserAudioDeviceAdded = WXS::User::AudioDeviceAdded += ref new Windows::Foundation::EventHandler( - [weakPtrToThis] ( Platform::Object^, WXS::AudioDeviceAddedEventArgs^ value ) - { + [weakPtrToThis] ( Platform::Object^, WXS::AudioDeviceAddedEventArgs^ value ) + { std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); if( sharedPtrToThis != nullptr ) { @@ -153,10 +153,10 @@ void ChatIntegrationLayer::InitializeChatManager( } }); - m_tokenUserAudioDeviceRemoved = WXS::User::AudioDeviceRemoved += + m_tokenUserAudioDeviceRemoved = WXS::User::AudioDeviceRemoved += ref new Windows::Foundation::EventHandler( - [weakPtrToThis] ( Platform::Object^, WXS::AudioDeviceRemovedEventArgs^ value ) - { + [weakPtrToThis] ( Platform::Object^, WXS::AudioDeviceRemovedEventArgs^ value ) + { std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); if( sharedPtrToThis != nullptr ) { @@ -164,10 +164,10 @@ void ChatIntegrationLayer::InitializeChatManager( } }); - m_tokenUserAudioDeviceChanged = WXS::User::AudioDeviceChanged += + m_tokenUserAudioDeviceChanged = WXS::User::AudioDeviceChanged += ref new Windows::Foundation::EventHandler( - [weakPtrToThis] ( Platform::Object^, WXS::AudioDeviceChangedEventArgs^ value ) - { + [weakPtrToThis] ( Platform::Object^, WXS::AudioDeviceChangedEventArgs^ value ) + { std::shared_ptr sharedPtrToThis(weakPtrToThis.lock()); if( sharedPtrToThis != nullptr ) { @@ -175,16 +175,16 @@ void ChatIntegrationLayer::InitializeChatManager( } }); - //m_tokenSuspending = Windows::ApplicationModel::Core::CoreApplication::Suspending += + //m_tokenSuspending = Windows::ApplicationModel::Core::CoreApplication::Suspending += // ref new EventHandler< Windows::ApplicationModel::SuspendingEventArgs^ >( [weakPtrToThis] (Platform::Object^, Windows::ApplicationModel::SuspendingEventArgs^ args) //{ - // // Upon Suspending, nothing needs to be done + // // Upon Suspending, nothing needs to be done //}); - //m_tokenResuming = Windows::ApplicationModel::Core::CoreApplication::Resuming += + //m_tokenResuming = Windows::ApplicationModel::Core::CoreApplication::Resuming += // ref new EventHandler< Platform::Object^ >( [weakPtrToThis] (Platform::Object^, Windows::ApplicationModel::SuspendingEventArgs^ args) //{ - // // Upon Resuming, re-initialize the network, and reinitialize the chat session + // // Upon Resuming, re-initialize the network, and reinitialize the chat session //}); } @@ -215,14 +215,14 @@ void ChatIntegrationLayer::Shutdown() } } -void ChatIntegrationLayer::OnDebugMessageReceived( - __in Microsoft::Xbox::GameChat::DebugMessageEventArgs^ args +void ChatIntegrationLayer::OnDebugMessageReceived( + __in Microsoft::Xbox::GameChat::DebugMessageEventArgs^ args ) { - // To integrate the Chat DLL in your game, - // change this to false and remove the LogComment calls, + // To integrate the Chat DLL in your game, + // change this to false and remove the LogComment calls, // or integrate with your game's own UI/debug message logging system - bool outputToUI = false; + bool outputToUI = false; if( outputToUI ) { @@ -237,14 +237,14 @@ void ChatIntegrationLayer::OnDebugMessageReceived( } else { - // The string appear in the Visual Studio Output window + // The string appear in the Visual Studio Output window #ifndef _CONTENT_PACKAGE OutputDebugString( args->Message->Data() ); #endif } } -void ChatIntegrationLayer::GameUI_RecordPacketStatistic( +void ChatIntegrationLayer::GameUI_RecordPacketStatistic( __in Microsoft::Xbox::GameChat::ChatMessageType messageType, __in ChatPacketType chatPacketType ) @@ -261,7 +261,7 @@ void ChatIntegrationLayer::GameUI_RecordPacketStatistic( } } -int ChatIntegrationLayer::GameUI_GetPacketStatistic( +int ChatIntegrationLayer::GameUI_GetPacketStatistic( __in Microsoft::Xbox::GameChat::ChatMessageType messageType, __in ChatPacketType chatPacketType ) @@ -278,8 +278,8 @@ int ChatIntegrationLayer::GameUI_GetPacketStatistic( } } -void ChatIntegrationLayer::OnOutgoingChatPacketReady( - __in Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args +void ChatIntegrationLayer::OnOutgoingChatPacketReady( + __in Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args ) { byte *bytes; @@ -298,7 +298,7 @@ void ChatIntegrationLayer::OnOutgoingChatPacketReady( } -void ChatIntegrationLayer::OnIncomingChatMessage( +void ChatIntegrationLayer::OnIncomingChatMessage( unsigned int sessionAddress, Platform::Array^ message ) @@ -308,8 +308,8 @@ void ChatIntegrationLayer::OnIncomingChatMessage( // Instead your title should upon receiving a packet, extract the chat message from it, and then call m_chatManager->ProcessIncomingChatMessage as shown below // You will need to isolate chat messages to be unique from the rest of you game's other message types. - // uniqueRemoteConsoleIdentifier is a Platform::Object^ and can be cast or unboxed to most types. - // What exactly you use doesn't matter, but optimally it would be something that uniquely identifies a console on in the session. + // uniqueRemoteConsoleIdentifier is a Platform::Object^ and can be cast or unboxed to most types. + // What exactly you use doesn't matter, but optimally it would be something that uniquely identifies a console on in the session. // A Windows::Xbox::Networking::SecureDeviceAssociation^ is perfect to use if you have access to it. // This is how you would convert from byte array to a IBuffer^ @@ -331,7 +331,7 @@ void ChatIntegrationLayer::OnIncomingChatMessage( { Microsoft::Xbox::GameChat::ChatMessageType chatMessageType = m_chatManager->ProcessIncomingChatMessage(chatMessage, uniqueRemoteConsoleIdentifier); - GameUI_RecordPacketStatistic( chatMessageType, ChatPacketType::IncomingPacket ); + GameUI_RecordPacketStatistic( chatMessageType, ChatPacketType::IncomingPacket ); } } @@ -341,7 +341,7 @@ void ChatIntegrationLayer::AddAllLocallySignedInUsersToChatClient( __in Windows::Foundation::Collections::IVectorView^ locallySignedInUsers ) { - // To integrate the Chat DLL in your game, + // To integrate the Chat DLL in your game, // add all locally signed in users to the chat client for each( Windows::Xbox::System::User^ user in locallySignedInUsers ) { @@ -486,10 +486,10 @@ void ChatIntegrationLayer::AddLocalUserToChatChannel( __in Windows::Xbox::System::IUser^ user ) { - // Adds a local user to a specific channel. + // Adds a local user to a specific channel. - // This is helper function waits for the task to cm_chatManageromplete so shouldn't be called from the UI thread - // Remove the .wait() and return the result of concurrency::create_task() if you want to call it from the UI thread + // This is helper function waits for the task to cm_chatManageromplete so shouldn't be called from the UI thread + // Remove the .wait() and return the result of concurrency::create_task() if you want to call it from the UI thread // and chain PPL tasks together m_pDQRNet->LogComment( L">>>>>>>>>>>>> AddLocalUserToChatChannel" ); @@ -502,7 +502,7 @@ void ChatIntegrationLayer::AddLocalUserToChatChannel( // Error handling try { - t.get(); + t.get(); } catch ( Platform::Exception^ ex ) { @@ -513,19 +513,19 @@ void ChatIntegrationLayer::AddLocalUserToChatChannel( } } -void ChatIntegrationLayer::RemoveRemoteConsole( +void ChatIntegrationLayer::RemoveRemoteConsole( unsigned int address ) { - // uniqueConsoleIdentifier is a Platform::Object^ and can be cast or unboxed to most types. - // What exactly you use doesn't matter, but optimally it would be something that uniquely identifies a console on in the session. + // uniqueConsoleIdentifier is a Platform::Object^ and can be cast or unboxed to most types. + // What exactly you use doesn't matter, but optimally it would be something that uniquely identifies a console on in the session. // A Windows::Xbox::Networking::SecureDeviceAssociation^ is perfect to use if you have access to it. // This is how you would convert from an int to a Platform::Object^ // Platform::Object obj = IntToPlatformObject(5); - // This is helper function waits for the task to complete so shouldn't be called from the UI thread - // Remove the .wait() and return the result of concurrency::create_task() if you want to call it from the UI thread + // This is helper function waits for the task to complete so shouldn't be called from the UI thread + // Remove the .wait() and return the result of concurrency::create_task() if you want to call it from the UI thread // and chain PPL tasks together Platform::Object^ uniqueRemoteConsoleIdentifier = (Platform::Object^)address; @@ -538,7 +538,7 @@ void ChatIntegrationLayer::RemoveRemoteConsole( // Error handling try { - t.get(); + t.get(); } catch ( Platform::Exception^ ex ) { @@ -549,15 +549,15 @@ void ChatIntegrationLayer::RemoveRemoteConsole( } } -void ChatIntegrationLayer::RemoveUserFromChatChannel( +void ChatIntegrationLayer::RemoveUserFromChatChannel( __in uint8 channelIndex, - __in Windows::Xbox::System::IUser^ user + __in Windows::Xbox::System::IUser^ user ) { if( m_chatManager != nullptr ) { - // This is helper function waits for the task to complete so shouldn't be called from the UI thread - // Remove the .wait() and return the result of concurrency::create_task() if you want to call it from the UI thread + // This is helper function waits for the task to complete so shouldn't be called from the UI thread + // Remove the .wait() and return the result of concurrency::create_task() if you want to call it from the UI thread // and chain PPL tasks together auto asyncOp = m_chatManager->RemoveLocalUserFromChatChannelAsync( channelIndex, user ); @@ -577,13 +577,13 @@ void ChatIntegrationLayer::RemoveUserFromChatChannel( } } -void ChatIntegrationLayer::OnNewSessionAddressAdded( +void ChatIntegrationLayer::OnNewSessionAddressAdded( __in unsigned int address ) { m_pDQRNet->LogCommentFormat( L">>>>>>>>>>>>> OnNewSessionAddressAdded (%d)",address ); Platform::Object^ uniqueConsoleIdentifier = (Platform::Object^)address; - /// Call this when a new console connects. + /// Call this when a new console connects. /// This adds this console to the chat layer if( m_chatManager != nullptr ) { @@ -611,8 +611,8 @@ bool ChatIntegrationLayer::HasMicFocus() return false; } -Platform::Object^ ChatIntegrationLayer::IntToPlatformObject( - __in int val +Platform::Object^ ChatIntegrationLayer::IntToPlatformObject( + __in int val ) { return (Platform::Object^)val; @@ -621,23 +621,23 @@ Platform::Object^ ChatIntegrationLayer::IntToPlatformObject( //return Windows::Foundation::PropertyValue::CreateInt32(val); } -int ChatIntegrationLayer::PlatformObjectToInt( - __in Platform::Object^ uniqueRemoteConsoleIdentifier +int ChatIntegrationLayer::PlatformObjectToInt( + __in Platform::Object^ uniqueRemoteConsoleIdentifier ) { - return safe_cast( uniqueRemoteConsoleIdentifier ); + return safe_cast( uniqueRemoteConsoleIdentifier ); // You can also do the same using a PropertyValue. //return safe_cast(uniqueRemoteConsoleIdentifier)->GetInt32(); } -void ChatIntegrationLayer::HandleChatChannelChanged( - __in uint8 oldChatChannelIndex, - __in uint8 newChatChannelIndex, - __in Microsoft::Xbox::GameChat::ChatUser^ chatUser +void ChatIntegrationLayer::HandleChatChannelChanged( + __in uint8 oldChatChannelIndex, + __in uint8 newChatChannelIndex, + __in Microsoft::Xbox::GameChat::ChatUser^ chatUser ) { - // We remember if the local user was currently muted from all channels. And when we switch channels, + // We remember if the local user was currently muted from all channels. And when we switch channels, // we ensure that the state persists. For remote users, title should implement this themselves // based on title game design if they want to persist the muting state. @@ -674,8 +674,8 @@ void ChatIntegrationLayer::HandleChatChannelChanged( } } -void ChatIntegrationLayer::ChangeChatUserMuteState( - __in Microsoft::Xbox::GameChat::ChatUser^ chatUser +void ChatIntegrationLayer::ChangeChatUserMuteState( + __in Microsoft::Xbox::GameChat::ChatUser^ chatUser ) { /// Helper function to swap the mute state of a specific chat user @@ -692,8 +692,8 @@ void ChatIntegrationLayer::ChangeChatUserMuteState( } } -Microsoft::Xbox::GameChat::ChatUser^ ChatIntegrationLayer::GetChatUserByXboxUserId( - __in Platform::String^ xboxUserId +Microsoft::Xbox::GameChat::ChatUser^ ChatIntegrationLayer::GetChatUserByXboxUserId( + __in Platform::String^ xboxUserId ) { Windows::Foundation::Collections::IVectorView^ chatUsers = GetChatUsers(); @@ -704,14 +704,14 @@ Microsoft::Xbox::GameChat::ChatUser^ ChatIntegrationLayer::GetChatUserByXboxUser return chatUser; } } - + return nullptr; } -bool ChatIntegrationLayer::CompareUniqueConsoleIdentifiers( - __in Platform::Object^ uniqueRemoteConsoleIdentifier1, - __in Platform::Object^ uniqueRemoteConsoleIdentifier2 +bool ChatIntegrationLayer::CompareUniqueConsoleIdentifiers( + __in Platform::Object^ uniqueRemoteConsoleIdentifier1, + __in Platform::Object^ uniqueRemoteConsoleIdentifier2 ) { if (uniqueRemoteConsoleIdentifier1 == nullptr || uniqueRemoteConsoleIdentifier2 == nullptr) @@ -719,7 +719,7 @@ bool ChatIntegrationLayer::CompareUniqueConsoleIdentifiers( return false; } - // uniqueRemoteConsoleIdentifier is a Platform::Object^ and can be cast or unboxed to most types. + // uniqueRemoteConsoleIdentifier is a Platform::Object^ and can be cast or unboxed to most types. // We're using XRNS addresses, which are unsigned ints unsigned int address1 = safe_cast(uniqueRemoteConsoleIdentifier1); unsigned int address2 = safe_cast(uniqueRemoteConsoleIdentifier2); diff --git a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h index 80b4e10a..4470a22b 100644 --- a/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h +++ b/Minecraft.Client/Durango/Network/ChatIntegrationLayer.h @@ -16,7 +16,7 @@ enum ChatPacketType OutgoingPacket = 1 }; -class ChatIntegrationLayer +class ChatIntegrationLayer : public std::enable_shared_from_this // shared_from_this is needed to use a weak ref to 'this' when handling delegate callbacks { public: @@ -26,7 +26,7 @@ public: /// /// Initializes the chat manager /// - void InitializeChatManager( + void InitializeChatManager( __in bool combineCaptureBuffersIntoSinglePacketEnabled, __in bool useKinectAsCaptureSource, __in bool applySoundEffectToCapture, @@ -47,8 +47,8 @@ public: bool m_canCaptureAudio; }; - void AddLocalUser( __in Windows::Xbox::System::IUser^ user ); - void RemoveLocalUser( __in Windows::Xbox::System::IUser^ user ); + void AddLocalUser( __in Windows::Xbox::System::IUser^ user ); + void RemoveLocalUser( __in Windows::Xbox::System::IUser^ user ); void EvaluateDevicesForUser(__in Windows::Xbox::System::IUser^ user ); vector m_addedUsers; @@ -57,18 +57,18 @@ public: private: /// /// Adds a local user to a specific channel - /// This is helper function waits for the task to complete so shouldn't be called from the UI thread + /// This is helper function waits for the task to complete so shouldn't be called from the UI thread /// /// The channel to add the user to /// The local user to add - void AddLocalUserToChatChannel( + void AddLocalUserToChatChannel( __in uint8 channelIndex, __in Windows::Xbox::System::IUser^ user - ); + ); /// /// Removes a local user from a specific channel - /// This is helper function waits for the task to complete so shouldn't be called from the UI thread + /// This is helper function waits for the task to complete so shouldn't be called from the UI thread /// /// The channel to remove the user from /// The local user to remove @@ -80,10 +80,10 @@ public: /// /// Removes a remote console from chat - /// This is helper function waits for the task to complete so shouldn't be called from the UI thread + /// This is helper function waits for the task to complete so shouldn't be called from the UI thread /// /// A unique ID for the remote console - void RemoveRemoteConsole( + void RemoveRemoteConsole( unsigned int address ); @@ -92,7 +92,7 @@ public: /// /// A buffer containing the chat message /// A unique ID for the remote console - void OnIncomingChatMessage( + void OnIncomingChatMessage( unsigned int sessionAddress, Platform::Array^ message ); @@ -111,7 +111,7 @@ public: /// Helper function to swap the mute state of a specific chat user /// void ChangeChatUserMuteState( - __in Microsoft::Xbox::GameChat::ChatUser^ chatUser + __in Microsoft::Xbox::GameChat::ChatUser^ chatUser ); /// @@ -120,20 +120,20 @@ public: void HandleChatChannelChanged( __in uint8 oldChatChannelIndex, __in uint8 newChatChannelIndex, - __in Microsoft::Xbox::GameChat::ChatUser^ chatUser + __in Microsoft::Xbox::GameChat::ChatUser^ chatUser ); /// - /// Call this when a new console connects. + /// Call this when a new console connects. /// This adds this console to the chat layer /// - void OnNewSessionAddressAdded( - __in unsigned int address + void OnNewSessionAddressAdded( + __in unsigned int address ); /// /// Adds a list of locally signed in users that have intent to play to the chat session on a specific channel index. - /// Avoid adding any user who is signed in that doesn't have intent to play otherwise users who are biometrically + /// Avoid adding any user who is signed in that doesn't have intent to play otherwise users who are biometrically /// signed in automatically will be added to the chat session /// /// The channel to add the users to @@ -147,8 +147,8 @@ public: /// Handles when a debug message is received. Send this to the UI and OutputDebugString. Games should integrate with their existing log system. /// /// Contains the debug message to log - void OnDebugMessageReceived( - __in Microsoft::Xbox::GameChat::DebugMessageEventArgs^ args + void OnDebugMessageReceived( + __in Microsoft::Xbox::GameChat::DebugMessageEventArgs^ args ); /// @@ -161,8 +161,8 @@ public: /// It should send the chat message in order (if that feature is available) if args->SendInOrder is true /// /// Describes the packet to send - void OnOutgoingChatPacketReady( - __in Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args + void OnOutgoingChatPacketReady( + __in Microsoft::Xbox::GameChat::ChatPacketEventArgs^ args ); /// @@ -189,13 +189,13 @@ public: /// /// Helper function to get specific ChatUser by xboxUserId /// - bool ChatIntegrationLayer::CompareUniqueConsoleIdentifiers( - __in Platform::Object^ uniqueRemoteConsoleIdentifier1, - __in Platform::Object^ uniqueRemoteConsoleIdentifier2 + bool ChatIntegrationLayer::CompareUniqueConsoleIdentifiers( + __in Platform::Object^ uniqueRemoteConsoleIdentifier1, + __in Platform::Object^ uniqueRemoteConsoleIdentifier2 ); /// - /// Helper function to return the ChatPerformanceCounters^ from the ChatManager so perf numbers can be shown on the UI + /// Helper function to return the ChatPerformanceCounters^ from the ChatManager so perf numbers can be shown on the UI /// These numbers will only be valid if m_chatManager->ChatSettings->PerformanceCountersEnabled is set to true. /// Microsoft::Xbox::GameChat::ChatPerformanceCounters^ GetChatPerformanceCounters(); @@ -204,13 +204,13 @@ public: /// Returns a count of the number of chat packets of a specific type that have been either sent or received. /// It is useful to monitor this number in the UI / logs to debug network issues. /// - int GameUI_GetPacketStatistic( + int GameUI_GetPacketStatistic( __in Microsoft::Xbox::GameChat::ChatMessageType messageType, __in ChatPacketType chatPacketType ); - - void OnControllerPairingChanged( - __in Windows::Xbox::Input::ControllerPairingChangedEventArgs^ args + + void OnControllerPairingChanged( + __in Windows::Xbox::Input::ControllerPairingChangedEventArgs^ args ); void ToggleRenderTargetVolume(); @@ -233,7 +233,7 @@ private: // Debug stats for chat packets. Use Debug_GetPacketStatistic() to get the values. /// It is useful to monitor this number in the UI / logs to debug network issues. - void GameUI_RecordPacketStatistic( + void GameUI_RecordPacketStatistic( __in Microsoft::Xbox::GameChat::ChatMessageType messageType, __in ChatPacketType chatPacketType ); diff --git a/Minecraft.Client/Durango/Sentient/DurangoTelemetry.cpp b/Minecraft.Client/Durango/Sentient/DurangoTelemetry.cpp index d51ce966..1b4f5465 100644 --- a/Minecraft.Client/Durango/Sentient/DurangoTelemetry.cpp +++ b/Minecraft.Client/Durango/Sentient/DurangoTelemetry.cpp @@ -51,13 +51,13 @@ HRESULT CDurangoTelemetryManager::Flush() bool CDurangoTelemetryManager::RecordPlayerSessionStart(int iPad) { durangoStats()->generatePlayerSession(); - + return true; } bool CDurangoTelemetryManager::RecordPlayerSessionExit(int iPad, int exitStatus) { - PlayerUID puid; shared_ptr plr; + PlayerUID puid; std::shared_ptr plr; ProfileManager.GetXUID(iPad, &puid, true); plr = Minecraft::GetInstance()->localplayers[iPad]; @@ -123,11 +123,11 @@ bool CDurangoTelemetryManager::RecordPlayerSessionExit(int iPad, int exitStatus) bool CDurangoTelemetryManager::RecordLevelStart(int iPad, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, int numberOfLocalPlayers, int numberOfOnlinePlayers) { CTelemetryManager::RecordLevelStart(iPad, friendsOrMatch, competeOrCoop, difficulty, numberOfLocalPlayers, numberOfOnlinePlayers); - + ULONG hr = 0; // Grab player info. - PlayerUID puid; shared_ptr plr; + PlayerUID puid; std::shared_ptr plr; ProfileManager.GetXUID(iPad, &puid, true); plr = Minecraft::GetInstance()->localplayers[iPad]; @@ -191,10 +191,10 @@ bool CDurangoTelemetryManager::RecordLevelStart(int iPad, ESen_FriendOrMatch fri GetSubLevelId(iPad), GetLevelInstanceID(), &ZERO_GUID, - friendsOrMatch, - competeOrCoop, - difficulty, - numberOfLocalPlayers, + friendsOrMatch, + competeOrCoop, + difficulty, + numberOfLocalPlayers, numberOfOnlinePlayers, &ZERO_GUID ); @@ -219,10 +219,10 @@ bool CDurangoTelemetryManager::RecordLevelStart(int iPad, ESen_FriendOrMatch fri // Durango // /* GUID */ guid2str(DurangoStats::getPlayerSession()).c_str(), /* WSTR */ DurangoStats::getMultiplayerCorrelationId(), - /* int */ friendsOrMatch, - /* int */ competeOrCoop, - /* int */ difficulty, - /* int */ numberOfLocalPlayers, + /* int */ friendsOrMatch, + /* int */ competeOrCoop, + /* int */ difficulty, + /* int */ numberOfLocalPlayers, /* int */ numberOfOnlinePlayers ); @@ -577,7 +577,7 @@ bool CDurangoTelemetryManager::RecordMediaShareUpload(int iPad, ESen_MediaDestin mediaDestination, mediaType ); -#else +#else ULONG hr = -1; #endif diff --git a/Minecraft.Client/EnchantTableRenderer.cpp b/Minecraft.Client/EnchantTableRenderer.cpp index 43f2b040..a16a0473 100644 --- a/Minecraft.Client/EnchantTableRenderer.cpp +++ b/Minecraft.Client/EnchantTableRenderer.cpp @@ -14,10 +14,10 @@ EnchantTableRenderer::~EnchantTableRenderer() delete bookModel; } -void EnchantTableRenderer::render(shared_ptr _table, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +void EnchantTableRenderer::render(std::shared_ptr _table, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) { // 4J Convert as we aren't using a templated class - shared_ptr table = dynamic_pointer_cast(_table); + std::shared_ptr table = dynamic_pointer_cast(_table); #ifdef __PSVITA__ // AP - the book pages are made with 0 depth so the front and back polys are at the same location. This can cause z-fighting if culling is disabled which can sometimes happen diff --git a/Minecraft.Client/EnchantTableRenderer.h b/Minecraft.Client/EnchantTableRenderer.h index 0b738ca9..77485719 100644 --- a/Minecraft.Client/EnchantTableRenderer.h +++ b/Minecraft.Client/EnchantTableRenderer.h @@ -15,5 +15,5 @@ public: EnchantTableRenderer(); ~EnchantTableRenderer(); - virtual void render(shared_ptr _table, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); + virtual void render(std::shared_ptr _table, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); }; diff --git a/Minecraft.Client/EnderChestRenderer.cpp b/Minecraft.Client/EnderChestRenderer.cpp index 2996b65f..67e27bf7 100644 --- a/Minecraft.Client/EnderChestRenderer.cpp +++ b/Minecraft.Client/EnderChestRenderer.cpp @@ -3,10 +3,10 @@ #include "ModelPart.h" #include "EnderChestRenderer.h" -void EnderChestRenderer::render(shared_ptr _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +void EnderChestRenderer::render(std::shared_ptr _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) { // 4J Convert as we aren't using a templated class - shared_ptr chest = dynamic_pointer_cast(_chest); + std::shared_ptr chest = dynamic_pointer_cast(_chest); int data = 0; diff --git a/Minecraft.Client/EnderChestRenderer.h b/Minecraft.Client/EnderChestRenderer.h index d0521ae0..0ff14e48 100644 --- a/Minecraft.Client/EnderChestRenderer.h +++ b/Minecraft.Client/EnderChestRenderer.h @@ -9,5 +9,5 @@ private: ChestModel chestModel; public: - void render(shared_ptr _chest, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param + void render(std::shared_ptr _chest, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param }; diff --git a/Minecraft.Client/EnderCrystalModel.cpp b/Minecraft.Client/EnderCrystalModel.cpp index fde03cd8..4d664605 100644 --- a/Minecraft.Client/EnderCrystalModel.cpp +++ b/Minecraft.Client/EnderCrystalModel.cpp @@ -3,7 +3,7 @@ -EnderCrystalModel::EnderCrystalModel(float g) +EnderCrystalModel::EnderCrystalModel(float g) { glass = new ModelPart(this, L"glass"); glass->texOffs(0, 0)->addBox(-4, -4, -4, 8, 8, 8); @@ -21,7 +21,7 @@ EnderCrystalModel::EnderCrystalModel(float g) } -void EnderCrystalModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void EnderCrystalModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { glPushMatrix(); glScalef(2, 2, 2); diff --git a/Minecraft.Client/EnderCrystalModel.h b/Minecraft.Client/EnderCrystalModel.h index 71f1db10..42ae1b3d 100644 --- a/Minecraft.Client/EnderCrystalModel.h +++ b/Minecraft.Client/EnderCrystalModel.h @@ -14,5 +14,5 @@ private: public: EnderCrystalModel(float g); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); }; \ No newline at end of file diff --git a/Minecraft.Client/EnderCrystalRenderer.cpp b/Minecraft.Client/EnderCrystalRenderer.cpp index 452206bc..f392824d 100644 --- a/Minecraft.Client/EnderCrystalRenderer.cpp +++ b/Minecraft.Client/EnderCrystalRenderer.cpp @@ -9,11 +9,11 @@ EnderCrystalRenderer::EnderCrystalRenderer() this->shadowRadius = 0.5f; } -void EnderCrystalRenderer::render(shared_ptr _crystal, double x, double y, double z, float rot, float a) +void EnderCrystalRenderer::render(std::shared_ptr _crystal, double x, double y, double z, float rot, float a) { - // 4J - original version used generics and thus had an input parameter of type EnderCrystal rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type EnderCrystal rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr crystal = dynamic_pointer_cast(_crystal); + std::shared_ptr crystal = dynamic_pointer_cast(_crystal); if (currentModel != EnderCrystalModel::MODEL_ID) { model = new EnderCrystalModel(0); diff --git a/Minecraft.Client/EnderCrystalRenderer.h b/Minecraft.Client/EnderCrystalRenderer.h index de5dc820..5ac644d1 100644 --- a/Minecraft.Client/EnderCrystalRenderer.h +++ b/Minecraft.Client/EnderCrystalRenderer.h @@ -13,5 +13,5 @@ private: public: EnderCrystalRenderer(); - virtual void render(shared_ptr _crystal, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _crystal, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/EnderDragonRenderer.cpp b/Minecraft.Client/EnderDragonRenderer.cpp index 8c531d4e..7fe0bf3f 100644 --- a/Minecraft.Client/EnderDragonRenderer.cpp +++ b/Minecraft.Client/EnderDragonRenderer.cpp @@ -5,7 +5,7 @@ #include "Lighting.h" #include "EnderDragonRenderer.h" -shared_ptr EnderDragonRenderer::bossInstance; +std::shared_ptr EnderDragonRenderer::bossInstance; int EnderDragonRenderer::currentModel; EnderDragonRenderer::EnderDragonRenderer() : MobRenderer(new DragonModel(0), 0.5f) @@ -15,10 +15,10 @@ EnderDragonRenderer::EnderDragonRenderer() : MobRenderer(new DragonModel(0), 0.5 this->setArmor(model); } -void EnderDragonRenderer::setupRotations(shared_ptr _mob, float bob, float bodyRot, float a) -{ +void EnderDragonRenderer::setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a) +{ // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); // 4J - reorganised a bit so we can free allocations double lpComponents[3]; @@ -32,7 +32,7 @@ void EnderDragonRenderer::setupRotations(shared_ptr _mob, float bob, float float rot2 = mob->getTilt(a); glRotatef(-yr, 0, 1, 0); - + glRotatef(rot2, 1, 0, 0); //glRotatef(rot2 * 10, 1, 0, 0); @@ -46,10 +46,10 @@ void EnderDragonRenderer::setupRotations(shared_ptr _mob, float bob, float } } -void EnderDragonRenderer::renderModel(shared_ptr _mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale) +void EnderDragonRenderer::renderModel(std::shared_ptr _mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); if (mob->dragonDeathTime > 0) { @@ -87,10 +87,10 @@ void EnderDragonRenderer::renderModel(shared_ptr _mob, float wp, float w } } -void EnderDragonRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void EnderDragonRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); EnderDragonRenderer::bossInstance = mob; if (currentModel != DragonModel::MODEL_ID) { @@ -167,10 +167,10 @@ void EnderDragonRenderer::render(shared_ptr _mob, double x, double y, do } } -void EnderDragonRenderer::additionalRendering(shared_ptr _mob, float a) -{ +void EnderDragonRenderer::additionalRendering(std::shared_ptr _mob, float a) +{ // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); MobRenderer::additionalRendering(mob, a); Tesselator *t = Tesselator::getInstance(); @@ -227,10 +227,10 @@ void EnderDragonRenderer::additionalRendering(shared_ptr _mob, float a) } -int EnderDragonRenderer::prepareArmor(shared_ptr _mob, int layer, float a) +int EnderDragonRenderer::prepareArmor(std::shared_ptr _mob, int layer, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); if (layer == 1) { diff --git a/Minecraft.Client/EnderDragonRenderer.h b/Minecraft.Client/EnderDragonRenderer.h index ab508d99..095e2cf2 100644 --- a/Minecraft.Client/EnderDragonRenderer.h +++ b/Minecraft.Client/EnderDragonRenderer.h @@ -10,7 +10,7 @@ class DragonModel; class EnderDragonRenderer : public MobRenderer { public: - static shared_ptr bossInstance; + static std::shared_ptr bossInstance; private: static int currentModel; @@ -22,15 +22,15 @@ public: EnderDragonRenderer(); protected: - virtual void setupRotations(shared_ptr _mob, float bob, float bodyRot, float a); + virtual void setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a); protected: - void renderModel(shared_ptr _mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale); + void renderModel(std::shared_ptr _mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale); public: - virtual void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); protected: - virtual void additionalRendering(shared_ptr _mob, float a); - virtual int prepareArmor(shared_ptr _mob, int layer, float a); + virtual void additionalRendering(std::shared_ptr _mob, float a); + virtual int prepareArmor(std::shared_ptr _mob, int layer, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/EndermanRenderer.cpp b/Minecraft.Client/EndermanRenderer.cpp index 8802376a..cf96e693 100644 --- a/Minecraft.Client/EndermanRenderer.cpp +++ b/Minecraft.Client/EndermanRenderer.cpp @@ -10,11 +10,11 @@ EndermanRenderer::EndermanRenderer() : MobRenderer(new EndermanModel(), 0.5f) this->setArmor(model); } -void EndermanRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void EndermanRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { - // 4J - original version used generics and thus had an input parameter of type Boat rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Boat rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); model->carrying = mob->getCarryingTile() > 0; model->creepy = mob->isCreepy(); @@ -29,11 +29,11 @@ void EndermanRenderer::render(shared_ptr _mob, double x, double y, doubl MobRenderer::render(mob, x, y, z, rot, a); } -void EndermanRenderer::additionalRendering(shared_ptr _mob, float a) +void EndermanRenderer::additionalRendering(std::shared_ptr _mob, float a) { - // 4J - original version used generics and thus had an input parameter of type Boat rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Boat rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); MobRenderer::additionalRendering(_mob, a); @@ -68,11 +68,11 @@ void EndermanRenderer::additionalRendering(shared_ptr _mob, float a) } } -int EndermanRenderer::prepareArmor(shared_ptr _mob, int layer, float a) +int EndermanRenderer::prepareArmor(std::shared_ptr _mob, int layer, float a) { - // 4J - original version used generics and thus had an input parameter of type Boat rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Boat rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); if (layer != 0) return -1; diff --git a/Minecraft.Client/EndermanRenderer.h b/Minecraft.Client/EndermanRenderer.h index 6f5126bd..eaf6393e 100644 --- a/Minecraft.Client/EndermanRenderer.h +++ b/Minecraft.Client/EndermanRenderer.h @@ -14,9 +14,9 @@ private: public: EndermanRenderer(); - virtual void render(shared_ptr _mob, double x, double y, double z, float rot, float a); - virtual void additionalRendering(shared_ptr _mob, float a); + virtual void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); + virtual void additionalRendering(std::shared_ptr _mob, float a); protected: - virtual int prepareArmor(shared_ptr _mob, int layer, float a); + virtual int prepareArmor(std::shared_ptr _mob, int layer, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/EntityRenderDispatcher.cpp b/Minecraft.Client/EntityRenderDispatcher.cpp index dfc9a11e..352d05e9 100644 --- a/Minecraft.Client/EntityRenderDispatcher.cpp +++ b/Minecraft.Client/EntityRenderDispatcher.cpp @@ -168,12 +168,12 @@ EntityRenderer *EntityRenderDispatcher::getRenderer(eINSTANCEOF e) return it->second; } -EntityRenderer *EntityRenderDispatcher::getRenderer(shared_ptr e) +EntityRenderer *EntityRenderDispatcher::getRenderer(std::shared_ptr e) { return getRenderer(e->GetType()); } -void EntityRenderDispatcher::prepare(Level *level, Textures *textures, Font *font, shared_ptr player, Options *options, float a) +void EntityRenderDispatcher::prepare(Level *level, Textures *textures, Font *font, std::shared_ptr player, Options *options, float a) { this->level = level; this->textures = textures; @@ -197,7 +197,7 @@ void EntityRenderDispatcher::prepare(Level *level, Textures *textures, Font *fon playerRotX = player->xRotO + (player->xRot - player->xRotO) * a; } - shared_ptr pl = dynamic_pointer_cast(player); + std::shared_ptr pl = dynamic_pointer_cast(player); if (pl->ThirdPersonView() == 2) { playerRotY += 180; @@ -209,7 +209,7 @@ void EntityRenderDispatcher::prepare(Level *level, Textures *textures, Font *fon } -void EntityRenderDispatcher::render(shared_ptr entity, float a) +void EntityRenderDispatcher::render(std::shared_ptr entity, float a) { double x = entity->xOld + (entity->x - entity->xOld) * a; double y = entity->yOld + (entity->y - entity->yOld) * a; @@ -230,7 +230,7 @@ void EntityRenderDispatcher::render(shared_ptr entity, float a) } } float r = entity->yRotO + (rotDiff) * a; - + int col = entity->getLightColor(a); if (entity->isOnFire()) { @@ -244,13 +244,13 @@ void EntityRenderDispatcher::render(shared_ptr entity, float a) render(entity, x - xOff, y - yOff, z - zOff, r, a); } -void EntityRenderDispatcher::render(shared_ptr entity, double x, double y, double z, float rot, float a, bool bItemFrame, bool bRenderPlayerShadow) +void EntityRenderDispatcher::render(std::shared_ptr entity, double x, double y, double z, float rot, float a, bool bItemFrame, bool bRenderPlayerShadow) { EntityRenderer *renderer = getRenderer(entity); if (renderer != NULL) - { + { renderer->SetItemFrame(bItemFrame); - + renderer->render(entity, x, y, z, rot, a); renderer->postRender(entity, x, y, z, rot, a, bRenderPlayerShadow); } diff --git a/Minecraft.Client/EntityRenderDispatcher.h b/Minecraft.Client/EntityRenderDispatcher.h index 248be18f..a750a109 100644 --- a/Minecraft.Client/EntityRenderDispatcher.h +++ b/Minecraft.Client/EntityRenderDispatcher.h @@ -26,7 +26,7 @@ public: Textures *textures; ItemInHandRenderer *itemInHandRenderer; Level *level; - shared_ptr cameraEntity; + std::shared_ptr cameraEntity; float playerRotY; float playerRotX; Options *options; @@ -38,10 +38,10 @@ private: EntityRenderDispatcher(); public: EntityRenderer *getRenderer(eINSTANCEOF e); - EntityRenderer *getRenderer(shared_ptr e); - void prepare(Level *level, Textures *textures, Font *font, shared_ptr player, Options *options, float a); - void render(shared_ptr entity, float a); - void render(shared_ptr entity, double x, double y, double z, float rot, float a, bool bItemFrame = false, bool bRenderPlayerShadow = true); + EntityRenderer *getRenderer(std::shared_ptr e); + void prepare(Level *level, Textures *textures, Font *font, std::shared_ptr player, Options *options, float a); + void render(std::shared_ptr entity, float a); + void render(std::shared_ptr entity, double x, double y, double z, float rot, float a, bool bItemFrame = false, bool bRenderPlayerShadow = true); void setLevel(Level *level); double distanceToSqr(double x, double y, double z); Font *getFont(); diff --git a/Minecraft.Client/EntityRenderer.cpp b/Minecraft.Client/EntityRenderer.cpp index 6c0247ed..3c09382f 100644 --- a/Minecraft.Client/EntityRenderer.cpp +++ b/Minecraft.Client/EntityRenderer.cpp @@ -41,7 +41,7 @@ bool EntityRenderer::bindTexture(const wstring& urlTexture, int backupTexture) Textures *t = entityRenderDispatcher->textures; // 4J-PB - no http textures on the xbox, mem textures instead - + //int id = t->loadHttpTexture(urlTexture, backupTexture); int id = t->loadMemTexture(urlTexture, backupTexture); @@ -62,7 +62,7 @@ bool EntityRenderer::bindTexture(const wstring& urlTexture, const wstring& backu Textures *t = entityRenderDispatcher->textures; // 4J-PB - no http textures on the xbox, mem textures instead - + //int id = t->loadHttpTexture(urlTexture, backupTexture); int id = t->loadMemTexture(urlTexture, backupTexture); @@ -78,7 +78,7 @@ bool EntityRenderer::bindTexture(const wstring& urlTexture, const wstring& backu } } -void EntityRenderer::renderFlame(shared_ptr e, double x, double y, double z, float a) +void EntityRenderer::renderFlame(std::shared_ptr e, double x, double y, double z, float a) { glDisable(GL_LIGHTING); @@ -146,7 +146,7 @@ void EntityRenderer::renderFlame(shared_ptr e, double x, double y, doubl glEnable(GL_LIGHTING); } -void EntityRenderer::renderShadow(shared_ptr e, double x, double y, double z, float pow, float a) +void EntityRenderer::renderShadow(std::shared_ptr e, double x, double y, double z, float pow, float a) { glDisable(GL_LIGHTING); glEnable(GL_BLEND); @@ -160,17 +160,17 @@ void EntityRenderer::renderShadow(shared_ptr e, double x, double y, doub glDepthMask(false); float r = shadowRadius; - shared_ptr mob = dynamic_pointer_cast(e); + std::shared_ptr mob = dynamic_pointer_cast(e); bool isLocalPlayer = false; float fYLocalPlayerShadowOffset=0.0f; //if (dynamic_pointer_cast(e) != NULL) if (mob != NULL) { - //shared_ptr mob = dynamic_pointer_cast(e); + //std::shared_ptr mob = dynamic_pointer_cast(e); r *= mob->getSizeScale(); - shared_ptr animal = dynamic_pointer_cast(mob); + std::shared_ptr animal = dynamic_pointer_cast(mob); if (animal != NULL) { if (animal->isBaby()) @@ -213,12 +213,12 @@ void EntityRenderer::renderShadow(shared_ptr e, double x, double y, doub for (int xt = x0; xt <= x1; xt++) for (int yt = y0; yt <= y1; yt++) for (int zt = z0; zt <= z1; zt++) - { + { int t = level->getTile(xt, yt - 1, zt); if (t > 0 && level->getRawBrightness(xt, yt, zt) > 3) { renderTileShadow(Tile::tiles[t], x, y + e->getShadowHeightOffs() + fYLocalPlayerShadowOffset, z, xt, yt , zt, pow, r, xo, yo + e->getShadowHeightOffs() + fYLocalPlayerShadowOffset, zo); - } + } } tt->end(); @@ -242,7 +242,7 @@ void EntityRenderer::renderTileShadow(Tile *tt, double x, double y, double z, in double a = ((pow - (y - (yt + yo)) / 2) * 0.5f) * getLevel()->getBrightness(xt, yt, zt); if (a < 0) return; if (a > 1) a = 1; - + t->color(1.0f, 1.0f, 1.0f, (float) a); // glColor4f(1, 1, 1, (float) a); @@ -383,7 +383,7 @@ void EntityRenderer::init(EntityRenderDispatcher *entityRenderDispatcher) this->entityRenderDispatcher = entityRenderDispatcher; } -void EntityRenderer::postRender(shared_ptr entity, double x, double y, double z, float rot, float a, bool bRenderPlayerShadow) +void EntityRenderer::postRender(std::shared_ptr entity, double x, double y, double z, float rot, float a, bool bRenderPlayerShadow) { if( !entityRenderDispatcher->isGuiRender ) // 4J - added, don't render shadow in gui as it uses its own blending, and we have globally enabled blending for interface opacity { diff --git a/Minecraft.Client/EntityRenderer.h b/Minecraft.Client/EntityRenderer.h index e0c264a5..f8c91685 100644 --- a/Minecraft.Client/EntityRenderer.h +++ b/Minecraft.Client/EntityRenderer.h @@ -36,16 +36,16 @@ public: EntityRenderer(); // 4J - added virtual ~EntityRenderer(); public: - virtual void render(shared_ptr entity, double x, double y, double z, float rot, float a) = 0; + virtual void render(std::shared_ptr entity, double x, double y, double z, float rot, float a) = 0; protected: virtual void bindTexture(int resourceName); // 4J - added virtual void bindTexture(const wstring& resourceName); virtual bool bindTexture(const wstring& urlTexture, int backupTexture); // 4J added - virtual bool bindTexture(const wstring& urlTexture, const wstring& backupTexture); + virtual bool bindTexture(const wstring& urlTexture, const wstring& backupTexture); private: - virtual void renderFlame(shared_ptr e, double x, double y, double z, float a); - virtual void renderShadow(shared_ptr e, double x, double y, double z, float pow, float a); + virtual void renderFlame(std::shared_ptr e, double x, double y, double z, float a); + virtual void renderShadow(std::shared_ptr e, double x, double y, double z, float pow, float a); virtual Level *getLevel(); virtual void renderTileShadow(Tile *tt, double x, double y, double z, int xt, int yt, int zt, float pow, float r, double xo, double yo, double zo); @@ -54,7 +54,7 @@ public: static void renderFlat(AABB *bb); static void renderFlat(float x0, float y0, float z0, float x1, float y1, float z1); virtual void init(EntityRenderDispatcher *entityRenderDispatcher); - virtual void postRender(shared_ptr entity, double x, double y, double z, float rot, float a, bool bRenderPlayerShadow); + virtual void postRender(std::shared_ptr entity, double x, double y, double z, float rot, float a, bool bRenderPlayerShadow); virtual Font *getFont(); virtual void registerTerrainTextures(IconRegister *iconRegister); diff --git a/Minecraft.Client/EntityTileRenderer.cpp b/Minecraft.Client/EntityTileRenderer.cpp index a2301d42..2898de27 100644 --- a/Minecraft.Client/EntityTileRenderer.cpp +++ b/Minecraft.Client/EntityTileRenderer.cpp @@ -7,8 +7,8 @@ EntityTileRenderer *EntityTileRenderer::instance = new EntityTileRenderer; EntityTileRenderer::EntityTileRenderer() { - chest = shared_ptr(new ChestTileEntity()); - enderChest = shared_ptr(new EnderChestTileEntity()); + chest = std::shared_ptr(new ChestTileEntity()); + enderChest = std::shared_ptr(new EnderChestTileEntity()); } void EntityTileRenderer::render(Tile *tile, int data, float brightness, float alpha, bool setColor, bool useCompiled) diff --git a/Minecraft.Client/EntityTileRenderer.h b/Minecraft.Client/EntityTileRenderer.h index cc572cad..14ba6bfc 100644 --- a/Minecraft.Client/EntityTileRenderer.h +++ b/Minecraft.Client/EntityTileRenderer.h @@ -10,8 +10,8 @@ class EntityTileRenderer static EntityTileRenderer *instance; private: - shared_ptr chest; - shared_ptr enderChest; + std::shared_ptr chest; + std::shared_ptr enderChest; public: EntityTileRenderer(); diff --git a/Minecraft.Client/EntityTracker.cpp b/Minecraft.Client/EntityTracker.cpp index 8f1dbcd8..ca31c03e 100644 --- a/Minecraft.Client/EntityTracker.cpp +++ b/Minecraft.Client/EntityTracker.cpp @@ -26,12 +26,12 @@ EntityTracker::EntityTracker(ServerLevel *level) maxRange = level->getServer()->getPlayers()->getMaxRange(); } -void EntityTracker::addEntity(shared_ptr e) +void EntityTracker::addEntity(std::shared_ptr e) { if (e->GetType() == eTYPE_SERVERPLAYER) { addEntity(e, 32 * 16, 2); - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); for( AUTO_VAR(it, entities.begin()); it != entities.end(); it++ ) { if( (*it)->e != player ) @@ -65,12 +65,12 @@ void EntityTracker::addEntity(shared_ptr e) else if (e->GetType() == eTYPE_ITEM_FRAME) addEntity(e, 16 * 10, INT_MAX, false); } -void EntityTracker::addEntity(shared_ptr e, int range, int updateInterval) +void EntityTracker::addEntity(std::shared_ptr e, int range, int updateInterval) { addEntity(e, range, updateInterval, false); } -void EntityTracker::addEntity(shared_ptr e, int range, int updateInterval, bool trackDeltas) +void EntityTracker::addEntity(std::shared_ptr e, int range, int updateInterval, bool trackDeltas) { if (range > maxRange) range = maxRange; if (entityMap.find(e->entityId) != entityMap.end()) @@ -81,7 +81,7 @@ void EntityTracker::addEntity(shared_ptr e, int range, int updateInterva { __debugbreak(); } - shared_ptr te = shared_ptr( new TrackedEntity(e, range, updateInterval, trackDeltas) ); + std::shared_ptr te = std::shared_ptr( new TrackedEntity(e, range, updateInterval, trackDeltas) ); entities.insert(te); entityMap[e->entityId] = te; te->updatePlayers(this, &level->players); @@ -89,23 +89,23 @@ void EntityTracker::addEntity(shared_ptr e, int range, int updateInterva // 4J - have split removeEntity into two bits - it used to do the equivalent of EntityTracker::removePlayer followed by EntityTracker::removeEntity. // This is to allow us to now choose to remove the player as a "seenBy" only when the player has actually been removed from the level's own player array -void EntityTracker::removeEntity(shared_ptr e) +void EntityTracker::removeEntity(std::shared_ptr e) { AUTO_VAR(it, entityMap.find(e->entityId)); if( it != entityMap.end() ) { - shared_ptr te = it->second; + std::shared_ptr te = it->second; entityMap.erase(it); entities.erase(te); te->broadcastRemoved(); } } -void EntityTracker::removePlayer(shared_ptr e) +void EntityTracker::removePlayer(std::shared_ptr e) { if (e->GetType() == eTYPE_SERVERPLAYER) { - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); for( AUTO_VAR(it, entities.begin()); it != entities.end(); it++ ) { (*it)->removePlayer(player); @@ -115,10 +115,10 @@ void EntityTracker::removePlayer(shared_ptr e) void EntityTracker::tick() { - vector > movedPlayers; + vector > movedPlayers; for( AUTO_VAR(it, entities.begin()); it != entities.end(); it++ ) { - shared_ptr te = *it; + std::shared_ptr te = *it; te->tick(this, &level->players); if (te->moved && te->e->GetType() == eTYPE_SERVERPLAYER) { @@ -132,7 +132,7 @@ void EntityTracker::tick() MinecraftServer *server = MinecraftServer::getInstance(); for( unsigned int i = 0; i < server->getPlayers()->players.size(); i++ ) { - shared_ptr ep = server->getPlayers()->players[i]; + std::shared_ptr ep = server->getPlayers()->players[i]; if( ep->dimension != level->dimension->id ) continue; if( ep->connection == NULL ) continue; @@ -142,7 +142,7 @@ void EntityTracker::tick() bool addPlayer = false; for (unsigned int j = 0; j < movedPlayers.size(); j++) { - shared_ptr sp = movedPlayers[j]; + std::shared_ptr sp = movedPlayers[j]; if( sp == ep ) break; @@ -153,17 +153,17 @@ void EntityTracker::tick() addPlayer = true; break; } - } + } if( addPlayer ) movedPlayers.push_back( ep ); } for (unsigned int i = 0; i < movedPlayers.size(); i++) { - shared_ptr player = movedPlayers[i]; + std::shared_ptr player = movedPlayers[i]; if(player->connection == NULL) continue; for( AUTO_VAR(it, entities.begin()); it != entities.end(); it++ ) { - shared_ptr te = *it; + std::shared_ptr te = *it; if (te->e != player) { te->updatePlayer(this, player); @@ -174,7 +174,7 @@ void EntityTracker::tick() // 4J Stu - We want to do this for dead players as they don't tick normally for(AUTO_VAR(it, level->players.begin()); it != level->players.end(); ++it) { - shared_ptr player = dynamic_pointer_cast(*it); + std::shared_ptr player = dynamic_pointer_cast(*it); if(!player->isAlive()) { player->flushEntitiesToRemove(); @@ -182,31 +182,31 @@ void EntityTracker::tick() } } -void EntityTracker::broadcast(shared_ptr e, shared_ptr packet) +void EntityTracker::broadcast(std::shared_ptr e, std::shared_ptr packet) { AUTO_VAR(it, entityMap.find( e->entityId )); if( it != entityMap.end() ) { - shared_ptr te = it->second; + std::shared_ptr te = it->second; te->broadcast(packet); } } -void EntityTracker::broadcastAndSend(shared_ptr e, shared_ptr packet) +void EntityTracker::broadcastAndSend(std::shared_ptr e, std::shared_ptr packet) { AUTO_VAR(it, entityMap.find( e->entityId )); if( it != entityMap.end() ) { - shared_ptr te = it->second; + std::shared_ptr te = it->second; te->broadcastAndSend(packet); } } -void EntityTracker::clear(shared_ptr serverPlayer) +void EntityTracker::clear(std::shared_ptr serverPlayer) { for( AUTO_VAR(it, entities.begin()); it != entities.end(); it++ ) { - shared_ptr te = *it; + std::shared_ptr te = *it; te->clear(serverPlayer); } } @@ -218,7 +218,7 @@ void EntityTracker::updateMaxRange() } -shared_ptr EntityTracker::getTracker(shared_ptr e) +std::shared_ptr EntityTracker::getTracker(std::shared_ptr e) { AUTO_VAR(it, entityMap.find(e->entityId)); if( it != entityMap.end() ) diff --git a/Minecraft.Client/EntityTracker.h b/Minecraft.Client/EntityTracker.h index 82b01d07..3fabc4b1 100644 --- a/Minecraft.Client/EntityTracker.h +++ b/Minecraft.Client/EntityTracker.h @@ -13,24 +13,24 @@ class EntityTracker { private: ServerLevel *level; - unordered_set > entities; - unordered_map , IntKeyHash2, IntKeyEq> entityMap; // was IntHashMap + unordered_set > entities; + unordered_map , IntKeyHash2, IntKeyEq> entityMap; // was IntHashMap int maxRange; public: EntityTracker(ServerLevel *level); - void addEntity(shared_ptr e); - void addEntity(shared_ptr e, int range, int updateInterval); - void addEntity(shared_ptr e, int range, int updateInterval, bool trackDeltas); - void removeEntity(shared_ptr e); - void removePlayer(shared_ptr e); // 4J added + void addEntity(std::shared_ptr e); + void addEntity(std::shared_ptr e, int range, int updateInterval); + void addEntity(std::shared_ptr e, int range, int updateInterval, bool trackDeltas); + void removeEntity(std::shared_ptr e); + void removePlayer(std::shared_ptr e); // 4J added void tick(); - void broadcast(shared_ptr e, shared_ptr packet); - void broadcastAndSend(shared_ptr e, shared_ptr packet); - void clear(shared_ptr serverPlayer); + void broadcast(std::shared_ptr e, std::shared_ptr packet); + void broadcastAndSend(std::shared_ptr e, std::shared_ptr packet); + void clear(std::shared_ptr serverPlayer); void updateMaxRange(); // AP added for Vita // 4J-JEV: Added, needed access to tracked entity of a riders mount. - shared_ptr getTracker(shared_ptr entity); + std::shared_ptr getTracker(std::shared_ptr entity); }; diff --git a/Minecraft.Client/ExperienceOrbRenderer.cpp b/Minecraft.Client/ExperienceOrbRenderer.cpp index 1771f833..97d00f79 100644 --- a/Minecraft.Client/ExperienceOrbRenderer.cpp +++ b/Minecraft.Client/ExperienceOrbRenderer.cpp @@ -19,9 +19,9 @@ ExperienceOrbRenderer::ExperienceOrbRenderer() } -void ExperienceOrbRenderer::render(shared_ptr _orb, double x, double y, double z, float rot, float a) +void ExperienceOrbRenderer::render(std::shared_ptr _orb, double x, double y, double z, float rot, float a) { - shared_ptr orb = dynamic_pointer_cast(_orb); + std::shared_ptr orb = dynamic_pointer_cast(_orb); glPushMatrix(); glTranslatef((float) x, (float) y, (float) z); diff --git a/Minecraft.Client/ExperienceOrbRenderer.h b/Minecraft.Client/ExperienceOrbRenderer.h index ebd166f4..5237ecb8 100644 --- a/Minecraft.Client/ExperienceOrbRenderer.h +++ b/Minecraft.Client/ExperienceOrbRenderer.h @@ -12,6 +12,6 @@ public: ExperienceOrbRenderer(); - void render(shared_ptr _orb, double x, double y, double z, float rot, float a); + void render(std::shared_ptr _orb, double x, double y, double z, float rot, float a); void blit(int x, int y, int sx, int sy, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.Client/FallingTileRenderer.cpp b/Minecraft.Client/FallingTileRenderer.cpp index 02e23dad..ad3d9ce3 100644 --- a/Minecraft.Client/FallingTileRenderer.cpp +++ b/Minecraft.Client/FallingTileRenderer.cpp @@ -12,10 +12,10 @@ FallingTileRenderer::FallingTileRenderer() : EntityRenderer() this->shadowRadius = 0.5f; } -void FallingTileRenderer::render(shared_ptr _tile, double x, double y, double z, float rot, float a) +void FallingTileRenderer::render(std::shared_ptr _tile, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr tile = dynamic_pointer_cast(_tile); + std::shared_ptr tile = dynamic_pointer_cast(_tile); glPushMatrix(); glTranslatef((float) x, (float) y, (float) z); diff --git a/Minecraft.Client/FallingTileRenderer.h b/Minecraft.Client/FallingTileRenderer.h index 0ece6033..c3181c96 100644 --- a/Minecraft.Client/FallingTileRenderer.h +++ b/Minecraft.Client/FallingTileRenderer.h @@ -10,5 +10,5 @@ private: public: FallingTileRenderer(); - virtual void render(shared_ptr _tile, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _tile, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/FireballRenderer.cpp b/Minecraft.Client/FireballRenderer.cpp index 836e8be3..c5f379a6 100644 --- a/Minecraft.Client/FireballRenderer.cpp +++ b/Minecraft.Client/FireballRenderer.cpp @@ -12,10 +12,10 @@ FireballRenderer::FireballRenderer(float scale) this->scale = scale; } -void FireballRenderer::render(shared_ptr _fireball, double x, double y, double z, float rot, float a) +void FireballRenderer::render(std::shared_ptr _fireball, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr fireball = dynamic_pointer_cast(_fireball); + std::shared_ptr fireball = dynamic_pointer_cast(_fireball); glPushMatrix(); @@ -54,7 +54,7 @@ void FireballRenderer::render(shared_ptr _fireball, double x, double y, } // 4J Added override. Based on EntityRenderer::renderFlame -void FireballRenderer::renderFlame(shared_ptr e, double x, double y, double z, float a) +void FireballRenderer::renderFlame(std::shared_ptr e, double x, double y, double z, float a) { glDisable(GL_LIGHTING); Icon *tex = Tile::fire->getTextureLayer(0); @@ -78,7 +78,7 @@ void FireballRenderer::renderFlame(shared_ptr e, double x, double y, dou //glRotatef(-entityRenderDispatcher->playerRotY, 0, 1, 0); - + glRotatef(180 - entityRenderDispatcher->playerRotY, 0, 1, 0); glRotatef(-entityRenderDispatcher->playerRotX, 1, 0, 0); glTranslatef(0,0,0.1f); diff --git a/Minecraft.Client/FireballRenderer.h b/Minecraft.Client/FireballRenderer.h index 9b22e74a..201e3aad 100644 --- a/Minecraft.Client/FireballRenderer.h +++ b/Minecraft.Client/FireballRenderer.h @@ -9,9 +9,9 @@ private: public: FireballRenderer(float scale); - virtual void render(shared_ptr _fireball, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _fireball, double x, double y, double z, float rot, float a); private: // 4J Added override - virtual void renderFlame(shared_ptr e, double x, double y, double z, float a); + virtual void renderFlame(std::shared_ptr e, double x, double y, double z, float a); }; diff --git a/Minecraft.Client/FishingHookRenderer.cpp b/Minecraft.Client/FishingHookRenderer.cpp index 0408e96e..a746db18 100644 --- a/Minecraft.Client/FishingHookRenderer.cpp +++ b/Minecraft.Client/FishingHookRenderer.cpp @@ -8,10 +8,10 @@ #include "..\Minecraft.World\Mth.h" #include "MultiPlayerLocalPlayer.h" -void FishingHookRenderer::render(shared_ptr _hook, double x, double y, double z, float rot, float a) +void FishingHookRenderer::render(std::shared_ptr _hook, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr hook = dynamic_pointer_cast(_hook); + std::shared_ptr hook = dynamic_pointer_cast(_hook); glPushMatrix(); diff --git a/Minecraft.Client/FishingHookRenderer.h b/Minecraft.Client/FishingHookRenderer.h index 2683f187..8bcfd252 100644 --- a/Minecraft.Client/FishingHookRenderer.h +++ b/Minecraft.Client/FishingHookRenderer.h @@ -3,6 +3,6 @@ class FishingHookRenderer : public EntityRenderer { -public: - virtual void render(shared_ptr _hook, double x, double y, double z, float rot, float a); +public: + virtual void render(std::shared_ptr _hook, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/FurnaceScreen.cpp b/Minecraft.Client/FurnaceScreen.cpp index 20ec7104..3e6b76e5 100644 --- a/Minecraft.Client/FurnaceScreen.cpp +++ b/Minecraft.Client/FurnaceScreen.cpp @@ -6,7 +6,7 @@ #include "..\Minecraft.World\net.minecraft.world.inventory.h" #include "..\Minecraft.World\FurnaceTileEntity.h" -FurnaceScreen::FurnaceScreen(shared_ptr inventory, shared_ptr furnace) : AbstractContainerScreen(new FurnaceMenu(inventory, furnace)) +FurnaceScreen::FurnaceScreen(std::shared_ptr inventory, std::shared_ptr furnace) : AbstractContainerScreen(new FurnaceMenu(inventory, furnace)) { this->furnace = furnace; } diff --git a/Minecraft.Client/FurnaceScreen.h b/Minecraft.Client/FurnaceScreen.h index f018093f..98c0bba7 100644 --- a/Minecraft.Client/FurnaceScreen.h +++ b/Minecraft.Client/FurnaceScreen.h @@ -7,10 +7,10 @@ class Inventory; class FurnaceScreen : public AbstractContainerScreen { private: - shared_ptr furnace; + std::shared_ptr furnace; public: - FurnaceScreen(shared_ptr inventory, shared_ptr furnace); + FurnaceScreen(std::shared_ptr inventory, std::shared_ptr furnace); protected: virtual void renderLabels(); virtual void renderBg(float a); diff --git a/Minecraft.Client/GameMode.cpp b/Minecraft.Client/GameMode.cpp index a11d6c07..975f81f8 100644 --- a/Minecraft.Client/GameMode.cpp +++ b/Minecraft.Client/GameMode.cpp @@ -46,11 +46,11 @@ void GameMode::render(float a) { } -bool GameMode::useItem(shared_ptr player, Level *level, shared_ptr item, bool bTestUseOnly) +bool GameMode::useItem(std::shared_ptr player, Level *level, std::shared_ptr item, bool bTestUseOnly) { } -void GameMode::initPlayer(shared_ptr player) +void GameMode::initPlayer(std::shared_ptr player) { } @@ -58,11 +58,11 @@ void GameMode::tick() { } -void GameMode::adjustPlayer(shared_ptr player) +void GameMode::adjustPlayer(std::shared_ptr player) { } -//bool GameMode::useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly) +//bool GameMode::useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly) //{ // // 4J-PB - Adding a test only version to allow tooltips to be displayed // int t = level->getTile(x, y, z); @@ -72,9 +72,9 @@ void GameMode::adjustPlayer(shared_ptr player) // { // switch(t) // { -// case Tile::recordPlayer_Id: +// case Tile::recordPlayer_Id: // case Tile::bed_Id: // special case for a bed -// if (Tile::tiles[t]->TestUse(level, x, y, z, player )) +// if (Tile::tiles[t]->TestUse(level, x, y, z, player )) // { // return true; // } @@ -89,38 +89,38 @@ void GameMode::adjustPlayer(shared_ptr player) // break; // } // } -// else +// else // { // if (Tile::tiles[t]->use(level, x, y, z, player )) return true; // } // } -// +// // if (item == NULL) return false; // return item->useOn(player, level, x, y, z, face, bTestUseOnOnly); //} -shared_ptr GameMode::createPlayer(Level *level) +std::shared_ptr GameMode::createPlayer(Level *level) { - return shared_ptr( new LocalPlayer(minecraft, level, minecraft->user, level->dimension->id) ); + return std::shared_ptr( new LocalPlayer(minecraft, level, minecraft->user, level->dimension->id) ); } -bool GameMode::interact(shared_ptr player, shared_ptr entity) +bool GameMode::interact(std::shared_ptr player, std::shared_ptr entity) { return player->interact(entity); } -void GameMode::attack(shared_ptr player, shared_ptr entity) +void GameMode::attack(std::shared_ptr player, std::shared_ptr entity) { player->attack(entity); } -shared_ptr GameMode::handleInventoryMouseClick(int containerId, int slotNum, int buttonNum, bool quickKeyHeld, shared_ptr player) +std::shared_ptr GameMode::handleInventoryMouseClick(int containerId, int slotNum, int buttonNum, bool quickKeyHeld, std::shared_ptr player) { return nullptr; } -void GameMode::handleCloseInventory(int containerId, shared_ptr player) +void GameMode::handleCloseInventory(int containerId, std::shared_ptr player) { player->containerMenu->removed(player); delete player->containerMenu; @@ -137,7 +137,7 @@ bool GameMode::isCutScene() return false; } -void GameMode::releaseUsingItem(shared_ptr player) +void GameMode::releaseUsingItem(std::shared_ptr player) { player->releaseUsingItem(); } @@ -162,21 +162,21 @@ bool GameMode::hasFarPickRange() return false; } -void GameMode::handleCreativeModeItemAdd(shared_ptr clicked, int i) +void GameMode::handleCreativeModeItemAdd(std::shared_ptr clicked, int i) { } -void GameMode::handleCreativeModeItemDrop(shared_ptr clicked) +void GameMode::handleCreativeModeItemDrop(std::shared_ptr clicked) { } -bool GameMode::handleCraftItem(int recipe, shared_ptr player) +bool GameMode::handleCraftItem(int recipe, std::shared_ptr player) { return true; } // 4J-PB -void GameMode::handleDebugOptions(unsigned int uiVal, shared_ptr player) +void GameMode::handleDebugOptions(unsigned int uiVal, std::shared_ptr player) { player->SetDebugOptions(uiVal); } diff --git a/Minecraft.Client/GameMode.h b/Minecraft.Client/GameMode.h index ab9ec9d1..71559708 100644 --- a/Minecraft.Client/GameMode.h +++ b/Minecraft.Client/GameMode.h @@ -25,32 +25,32 @@ public: virtual void stopDestroyBlock() = 0; virtual void render(float a); virtual float getPickRange() = 0; - virtual void initPlayer(shared_ptr player); + virtual void initPlayer(std::shared_ptr player); virtual void tick(); virtual bool canHurtPlayer() = 0; - virtual void adjustPlayer(shared_ptr player); - virtual bool useItem(shared_ptr player, Level *level, shared_ptr item, bool bTestUseOnly=false); - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem = NULL) = 0; + virtual void adjustPlayer(std::shared_ptr player); + virtual bool useItem(std::shared_ptr player, Level *level, std::shared_ptr item, bool bTestUseOnly=false); + virtual bool useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem = NULL) = 0; - virtual shared_ptr createPlayer(Level *level); - virtual bool interact(shared_ptr player, shared_ptr entity); - virtual void attack(shared_ptr player, shared_ptr entity); - virtual shared_ptr handleInventoryMouseClick(int containerId, int slotNum, int buttonNum, bool quickKeyHeld, shared_ptr player); - virtual void handleCloseInventory(int containerId, shared_ptr player); + virtual std::shared_ptr createPlayer(Level *level); + virtual bool interact(std::shared_ptr player, std::shared_ptr entity); + virtual void attack(std::shared_ptr player, std::shared_ptr entity); + virtual std::shared_ptr handleInventoryMouseClick(int containerId, int slotNum, int buttonNum, bool quickKeyHeld, std::shared_ptr player); + virtual void handleCloseInventory(int containerId, std::shared_ptr player); virtual void handleInventoryButtonClick(int containerId, int buttonId); virtual bool isCutScene(); - virtual void releaseUsingItem(shared_ptr player); + virtual void releaseUsingItem(std::shared_ptr player); virtual bool hasExperience(); virtual bool hasMissTime(); virtual bool hasInfiniteItems(); virtual bool hasFarPickRange(); - virtual void handleCreativeModeItemAdd(shared_ptr clicked, int i); - virtual void handleCreativeModeItemDrop(shared_ptr clicked); + virtual void handleCreativeModeItemAdd(std::shared_ptr clicked, int i); + virtual void handleCreativeModeItemDrop(std::shared_ptr clicked); // 4J Stu - Added so we can send packets for this in the network game - virtual bool handleCraftItem(int recipe, shared_ptr player); - virtual void handleDebugOptions(unsigned int uiVal, shared_ptr player); + virtual bool handleCraftItem(int recipe, std::shared_ptr player); + virtual void handleDebugOptions(unsigned int uiVal, std::shared_ptr player); // 4J Stu - Added for tutorial checks virtual bool isInputAllowed(int mapping) { return true; } diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 716d3307..1cc1044f 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -352,13 +352,13 @@ void GameRenderer::pick(float a) Vec3 *to = from->add(b->x * range, b->y * range, b->z * range); hovered = nullptr; float overlap = 1; - vector > *objects = mc->level->getEntities(mc->cameraTargetPlayer, mc->cameraTargetPlayer->bb->expand(b->x * (range), b->y * (range), b->z * (range))->grow(overlap, overlap, overlap)); + vector > *objects = mc->level->getEntities(mc->cameraTargetPlayer, mc->cameraTargetPlayer->bb->expand(b->x * (range), b->y * (range), b->z * (range))->grow(overlap, overlap, overlap)); double nearest = dist; AUTO_VAR(itEnd, objects->end()); for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) { - shared_ptr e = *it; //objects->at(i); + std::shared_ptr e = *it; //objects->at(i); if (!e->isPickable()) continue; float rr = e->getPickRadius(); @@ -407,7 +407,7 @@ float GameRenderer::GetFovVal() void GameRenderer::tickFov() { - shared_ptrplayer = dynamic_pointer_cast(mc->cameraTargetPlayer); + std::shared_ptrplayer = dynamic_pointer_cast(mc->cameraTargetPlayer); int playerIdx = player ? player->GetXboxPad() : 0; tFov[playerIdx] = player->getFieldOfViewModifier(); @@ -420,7 +420,7 @@ float GameRenderer::getFov(float a, bool applyEffects) { if (cameraFlip > 0 ) return 90; - shared_ptr player = dynamic_pointer_cast(mc->cameraTargetPlayer); + std::shared_ptr player = dynamic_pointer_cast(mc->cameraTargetPlayer); int playerIdx = player ? player->GetXboxPad() : 0; float fov = m_fov;//70; if (applyEffects) @@ -444,7 +444,7 @@ float GameRenderer::getFov(float a, bool applyEffects) void GameRenderer::bobHurt(float a) { - shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr player = mc->cameraTargetPlayer; float hurt = player->hurtTime - a; @@ -470,12 +470,12 @@ void GameRenderer::bobHurt(float a) void GameRenderer::bobView(float a) { - shared_ptr player = dynamic_pointer_cast(mc->cameraTargetPlayer); + std::shared_ptr player = dynamic_pointer_cast(mc->cameraTargetPlayer); if(player==NULL) { return; } - //shared_ptr player = dynamic_pointer_cast(mc->cameraTargetPlayer); + //std::shared_ptr player = dynamic_pointer_cast(mc->cameraTargetPlayer); float wda = player->walkDist - player->walkDistO; float b = -(player->walkDist + wda * a); @@ -489,8 +489,8 @@ void GameRenderer::bobView(float a) void GameRenderer::moveCameraToPlayer(float a) { - shared_ptr player = mc->cameraTargetPlayer; - shared_ptr localplayer = dynamic_pointer_cast(mc->cameraTargetPlayer); + std::shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr localplayer = dynamic_pointer_cast(mc->cameraTargetPlayer); float heightOffset = player->heightOffset - 1.62f; double x = player->xo + (player->x - player->xo) * a; @@ -719,12 +719,12 @@ void GameRenderer::renderItemInHand(float a, int eye) { if (cameraFlip > 0) return; - shared_ptr localplayer = dynamic_pointer_cast(mc->cameraTargetPlayer); + std::shared_ptr localplayer = dynamic_pointer_cast(mc->cameraTargetPlayer); // 4J-PB - to turn off the hand for screenshots, but not when the item held is a map if ( localplayer!=NULL) { - shared_ptr item = localplayer->inventory->getSelected(); + std::shared_ptr item = localplayer->inventory->getSelected(); if(!(item && item->getItem()->id==Item::map_Id) && app.GetGameSettings(localplayer->GetXboxPad(),eGameSetting_DisplayHand)==0 ) return; } @@ -864,7 +864,7 @@ void GameRenderer::updateLightTexture(float a) for(int j = 0; j < XUSER_MAX_COUNT; j++ ) { // Loop over all the players - shared_ptr player = Minecraft::GetInstance()->localplayers[j]; + std::shared_ptr player = Minecraft::GetInstance()->localplayers[j]; if (player == NULL) continue; Level *level = player->level; // 4J - was mc->level when it was just to update the one light texture @@ -969,7 +969,7 @@ void GameRenderer::updateLightTexture(float a) } } -float GameRenderer::getNightVisionScale(shared_ptr player, float a) +float GameRenderer::getNightVisionScale(std::shared_ptr player, float a) { int duration = player->getEffect(MobEffect::nightVision)->getDuration(); if (duration > (SharedConstants::TICKS_PER_SECOND * 10)) @@ -1269,7 +1269,7 @@ void GameRenderer::renderLevel(float a, int64_t until) } pick(a); - shared_ptr cameraEntity = mc->cameraTargetPlayer; + std::shared_ptr cameraEntity = mc->cameraTargetPlayer; LevelRenderer *levelRenderer = mc->levelRenderer; ParticleEngine *particleEngine = mc->particleEngine; double xOff = cameraEntity->xOld + (cameraEntity->x - cameraEntity->xOld) * a; @@ -1383,10 +1383,10 @@ void GameRenderer::renderLevel(float a, int64_t until) PIXEndNamedEvent(); turnOffLightLayer(a); // 4J - brought forward from 1.8.2 - shared_ptr player = dynamic_pointer_cast(cameraEntity); + std::shared_ptr player = dynamic_pointer_cast(cameraEntity); if (mc->hitResult != NULL && cameraEntity->isUnderLiquid(Material::water) && player!=NULL) //&& !mc->options.hideGui) { - //shared_ptr player = dynamic_pointer_cast(cameraEntity); + //std::shared_ptr player = dynamic_pointer_cast(cameraEntity); glDisable(GL_ALPHA_TEST); levelRenderer->renderHit(player, mc->hitResult, 0, player->inventory->getSelected(), a); levelRenderer->renderHitOutline(player, mc->hitResult, 0, player->inventory->getSelected(), a); @@ -1445,7 +1445,7 @@ void GameRenderer::renderLevel(float a, int64_t until) { if (mc->hitResult != NULL && !cameraEntity->isUnderLiquid(Material::water)) { - shared_ptr player = dynamic_pointer_cast(cameraEntity); + std::shared_ptr player = dynamic_pointer_cast(cameraEntity); glDisable(GL_ALPHA_TEST); levelRenderer->renderHit(player, mc->hitResult, 0, player->inventory->getSelected(), a); levelRenderer->renderHitOutline(player, mc->hitResult, 0, player->inventory->getSelected(), a); @@ -1512,7 +1512,7 @@ void GameRenderer::tickRain() rainLevel /= ( mc->levelRenderer->activePlayers() + 1 ); random->setSeed(_tick * 312987231l); - shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr player = mc->cameraTargetPlayer; Level *level = mc->level; int x0 = Mth::floor(player->x); @@ -1549,7 +1549,7 @@ void GameRenderer::tickRain() { if (Tile::tiles[t]->material == Material::lava) { - mc->particleEngine->add( shared_ptr( new SmokeParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za, 0, 0, 0) ) ); + mc->particleEngine->add( std::shared_ptr( new SmokeParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za, 0, 0, 0) ) ); } else { @@ -1559,7 +1559,7 @@ void GameRenderer::tickRain() rainPosY = y + 0.1f - Tile::tiles[t]->getShapeY0(); rainPosZ = z + za; } - mc->particleEngine->add( shared_ptr( new WaterDropParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za) ) ); + mc->particleEngine->add( std::shared_ptr( new WaterDropParticle(level, x + xa, y + 0.1f - Tile::tiles[t]->getShapeY0(), z + za) ) ); } } } @@ -1612,7 +1612,7 @@ void GameRenderer::renderSnowAndRain(float a) } } - shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr player = mc->cameraTargetPlayer; Level *level = mc->level; int x0 = Mth::floor(player->x); @@ -1796,7 +1796,7 @@ void GameRenderer::setupGuiScreen(int forceScale /*=-1*/) void GameRenderer::setupClearColor(float a) { Level *level = mc->level; - shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr player = mc->cameraTargetPlayer; float whiteness = 1.0f / (4 - mc->options->viewDistance); whiteness = 1 - (float) pow((double)whiteness, 0.25); @@ -1953,7 +1953,7 @@ void GameRenderer::setupClearColor(float a) void GameRenderer::setupFog(int i, float alpha) { - shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr player = mc->cameraTargetPlayer; // 4J - check for creative mode brought forward from 1.2.3 bool creative = false; diff --git a/Minecraft.Client/GameRenderer.h b/Minecraft.Client/GameRenderer.h index fca091a1..6be8d03e 100644 --- a/Minecraft.Client/GameRenderer.h +++ b/Minecraft.Client/GameRenderer.h @@ -25,7 +25,7 @@ public: ItemInHandRenderer *itemInHandRenderer; private: int _tick; - shared_ptr hovered; + std::shared_ptr hovered; // smooth camera movement SmoothFloat smoothTurnX; @@ -108,7 +108,7 @@ public: private: void tickLightTexture(); void updateLightTexture(float a); - float getNightVisionScale(shared_ptr player, float a); + float getNightVisionScale(std::shared_ptr player, float a); public: void render(float a, bool bFirst); // 4J added bFirst void renderLevel(float a); diff --git a/Minecraft.Client/GhastModel.cpp b/Minecraft.Client/GhastModel.cpp index 460c28ff..bc41c774 100644 --- a/Minecraft.Client/GhastModel.cpp +++ b/Minecraft.Client/GhastModel.cpp @@ -42,7 +42,7 @@ void GhastModel::setupAnim(float time, float r, float bob, float yRot, float xRo } } -void GhastModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void GhastModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); diff --git a/Minecraft.Client/GhastModel.h b/Minecraft.Client/GhastModel.h index 22e9023c..59ce7b7d 100644 --- a/Minecraft.Client/GhastModel.h +++ b/Minecraft.Client/GhastModel.h @@ -10,5 +10,5 @@ public: GhastModel(); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); }; \ No newline at end of file diff --git a/Minecraft.Client/GhastRenderer.cpp b/Minecraft.Client/GhastRenderer.cpp index 1d8a2833..59dd361e 100644 --- a/Minecraft.Client/GhastRenderer.cpp +++ b/Minecraft.Client/GhastRenderer.cpp @@ -7,10 +7,10 @@ GhastRenderer::GhastRenderer() : MobRenderer(new GhastModel(), 0.5f) { } -void GhastRenderer::scale(shared_ptr mob, float a) +void GhastRenderer::scale(std::shared_ptr mob, float a) { - shared_ptr ghast = dynamic_pointer_cast(mob); - + std::shared_ptr ghast = dynamic_pointer_cast(mob); + float ss = (ghast->oCharge+(ghast->charge-ghast->oCharge)*a)/20.0f; if (ss<0) ss = 0; ss = 1/(ss*ss*ss*ss*ss*2+1); diff --git a/Minecraft.Client/GhastRenderer.h b/Minecraft.Client/GhastRenderer.h index 6778b9a5..1bd3131f 100644 --- a/Minecraft.Client/GhastRenderer.h +++ b/Minecraft.Client/GhastRenderer.h @@ -7,5 +7,5 @@ public: GhastRenderer(); protected: - virtual void scale(shared_ptr mob, float a); + virtual void scale(std::shared_ptr mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/GiantMobRenderer.cpp b/Minecraft.Client/GiantMobRenderer.cpp index 6dabf7cb..7df83317 100644 --- a/Minecraft.Client/GiantMobRenderer.cpp +++ b/Minecraft.Client/GiantMobRenderer.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" -#include "GiantMobRenderer.h" +#include "GiantMobRenderer.h" GiantMobRenderer::GiantMobRenderer(Model *model, float shadow, float _scale) : MobRenderer(model, shadow *_scale) { this->_scale = _scale; } -void GiantMobRenderer::scale(shared_ptr mob, float a) +void GiantMobRenderer::scale(std::shared_ptr mob, float a) { glScalef(_scale, _scale, _scale); } \ No newline at end of file diff --git a/Minecraft.Client/GiantMobRenderer.h b/Minecraft.Client/GiantMobRenderer.h index 5b1cce1d..c4070863 100644 --- a/Minecraft.Client/GiantMobRenderer.h +++ b/Minecraft.Client/GiantMobRenderer.h @@ -10,5 +10,5 @@ public: GiantMobRenderer(Model *model, float shadow, float scale); protected: - virtual void scale(shared_ptr mob, float a); + virtual void scale(std::shared_ptr mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index ffdf5055..ff1f407d 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -225,7 +225,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) // Display the pumpkin screen effect ///////////////////////////////////////////////////////////////////////////////////// - shared_ptr headGear = minecraft->player->inventory->getArmor(3); + std::shared_ptr headGear = minecraft->player->inventory->getArmor(3); // 4J-PB - changing this to be per player //if (!minecraft->options->thirdPersonView && headGear != NULL && headGear->id == Tile::pumpkin_Id) renderPumpkin(screenWidth, screenHeight); @@ -302,7 +302,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) minecraft->textures->bindTexture(TN_GUI_GUI); // 4J was L"/gui/gui.png" MemSect(0); - shared_ptr inventory = minecraft->player->inventory; + std::shared_ptr inventory = minecraft->player->inventory; if(bTwoPlayerSplitscreen) { // need to apply scale factors depending on the mode @@ -1027,7 +1027,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) // { // if (EnderDragonRenderer::bossInstance == NULL) return; // -// shared_ptr boss = EnderDragonRenderer::bossInstance; +// std::shared_ptr boss = EnderDragonRenderer::bossInstance; // EnderDragonRenderer::bossInstance = NULL; // // Minecraft *pMinecraft=Minecraft::GetInstance(); @@ -1148,7 +1148,7 @@ void Gui::renderTp(float br, int w, int h) void Gui::renderSlot(int slot, int x, int y, float a) { - shared_ptr item = minecraft->player->inventory->items[slot]; + std::shared_ptr item = minecraft->player->inventory->items[slot]; if (item == NULL) return; float pop = item->popTime - a; diff --git a/Minecraft.Client/HumanoidMobRenderer.cpp b/Minecraft.Client/HumanoidMobRenderer.cpp index 389116ed..af2dc0a2 100644 --- a/Minecraft.Client/HumanoidMobRenderer.cpp +++ b/Minecraft.Client/HumanoidMobRenderer.cpp @@ -36,12 +36,12 @@ void HumanoidMobRenderer::createArmorParts() armorParts2 = new HumanoidModel(0.5f); } -void HumanoidMobRenderer::additionalRendering(shared_ptr mob, float a) +void HumanoidMobRenderer::additionalRendering(std::shared_ptr mob, float a) { float brightness = SharedConstants::TEXTURE_LIGHTING ? 1 : mob->getBrightness(a); glColor3f(brightness, brightness, brightness); - shared_ptr item = mob->getCarriedItem(); - shared_ptr headGear = mob->getArmor(3); + std::shared_ptr item = mob->getCarriedItem(); + std::shared_ptr headGear = mob->getArmor(3); if (headGear != NULL) { @@ -49,7 +49,7 @@ void HumanoidMobRenderer::additionalRendering(shared_ptr mob, float a) // 4J-PB - need to disable rendering armour/skulls/pumpkins for some special skins (Daleks) if((mob->getAnimOverrideBitmask()&(1<head->translateTo(1 / 16.0f); @@ -138,13 +138,13 @@ void HumanoidMobRenderer::additionalRendering(shared_ptr mob, float a) { this->entityRenderDispatcher->itemInHandRenderer->renderItem(mob, item, 1); } - + glPopMatrix(); } } -void HumanoidMobRenderer::scale(shared_ptr mob, float a) +void HumanoidMobRenderer::scale(std::shared_ptr mob, float a) { glScalef(_scale, _scale, _scale); } \ No newline at end of file diff --git a/Minecraft.Client/HumanoidMobRenderer.h b/Minecraft.Client/HumanoidMobRenderer.h index 6c718fb9..6654f765 100644 --- a/Minecraft.Client/HumanoidMobRenderer.h +++ b/Minecraft.Client/HumanoidMobRenderer.h @@ -7,7 +7,7 @@ class HumanoidMobRenderer : public MobRenderer { protected: HumanoidModel *humanoidModel; - float _scale; + float _scale; HumanoidModel *armorParts1; HumanoidModel *armorParts2; @@ -17,6 +17,6 @@ public: HumanoidMobRenderer(HumanoidModel *humanoidModel, float shadow, float scale); protected: virtual void createArmorParts(); - virtual void additionalRendering(shared_ptr mob, float a); - void scale(shared_ptr mob, float a); + virtual void additionalRendering(std::shared_ptr mob, float a); + void scale(std::shared_ptr mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/HumanoidModel.cpp b/Minecraft.Client/HumanoidModel.cpp index 444d9c90..5a9c465a 100644 --- a/Minecraft.Client/HumanoidModel.cpp +++ b/Minecraft.Client/HumanoidModel.cpp @@ -4,7 +4,7 @@ #include "..\Minecraft.World\Entity.h" #include "ModelPart.h" -// 4J added +// 4J added ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox) { @@ -49,9 +49,9 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox) pNewBox = new ModelPart(this, (int)pBox->fU, (int)pBox->fV); pNewBox->visible=false; - pNewBox->addHumanoidBox(pBox->fX, pBox->fY, pBox->fZ, pBox->fW, pBox->fH, pBox->fD, 0); + pNewBox->addHumanoidBox(pBox->fX, pBox->fY, pBox->fZ, pBox->fW, pBox->fH, pBox->fD, 0); // 4J-PB - don't compile here, since the lighting isn't set up. It'll be compiled on first use. - //pNewBox->compile(1.0f/16.0f); + //pNewBox->compile(1.0f/16.0f); pAttachTo->addChild(pNewBox); } @@ -69,7 +69,7 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight) ear = new ModelPart(this, 24, 0); ear->addHumanoidBox(-3, -6, -1, 6, 6, 1, g); // Ear - + head = new ModelPart(this, 0, 0); head->addHumanoidBox(-4, -8, -4, 8, 8, 8, g); // Head head->setPos(0, 0 + yOffset, 0); @@ -140,8 +140,8 @@ HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight _init(g,yOffset,texWidth,texHeight); } -void HumanoidModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) -{ +void HumanoidModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +{ if(entity!=NULL) { m_uiAnimOverrideBitmask=entity->getAnimOverrideBitmask(); @@ -183,7 +183,7 @@ void HumanoidModel::render(shared_ptr entity, float time, float r, float void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim) { //bool bIsAttacking = (attackTime > -9990.0f); - + { head->yRot = yRot / (float) (180.0f / PI); head->xRot = xRot / (float) (180.0f / PI); @@ -253,7 +253,7 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float leg1->xRot = -HALF_PI; leg0->yRot = HALF_PI * 0.2f; leg1->yRot = -HALF_PI * 0.2f; - } + } else if(uiBitmaskOverrideAnim&(1<xRot=0.0f; @@ -261,7 +261,7 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float leg1->xRot=0.0f; leg1->zRot=0.0f; leg0->yRot = 0.0f; - leg1->yRot = 0.0f; + leg1->yRot = 0.0f; } else if(uiBitmaskOverrideAnim&(1<xRot = arm1->xRot * 0.5f - HALF_PI * 0.2f * holdingLeftHand; } - if (holdingRightHand != 0) + if (holdingRightHand != 0) { arm0->xRot = arm0->xRot * 0.5f - HALF_PI * 0.2f * holdingRightHand; } @@ -305,7 +305,7 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float float aa = Mth::sin(swing * PI); float bb = Mth::sin(attackTime * PI) * -(head->xRot - 0.7f) * 0.75f; arm0->xRot -= aa * 1.2f + bb; // 4J - changed 1.2 -> 1.2f - arm0->yRot += body->yRot * 2.0f; + arm0->yRot += body->yRot * 2.0f; if((uiBitmaskOverrideAnim&(1<xRot += ((Mth::sin(bob * 0.067f)) * 0.05f); arm1->xRot -= ((Mth::sin(bob * 0.067f)) * 0.05f); - if (bowAndArrow) + if (bowAndArrow) { float attack2 = 0.0f; float attack = 0.0f; @@ -441,15 +441,15 @@ void HumanoidModel::render(HumanoidModel *model, float scale, bool usecompiled) hair->xRot = head->xRot; body->yRot = model->body->yRot; - + arm0->xRot = model->arm0->xRot; arm0->yRot = model->arm0->yRot; arm0->zRot = model->arm0->zRot; - + arm1->xRot = model->arm1->xRot; arm1->yRot = model->arm1->yRot; arm1->zRot = model->arm1->zRot; - + leg0->xRot = model->leg0->xRot; leg1->xRot = model->leg1->xRot; diff --git a/Minecraft.Client/HumanoidModel.h b/Minecraft.Client/HumanoidModel.h index 0ca10f4b..e0ebca55 100644 --- a/Minecraft.Client/HumanoidModel.h +++ b/Minecraft.Client/HumanoidModel.h @@ -5,7 +5,7 @@ class HumanoidModel : public Model { public: ModelPart *head, *hair, *body, *arm0, *arm1, *leg0, *leg1, *ear, *cloak; - //ModelPart *hat; + //ModelPart *hat; int holdingLeftHand; int holdingRightHand; @@ -53,11 +53,11 @@ public: HumanoidModel(); HumanoidModel(float g); HumanoidModel(float g, float yOffset, int texWidth, int texHeight); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); void renderHair(float scale, bool usecompiled); void renderEars(float scale, bool usecompiled); - void renderCloak(float scale, bool usecompiled); + void renderCloak(float scale, bool usecompiled); void render(HumanoidModel *model, float scale, bool usecompiled); // Add new bits to models diff --git a/Minecraft.Client/InventoryScreen.cpp b/Minecraft.Client/InventoryScreen.cpp index 726a5e8d..61f06bae 100644 --- a/Minecraft.Client/InventoryScreen.cpp +++ b/Minecraft.Client/InventoryScreen.cpp @@ -10,7 +10,7 @@ #include "StatsScreen.h" #include "..\Minecraft.World\net.minecraft.stats.h" -InventoryScreen::InventoryScreen(shared_ptr player) : AbstractContainerScreen(player->inventoryMenu) +InventoryScreen::InventoryScreen(std::shared_ptr player) : AbstractContainerScreen(player->inventoryMenu) { xMouse = yMouse = 0.0f; // 4J added diff --git a/Minecraft.Client/InventoryScreen.h b/Minecraft.Client/InventoryScreen.h index c39edfe0..4f62ce35 100644 --- a/Minecraft.Client/InventoryScreen.h +++ b/Minecraft.Client/InventoryScreen.h @@ -6,7 +6,7 @@ class Button; class InventoryScreen : public AbstractContainerScreen { public: - InventoryScreen(shared_ptr player); + InventoryScreen(std::shared_ptr player); virtual void init(); protected: virtual void renderLabels(); diff --git a/Minecraft.Client/ItemFrameRenderer.cpp b/Minecraft.Client/ItemFrameRenderer.cpp index 40769fb9..06f8992e 100644 --- a/Minecraft.Client/ItemFrameRenderer.cpp +++ b/Minecraft.Client/ItemFrameRenderer.cpp @@ -23,11 +23,11 @@ void ItemFrameRenderer::registerTerrainTextures(IconRegister *iconRegister) backTexture = iconRegister->registerIcon(L"itemframe_back"); } -void ItemFrameRenderer::render(shared_ptr _itemframe, double x, double y, double z, float rot, float a) +void ItemFrameRenderer::render(std::shared_ptr _itemframe, double x, double y, double z, float rot, float a) { - // 4J - original version used generics and thus had an input parameter of type EnderCrystal rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type EnderCrystal rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr itemFrame = dynamic_pointer_cast(_itemframe); + std::shared_ptr itemFrame = dynamic_pointer_cast(_itemframe); glPushMatrix(); float xOffs = (float) (itemFrame->x - x) - 0.5f; @@ -47,7 +47,7 @@ void ItemFrameRenderer::render(shared_ptr _itemframe, double x, double } -void ItemFrameRenderer::drawFrame(shared_ptr itemFrame) +void ItemFrameRenderer::drawFrame(std::shared_ptr itemFrame) { Minecraft *pMinecraft=Minecraft::GetInstance(); @@ -102,14 +102,14 @@ void ItemFrameRenderer::drawFrame(shared_ptr itemFrame) glPopMatrix(); } -void ItemFrameRenderer::drawItem(shared_ptr entity) +void ItemFrameRenderer::drawItem(std::shared_ptr entity) { Minecraft *pMinecraft=Minecraft::GetInstance(); - shared_ptr instance = entity->getItem(); + std::shared_ptr instance = entity->getItem(); if (instance == NULL) return; - shared_ptr itemEntity = shared_ptr(new ItemEntity(entity->level, 0, 0, 0, instance)); + std::shared_ptr itemEntity = std::shared_ptr(new ItemEntity(entity->level, 0, 0, 0, instance)); itemEntity->getItem()->count = 1; itemEntity->bobOffs = 0; @@ -119,7 +119,7 @@ void ItemFrameRenderer::drawItem(shared_ptr entity) glRotatef(180 + entity->yRot, 0, 1, 0); glRotatef(-90 * entity->getRotation(), 0, 0, 1); - switch (entity->getRotation()) + switch (entity->getRotation()) { case 1: glTranslatef(-0.16f, -0.16f, 0); @@ -132,7 +132,7 @@ void ItemFrameRenderer::drawItem(shared_ptr entity) break; } - if (itemEntity->getItem()->getItem() == Item::map) + if (itemEntity->getItem()->getItem() == Item::map) { entityRenderDispatcher->textures->bindTexture(TN_MISC_MAPBG); Tesselator *t = Tesselator::getInstance(); @@ -150,13 +150,13 @@ void ItemFrameRenderer::drawItem(shared_ptr entity) t->vertexUV(0 - vo, 0 - vo, 0, 0, 0); t->end(); - shared_ptr data = Item::map->getSavedData(itemEntity->getItem(), entity->level); - if (data != NULL) + std::shared_ptr data = Item::map->getSavedData(itemEntity->getItem(), entity->level); + if (data != NULL) { entityRenderDispatcher->itemInHandRenderer->minimap->render(nullptr, entityRenderDispatcher->textures, data, entity->entityId); } - } - else + } + else { if (itemEntity->getItem()->getItem() == Item::compass) { @@ -178,7 +178,7 @@ void ItemFrameRenderer::drawItem(shared_ptr entity) ct->cycleFrames(); } } - + glPopMatrix(); } diff --git a/Minecraft.Client/ItemFrameRenderer.h b/Minecraft.Client/ItemFrameRenderer.h index 47f2fe90..b63ebf83 100644 --- a/Minecraft.Client/ItemFrameRenderer.h +++ b/Minecraft.Client/ItemFrameRenderer.h @@ -9,9 +9,9 @@ private: //@Override public: void registerTerrainTextures(IconRegister *iconRegister); - virtual void render(shared_ptr _itemframe, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _itemframe, double x, double y, double z, float rot, float a); private: - void drawFrame(shared_ptr itemFrame); - void drawItem(shared_ptr entity); + void drawFrame(std::shared_ptr itemFrame); + void drawItem(std::shared_ptr entity); }; diff --git a/Minecraft.Client/ItemInHandRenderer.cpp b/Minecraft.Client/ItemInHandRenderer.cpp index cee9254d..14c28f02 100644 --- a/Minecraft.Client/ItemInHandRenderer.cpp +++ b/Minecraft.Client/ItemInHandRenderer.cpp @@ -87,7 +87,7 @@ ItemInHandRenderer::ItemInHandRenderer(Minecraft *mc, bool optimisedMinimap) t->vertexUV(x0, y1, z1, u, v); t->vertexUV(x0, y1, z0, u, v); t->vertexUV(x1, y1, z0, u, v); - } + } t->end(); glEndList(); } @@ -150,7 +150,7 @@ ItemInHandRenderer::ItemInHandRenderer(Minecraft *mc, bool optimisedMinimap) t->vertexUV(x0, y1, z1, u0, v1); t->vertexUV(x0, y1, z0, u0, v1); t->vertexUV(x1, y1, z0, u1, v1); - } + } t->end(); glDepthFunc(GL_LEQUAL); glEndList(); @@ -158,7 +158,7 @@ ItemInHandRenderer::ItemInHandRenderer(Minecraft *mc, bool optimisedMinimap) } -void ItemInHandRenderer::renderItem(shared_ptr mob, shared_ptr item, int layer, bool setColor/* = true*/) +void ItemInHandRenderer::renderItem(std::shared_ptr mob, std::shared_ptr item, int layer, bool setColor/* = true*/) { // 4J - code borrowed from render method below, although not factoring in brightness as that should already be being taken into account // by texture lighting. This is for colourising things held in 3rd person view. @@ -203,7 +203,7 @@ void ItemInHandRenderer::renderItem(shared_ptr mob, shared_ptrgetWidth(); int LOD = -1; // Default to not doing anything special with LOD forcing if( iconWidth == 32 ) @@ -312,14 +312,14 @@ void ItemInHandRenderer::renderItem3D(Tesselator *t, float u0, float v0, float u void ItemInHandRenderer::render(float a) { float h = oHeight + (height - oHeight) * a; - shared_ptr player = mc->player; + std::shared_ptr player = mc->player; // 4J - added so we can adjust the position of the hands for horizontal & vertical split screens float fudgeX = 0.0f; float fudgeY = 0.0f; float fudgeZ = 0.0f; bool splitHoriz = false; - shared_ptr localPlayer = dynamic_pointer_cast(player); + std::shared_ptr localPlayer = dynamic_pointer_cast(player); if( localPlayer ) { if( localPlayer->m_iScreenSection == C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM || @@ -353,7 +353,7 @@ void ItemInHandRenderer::render(float a) glRotatef((yr - yrr) * 0.1f, 0, 1, 0); } - shared_ptr item = selectedItem; + std::shared_ptr item = selectedItem; float br = mc->level->getBrightness(Mth::floor(player->x), Mth::floor(player->y), Mth::floor(player->z)); // 4J - change brought forward from 1.8.2 @@ -433,7 +433,7 @@ void ItemInHandRenderer::render(float a) glScalef(ss, ss, ss); // Can't turn off the hand if the player is holding a map - shared_ptr itemInstance = player->inventory->getSelected(); + std::shared_ptr itemInstance = player->inventory->getSelected(); if ((itemInstance && (itemInstance->getItem()->id==Item::map_Id)) || app.GetGameSettings(localPlayer->GetXboxPad(),eGameSetting_DisplayHand)!=0 ) { playerRenderer->renderHand(); @@ -477,7 +477,7 @@ void ItemInHandRenderer::render(float a) t->vertexUV((float)(0 - vo), (float)( 0 - vo), (float)( 0), (float)( 0), (float)( 0)); t->end(); - shared_ptr data = Item::map->getSavedData(item, mc->level); + std::shared_ptr data = Item::map->getSavedData(item, mc->level); PIXBeginNamedEvent(0,"Minimap render"); if(data != NULL) minimap->render(mc->player, mc->textures, data, mc->player->entityId); PIXEndNamedEvent(); @@ -652,7 +652,7 @@ void ItemInHandRenderer::render(float a) glScalef(ss, ss, ss); MemSect(31); // Can't turn off the hand if the player is holding a map - shared_ptr itemInstance = player->inventory->getSelected(); + std::shared_ptr itemInstance = player->inventory->getSelected(); if ( (itemInstance && (itemInstance->getItem()->id==Item::map_Id)) || app.GetGameSettings(localPlayer->GetXboxPad(),eGameSetting_DisplayHand)!=0 ) { @@ -837,8 +837,8 @@ void ItemInHandRenderer::tick() oHeight = height; - shared_ptr player = mc->player; - shared_ptr nextTile = player->inventory->getSelected(); + std::shared_ptr player = mc->player; + std::shared_ptr nextTile = player->inventory->getSelected(); bool matches = lastSlot == player->inventory->selected && nextTile == selectedItem; if (selectedItem == NULL && nextTile == NULL) diff --git a/Minecraft.Client/ItemInHandRenderer.h b/Minecraft.Client/ItemInHandRenderer.h index dee51a7f..975dd360 100644 --- a/Minecraft.Client/ItemInHandRenderer.h +++ b/Minecraft.Client/ItemInHandRenderer.h @@ -11,7 +11,7 @@ class ItemInHandRenderer { private: Minecraft *mc; - shared_ptr selectedItem; + std::shared_ptr selectedItem; float height; float oHeight; TileRenderer *tileRenderer; @@ -23,7 +23,7 @@ public: public: ItemInHandRenderer(Minecraft *mc, bool optimisedMinimap = true); // 4J Added optimisedMinimap param - void renderItem(shared_ptr mob, shared_ptr item, int layer, bool setColor = true); // 4J added setColor parameter + void renderItem(std::shared_ptr mob, std::shared_ptr item, int layer, bool setColor = true); // 4J added setColor parameter static void renderItem3D(Tesselator *t, float u0, float v0, float u1, float v1, int width, int height, float depth, bool isGlint); // 4J added isGlint parameter public: void render(float a); diff --git a/Minecraft.Client/ItemRenderer.cpp b/Minecraft.Client/ItemRenderer.cpp index 03d0d3a5..fc5e5fde 100644 --- a/Minecraft.Client/ItemRenderer.cpp +++ b/Minecraft.Client/ItemRenderer.cpp @@ -29,13 +29,13 @@ ItemRenderer::~ItemRenderer() delete random; } -void ItemRenderer::render(shared_ptr _itemEntity, double x, double y, double z, float rot, float a) +void ItemRenderer::render(std::shared_ptr _itemEntity, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr itemEntity = dynamic_pointer_cast(_itemEntity); + std::shared_ptr itemEntity = dynamic_pointer_cast(_itemEntity); random->setSeed(187); - shared_ptr item = itemEntity->getItem(); + std::shared_ptr item = itemEntity->getItem(); glPushMatrix(); float bob = Mth::sin((itemEntity->age + a) / 10.0f + itemEntity->bobOffs) * 0.1f + 0.1f; @@ -54,7 +54,7 @@ void ItemRenderer::render(shared_ptr _itemEntity, double x, double y, do { glRotatef(spin, 0, 1, 0); - if (m_bItemFrame) + if (m_bItemFrame) { glScalef(1.25f, 1.25f, 1.25f); glTranslatef(0, 0.05f, 0); @@ -73,7 +73,7 @@ void ItemRenderer::render(shared_ptr _itemEntity, double x, double y, do for (int i = 0; i < count; i++) { glPushMatrix(); - if (i > 0) + if (i > 0) { float xo = (random->nextFloat() * 2 - 1) * 0.2f / s; float yo = (random->nextFloat() * 2 - 1) * 0.2f / s; @@ -88,13 +88,13 @@ void ItemRenderer::render(shared_ptr _itemEntity, double x, double y, do } else if (item->getItem()->hasMultipleSpriteLayers()) { - if (m_bItemFrame) + if (m_bItemFrame) { glScalef(1 / 1.95f, 1 / 1.95f, 1 / 1.95f); glTranslatef(0, -0.05f, 0); glDisable(GL_LIGHTING); - } - else + } + else { glScalef(1 / 2.0f, 1 / 2.0f, 1 / 2.0f); } @@ -124,17 +124,17 @@ void ItemRenderer::render(shared_ptr _itemEntity, double x, double y, do } else { - if (m_bItemFrame) + if (m_bItemFrame) { glScalef(1 / 1.95f, 1 / 1.95f, 1 / 1.95f); glTranslatef(0, -0.05f, 0); glDisable(GL_LIGHTING); - } - else + } + else { glScalef(1 / 2.0f, 1 / 2.0f, 1 / 2.0f); } - + // 4J Stu - For rendering the static compass, we give it a non-zero aux value if(item->id == Item::compass_Id) item->setAuxValue(255); Icon *icon = item->getIcon(); @@ -172,7 +172,7 @@ void ItemRenderer::render(shared_ptr _itemEntity, double x, double y, do } } -void ItemRenderer::renderItemBillboard(shared_ptr entity, Icon *icon, int count, float a, float red, float green, float blue) +void ItemRenderer::renderItemBillboard(std::shared_ptr entity, Icon *icon, int count, float a, float red, float green, float blue) { Tesselator *t = Tesselator::getInstance(); @@ -188,7 +188,7 @@ void ItemRenderer::renderItemBillboard(shared_ptr entity, Icon *icon if (entityRenderDispatcher->options->fancyGraphics) { - // Consider forcing the mipmap LOD level to use, if this is to be rendered from a larger than standard source texture. + // Consider forcing the mipmap LOD level to use, if this is to be rendered from a larger than standard source texture. int iconWidth = icon->getWidth(); int LOD = -1; // Default to not doing anything special with LOD forcing if( iconWidth == 32 ) @@ -213,7 +213,7 @@ void ItemRenderer::renderItemBillboard(shared_ptr entity, Icon *icon float width = 1 / 16.0f; float margin = 0.35f / 16.0f; - shared_ptr item = entity->getItem(); + std::shared_ptr item = entity->getItem(); int items = item->count; if (items < 2) @@ -315,7 +315,7 @@ void ItemRenderer::renderItemBillboard(shared_ptr entity, Icon *icon } } -void ItemRenderer::renderGuiItem(Font *font, Textures *textures, shared_ptr item, float x, float y, float fScale, float fAlpha) +void ItemRenderer::renderGuiItem(Font *font, Textures *textures, std::shared_ptr item, float x, float y, float fScale, float fAlpha) { renderGuiItem(font,textures,item,x,y,fScale,fScale,fAlpha, true); } @@ -325,7 +325,7 @@ extern IDirect3DDevice9 *g_pD3DDevice; #endif // 4J - this used to take x and y as ints, and no scale and alpha - but this interface is now implemented as a wrapper round this more fully featured one -void ItemRenderer::renderGuiItem(Font *font, Textures *textures, shared_ptr item, float x, float y, float fScaleX,float fScaleY, float fAlpha, bool useCompiled) +void ItemRenderer::renderGuiItem(Font *font, Textures *textures, std::shared_ptr item, float x, float y, float fScaleX,float fScaleY, float fAlpha, bool useCompiled) { int itemId = item->id; int itemAuxValue = item->getAuxValue(); @@ -447,13 +447,13 @@ void ItemRenderer::renderGuiItem(Font *font, Textures *textures, shared_ptr item, int x, int y) +void ItemRenderer::renderGuiItem(Font *font, Textures *textures, std::shared_ptr item, int x, int y) { renderGuiItem(font, textures, item, (float)x, (float)y, 1.0f, 1.0f ); } // 4J - this used to take x and y as ints, and no scale, alpha or foil - but this interface is now implemented as a wrapper round this more fully featured one -void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const shared_ptr item, float x, float y,float fScale,float fAlpha, bool isFoil) +void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const std::shared_ptr item, float x, float y,float fScale,float fAlpha, bool isFoil) { if(item==NULL) return; renderAndDecorateItem(font, textures, item, x, y,fScale, fScale, fAlpha, isFoil, true); @@ -461,7 +461,7 @@ void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const s // 4J - added isConstantBlended and blendFactor parameters. This is true if the gui item is being rendered from a context where it already has blending enabled to do general interface fading // (ie from the gui rather than xui). In this case we dno't want to enable/disable blending, and do need to restore the blend state when we are done. -void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const shared_ptr item, float x, float y,float fScaleX, float fScaleY,float fAlpha, bool isFoil, bool isConstantBlended, bool useCompiled) +void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const std::shared_ptr item, float x, float y,float fScaleX, float fScaleY,float fAlpha, bool isFoil, bool isConstantBlended, bool useCompiled) { if (item == NULL) { @@ -469,7 +469,7 @@ void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const s } renderGuiItem(font, textures, item, x, y,fScaleX,fScaleY,fAlpha, useCompiled); - + if (isFoil || item->isFoil()) { glDepthFunc(GL_GREATER); @@ -478,7 +478,7 @@ void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const s textures->bindTexture(TN__BLUR__MISC_GLINT); // 4J was "%blur%/misc/glint.png" blitOffset -= 50; if( !isConstantBlended ) glEnable(GL_BLEND); - + glBlendFunc(GL_DST_COLOR, GL_ONE); // 4J - changed blend equation from GL_DST_COLOR, GL_DST_COLOR so we can fade this out float blendFactor = isConstantBlended ? Gui::currentGuiBlendFactor : 1.0f; @@ -507,7 +507,7 @@ void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const s } // 4J - original interface, now just a wrapper for preceding overload -void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const shared_ptr item, int x, int y) +void ItemRenderer::renderAndDecorateItem(Font *font, Textures *textures, const std::shared_ptr item, int x, int y) { renderAndDecorateItem( font, textures, item, (float)x, (float)y, 1.0f, 1.0f, item->isFoil() ); } @@ -560,18 +560,18 @@ void ItemRenderer::blitGlint(int id, float x, float y, float w, float h) } } -void ItemRenderer::renderGuiItemDecorations(Font *font, Textures *textures, shared_ptr item, int x, int y, float fAlpha) +void ItemRenderer::renderGuiItemDecorations(Font *font, Textures *textures, std::shared_ptr item, int x, int y, float fAlpha) { renderGuiItemDecorations(font, textures, item, x, y, L"", fAlpha); } -void ItemRenderer::renderGuiItemDecorations(Font *font, Textures *textures, shared_ptr item, int x, int y, const wstring &countText, float fAlpha) +void ItemRenderer::renderGuiItemDecorations(Font *font, Textures *textures, std::shared_ptr item, int x, int y, const wstring &countText, float fAlpha) { if (item == NULL) { return; } - + glEnable(GL_BLEND); RenderManager.StateSetBlendFactor(0xffffff |(((unsigned int)(fAlpha * 0xff))<<24)); glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA); diff --git a/Minecraft.Client/ItemRenderer.h b/Minecraft.Client/ItemRenderer.h index 9690f77c..830e8510 100644 --- a/Minecraft.Client/ItemRenderer.h +++ b/Minecraft.Client/ItemRenderer.h @@ -18,20 +18,20 @@ public: ItemRenderer(); virtual ~ItemRenderer(); - virtual void render(shared_ptr _itemEntity, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _itemEntity, double x, double y, double z, float rot, float a); private: - virtual void renderItemBillboard(shared_ptr entity, Icon *icon, int count, float a, float red, float green, float blue); + virtual void renderItemBillboard(std::shared_ptr entity, Icon *icon, int count, float a, float red, float green, float blue); public: // 4J - original 2 interface variants - void renderGuiItem(Font *font, Textures *textures, shared_ptr item, int x, int y); - void renderAndDecorateItem(Font *font, Textures *textures, const shared_ptr item, int x, int y); + void renderGuiItem(Font *font, Textures *textures, std::shared_ptr item, int x, int y); + void renderAndDecorateItem(Font *font, Textures *textures, const std::shared_ptr item, int x, int y); // 4J - new interfaces added - void renderGuiItem(Font *font, Textures *textures, shared_ptr item, float x, float y, float fScale, float fAlpha); - void renderGuiItem(Font *font, Textures *textures, shared_ptr item, float x, float y, float fScaleX,float fScaleY, float fAlpha, bool useCompiled); // 4J Added useCompiled - void renderAndDecorateItem(Font *font, Textures *textures, const shared_ptr item, float x, float y, float fScale, float fAlpha, bool isFoil); - void renderAndDecorateItem(Font *font, Textures *textures, const shared_ptr item, float x, float y, float fScaleX, float fScaleY, float fAlpha, bool isFoil, bool isConstantBlended, bool useCompiled = true); // 4J - added isConstantBlended and useCompiled + void renderGuiItem(Font *font, Textures *textures, std::shared_ptr item, float x, float y, float fScale, float fAlpha); + void renderGuiItem(Font *font, Textures *textures, std::shared_ptr item, float x, float y, float fScaleX,float fScaleY, float fAlpha, bool useCompiled); // 4J Added useCompiled + void renderAndDecorateItem(Font *font, Textures *textures, const std::shared_ptr item, float x, float y, float fScale, float fAlpha, bool isFoil); + void renderAndDecorateItem(Font *font, Textures *textures, const std::shared_ptr item, float x, float y, float fScaleX, float fScaleY, float fAlpha, bool isFoil, bool isConstantBlended, bool useCompiled = true); // 4J - added isConstantBlended and useCompiled // 4J Added virtual void SetItemFrame(bool bSet) {m_bItemFrame=bSet;} @@ -42,8 +42,8 @@ private: void blitGlint(int id, float x, float y, float w, float h); // 4J - changed x,y,w,h to floats public: - void renderGuiItemDecorations(Font *font, Textures *textures, shared_ptr item, int x, int y, float fAlpha = 1.0f); - void renderGuiItemDecorations(Font *font, Textures *textures, shared_ptr item, int x, int y, const wstring &countText, float fAlpha = 1.0f); + void renderGuiItemDecorations(Font *font, Textures *textures, std::shared_ptr item, int x, int y, float fAlpha = 1.0f); + void renderGuiItemDecorations(Font *font, Textures *textures, std::shared_ptr item, int x, int y, const wstring &countText, float fAlpha = 1.0f); private: void fillRect(Tesselator *t, int x, int y, int w, int h, int c); public: diff --git a/Minecraft.Client/ItemSpriteRenderer.cpp b/Minecraft.Client/ItemSpriteRenderer.cpp index 5a1ea620..1cc60b62 100644 --- a/Minecraft.Client/ItemSpriteRenderer.cpp +++ b/Minecraft.Client/ItemSpriteRenderer.cpp @@ -17,7 +17,7 @@ ItemSpriteRenderer::ItemSpriteRenderer(Item *sourceItem, int sourceItemAuxValue // this(sourceItem, 0); //} -void ItemSpriteRenderer::render(shared_ptr e, double x, double y, double z, float rot, float a) +void ItemSpriteRenderer::render(std::shared_ptr e, double x, double y, double z, float rot, float a) { // the icon is already cached in the item object, so there should not be any performance impact by not caching it here Icon *icon = sourceItem->getIcon(sourceItemAuxValue); diff --git a/Minecraft.Client/ItemSpriteRenderer.h b/Minecraft.Client/ItemSpriteRenderer.h index e60feece..e8359783 100644 --- a/Minecraft.Client/ItemSpriteRenderer.h +++ b/Minecraft.Client/ItemSpriteRenderer.h @@ -11,7 +11,7 @@ private: public: ItemSpriteRenderer(Item *sourceItem, int sourceItemAuxValue = 0); //ItemSpriteRenderer(Item *icon); - virtual void render(shared_ptr e, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr e, double x, double y, double z, float rot, float a); private: void renderIcon(Tesselator *t, Icon *icon); diff --git a/Minecraft.Client/LavaSlimeModel.cpp b/Minecraft.Client/LavaSlimeModel.cpp index 427b9547..4c024cfe 100644 --- a/Minecraft.Client/LavaSlimeModel.cpp +++ b/Minecraft.Client/LavaSlimeModel.cpp @@ -5,18 +5,18 @@ #include "..\Minecraft.World\LavaSlime.h" -LavaSlimeModel::LavaSlimeModel() +LavaSlimeModel::LavaSlimeModel() { - for (int i = 0; i < BODYCUBESLENGTH; i++) + for (int i = 0; i < BODYCUBESLENGTH; i++) { int u = 0; int v = i; - if (i == 2) + if (i == 2) { u = 24; v = 10; - } - else if (i == 3) + } + else if (i == 3) { u = 24; v = 19; @@ -36,33 +36,33 @@ LavaSlimeModel::LavaSlimeModel() } } -int LavaSlimeModel::getModelVersion() +int LavaSlimeModel::getModelVersion() { return 5; } -void LavaSlimeModel::prepareMobModel(shared_ptr mob, float time, float r, float a) +void LavaSlimeModel::prepareMobModel(std::shared_ptr mob, float time, float r, float a) { - shared_ptr lavaSlime = dynamic_pointer_cast(mob); + std::shared_ptr lavaSlime = dynamic_pointer_cast(mob); float slimeSquish = (lavaSlime->oSquish + (lavaSlime->squish - lavaSlime->oSquish) * a); - if (slimeSquish < 0) + if (slimeSquish < 0) { slimeSquish = 0.0f; } - for (int i = 0; i < BODYCUBESLENGTH; i++) + for (int i = 0; i < BODYCUBESLENGTH; i++) { bodyCubes[i]->y = -(4 - i) * slimeSquish * 1.7f; } } -void LavaSlimeModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void LavaSlimeModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); insideCube->render(scale, usecompiled); - for (int i = 0; i < BODYCUBESLENGTH; i++) + for (int i = 0; i < BODYCUBESLENGTH; i++) { bodyCubes[i]->render(scale, usecompiled); } diff --git a/Minecraft.Client/LavaSlimeModel.h b/Minecraft.Client/LavaSlimeModel.h index 44bd1663..ead7147f 100644 --- a/Minecraft.Client/LavaSlimeModel.h +++ b/Minecraft.Client/LavaSlimeModel.h @@ -1,7 +1,7 @@ #pragma once #include "Model.h" -class LavaSlimeModel : public Model +class LavaSlimeModel : public Model { static const int BODYCUBESLENGTH=8; ModelPart *bodyCubes[BODYCUBESLENGTH]; @@ -10,6 +10,6 @@ class LavaSlimeModel : public Model public: LavaSlimeModel(); int getModelVersion(); - virtual void prepareMobModel(shared_ptr mob, float time, float r, float a); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void prepareMobModel(std::shared_ptr mob, float time, float r, float a); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); }; diff --git a/Minecraft.Client/LavaSlimeRenderer.cpp b/Minecraft.Client/LavaSlimeRenderer.cpp index 3d2cbf47..6bb75720 100644 --- a/Minecraft.Client/LavaSlimeRenderer.cpp +++ b/Minecraft.Client/LavaSlimeRenderer.cpp @@ -8,11 +8,11 @@ LavaSlimeRenderer::LavaSlimeRenderer() : MobRenderer(new LavaSlimeModel(), .25f) this->modelVersion = ((LavaSlimeModel *) model)->getModelVersion(); } -void LavaSlimeRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) -{ - // 4J - original version used generics and thus had an input parameter of type LavaSlime rather than shared_ptr we have here - +void LavaSlimeRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) +{ + // 4J - original version used generics and thus had an input parameter of type LavaSlime rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); int modelVersion = ((LavaSlimeModel *) model)->getModelVersion(); if (modelVersion != this->modelVersion) { @@ -23,11 +23,11 @@ void LavaSlimeRenderer::render(shared_ptr _mob, double x, double y, doub MobRenderer::render(mob, x, y, z, rot, a); } -void LavaSlimeRenderer::scale(shared_ptr _slime, float a) +void LavaSlimeRenderer::scale(std::shared_ptr _slime, float a) { - // 4J - original version used generics and thus had an input parameter of type LavaSlime rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type LavaSlime rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr slime = dynamic_pointer_cast(_slime); + std::shared_ptr slime = dynamic_pointer_cast(_slime); int size = slime->getSize(); float ss = (slime->oSquish + (slime->squish - slime->oSquish) * a) / (size * 0.5f + 1); float w = 1 / (ss + 1); diff --git a/Minecraft.Client/LavaSlimeRenderer.h b/Minecraft.Client/LavaSlimeRenderer.h index b0c44d1e..29afb390 100644 --- a/Minecraft.Client/LavaSlimeRenderer.h +++ b/Minecraft.Client/LavaSlimeRenderer.h @@ -10,8 +10,8 @@ private: public: LavaSlimeRenderer(); - virtual void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); protected: - virtual void scale(shared_ptr _slime, float a); + virtual void scale(std::shared_ptr _slime, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/LevelRenderer.cpp b/Minecraft.Client/LevelRenderer.cpp index 917fa9f3..4cdb0cbe 100644 --- a/Minecraft.Client/LevelRenderer.cpp +++ b/Minecraft.Client/LevelRenderer.cpp @@ -475,7 +475,7 @@ void LevelRenderer::allChanged(int playerIndex) if (level != NULL) { - shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr player = mc->cameraTargetPlayer; if (player != NULL) { this->resortChunks(Mth::floor(player->x), Mth::floor(player->y), Mth::floor(player->z)); @@ -509,7 +509,7 @@ void LevelRenderer::renderEntities(Vec3 *cam, Culler *culler, float a) renderedEntities = 0; culledEntities = 0; - shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr player = mc->cameraTargetPlayer; EntityRenderDispatcher::xOff = (player->xOld + (player->x - player->xOld) * a); EntityRenderDispatcher::yOff = (player->yOld + (player->y - player->yOld) * a); @@ -520,13 +520,13 @@ void LevelRenderer::renderEntities(Vec3 *cam, Culler *culler, float a) mc->gameRenderer->turnOnLightLayer(a); // 4J - brought forward from 1.8.2 - vector > entities = level[playerIndex]->getAllEntities(); + vector > entities = level[playerIndex]->getAllEntities(); totalEntities = (int)entities.size(); AUTO_VAR(itEndGE, level[playerIndex]->globalEntities.end()); for (AUTO_VAR(it, level[playerIndex]->globalEntities.begin()); it != itEndGE; it++) { - shared_ptr entity = *it; //level->globalEntities[i]; + std::shared_ptr entity = *it; //level->globalEntities[i]; renderedEntities++; if (entity->shouldRender(cam)) EntityRenderDispatcher::instance->render(entity, a); } @@ -534,13 +534,13 @@ void LevelRenderer::renderEntities(Vec3 *cam, Culler *culler, float a) AUTO_VAR(itEndEnts, entities.end()); for (AUTO_VAR(it, entities.begin()); it != itEndEnts; it++) { - shared_ptr entity = *it; //entities[i]; + std::shared_ptr entity = *it; //entities[i]; if ((entity->shouldRender(cam) && (entity->noCulling || culler->isVisible(entity->bb)))) { // 4J-PB - changing this to be per player //if (entity == mc->cameraTargetPlayer && !mc->options->thirdPersonView && !mc->cameraTargetPlayer->isSleeping()) continue; - shared_ptr localplayer = dynamic_pointer_cast(mc->cameraTargetPlayer); + std::shared_ptr localplayer = dynamic_pointer_cast(mc->cameraTargetPlayer); if (localplayer && entity == mc->cameraTargetPlayer && !localplayer->ThirdPersonView() && !mc->cameraTargetPlayer->isSleeping()) continue; @@ -669,7 +669,7 @@ void LevelRenderer::resortChunks(int xc, int yc, int zc) LeaveCriticalSection(&m_csDirtyChunks); } -int LevelRenderer::render(shared_ptr player, int layer, double alpha, bool updateChunks) +int LevelRenderer::render(std::shared_ptr player, int layer, double alpha, bool updateChunks) { int playerIndex = mc->player->GetXboxPad(); @@ -741,7 +741,7 @@ int LevelRenderer::renderChunks(int from, int to, int layer, double alpha) #if 1 // 4J - cut down version, we're not using offsetted render lists, or a sorted chunk list, anymore mc->gameRenderer->turnOnLightLayer(alpha); // 4J - brought forward from 1.8.2 - shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr player = mc->cameraTargetPlayer; double xOff = player->xOld + (player->x - player->xOld) * alpha; double yOff = player->yOld + (player->y - player->yOld) * alpha; double zOff = player->zOld + (player->z - player->zOld) * alpha; @@ -854,7 +854,7 @@ int LevelRenderer::renderChunks(int from, int to, int layer, double alpha) } } - shared_ptr player = mc->cameraTargetPlayer; + std::shared_ptr player = mc->cameraTargetPlayer; double xOff = player->xOld + (player->x - player->xOld) * alpha; double yOff = player->yOld + (player->y - player->yOld) * alpha; double zOff = player->zOld + (player->z - player->zOld) * alpha; @@ -1909,8 +1909,8 @@ bool LevelRenderer::updateDirtyChunks() for( int p = 0; p < XUSER_MAX_COUNT; p++ ) { // It's possible that the localplayers member can be set to NULL on the main thread when a player chooses to exit the game - // So take a reference to the player object now. As it is a shared_ptr it should live as long as we need it - shared_ptr player = mc->localplayers[p]; + // So take a reference to the player object now. As it is a std::shared_ptr it should live as long as we need it + std::shared_ptr player = mc->localplayers[p]; if( player == NULL ) continue; if( chunks[p].data == NULL ) continue; if( level[p] == NULL ) continue; @@ -2161,7 +2161,7 @@ bool LevelRenderer::updateDirtyChunks() } -void LevelRenderer::renderHit(shared_ptr player, HitResult *h, int mode, shared_ptr inventoryItem, float a) +void LevelRenderer::renderHit(std::shared_ptr player, HitResult *h, int mode, std::shared_ptr inventoryItem, float a) { Tesselator *t = Tesselator::getInstance(); glEnable(GL_BLEND); @@ -2180,7 +2180,7 @@ void LevelRenderer::renderHit(shared_ptr player, HitResult *h, int mode, glDisable(GL_ALPHA_TEST); } -void LevelRenderer::renderDestroyAnimation(Tesselator *t, shared_ptr player, float a) +void LevelRenderer::renderDestroyAnimation(Tesselator *t, std::shared_ptr player, float a) { double xo = player->xOld + (player->x - player->xOld) * a; double yo = player->yOld + (player->y - player->yOld) * a; @@ -2246,7 +2246,7 @@ void LevelRenderer::renderDestroyAnimation(Tesselator *t, shared_ptr pla } } -void LevelRenderer::renderHitOutline(shared_ptr player, HitResult *h, int mode, shared_ptr inventoryItem, float a) +void LevelRenderer::renderHitOutline(std::shared_ptr player, HitResult *h, int mode, std::shared_ptr inventoryItem, float a) { if (mode == 0 && h->type == HitResult::TILE) @@ -2586,7 +2586,7 @@ void LevelRenderer::playSound(int iSound, double x, double y, double z, float vo } */ } -void LevelRenderer::playSound(shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist) +void LevelRenderer::playSound(std::shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist) { } @@ -2606,21 +2606,21 @@ if (xd * xd + yd * yd + zd * zd > particleDistance * particleDistance) return; int playerIndex = mc->player->GetXboxPad(); // 4J added -if (name== L"bubble") mc->particleEngine->add(shared_ptr( new BubbleParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); -else if (name== L"smoke") mc->particleEngine->add(shared_ptr( new SmokeParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); -else if (name== L"note") mc->particleEngine->add(shared_ptr( new NoteParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); -else if (name== L"portal") mc->particleEngine->add(shared_ptr( new PortalParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); -else if (name== L"explode") mc->particleEngine->add(shared_ptr( new ExplodeParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); -else if (name== L"flame") mc->particleEngine->add(shared_ptr( new FlameParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); -else if (name== L"lava") mc->particleEngine->add(shared_ptr( new LavaParticle(level[playerIndex], x, y, z) ) ); -else if (name== L"footstep") mc->particleEngine->add(shared_ptr( new FootstepParticle(textures, level[playerIndex], x, y, z) ) ); -else if (name== L"splash") mc->particleEngine->add(shared_ptr( new SplashParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); -else if (name== L"largesmoke") mc->particleEngine->add(shared_ptr( new SmokeParticle(level[playerIndex], x, y, z, xa, ya, za, 2.5f) ) ); -else if (name== L"reddust") mc->particleEngine->add(shared_ptr( new RedDustParticle(level[playerIndex], x, y, z, (float) xa, (float) ya, (float) za) ) ); -else if (name== L"snowballpoof") mc->particleEngine->add(shared_ptr( new BreakingItemParticle(level[playerIndex], x, y, z, Item::snowBall) ) ); -else if (name== L"snowshovel") mc->particleEngine->add(shared_ptr( new SnowShovelParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); -else if (name== L"slime") mc->particleEngine->add(shared_ptr( new BreakingItemParticle(level[playerIndex], x, y, z, Item::slimeBall)) ) ; -else if (name== L"heart") mc->particleEngine->add(shared_ptr( new HeartParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); +if (name== L"bubble") mc->particleEngine->add(std::shared_ptr( new BubbleParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); +else if (name== L"smoke") mc->particleEngine->add(std::shared_ptr( new SmokeParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); +else if (name== L"note") mc->particleEngine->add(std::shared_ptr( new NoteParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); +else if (name== L"portal") mc->particleEngine->add(std::shared_ptr( new PortalParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); +else if (name== L"explode") mc->particleEngine->add(std::shared_ptr( new ExplodeParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); +else if (name== L"flame") mc->particleEngine->add(std::shared_ptr( new FlameParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); +else if (name== L"lava") mc->particleEngine->add(std::shared_ptr( new LavaParticle(level[playerIndex], x, y, z) ) ); +else if (name== L"footstep") mc->particleEngine->add(std::shared_ptr( new FootstepParticle(textures, level[playerIndex], x, y, z) ) ); +else if (name== L"splash") mc->particleEngine->add(std::shared_ptr( new SplashParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); +else if (name== L"largesmoke") mc->particleEngine->add(std::shared_ptr( new SmokeParticle(level[playerIndex], x, y, z, xa, ya, za, 2.5f) ) ); +else if (name== L"reddust") mc->particleEngine->add(std::shared_ptr( new RedDustParticle(level[playerIndex], x, y, z, (float) xa, (float) ya, (float) za) ) ); +else if (name== L"snowballpoof") mc->particleEngine->add(std::shared_ptr( new BreakingItemParticle(level[playerIndex], x, y, z, Item::snowBall) ) ); +else if (name== L"snowshovel") mc->particleEngine->add(std::shared_ptr( new SnowShovelParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); +else if (name== L"slime") mc->particleEngine->add(std::shared_ptr( new BreakingItemParticle(level[playerIndex], x, y, z, Item::slimeBall)) ) ; +else if (name== L"heart") mc->particleEngine->add(std::shared_ptr( new HeartParticle(level[playerIndex], x, y, z, xa, ya, za) ) ); } */ @@ -2629,7 +2629,7 @@ void LevelRenderer::addParticle(ePARTICLE_TYPE eParticleType, double x, double y addParticleInternal( eParticleType, x, y, z, xa, ya, za ); } -shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticleType, double x, double y, double z, double xa, double ya, double za) +std::shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticleType, double x, double y, double z, double xa, double ya, double za) { if (mc == NULL || mc->cameraTargetPlayer == NULL || mc->particleEngine == NULL) { @@ -2683,7 +2683,7 @@ shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticle bool inRange = false; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - shared_ptr thisPlayer = mc->localplayers[i]; + std::shared_ptr thisPlayer = mc->localplayers[i]; if(thisPlayer != NULL && level[i] == lev) { xd = thisPlayer->x - x; @@ -2706,35 +2706,35 @@ shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticle return nullptr; } - shared_ptr particle; + std::shared_ptr particle; switch(eParticleType) { case eParticleType_hugeexplosion: - particle = shared_ptr(new HugeExplosionSeedParticle(lev, x, y, z, xa, ya, za)); + particle = std::shared_ptr(new HugeExplosionSeedParticle(lev, x, y, z, xa, ya, za)); break; case eParticleType_largeexplode: - particle = shared_ptr(new HugeExplosionParticle(textures, lev, x, y, z, xa, ya, za)); + particle = std::shared_ptr(new HugeExplosionParticle(textures, lev, x, y, z, xa, ya, za)); break; case eParticleType_bubble: - particle = shared_ptr( new BubbleParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new BubbleParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_suspended: - particle = shared_ptr( new SuspendedParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new SuspendedParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_depthsuspend: - particle = shared_ptr( new SuspendedTownParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new SuspendedTownParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_townaura: - particle = shared_ptr( new SuspendedTownParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new SuspendedTownParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_crit: { - shared_ptr critParticle2 = shared_ptr(new CritParticle2(lev, x, y, z, xa, ya, za)); + std::shared_ptr critParticle2 = std::shared_ptr(new CritParticle2(lev, x, y, z, xa, ya, za)); critParticle2->CritParticle2PostConstructor(); - particle = shared_ptr( critParticle2 ); + particle = std::shared_ptr( critParticle2 ); // request from 343 to set pink for the needler in the Halo Texture Pack // Set particle colour from colour-table. unsigned int cStart = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Particle_CritStart ); @@ -2758,15 +2758,15 @@ shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticle break; case eParticleType_magicCrit: { - shared_ptr critParticle2 = shared_ptr(new CritParticle2(lev, x, y, z, xa, ya, za)); + std::shared_ptr critParticle2 = std::shared_ptr(new CritParticle2(lev, x, y, z, xa, ya, za)); critParticle2->CritParticle2PostConstructor(); - particle = shared_ptr(critParticle2); + particle = std::shared_ptr(critParticle2); particle->setColor(particle->getRedCol() * 0.3f, particle->getGreenCol() * 0.8f, particle->getBlueCol()); particle->setNextMiscAnimTex(); } break; case eParticleType_smoke: - particle = shared_ptr( new SmokeParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new SmokeParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_endportal: // 4J - Added. { @@ -2776,94 +2776,94 @@ shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticle unsigned int col = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Particle_EnderPortal ); tmp->setColor( ( (col>>16)&0xFF )/255.0f, ( (col>>8)&0xFF )/255.0, ( col&0xFF )/255.0 ); - particle = shared_ptr(tmp); + particle = std::shared_ptr(tmp); } break; case eParticleType_mobSpell: - particle = shared_ptr(new SpellParticle(lev, x, y, z, 0, 0, 0)); + particle = std::shared_ptr(new SpellParticle(lev, x, y, z, 0, 0, 0)); particle->setColor((float) xa, (float) ya, (float) za); break; case eParticleType_spell: - particle = shared_ptr( new SpellParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new SpellParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_instantSpell: - particle = shared_ptr(new SpellParticle(lev, x, y, z, xa, ya, za)); + particle = std::shared_ptr(new SpellParticle(lev, x, y, z, xa, ya, za)); dynamic_pointer_cast(particle)->setBaseTex(9 * 16); break; case eParticleType_note: - particle = shared_ptr( new NoteParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new NoteParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_netherportal: - particle = shared_ptr( new NetherPortalParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new NetherPortalParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_ender: - particle = shared_ptr( new EnderParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new EnderParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_enchantmenttable: - particle = shared_ptr(new EchantmentTableParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr(new EchantmentTableParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_explode: - particle = shared_ptr( new ExplodeParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new ExplodeParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_flame: - particle = shared_ptr( new FlameParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new FlameParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_lava: - particle = shared_ptr( new LavaParticle(lev, x, y, z) ); + particle = std::shared_ptr( new LavaParticle(lev, x, y, z) ); break; case eParticleType_footstep: - particle = shared_ptr( new FootstepParticle(textures, lev, x, y, z) ); + particle = std::shared_ptr( new FootstepParticle(textures, lev, x, y, z) ); break; case eParticleType_splash: - particle = shared_ptr( new SplashParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new SplashParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_largesmoke: - particle = shared_ptr( new SmokeParticle(lev, x, y, z, xa, ya, za, 2.5f) ); + particle = std::shared_ptr( new SmokeParticle(lev, x, y, z, xa, ya, za, 2.5f) ); break; case eParticleType_reddust: - particle = shared_ptr( new RedDustParticle(lev, x, y, z, (float) xa, (float) ya, (float) za) ); + particle = std::shared_ptr( new RedDustParticle(lev, x, y, z, (float) xa, (float) ya, (float) za) ); break; case eParticleType_snowballpoof: - particle = shared_ptr( new BreakingItemParticle(lev, x, y, z, Item::snowBall, textures) ); + particle = std::shared_ptr( new BreakingItemParticle(lev, x, y, z, Item::snowBall, textures) ); break; case eParticleType_dripWater: - particle = shared_ptr( new DripParticle(lev, x, y, z, Material::water) ); + particle = std::shared_ptr( new DripParticle(lev, x, y, z, Material::water) ); break; case eParticleType_dripLava: - particle = shared_ptr( new DripParticle(lev, x, y, z, Material::lava) ); + particle = std::shared_ptr( new DripParticle(lev, x, y, z, Material::lava) ); break; case eParticleType_snowshovel: - particle = shared_ptr( new SnowShovelParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new SnowShovelParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_slime: - particle = shared_ptr( new BreakingItemParticle(lev, x, y, z, Item::slimeBall, textures)); + particle = std::shared_ptr( new BreakingItemParticle(lev, x, y, z, Item::slimeBall, textures)); break; case eParticleType_heart: - particle = shared_ptr( new HeartParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new HeartParticle(lev, x, y, z, xa, ya, za) ); break; case eParticleType_angryVillager: - particle = shared_ptr( new HeartParticle(lev, x, y + 0.5f, z, xa, ya, za) ); + particle = std::shared_ptr( new HeartParticle(lev, x, y + 0.5f, z, xa, ya, za) ); particle->setMiscTex(1 + 16 * 5); particle->setColor(1, 1, 1); break; case eParticleType_happyVillager: - particle = shared_ptr( new SuspendedTownParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new SuspendedTownParticle(lev, x, y, z, xa, ya, za) ); particle->setMiscTex(2 + 16 * 5); particle->setColor(1, 1, 1); break; case eParticleType_dragonbreath: - particle = shared_ptr( new DragonBreathParticle(lev, x, y, z, xa, ya, za) ); + particle = std::shared_ptr( new DragonBreathParticle(lev, x, y, z, xa, ya, za) ); break; default: if( ( eParticleType >= eParticleType_iconcrack_base ) && ( eParticleType <= eParticleType_iconcrack_last ) ) { int id = PARTICLE_CRACK_ID(eParticleType), data = PARTICLE_CRACK_DATA(eParticleType); - particle = shared_ptr(new BreakingItemParticle(lev, x, y, z, xa, ya, za, Item::items[id], textures, data)); + particle = std::shared_ptr(new BreakingItemParticle(lev, x, y, z, xa, ya, za, Item::items[id], textures, data)); } else if( ( eParticleType >= eParticleType_tilecrack_base ) && ( eParticleType <= eParticleType_tilecrack_last ) ) { int id = PARTICLE_CRACK_ID(eParticleType), data = PARTICLE_CRACK_DATA(eParticleType); - particle = dynamic_pointer_cast( shared_ptr(new TerrainParticle(lev, x, y, z, xa, ya, za, Tile::tiles[id], 0, data, textures))->init(data) ); + particle = dynamic_pointer_cast( std::shared_ptr(new TerrainParticle(lev, x, y, z, xa, ya, za, Tile::tiles[id], 0, data, textures))->init(data) ); } } @@ -2875,7 +2875,7 @@ shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticle return particle; } -void LevelRenderer::entityAdded(shared_ptr entity) +void LevelRenderer::entityAdded(std::shared_ptr entity) { entity->prepareCustomTextures(); // 4J - these empty string comparisons used to check for NULL references, but we don't have string pointers (currently) in entities, @@ -2899,7 +2899,7 @@ void LevelRenderer::entityAdded(shared_ptr entity) } -void LevelRenderer::entityRemoved(shared_ptr entity) +void LevelRenderer::entityRemoved(std::shared_ptr entity) { /* 4J - removed temp if (entity->customTextureUrl != L"") textures->removeHttpTexture(entity->customTextureUrl); @@ -2936,7 +2936,7 @@ void LevelRenderer::clear() MemoryTracker::releaseLists(chunkLists); } -void LevelRenderer::levelEvent(shared_ptr source, int type, int x, int y, int z, int data) +void LevelRenderer::levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data) { int playerIndex = mc->player->GetXboxPad(); // 4J added Random *random = level[playerIndex]->random; @@ -3048,7 +3048,7 @@ void LevelRenderer::levelEvent(shared_ptr source, int type, int x, int y double ys = 0.01 + random->nextDouble() * 0.5; double zs = sin(angle) * dist; - shared_ptr spellParticle = addParticleInternal(particleName, xp + xs * 0.1, yp + 0.3, zp + zs * 0.1, xs, ys, zs); + std::shared_ptr spellParticle = addParticleInternal(particleName, xp + xs * 0.1, yp + 0.3, zp + zs * 0.1, xs, ys, zs); if (spellParticle != NULL) { float randBrightness = 0.75f + random->nextFloat() * 0.25f; @@ -3075,7 +3075,7 @@ void LevelRenderer::levelEvent(shared_ptr source, int type, int x, int y double ys = 0.01 + random->nextDouble() * 0.5; double zs = sin(angle) * dist; - shared_ptr acidParticle = addParticleInternal(particleName, xp + xs * 0.1, yp + 0.3, zp + zs * 0.1, xs, ys, zs); + std::shared_ptr acidParticle = addParticleInternal(particleName, xp + xs * 0.1, yp + 0.3, zp + zs * 0.1, xs, ys, zs); if (acidParticle != NULL) { float randBrightness = 0.75f + random->nextFloat() * 0.25f; diff --git a/Minecraft.Client/LevelRenderer.h b/Minecraft.Client/LevelRenderer.h index b2bd5eb2..7db67d08 100644 --- a/Minecraft.Client/LevelRenderer.h +++ b/Minecraft.Client/LevelRenderer.h @@ -71,7 +71,7 @@ public: private: void resortChunks(int xc, int yc, int zc); public: - int render(shared_ptr player, int layer, double alpha, bool updateChunks); + int render(std::shared_ptr player, int layer, double alpha, bool updateChunks); private: int renderChunks(int from, int to, int layer, double alpha); public: @@ -87,9 +87,9 @@ public: bool updateDirtyChunks(); public: - void renderHit(shared_ptr player, HitResult *h, int mode, shared_ptr inventoryItem, float a); - void renderDestroyAnimation(Tesselator *t, shared_ptr player, float a); - void renderHitOutline(shared_ptr player, HitResult *h, int mode, shared_ptr inventoryItem, float a); + void renderHit(std::shared_ptr player, HitResult *h, int mode, std::shared_ptr inventoryItem, float a); + void renderDestroyAnimation(Tesselator *t, std::shared_ptr player, float a); + void renderHitOutline(std::shared_ptr player, HitResult *h, int mode, std::shared_ptr inventoryItem, float a); void render(AABB *b); void setDirty(int x0, int y0, int z0, int x1, int y1, int z1, Level *level); // 4J - added level param void tileChanged(int x, int y, int z); @@ -106,26 +106,26 @@ public: void cull(Culler *culler, float a); void playStreamingMusic(const wstring& name, int x, int y, int z); void playSound(int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f); - void playSound(shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f); + void playSound(std::shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f); void addParticle(ePARTICLE_TYPE eParticleType, double x, double y, double z, double xa, double ya, double za); // 4J added - shared_ptr addParticleInternal(ePARTICLE_TYPE eParticleType, double x, double y, double z, double xa, double ya, double za); // 4J added - void entityAdded(shared_ptr entity); - void entityRemoved(shared_ptr entity); - void playerRemoved(shared_ptr entity) {} // 4J added - for when a player is removed from the level's player array, not just the entity storage + std::shared_ptr addParticleInternal(ePARTICLE_TYPE eParticleType, double x, double y, double z, double xa, double ya, double za); // 4J added + void entityAdded(std::shared_ptr entity); + void entityRemoved(std::shared_ptr entity); + void playerRemoved(std::shared_ptr entity) {} // 4J added - for when a player is removed from the level's player array, not just the entity storage void skyColorChanged(); void clear(); - void levelEvent(shared_ptr source, int type, int x, int y, int z, int data); + void levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data); void destroyTileProgress(int id, int x, int y, int z, int progress); void registerTextures(IconRegister *iconRegister); - typedef unordered_map >, IntKeyHash, IntKeyEq> rteMap; + typedef unordered_map >, IntKeyHash, IntKeyEq> rteMap; private: // debug int m_freezeticks; // used to freeze the clouds // 4J - this block of declarations was scattered round the code but have gathered everything into one place - rteMap renderableTileEntities; // 4J - changed - was vector, now hashed by chunk so we can find them + rteMap renderableTileEntities; // 4J - changed - was vector, now hashed by chunk so we can find them CRITICAL_SECTION m_csRenderableTileEntities; MultiPlayerLevel *level[4]; // 4J - now one per player Textures *textures; diff --git a/Minecraft.Client/LightningBoltRenderer.cpp b/Minecraft.Client/LightningBoltRenderer.cpp index d02ea7f7..9bf7af05 100644 --- a/Minecraft.Client/LightningBoltRenderer.cpp +++ b/Minecraft.Client/LightningBoltRenderer.cpp @@ -3,10 +3,10 @@ #include "Tesselator.h" #include "..\Minecraft.World\net.minecraft.world.entity.global.h" -void LightningBoltRenderer::render(shared_ptr _bolt, double x, double y, double z, float rot, float a) +void LightningBoltRenderer::render(std::shared_ptr _bolt, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr bolt = dynamic_pointer_cast(_bolt); + std::shared_ptr bolt = dynamic_pointer_cast(_bolt); Tesselator *t = Tesselator::getInstance(); diff --git a/Minecraft.Client/LightningBoltRenderer.h b/Minecraft.Client/LightningBoltRenderer.h index 5a2b33a3..bf5c7c82 100644 --- a/Minecraft.Client/LightningBoltRenderer.h +++ b/Minecraft.Client/LightningBoltRenderer.h @@ -4,5 +4,5 @@ class LightningBoltRenderer : public EntityRenderer { public: - virtual void render(shared_ptr bolt, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr bolt, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index ed286cd9..64fddbf1 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -165,7 +165,7 @@ void LocalPlayer::calculateFlight(float xa, float ya, float za) void LocalPlayer::serverAiStep() { Player::serverAiStep(); - + if( abilities.flying && abilities.mayfly ) { // snap y rotation for flying to nearest 90 degrees in world space @@ -183,7 +183,7 @@ void LocalPlayer::serverAiStep() float yRotDiff = yRotSnapped - yRotFinal; // Apply the same difference to the player rotated space angle float yRotInputAdjust = yRotInput + yRotDiff; - + // Calculate final x/y player-space movement required this->xxa = cos(yRotInputAdjust * ( PI / 180.0f) ) * fMag; this->yya = sin(yRotInputAdjust * ( PI / 180.0f) ) * fMag; @@ -355,7 +355,7 @@ void LocalPlayer::aiStep() if (isSprinting() && (!forwardEnoughToContinueSprint || !enoughFoodToSprint || isSneaking() || isUsingItem())) { setSprinting(false); - } + } // 4J Stu - Fix for #52705 - Customer Encountered: Player can fly in bed while being in Creative mode. if (!isSleeping() && (abilities.mayfly || isAllowedToFly() )) @@ -396,7 +396,7 @@ void LocalPlayer::aiStep() abilities.flying = false; } } - + if (abilities.flying) { @@ -515,7 +515,7 @@ void LocalPlayer::aiStep() else { ProfileManager.SetCurrentGameActivity(m_iPad,CONTEXT_PRESENCE_MULTIPLAYER,false); - } + } } else { @@ -605,14 +605,14 @@ void LocalPlayer::closeContainer() ui.CloseUIScenes( m_iPad ); } -void LocalPlayer::openTextEdit(shared_ptr sign) +void LocalPlayer::openTextEdit(std::shared_ptr sign) { bool success = app.LoadSignEntryMenu(GetXboxPad(), sign ); if( success ) ui.PlayUISFX(eSFX_Press); //minecraft->setScreen(new TextEditScreen(sign)); } -bool LocalPlayer::openContainer(shared_ptr container) +bool LocalPlayer::openContainer(std::shared_ptr container) { bool success = app.LoadContainerMenu(GetXboxPad(), inventory, container ); if( success ) ui.PlayUISFX(eSFX_Press); @@ -645,7 +645,7 @@ bool LocalPlayer::startRepairing(int x, int y, int z) return success; } -bool LocalPlayer::openFurnace(shared_ptr furnace) +bool LocalPlayer::openFurnace(std::shared_ptr furnace) { bool success = app.LoadFurnaceMenu(GetXboxPad(),inventory, furnace); if( success ) ui.PlayUISFX(eSFX_Press); @@ -653,7 +653,7 @@ bool LocalPlayer::openFurnace(shared_ptr furnace) return success; } -bool LocalPlayer::openBrewingStand(shared_ptr brewingStand) +bool LocalPlayer::openBrewingStand(std::shared_ptr brewingStand) { bool success = app.LoadBrewingStandMenu(GetXboxPad(),inventory, brewingStand); if( success ) ui.PlayUISFX(eSFX_Press); @@ -661,7 +661,7 @@ bool LocalPlayer::openBrewingStand(shared_ptr brewingSta return success; } -bool LocalPlayer::openTrap(shared_ptr trap) +bool LocalPlayer::openTrap(std::shared_ptr trap) { bool success = app.LoadTrapMenu(GetXboxPad(),inventory, trap); if( success ) ui.PlayUISFX(eSFX_Press); @@ -669,7 +669,7 @@ bool LocalPlayer::openTrap(shared_ptr trap) return success; } -bool LocalPlayer::openTrading(shared_ptr traderTarget) +bool LocalPlayer::openTrading(std::shared_ptr traderTarget) { bool success = app.LoadTradingMenu(GetXboxPad(),inventory, traderTarget, level); if( success ) ui.PlayUISFX(eSFX_Press); @@ -677,23 +677,23 @@ bool LocalPlayer::openTrading(shared_ptr traderTarget) return success; } -void LocalPlayer::crit(shared_ptr e) +void LocalPlayer::crit(std::shared_ptr e) { - shared_ptr critParticle = shared_ptr( new CritParticle((Level *)minecraft->level, e) ); + std::shared_ptr critParticle = std::shared_ptr( new CritParticle((Level *)minecraft->level, e) ); critParticle->CritParticlePostConstructor(); minecraft->particleEngine->add(critParticle); } -void LocalPlayer::magicCrit(shared_ptr e) +void LocalPlayer::magicCrit(std::shared_ptr e) { - shared_ptr critParticle = shared_ptr( new CritParticle((Level *)minecraft->level, e, eParticleType_magicCrit) ); + std::shared_ptr critParticle = std::shared_ptr( new CritParticle((Level *)minecraft->level, e, eParticleType_magicCrit) ); critParticle->CritParticlePostConstructor(); minecraft->particleEngine->add(critParticle); } -void LocalPlayer::take(shared_ptr e, int orgCount) +void LocalPlayer::take(std::shared_ptr e, int orgCount) { - minecraft->particleEngine->add( shared_ptr( new TakeAnimationParticle((Level *)minecraft->level, e, shared_from_this(), -0.5f) ) ); + minecraft->particleEngine->add( std::shared_ptr( new TakeAnimationParticle((Level *)minecraft->level, e, shared_from_this(), -0.5f) ) ); } void LocalPlayer::chat(const wstring& message) @@ -761,7 +761,7 @@ void LocalPlayer::awardStat(Stat *stat, byteArray param) { #ifdef _DURANGO // 4J-JEV: Maybe we want to fine tune this later? #TODO - if ( !ProfileManager.IsGuest(GetXboxPad()) + if ( !ProfileManager.IsGuest(GetXboxPad()) && app.CanRecordStatsAndAchievements() && ProfileManager.IsFullVersion() ) @@ -840,7 +840,7 @@ void LocalPlayer::awardStat(Stat *stat, byteArray param) toolStats[0][2] = GenericStats::itemsCrafted(Item::shovel_iron->id); toolStats[0][3] = GenericStats::itemsCrafted(Item::shovel_diamond->id); toolStats[0][4] = GenericStats::itemsCrafted(Item::shovel_gold->id); - toolStats[1][0] = GenericStats::itemsCrafted(Item::pickAxe_wood->id); + toolStats[1][0] = GenericStats::itemsCrafted(Item::pickAxe_wood->id); toolStats[1][1] = GenericStats::itemsCrafted(Item::pickAxe_stone->id); toolStats[1][2] = GenericStats::itemsCrafted(Item::pickAxe_iron->id); toolStats[1][3] = GenericStats::itemsCrafted(Item::pickAxe_diamond->id); @@ -855,7 +855,7 @@ void LocalPlayer::awardStat(Stat *stat, byteArray param) toolStats[3][2] = GenericStats::itemsCrafted(Item::hoe_iron->id); toolStats[3][3] = GenericStats::itemsCrafted(Item::hoe_diamond->id); toolStats[3][4] = GenericStats::itemsCrafted(Item::hoe_gold->id); - + bool justCraftedTool = false; for (int i=0; i<4; i++) { @@ -893,7 +893,7 @@ void LocalPlayer::awardStat(Stat *stat, byteArray param) awardStat(GenericStats::MOARTools(), GenericStats::param_noArgs()); } } - + } #ifdef _XBOX @@ -977,7 +977,7 @@ void LocalPlayer::awardStat(Stat *stat, byteArray param) numEmeraldMined = pStats->getTotalValue(emeraldMined); numEmeraldBought = pStats->getTotalValue(emeraldBought); totalSum = numEmeraldMined + numEmeraldBought; - + app.DebugPrintf( "[AwardStat] Check unlock 'The Haggler': " "emerald_mined=%i, emerald_bought=%i, sum=%i.\n", @@ -1033,7 +1033,7 @@ void LocalPlayer::awardStat(Stat *stat, byteArray param) // AWARD : Rainbow Collection, collect all different colours of wool. { bool justPickedupWool = false; - + for (int i=0; i<16; i++) if ( stat == GenericStats::itemsCollected(Tile::cloth_Id, i) ) justPickedupWool = true; @@ -1041,7 +1041,7 @@ void LocalPlayer::awardStat(Stat *stat, byteArray param) if (justPickedupWool) { unsigned int woolCount = 0; - + for (unsigned int i = 0; i < 16; i++) { if (pStats->getTotalValue(GenericStats::itemsCollected(Tile::cloth_Id, i)) > 0) @@ -1152,7 +1152,7 @@ bool LocalPlayer::hasPermission(EGameCommand command) return level->getLevelData()->getAllowCommands(); } -void LocalPlayer::onCrafted(shared_ptr item) +void LocalPlayer::onCrafted(std::shared_ptr item) { if( minecraft->localgameModes[m_iPad] != NULL ) { @@ -1195,7 +1195,7 @@ void LocalPlayer::mapPlayerChunk(const unsigned int flagTileType) cout << "O"; else for (unsigned int y = 127; y > 0; y--) { - int t = cc->getTile(x,y,z); + int t = cc->getTile(x,y,z); if (flagTileType != 0 && t == flagTileType) { cout << "@"; break; } else if (t != 0 && t < 10) { cout << t; break; } else if (t > 0) { cout << "#"; break; } @@ -1229,7 +1229,7 @@ void LocalPlayer::handleMouseDown(int button, bool down) if( ( ( y == 0 ) || ( ( y == 127 ) && level->dimension->hasCeiling ) ) && level->dimension->id != 1 ) return; minecraft->gameMode->continueDestroyBlock(x, y, z, minecraft->hitResult->f); - + if(mayBuild(x,y,z)) { minecraft->particleEngine->crack(x, y, z, minecraft->hitResult->f); @@ -1267,7 +1267,7 @@ bool LocalPlayer::creativeModeHandleMouseClick(int button, bool buttonPressed) } // Get distance from last click point in each axis - float dX = (float)x - lastClickX; + float dX = (float)x - lastClickX; float dY = (float)y - lastClickY; float dZ = (float)z - lastClickZ; bool newClick = false; @@ -1415,13 +1415,13 @@ bool LocalPlayer::handleMouseClick(int button) bool returnItemPlaced = false; if (button == 0 && missTime > 0) return false; - if (button == 0) + if (button == 0) { //app.DebugPrintf("handleMouseClick - Player %d is swinging\n",GetXboxPad()); swing(); } - bool mayUse = true; + bool mayUse = true; // 4J-PB - Adding a special case in here for sleeping in a bed in a multiplayer game - we need to wake up, and we don't have the inbedchatscreen with a button @@ -1430,10 +1430,10 @@ bool LocalPlayer::handleMouseClick(int button) if(lastClickState == lastClick_oldRepeat) return false; - shared_ptr mplp = dynamic_pointer_cast( shared_from_this() ); + std::shared_ptr mplp = dynamic_pointer_cast( shared_from_this() ); if(mplp && mplp->connection) mplp->StopSleeping(); - + } // 4J Stu - We should not accept any input while asleep, except the above to wake up if(isSleeping() && level != NULL && level->isClientSide) @@ -1441,7 +1441,7 @@ bool LocalPlayer::handleMouseClick(int button) return false; } - shared_ptr oldItem = inventory->getSelected(); + std::shared_ptr oldItem = inventory->getSelected(); if (minecraft->hitResult == NULL) { @@ -1455,15 +1455,15 @@ bool LocalPlayer::handleMouseClick(int button) } if (button == 1) { - // 4J-PB - if we milk a cow here, and end up with a bucket of milk, the if (mayUse && button == 1) further down will + // 4J-PB - if we milk a cow here, and end up with a bucket of milk, the if (mayUse && button == 1) further down will // then empty our bucket if we're pointing at a tile - // It looks like interact really should be returning a result so we can check this, but it's possibly just the + // It looks like interact really should be returning a result so we can check this, but it's possibly just the // milk bucket that causes a problem if(minecraft->hitResult->entity->GetType()==eTYPE_COW) { // If I have an empty bucket in my hand, it's going to be filled with milk, so turn off mayUse - shared_ptr item = inventory->getSelected(); + std::shared_ptr item = inventory->getSelected(); if(item && (item->id==Item::bucket_empty_Id)) { mayUse=false; @@ -1493,7 +1493,7 @@ bool LocalPlayer::handleMouseClick(int button) } else { - shared_ptr item = oldItem; + std::shared_ptr item = oldItem; int oldCount = item != NULL ? item->count : 0; bool usedItem = false; if (minecraft->gameMode->useItemOn(minecraft->localplayers[GetXboxPad()], level, item, x, y, z, face, minecraft->hitResult->pos, false, &usedItem)) @@ -1525,7 +1525,7 @@ bool LocalPlayer::handleMouseClick(int button) if (mayUse && button == 1) { - shared_ptr item = inventory->getSelected(); + std::shared_ptr item = inventory->getSelected(); if (item != NULL) { if (minecraft->gameMode->useItem(minecraft->localplayers[GetXboxPad()], level, item)) @@ -1541,7 +1541,7 @@ void LocalPlayer::updateRichPresence() { if((m_iPad!=-1)/* && !ui.GetMenuDisplayed(m_iPad)*/ ) { - shared_ptr selectedItem = inventory->getSelected(); + std::shared_ptr selectedItem = inventory->getSelected(); if(selectedItem != NULL && selectedItem->id == Item::fishingRod_Id) { app.SetRichPresenceContext(m_iPad,CONTEXT_GAME_STATE_FISHING); @@ -1549,7 +1549,7 @@ void LocalPlayer::updateRichPresence() else if(selectedItem != NULL && selectedItem->id == Item::map_Id) { app.SetRichPresenceContext(m_iPad,CONTEXT_GAME_STATE_MAP); - } + } else if(riding != NULL && dynamic_pointer_cast(riding) != NULL) { app.SetRichPresenceContext(m_iPad,CONTEXT_GAME_STATE_RIDING_MINECART); @@ -1597,7 +1597,7 @@ float LocalPlayer::getAndResetChangeDimensionTimer() return returnVal; } -void LocalPlayer::handleCollectItem(shared_ptr item) +void LocalPlayer::handleCollectItem(std::shared_ptr item) { if(item != NULL) { diff --git a/Minecraft.Client/LocalPlayer.h b/Minecraft.Client/LocalPlayer.h index 865af154..e4c0142c 100644 --- a/Minecraft.Client/LocalPlayer.h +++ b/Minecraft.Client/LocalPlayer.h @@ -99,18 +99,18 @@ public: virtual void addAdditonalSaveData(CompoundTag *entityTag); virtual void readAdditionalSaveData(CompoundTag *entityTag); virtual void closeContainer(); - virtual void openTextEdit(shared_ptr sign); - virtual bool openContainer(shared_ptr container); // 4J added bool return + virtual void openTextEdit(std::shared_ptr sign); + virtual bool openContainer(std::shared_ptr container); // 4J added bool return virtual bool startCrafting(int x, int y, int z); // 4J added bool return virtual bool startEnchanting(int x, int y, int z); // 4J added bool return virtual bool startRepairing(int x, int y, int z); - virtual bool openFurnace(shared_ptr furnace); // 4J added bool return - virtual bool openBrewingStand(shared_ptr brewingStand); // 4J added bool return - virtual bool openTrap(shared_ptr trap); // 4J added bool return - virtual bool openTrading(shared_ptr traderTarget); - virtual void crit(shared_ptr e); - virtual void magicCrit(shared_ptr e); - virtual void take(shared_ptr e, int orgCount); + virtual bool openFurnace(std::shared_ptr furnace); // 4J added bool return + virtual bool openBrewingStand(std::shared_ptr brewingStand); // 4J added bool return + virtual bool openTrap(std::shared_ptr trap); // 4J added bool return + virtual bool openTrading(std::shared_ptr traderTarget); + virtual void crit(std::shared_ptr e); + virtual void magicCrit(std::shared_ptr e); + virtual void take(std::shared_ptr e, int orgCount); virtual void chat(const wstring& message); virtual bool isSneaking(); //virtual bool isIdle(); @@ -159,7 +159,7 @@ public: int lastClickState; // 4J Stu - Added to allow callback to tutorial to stay within Minecraft.Client - virtual void onCrafted(shared_ptr item); + virtual void onCrafted(std::shared_ptr item); virtual void setAndBroadcastCustomSkin(DWORD skinId); virtual void setAndBroadcastCustomCape(DWORD capeId); @@ -189,7 +189,7 @@ public: float getAndResetChangeDimensionTimer(); - virtual void handleCollectItem(shared_ptr item); + virtual void handleCollectItem(std::shared_ptr item); void SetPlayerAdditionalModelParts(vectorpAdditionalModelParts); private: diff --git a/Minecraft.Client/MinecartModel.cpp b/Minecraft.Client/MinecartModel.cpp index 8a1ce0d7..d4ff04c0 100644 --- a/Minecraft.Client/MinecartModel.cpp +++ b/Minecraft.Client/MinecartModel.cpp @@ -18,22 +18,22 @@ MinecartModel::MinecartModel() : Model() cubes[0]->addBox((float)(-w / 2), (float)(-h / 2), -1, w, h, 2, 0); cubes[0]->setPos(0, (float)(0 + yOff), 0); - + cubes[5]->addBox((float)(-w / 2 + 1), (float)(-h / 2 + 1), -1, w - 2, h - 2, 1, 0); cubes[5]->setPos(0, (float)(0 + yOff), 0); - + cubes[1]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[1]->setPos((float)(-w / 2 + 1), (float)(0 + yOff), 0); - + cubes[2]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[2]->setPos((float)(+w / 2 - 1), (float)(0 + yOff), 0); - + cubes[3]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[3]->setPos(0, (float)(0 + yOff), (float)(-h / 2 + 1)); - + cubes[4]->addBox((float)(-w / 2 + 2), (float)(-d - 1), -1, w - 4, d, 2, 0); cubes[4]->setPos(0, (float)(0 + yOff), (float)(+h / 2 - 1)); - + cubes[0]->xRot = PI / 2; cubes[1]->yRot = PI / 2 * 3; cubes[2]->yRot = PI / 2 * 1; @@ -47,7 +47,7 @@ MinecartModel::MinecartModel() : Model() } } -void MinecartModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void MinecartModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { cubes[5]->y = 4 - bob; for (int i = 0; i < MINECART_LENGTH; i++) diff --git a/Minecraft.Client/MinecartModel.h b/Minecraft.Client/MinecartModel.h index de925566..2cf6d0ef 100644 --- a/Minecraft.Client/MinecartModel.h +++ b/Minecraft.Client/MinecartModel.h @@ -9,5 +9,5 @@ public: ModelPart *cubes[MINECART_LENGTH]; MinecartModel(); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); }; diff --git a/Minecraft.Client/MinecartRenderer.cpp b/Minecraft.Client/MinecartRenderer.cpp index 1fa4a1d9..cd274992 100644 --- a/Minecraft.Client/MinecartRenderer.cpp +++ b/Minecraft.Client/MinecartRenderer.cpp @@ -10,10 +10,10 @@ MinecartRenderer::MinecartRenderer() model = new MinecartModel(); } -void MinecartRenderer::render(shared_ptr _cart, double x, double y, double z, float rot, float a) +void MinecartRenderer::render(std::shared_ptr _cart, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr cart = dynamic_pointer_cast(_cart); + std::shared_ptr cart = dynamic_pointer_cast(_cart); glPushMatrix(); diff --git a/Minecraft.Client/MinecartRenderer.h b/Minecraft.Client/MinecartRenderer.h index 0335ba8d..6902a3bf 100644 --- a/Minecraft.Client/MinecartRenderer.h +++ b/Minecraft.Client/MinecartRenderer.h @@ -8,5 +8,5 @@ protected: public: MinecartRenderer(); - void render(shared_ptr _cart, double x, double y, double z, float rot, float a); + void render(std::shared_ptr _cart, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index aef61677..315eb52b 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -977,7 +977,7 @@ bool Minecraft::addLocalPlayer(int idx) if(success) { app.DebugPrintf("Adding temp local player on pad %d\n", idx); - localplayers[idx] = shared_ptr( new MultiplayerLocalPlayer(this, level, user, NULL ) ); + localplayers[idx] = std::shared_ptr( new MultiplayerLocalPlayer(this, level, user, NULL ) ); localgameModes[idx] = NULL; updatePlayerViewportAssignments(); @@ -1025,7 +1025,7 @@ void Minecraft::addPendingLocalConnection(int idx, ClientConnection *connection) m_pendingLocalConnections[idx] = connection; } -shared_ptr Minecraft::createExtraLocalPlayer(int idx, const wstring& name, int iPad, int iDimension, ClientConnection *clientConnection /*= NULL*/,MultiPlayerLevel *levelpassedin) +std::shared_ptr Minecraft::createExtraLocalPlayer(int idx, const wstring& name, int iPad, int iDimension, ClientConnection *clientConnection /*= NULL*/,MultiPlayerLevel *levelpassedin) { if( clientConnection == NULL) return nullptr; @@ -1141,7 +1141,7 @@ void Minecraft::removeLocalPlayerIdx(int idx) { if( getLevel( localplayers[idx]->dimension )->isClientSide ) { - shared_ptr mplp = localplayers[idx]; + std::shared_ptr mplp = localplayers[idx]; ( (MultiPlayerLevel *)getLevel( localplayers[idx]->dimension ) )->removeClientConnection(mplp->connection, true); delete mplp->connection; mplp->connection = NULL; @@ -1163,7 +1163,7 @@ void Minecraft::removeLocalPlayerIdx(int idx) } else if( m_pendingLocalConnections[idx] != NULL ) { - m_pendingLocalConnections[idx]->sendAndDisconnect( shared_ptr( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) );; + m_pendingLocalConnections[idx]->sendAndDisconnect( std::shared_ptr( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) );; delete m_pendingLocalConnections[idx]; m_pendingLocalConnections[idx] = NULL; g_NetworkManager.RemoveLocalPlayerByUserIndex(idx); @@ -1676,7 +1676,7 @@ void Minecraft::run_middle() else { // create the localplayer - shared_ptr player = localplayers[i]; + std::shared_ptr player = localplayers[i]; if( player == NULL) { player = createExtraLocalPlayer(i, (convStringToWstring( ProfileManager.GetGamertag(i) )).c_str(), i, level->dimension->id); @@ -1892,7 +1892,7 @@ void Minecraft::run_middle() // if (pause) timer.a = 1; PIXBeginNamedEvent(0,"Sound engine update"); - soundEngine->tick((shared_ptr *)localplayers, timer->a); + soundEngine->tick((std::shared_ptr *)localplayers, timer->a); PIXEndNamedEvent(); PIXBeginNamedEvent(0,"Light update"); @@ -2427,7 +2427,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) else { // no hit result, but we may have something in our hand that we can do something with - shared_ptr itemInstance = player->inventory->getSelected(); + std::shared_ptr itemInstance = player->inventory->getSelected(); // 4J-JEV: Moved all this here to avoid having it in 3 different places. if (itemInstance) @@ -2798,14 +2798,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) // is there an object in hand? if(player->inventory->IsHeldItem()) { - shared_ptr heldItem=player->inventory->getSelected(); + std::shared_ptr heldItem=player->inventory->getSelected(); int iID=heldItem->getItem()->id; switch(iID) { default: { - shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -2822,7 +2822,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) // is there an object in hand? if(player->inventory->IsHeldItem()) { - shared_ptr heldItem=player->inventory->getSelected(); + std::shared_ptr heldItem=player->inventory->getSelected(); int iID=heldItem->getItem()->id; // It's an item @@ -2834,7 +2834,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; default: { - shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -2851,7 +2851,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT; - shared_ptr heldItem=player->inventory->getSelected(); + std::shared_ptr heldItem=player->inventory->getSelected(); int iID=heldItem->getItem()->id; // It's an item @@ -2865,13 +2865,13 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) case Item::shears_Id: { if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT; - shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby()) *piUse=IDS_TOOLTIPS_SHEAR; } break; default: { - shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -2924,7 +2924,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) // is there an object in hand? if(player->inventory->IsHeldItem()) { - shared_ptr heldItem=player->inventory->getSelected(); + std::shared_ptr heldItem=player->inventory->getSelected(); int iID=heldItem->getItem()->id; if(iID==Item::coal->id) @@ -2946,14 +2946,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT; if(player->inventory->IsHeldItem()) { - shared_ptr heldItem=player->inventory->getSelected(); + std::shared_ptr heldItem=player->inventory->getSelected(); int iID=heldItem->getItem()->id; switch(iID) { case Item::dye_powder_Id: { - shared_ptr sheep = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr sheep = dynamic_pointer_cast(hitResult->entity); // convert to tile-based color value (0 is white instead of black) int newColor = ClothTile::getTileDataForItemAuxValue(heldItem->getAuxValue()); @@ -2966,7 +2966,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; case Item::shears_Id: { - shared_ptr sheep = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr sheep = dynamic_pointer_cast(hitResult->entity); // can only shear a sheep that hasn't been sheared if(!sheep->isSheared() ) @@ -2978,7 +2978,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; default: { - shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -3008,7 +3008,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { if(player->inventory->IsHeldItem()) { - shared_ptr heldItem=player->inventory->getSelected(); + std::shared_ptr heldItem=player->inventory->getSelected(); int iID=heldItem->getItem()->id; switch(iID) @@ -3018,7 +3018,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; default: { - shared_ptr animal = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr animal = dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby() && !animal->isInLove() && (animal->getAge() == 0) && animal->isFood(heldItem)) { @@ -3036,8 +3036,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) // can be tamed, fed, and made to sit/stand, or enter love mode { int iID=-1; - shared_ptr heldItem=nullptr; - shared_ptr wolf = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr heldItem=nullptr; + std::shared_ptr wolf = dynamic_pointer_cast(hitResult->entity); if(player->inventory->IsHeldItem()) { @@ -3126,8 +3126,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) case eTYPE_OZELOT: { int iID=-1; - shared_ptr heldItem=nullptr; - shared_ptr ocelot = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr heldItem=nullptr; + std::shared_ptr ocelot = dynamic_pointer_cast(hitResult->entity); if(player->inventory->IsHeldItem()) { @@ -3188,7 +3188,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) case eTYPE_PLAYER: { // Fix for #58576 - TU6: Content: Gameplay: Hit button prompt is available when attacking a host who has "Invisible" option turned on - shared_ptr TargetPlayer = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr TargetPlayer = dynamic_pointer_cast(hitResult->entity); if(!TargetPlayer->hasInvisiblePrivilege()) // This means they are invisible, not just that they have the privilege { @@ -3201,7 +3201,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; case eTYPE_ITEM_FRAME: { - shared_ptr itemFrame = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr itemFrame = dynamic_pointer_cast(hitResult->entity); // is the frame occupied? if(itemFrame->getItem()!=NULL) @@ -3223,7 +3223,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; case eTYPE_VILLAGER: { - shared_ptr villager = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr villager = dynamic_pointer_cast(hitResult->entity); if (!villager->isBaby()) { *piUse=IDS_TOOLTIPS_TRADE; @@ -3233,8 +3233,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; case eTYPE_ZOMBIE: { - shared_ptr zomb = dynamic_pointer_cast(hitResult->entity); - shared_ptr heldItem=nullptr; + std::shared_ptr zomb = dynamic_pointer_cast(hitResult->entity); + std::shared_ptr heldItem=nullptr; if(player->inventory->IsHeldItem()) { @@ -3470,9 +3470,9 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if((player->ullButtonsPressed&(1LL< mob = dynamic_pointer_cast(Creeper::_class->newInstance( level )); - //shared_ptr mob = dynamic_pointer_cast(Wolf::_class->newInstance( level )); - shared_ptr mob = dynamic_pointer_cast(shared_ptr(new Spider( level ))); + //std::shared_ptr mob = dynamic_pointer_cast(Creeper::_class->newInstance( level )); + //std::shared_ptr mob = dynamic_pointer_cast(Wolf::_class->newInstance( level )); + std::shared_ptr mob = dynamic_pointer_cast(std::shared_ptr(new Spider( level ))); mob->moveTo(player->x+1, player->y, player->z+1, level->random->nextFloat() * 360, 0); level->addEntity(mob); } @@ -3502,14 +3502,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if((player->ullButtonsPressed&(1LL<isInputAllowed(MINECRAFT_ACTION_INVENTORY)) { - shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->player ); + std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->player ); ui.PlayUISFX(eSFX_Press); app.LoadInventoryMenu(iPad,player); } if((player->ullButtonsPressed&(1LL<isInputAllowed(MINECRAFT_ACTION_CRAFTING)) { - shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->player ); + std::shared_ptr player = dynamic_pointer_cast( Minecraft::GetInstance()->player ); // 4J-PB - reordered the if statement so creative mode doesn't bring up the crafting table // Fix for #39014 - TU5: Creative Mode: Pressing X to access the creative menu while looking at a crafting table causes the crafting menu to display @@ -3573,7 +3573,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if( selected || wheel != 0 || (player->ullButtonsPressed&(1LL< selectedItem = player->getSelectedItem(); + std::shared_ptr selectedItem = player->getSelectedItem(); // Dropping items happens over network, so if we only have one then assume that we dropped it and should hide the item int iCount=0; @@ -3841,7 +3841,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) setLocalPlayerIdx(idx); gameRenderer->setupCamera(timer->a, i); Camera::prepare(localplayers[idx], localplayers[idx]->ThirdPersonView() == 2); - shared_ptr cameraEntity = cameraTargetPlayer; + std::shared_ptr cameraEntity = cameraTargetPlayer; double xOff = cameraEntity->xOld + (cameraEntity->x - cameraEntity->xOld) * timer->a; double yOff = cameraEntity->yOld + (cameraEntity->y - cameraEntity->yOld) * timer->a; double zOff = cameraEntity->zOld + (cameraEntity->z - cameraEntity->zOld) * timer->a; @@ -3967,7 +3967,7 @@ MultiPlayerLevel *Minecraft::getLevel(int dimension) //} // Also causing ambiguous call for some reason -// as it is matching shared_ptr from the func below with bool from this one +// as it is matching std::shared_ptr from the func below with bool from this one //void Minecraft::setLevel(Level *level, const wstring& message, bool doForceStatsSave /*= true*/) //{ // setLevel(level, message, NULL, doForceStatsSave); @@ -3981,7 +3981,7 @@ void Minecraft::forceaddLevel(MultiPlayerLevel *level) else levels[0] = level; } -void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_ptr forceInsertPlayer /*=NULL*/, bool doForceStatsSave /*=true*/, bool bPrimaryPlayerSignedOut /*=false*/) +void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, std::shared_ptr forceInsertPlayer /*=NULL*/, bool doForceStatsSave /*=true*/, bool bPrimaryPlayerSignedOut /*=false*/) { EnterCriticalSection(&m_setLevelCS); bool playerAdded = false; @@ -4046,7 +4046,7 @@ void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_pt // Delete all the player objects for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) { - shared_ptr mplp = localplayers[idx]; + std::shared_ptr mplp = localplayers[idx]; if(mplp != NULL && mplp->connection != NULL ) { delete mplp->connection; @@ -4293,7 +4293,7 @@ wstring Minecraft::gatherStats4() void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId) { gameRenderer->DisableUpdateThread(); // 4J - don't do updating whilst we are adjusting the player & localplayer array - shared_ptr localPlayer = localplayers[iPad]; + std::shared_ptr localPlayer = localplayers[iPad]; level->validateSpawn(); level->removeAllPendingEntityRemovals(); @@ -4304,7 +4304,7 @@ void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId) level->removeEntity(localPlayer); } - shared_ptr oldPlayer = localPlayer; + std::shared_ptr oldPlayer = localPlayer; cameraTargetPlayer = nullptr; // 4J-PB - copy and set the players xbox pad @@ -4692,7 +4692,7 @@ bool mayUse = true; if(button==1 && (player->isSleeping() && level != NULL && level->isClientSide)) { -shared_ptr mplp = dynamic_pointer_cast( player ); +std::shared_ptr mplp = dynamic_pointer_cast( player ); if(mplp) mplp->StopSleeping(); @@ -4741,7 +4741,7 @@ gameMode->startDestroyBlock(x, y, z, hitResult->f); } else { -shared_ptr item = player->inventory->getSelected(); +std::shared_ptr item = player->inventory->getSelected(); int oldCount = item != NULL ? item->count : 0; if (gameMode->useItemOn(player, level, item, x, y, z, face)) { @@ -4767,7 +4767,7 @@ gameRenderer->itemInHandRenderer->itemPlaced(); if (mayUse && button == 1) { -shared_ptr item = player->inventory->getSelected(); +std::shared_ptr item = player->inventory->getSelected(); if (item != NULL) { if (gameMode->useItem(player, level, item)) @@ -4854,7 +4854,7 @@ void Minecraft::inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasP else if( ProfileManager.IsSignedInLive(iPad) && ProfileManager.AllowedToPlayMultiplayer(iPad) ) { // create the local player for the iPad - shared_ptr player = pClass->localplayers[iPad]; + std::shared_ptr player = pClass->localplayers[iPad]; if( player == NULL) { if( pClass->level->isClientSide ) @@ -4864,7 +4864,7 @@ void Minecraft::inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasP else { // create the local player for the iPad - shared_ptr player = pClass->localplayers[iPad]; + std::shared_ptr player = pClass->localplayers[iPad]; if( player == NULL) { player = pClass->createExtraLocalPlayer(iPad, (convStringToWstring( ProfileManager.GetGamertag(iPad) )).c_str(), iPad, pClass->level->dimension->id); @@ -4935,7 +4935,7 @@ int Minecraft::InGame_SignInReturned(void *pParam,bool bContinue, int iPad) else { // create the local player for the iPad - shared_ptr player = pMinecraftClass->localplayers[iPad]; + std::shared_ptr player = pMinecraftClass->localplayers[iPad]; if( player == NULL) { player = pMinecraftClass->createExtraLocalPlayer(iPad, (convStringToWstring( ProfileManager.GetGamertag(iPad) )).c_str(), iPad, pMinecraftClass->level->dimension->id); @@ -4964,7 +4964,7 @@ void Minecraft::tickAllConnections() int oldIdx = getLocalPlayerIdx(); for(unsigned int i = 0; i < XUSER_MAX_COUNT; i++ ) { - shared_ptr mplp = localplayers[i]; + std::shared_ptr mplp = localplayers[i]; if( mplp && mplp->connection) { setLocalPlayerIdx(i); diff --git a/Minecraft.Client/Minecraft.h b/Minecraft.Client/Minecraft.h index 2e943de7..cbe13e09 100644 --- a/Minecraft.Client/Minecraft.h +++ b/Minecraft.Client/Minecraft.h @@ -90,11 +90,11 @@ public: MultiPlayerLevel *level; LevelRenderer *levelRenderer; - shared_ptr player; + std::shared_ptr player; MultiPlayerLevelArray levels; - shared_ptr localplayers[XUSER_MAX_COUNT]; + std::shared_ptr localplayers[XUSER_MAX_COUNT]; MultiPlayerGameMode *localgameModes[XUSER_MAX_COUNT]; int localPlayerIdx; ItemInHandRenderer *localitemInHandRenderers[XUSER_MAX_COUNT]; @@ -110,7 +110,7 @@ public: void addPendingLocalConnection(int idx, ClientConnection *connection); void connectionDisconnected(int idx, DisconnectPacket::eDisconnectReason reason) { m_connectionFailed[idx] = true; m_connectionFailedReason[idx] = reason; } - shared_ptr createExtraLocalPlayer(int idx, const wstring& name, int pad, int iDimension, ClientConnection *clientConnection = NULL,MultiPlayerLevel *levelpassedin=NULL); + std::shared_ptr createExtraLocalPlayer(int idx, const wstring& name, int pad, int iDimension, ClientConnection *clientConnection = NULL,MultiPlayerLevel *levelpassedin=NULL); void createPrimaryLocalPlayer(int iPad); bool setLocalPlayerIdx(int idx); int getLocalPlayerIdx(); @@ -119,7 +119,7 @@ public: void updatePlayerViewportAssignments(); int unoccupiedQuadrant; // 4J - added - shared_ptr cameraTargetPlayer; + std::shared_ptr cameraTargetPlayer; ParticleEngine *particleEngine; User *user; wstring serverDomain; @@ -276,7 +276,7 @@ public: // 4J Stu - Added the doForceStatsSave param //void setLevel(Level *level, bool doForceStatsSave = true); //void setLevel(Level *level, const wstring& message, bool doForceStatsSave = true); - void setLevel(MultiPlayerLevel *level, int message = -1, shared_ptr forceInsertPlayer = nullptr, bool doForceStatsSave = true,bool bPrimaryPlayerSignedOut=false); + void setLevel(MultiPlayerLevel *level, int message = -1, std::shared_ptr forceInsertPlayer = nullptr, bool doForceStatsSave = true,bool bPrimaryPlayerSignedOut=false); // 4J-PB - added to force in the 'other' level when the main player creates the level at game load time void forceaddLevel(MultiPlayerLevel *level); void prepareLevel(int title); // 4J - changed to public diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index a57b798b..b94330d7 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -395,7 +395,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring if( app.GetGameHostOption(eGameHostOption_BonusChest ) ) levelSettings->enableStartingBonusItems(); // 4J - temp - load existing level - shared_ptr storage = nullptr; + std::shared_ptr storage = nullptr; bool levelChunksNeedConverted = false; if( initData->saveData != NULL ) { @@ -413,7 +413,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring levelChunksNeedConverted = true; pSave->ConvertToLocalPlatform(); // check if we need to convert this file from PS3->PS4 - storage = shared_ptr(new McRegionLevelStorage(pSave, File(L"."), name, true)); + storage = std::shared_ptr(new McRegionLevelStorage(pSave, File(L"."), name, true)); } else { @@ -438,9 +438,9 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring newFormatSave = new ConsoleSaveFileSplit( L"" ); } - storage = shared_ptr(new McRegionLevelStorage(newFormatSave, File(L"."), name, true)); + storage = std::shared_ptr(new McRegionLevelStorage(newFormatSave, File(L"."), name, true)); #else - storage = shared_ptr(new McRegionLevelStorage(new ConsoleSaveFileOriginal( L"" ), File(L"."), name, true)); + storage = std::shared_ptr(new McRegionLevelStorage(new ConsoleSaveFileOriginal( L"" ), File(L"."), name, true)); #endif } @@ -1245,7 +1245,7 @@ void MinecraftServer::run(int64_t seed, void *lpParameter) players->saveAll(Minecraft::GetInstance()->progressRenderer); } - players->broadcastAll( shared_ptr( new UpdateProgressPacket(20) ) ); + players->broadcastAll( std::shared_ptr( new UpdateProgressPacket(20) ) ); for (unsigned int j = 0; j < levels.length; j++) { @@ -1256,7 +1256,7 @@ void MinecraftServer::run(int64_t seed, void *lpParameter) ServerLevel *level = levels[levels.length - 1 - j]; level->save(true, Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame)); - players->broadcastAll( shared_ptr( new UpdateProgressPacket(33 + (j*33) ) ) ); + players->broadcastAll( std::shared_ptr( new UpdateProgressPacket(33 + (j*33) ) ) ); } if( !s_bServerHalted ) { @@ -1269,16 +1269,16 @@ void MinecraftServer::run(int64_t seed, void *lpParameter) case eXuiServerAction_DropItem: // Find the player, and drop the id at their feet { - shared_ptr player = players->players.at(0); + std::shared_ptr player = players->players.at(0); size_t id = (size_t) param; - player->drop( shared_ptr( new ItemInstance(id, 1, 0 ) ) ); + player->drop( std::shared_ptr( new ItemInstance(id, 1, 0 ) ) ); } break; case eXuiServerAction_SpawnMob: { - shared_ptr player = players->players.at(0); + std::shared_ptr player = players->players.at(0); eINSTANCEOF factory = (eINSTANCEOF)((size_t)param); - shared_ptr mob = dynamic_pointer_cast(EntityIO::newByEnumType(factory,player->level )); + std::shared_ptr mob = dynamic_pointer_cast(EntityIO::newByEnumType(factory,player->level )); mob->moveTo(player->x+1, player->y, player->z+1, player->level->random->nextFloat() * 360, 0); mob->setDespawnProtected(); // 4J added, default to being protected against despawning (has to be done after initial position is set) player->level->addEntity(mob); @@ -1306,20 +1306,20 @@ void MinecraftServer::run(int64_t seed, void *lpParameter) } break; case eXuiServerAction_ServerSettingChanged_Gamertags: - players->broadcastAll( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_OPTIONS, app.GetGameHostOption(eGameHostOption_Gamertags)) ) ); + players->broadcastAll( std::shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_OPTIONS, app.GetGameHostOption(eGameHostOption_Gamertags)) ) ); break; case eXuiServerAction_ServerSettingChanged_BedrockFog: - players->broadcastAll( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, app.GetGameHostOption(eGameHostOption_All)) ) ); + players->broadcastAll( std::shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, app.GetGameHostOption(eGameHostOption_All)) ) ); break; case eXuiServerAction_ServerSettingChanged_Difficulty: - players->broadcastAll( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_DIFFICULTY, Minecraft::GetInstance()->options->difficulty) ) ); + players->broadcastAll( std::shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_DIFFICULTY, Minecraft::GetInstance()->options->difficulty) ) ); break; case eXuiServerAction_ExportSchematic: #ifndef _CONTENT_PACKAGE app.EnterSaveNotificationSection(); - //players->broadcastAll( shared_ptr( new UpdateProgressPacket(20) ) ); + //players->broadcastAll( std::shared_ptr( new UpdateProgressPacket(20) ) ); if( !s_bServerHalted ) { @@ -1357,7 +1357,7 @@ void MinecraftServer::run(int64_t seed, void *lpParameter) pos->m_yRot, pos->m_elev ); - shared_ptr player = players->players.at(pos->player); + std::shared_ptr player = players->players.at(pos->player); player->debug_setPosition( pos->m_camX, pos->m_camY, pos->m_camZ, pos->m_yRot, pos->m_elev ); @@ -1414,14 +1414,14 @@ void MinecraftServer::run(int64_t seed, void *lpParameter) void MinecraftServer::broadcastStartSavingPacket() { - players->broadcastAll( shared_ptr( new GameEventPacket(GameEventPacket::START_SAVING, 0) ) );; + players->broadcastAll( std::shared_ptr( new GameEventPacket(GameEventPacket::START_SAVING, 0) ) );; } void MinecraftServer::broadcastStopSavingPacket() { if( !s_bServerHalted ) { - players->broadcastAll( shared_ptr( new GameEventPacket(GameEventPacket::STOP_SAVING, 0) ) );; + players->broadcastAll( std::shared_ptr( new GameEventPacket(GameEventPacket::STOP_SAVING, 0) ) );; } } @@ -1456,7 +1456,7 @@ void MinecraftServer::tick() /* if(m_lastSentDifficulty != pMinecraft->options->difficulty) { m_lastSentDifficulty = pMinecraft->options->difficulty; - players->broadcastAll( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_DIFFICULTY, pMinecraft->options->difficulty) ) ); + players->broadcastAll( std::shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_DIFFICULTY, pMinecraft->options->difficulty) ) ); }*/ for (unsigned int i = 0; i < levels.length; i++) @@ -1476,7 +1476,7 @@ void MinecraftServer::tick() if (tickCount % 20 == 0) { - players->broadcastAll( shared_ptr( new SetTimePacket(level->getTime() ) ), level->dimension->id); + players->broadcastAll( std::shared_ptr( new SetTimePacket(level->getTime() ) ), level->dimension->id); } // #ifndef __PS3__ static int64_t stc = 0; diff --git a/Minecraft.Client/Minimap.cpp b/Minecraft.Client/Minimap.cpp index c18cd267..88552b01 100644 --- a/Minecraft.Client/Minimap.cpp +++ b/Minecraft.Client/Minimap.cpp @@ -85,7 +85,7 @@ void Minimap::reloadColours() LUT[i] = 255 << 24 | r << 16 | g << 8 | b; #elif defined __ORBIS__ r >>= 3; g >>= 3; b >>= 3; - LUT[i] = 1 << 15 | ( r << 10 ) | ( g << 5 ) | b; + LUT[i] = 1 << 15 | ( r << 10 ) | ( g << 5 ) | b; #else LUT[i] = r << 24 | g << 16 | b << 8 | 255; #endif @@ -98,7 +98,7 @@ void Minimap::reloadColours() } // 4J added entityId -void Minimap::render(shared_ptr player, Textures *textures, shared_ptr data, int entityId) +void Minimap::render(std::shared_ptr player, Textures *textures, std::shared_ptr data, int entityId) { // 4J - only update every 8 renders, as an optimisation // We don't want to use this for ItemFrame renders of maps, as then we can't have different maps together @@ -203,7 +203,7 @@ void Minimap::render(shared_ptr player, Textures *textures, shared_ptrimg; imgIndex -= 16; @@ -253,7 +253,7 @@ void Minimap::render(shared_ptr player, Textures *textures, shared_ptry); int posz = floor(player->z); swprintf(playerPosText, 32, L"X: %d, Y: %d, Z: %d", posx, posy, posz); - + font->draw(playerPosText, x, y, Minecraft::GetInstance()->getColourTable()->getColour(eMinecraftColour_Map_Text)); } //#endif diff --git a/Minecraft.Client/Minimap.h b/Minecraft.Client/Minimap.h index 758d8a8a..6b4776f9 100644 --- a/Minecraft.Client/Minimap.h +++ b/Minecraft.Client/Minimap.h @@ -31,5 +31,5 @@ private: public: Minimap(Font *font, Options *options, Textures *textures, bool optimised = true); // 4J Added optimised param static void reloadColours(); - void render(shared_ptr player, Textures *textures, shared_ptr data, int entityId); // 4J added entityId param + void render(std::shared_ptr player, Textures *textures, std::shared_ptr data, int entityId); // 4J added entityId param }; diff --git a/Minecraft.Client/MobRenderer.cpp b/Minecraft.Client/MobRenderer.cpp index 8874ab9c..7399f2c2 100644 --- a/Minecraft.Client/MobRenderer.cpp +++ b/Minecraft.Client/MobRenderer.cpp @@ -31,11 +31,11 @@ float MobRenderer::rotlerp(float from, float to, float a) return from + a * diff; } -void MobRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void MobRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { // 4J - added - this used to use generics so the input parameter could be a mob (or derived type), but we aren't // able to do that so dynamically casting to get the more specific type here. - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); glPushMatrix(); glDisable(GL_CULL_FACE); @@ -54,7 +54,7 @@ void MobRenderer::render(shared_ptr _mob, double x, double y, double z, if (mob->isRiding() && dynamic_pointer_cast(mob->riding)) { - shared_ptr riding = dynamic_pointer_cast(mob->riding); + std::shared_ptr riding = dynamic_pointer_cast(mob->riding); bodyRot = rotlerp(riding->yBodyRotO, riding->yBodyRot, a); float headDiff = Mth::wrapDegrees(headRot - bodyRot); @@ -233,9 +233,9 @@ void MobRenderer::render(shared_ptr _mob, double x, double y, double z, MemSect(0); } -void MobRenderer::renderModel(shared_ptr mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale) +void MobRenderer::renderModel(std::shared_ptr mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale) { - shared_ptr player = dynamic_pointer_cast(Minecraft::GetInstance()->player); + std::shared_ptr player = dynamic_pointer_cast(Minecraft::GetInstance()->player); bindTexture(mob->customTextureUrl, mob->getTexture()); if (!mob->isInvisible()) @@ -262,15 +262,15 @@ void MobRenderer::renderModel(shared_ptr mob, float wp, float ws, float } } -void MobRenderer::setupPosition(shared_ptr mob, double x, double y, double z) +void MobRenderer::setupPosition(std::shared_ptr mob, double x, double y, double z) { glTranslatef((float) x, (float) y, (float) z); } -void MobRenderer::setupRotations(shared_ptr mob, float bob, float bodyRot, float a) +void MobRenderer::setupRotations(std::shared_ptr mob, float bob, float bodyRot, float a) { glRotatef(180 - bodyRot, 0, 1, 0); - if (mob->deathTime > 0) + if (mob->deathTime > 0) { float fall = (mob->deathTime + a - 1) / 20.0f * 1.6f; fall = (float)sqrt(fall); @@ -279,49 +279,49 @@ void MobRenderer::setupRotations(shared_ptr mob, float bob, float bodyRot, } } -float MobRenderer::getAttackAnim(shared_ptr mob, float a) +float MobRenderer::getAttackAnim(std::shared_ptr mob, float a) { return mob->getAttackAnim(a); } -float MobRenderer::getBob(shared_ptr mob, float a) +float MobRenderer::getBob(std::shared_ptr mob, float a) { return (mob->tickCount + a); } -void MobRenderer::additionalRendering(shared_ptr mob, float a) +void MobRenderer::additionalRendering(std::shared_ptr mob, float a) { } -int MobRenderer::prepareArmorOverlay(shared_ptr mob, int layer, float a) +int MobRenderer::prepareArmorOverlay(std::shared_ptr mob, int layer, float a) { return prepareArmor(mob, layer, a); } -int MobRenderer::prepareArmor(shared_ptr mob, int layer, float a) +int MobRenderer::prepareArmor(std::shared_ptr mob, int layer, float a) { return -1; } -void MobRenderer::prepareSecondPassArmor(shared_ptr mob, int layer, float a) +void MobRenderer::prepareSecondPassArmor(std::shared_ptr mob, int layer, float a) { } -float MobRenderer::getFlipDegrees(shared_ptr mob) +float MobRenderer::getFlipDegrees(std::shared_ptr mob) { return 90; } -int MobRenderer::getOverlayColor(shared_ptr mob, float br, float a) +int MobRenderer::getOverlayColor(std::shared_ptr mob, float br, float a) { return 0; } -void MobRenderer::scale(shared_ptr mob, float a) +void MobRenderer::scale(std::shared_ptr mob, float a) { } -void MobRenderer::renderName(shared_ptr mob, double x, double y, double z) +void MobRenderer::renderName(std::shared_ptr mob, double x, double y, double z) { if (Minecraft::renderDebug()) { @@ -330,7 +330,7 @@ void MobRenderer::renderName(shared_ptr mob, double x, double y, double z) } // 4J Added parameter for color here so that we can colour players names -void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName, double x, double y, double z, int maxDist, int color /*= 0xffffffff*/) +void MobRenderer::renderNameTag(std::shared_ptr mob, const wstring& OriginalName, double x, double y, double z, int maxDist, int color /*= 0xffffffff*/) { if ( app.GetGameSettings(eGameSetting_DisplayHUD)==0 ) @@ -390,13 +390,13 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName if( textOpacity < 0.0f ) textOpacity = 0.0f; if( textOpacity > 1.0f ) textOpacity = 1.0f; - + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); Tesselator *t = Tesselator::getInstance(); int offs = 0; - shared_ptr player = dynamic_pointer_cast(mob); + std::shared_ptr player = dynamic_pointer_cast(mob); if (player != NULL && app.isXuidDeadmau5( player->getXuid() ) ) offs = -10; wstring playerName; @@ -415,7 +415,7 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName else { memset(wchName,0,sizeof(WCHAR)*2); - swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1); + swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1); playerName=wchName; player->SetPlayerNameValidState(false); } @@ -425,8 +425,8 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName break; case Player::ePlayerNameValid_False: memset(wchName,0,sizeof(WCHAR)*2); - swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1); - playerName=wchName; + swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1); + playerName=wchName; break; } @@ -459,7 +459,7 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName t->vertex((float)(+w + 1), (float)( +8 + offs + 1), (float)( 0)); t->vertex((float)(+w + 1), (float)( -1 + offs), (float)( 0)); t->end(); - + glEnable(GL_DEPTH_TEST); glDepthMask(true); glDepthFunc(GL_ALWAYS); @@ -479,7 +479,7 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName glEnable(GL_TEXTURE_2D); font->draw(playerName, -font->width(playerName) / 2, offs, 0x20ffffff); glEnable(GL_DEPTH_TEST); - + glDepthMask(true); } @@ -495,10 +495,10 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName t->vertex((float)(-w - 1), (float)( +8 + offs), (float)( 0)); t->vertex((float)(+w + 1), (float)( +8 + offs), (float)( 0)); t->vertex((float)(+w + 1), (float)( -1 + offs), (float)( 0)); - t->end(); + t->end(); glDepthFunc(GL_LEQUAL); glEnable(GL_TEXTURE_2D); - + glTranslatef(0.0f, 0.0f, -0.04f); } @@ -507,7 +507,7 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName int textColor = ( ( (int)(textOpacity*255) << 24 ) | 0xffffff ); font->draw(playerName, -font->width(playerName) / 2, offs, textColor); } - + glEnable(GL_LIGHTING); glDisable(GL_BLEND); glColor4f(1, 1, 1, 1); diff --git a/Minecraft.Client/MobRenderer.h b/Minecraft.Client/MobRenderer.h index a8b2b93e..6a5df478 100644 --- a/Minecraft.Client/MobRenderer.h +++ b/Minecraft.Client/MobRenderer.h @@ -23,22 +23,22 @@ public: private: float rotlerp(float from, float to, float a); public: - virtual void render(shared_ptr mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr mob, double x, double y, double z, float rot, float a); protected: - virtual void renderModel(shared_ptr mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale); - virtual void setupPosition(shared_ptr mob, double x, double y, double z); - virtual void setupRotations(shared_ptr mob, float bob, float bodyRot, float a); - virtual float getAttackAnim(shared_ptr mob, float a); - virtual float getBob(shared_ptr mob, float a); - virtual void additionalRendering(shared_ptr mob, float a); - virtual int prepareArmorOverlay(shared_ptr mob, int layer, float a); - virtual int prepareArmor(shared_ptr mob, int layer, float a); - virtual void prepareSecondPassArmor(shared_ptr mob, int layer, float a); - virtual float getFlipDegrees(shared_ptr mob); - virtual int getOverlayColor(shared_ptr mob, float br, float a); - virtual void scale(shared_ptr mob, float a); - virtual void renderName(shared_ptr mob, double x, double y, double z); - virtual void renderNameTag(shared_ptr mob, const wstring& name, double x, double y, double z, int maxDist, int color = 0xff000000); + virtual void renderModel(std::shared_ptr mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale); + virtual void setupPosition(std::shared_ptr mob, double x, double y, double z); + virtual void setupRotations(std::shared_ptr mob, float bob, float bodyRot, float a); + virtual float getAttackAnim(std::shared_ptr mob, float a); + virtual float getBob(std::shared_ptr mob, float a); + virtual void additionalRendering(std::shared_ptr mob, float a); + virtual int prepareArmorOverlay(std::shared_ptr mob, int layer, float a); + virtual int prepareArmor(std::shared_ptr mob, int layer, float a); + virtual void prepareSecondPassArmor(std::shared_ptr mob, int layer, float a); + virtual float getFlipDegrees(std::shared_ptr mob); + virtual int getOverlayColor(std::shared_ptr mob, float br, float a); + virtual void scale(std::shared_ptr mob, float a); + virtual void renderName(std::shared_ptr mob, double x, double y, double z); + virtual void renderNameTag(std::shared_ptr mob, const wstring& name, double x, double y, double z, int maxDist, int color = 0xff000000); public: // 4J Added diff --git a/Minecraft.Client/MobSpawnerRenderer.cpp b/Minecraft.Client/MobSpawnerRenderer.cpp index 4ee772dd..50a8cbb2 100644 --- a/Minecraft.Client/MobSpawnerRenderer.cpp +++ b/Minecraft.Client/MobSpawnerRenderer.cpp @@ -5,15 +5,15 @@ #include "..\Minecraft.World\net.minecraft.world.level.tile.entity.h" #include "..\Minecraft.World\net.minecraft.world.entity.h" -void MobSpawnerRenderer::render(shared_ptr _spawner, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +void MobSpawnerRenderer::render(std::shared_ptr _spawner, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr spawner = dynamic_pointer_cast(_spawner); + std::shared_ptr spawner = dynamic_pointer_cast(_spawner); glPushMatrix(); glTranslatef((float) x + 0.5f, (float) y, (float) z + 0.5f); - shared_ptr e = spawner->getDisplayEntity(); + std::shared_ptr e = spawner->getDisplayEntity(); if (e != NULL) { e->setLevel(spawner->level); diff --git a/Minecraft.Client/MobSpawnerRenderer.h b/Minecraft.Client/MobSpawnerRenderer.h index ad7dfe67..c8b392ad 100644 --- a/Minecraft.Client/MobSpawnerRenderer.h +++ b/Minecraft.Client/MobSpawnerRenderer.h @@ -5,7 +5,7 @@ using namespace std; class MobSpawnerRenderer : public TileEntityRenderer { private: - unordered_map > models; + unordered_map > models; public: - virtual void render(shared_ptr _spawner, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param + virtual void render(std::shared_ptr _spawner, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param }; diff --git a/Minecraft.Client/Model.h b/Minecraft.Client/Model.h index e4161d0c..e7595845 100644 --- a/Minecraft.Client/Model.h +++ b/Minecraft.Client/Model.h @@ -19,9 +19,9 @@ public: int texHeight; Model(); // 4J added - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) {} + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) {} virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0) {} - virtual void prepareMobModel(shared_ptr mob, float time, float r, float a) {} + virtual void prepareMobModel(std::shared_ptr mob, float time, float r, float a) {} virtual ModelPart *getRandomCube(Random random) {return cubes.at(random.nextInt((int)cubes.size()));} virtual ModelPart * AddOrRetrievePart(SKIN_BOX *pBox) { return NULL;} diff --git a/Minecraft.Client/MultiPlayerGameMode.cpp b/Minecraft.Client/MultiPlayerGameMode.cpp index 7de59803..2f048d95 100644 --- a/Minecraft.Client/MultiPlayerGameMode.cpp +++ b/Minecraft.Client/MultiPlayerGameMode.cpp @@ -38,7 +38,7 @@ void MultiPlayerGameMode::creativeDestroyBlock(Minecraft *minecraft, MultiPlayer } } -void MultiPlayerGameMode::adjustPlayer(shared_ptr player) +void MultiPlayerGameMode::adjustPlayer(std::shared_ptr player) { localPlayerMode->updatePlayerAbilities(&player->abilities); } @@ -54,7 +54,7 @@ void MultiPlayerGameMode::setLocalMode(GameType *mode) localPlayerMode->updatePlayerAbilities(&minecraft->player->abilities); } -void MultiPlayerGameMode::initPlayer(shared_ptr player) +void MultiPlayerGameMode::initPlayer(std::shared_ptr player) { player->yRot = -180; } @@ -87,7 +87,7 @@ bool MultiPlayerGameMode::destroyBlock(int x, int y, int z, int face) if (!localPlayerMode->isCreative()) { - shared_ptr item = minecraft->player->getSelectedItem(); + std::shared_ptr item = minecraft->player->getSelectedItem(); if (item != NULL) { item->mineBlock(level, oldTile->id, x, y, z, minecraft->player); @@ -102,7 +102,7 @@ bool MultiPlayerGameMode::destroyBlock(int x, int y, int z, int face) } void MultiPlayerGameMode::startDestroyBlock(int x, int y, int z, int face) -{ +{ if(!minecraft->player->isAllowedToMine()) return; if (localPlayerMode->isReadOnly()) { @@ -111,13 +111,13 @@ void MultiPlayerGameMode::startDestroyBlock(int x, int y, int z, int face) if (localPlayerMode->isCreative()) { - connection->send(shared_ptr( new PlayerActionPacket(PlayerActionPacket::START_DESTROY_BLOCK, x, y, z, face) )); + connection->send(std::shared_ptr( new PlayerActionPacket(PlayerActionPacket::START_DESTROY_BLOCK, x, y, z, face) )); creativeDestroyBlock(minecraft, this, x, y, z, face); destroyDelay = 5; } else if (!isDestroying || x != xDestroyBlock || y != yDestroyBlock || z != zDestroyBlock) { - connection->send( shared_ptr( new PlayerActionPacket(PlayerActionPacket::START_DESTROY_BLOCK, x, y, z, face) ) ); + connection->send( std::shared_ptr( new PlayerActionPacket(PlayerActionPacket::START_DESTROY_BLOCK, x, y, z, face) ) ); int t = minecraft->level->getTile(x, y, z); if (t > 0 && destroyProgress == 0) Tile::tiles[t]->attack(minecraft->level, x, y, z, minecraft->player); if (t > 0 && @@ -147,7 +147,7 @@ void MultiPlayerGameMode::stopDestroyBlock() { if (isDestroying) { - connection->send(shared_ptr(new PlayerActionPacket(PlayerActionPacket::ABORT_DESTROY_BLOCK, xDestroyBlock, yDestroyBlock, zDestroyBlock, -1))); + connection->send(std::shared_ptr(new PlayerActionPacket(PlayerActionPacket::ABORT_DESTROY_BLOCK, xDestroyBlock, yDestroyBlock, zDestroyBlock, -1))); } isDestroying = false; @@ -170,7 +170,7 @@ void MultiPlayerGameMode::continueDestroyBlock(int x, int y, int z, int face) if (localPlayerMode->isCreative()) { destroyDelay = 5; - connection->send(shared_ptr( new PlayerActionPacket(PlayerActionPacket::START_DESTROY_BLOCK, x, y, z, face) ) ); + connection->send(std::shared_ptr( new PlayerActionPacket(PlayerActionPacket::START_DESTROY_BLOCK, x, y, z, face) ) ); creativeDestroyBlock(minecraft, this, x, y, z, face); return; } @@ -202,7 +202,7 @@ void MultiPlayerGameMode::continueDestroyBlock(int x, int y, int z, int face) if (destroyProgress >= 1) { isDestroying = false; - connection->send( shared_ptr( new PlayerActionPacket(PlayerActionPacket::STOP_DESTROY_BLOCK, x, y, z, face) ) ); + connection->send( std::shared_ptr( new PlayerActionPacket(PlayerActionPacket::STOP_DESTROY_BLOCK, x, y, z, face) ) ); destroyBlock(x, y, z, face); destroyProgress = 0; oDestroyProgress = 0; @@ -241,11 +241,11 @@ void MultiPlayerGameMode::ensureHasSentCarriedItem() if (newItem != carriedItem) { carriedItem = newItem; - connection->send( shared_ptr( new SetCarriedItemPacket(carriedItem) ) ); + connection->send( std::shared_ptr( new SetCarriedItemPacket(carriedItem) ) ); } } -bool MultiPlayerGameMode::useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem) +bool MultiPlayerGameMode::useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem) { if( pbUsedItem ) *pbUsedItem = false; // Did we actually use the held item? @@ -259,16 +259,16 @@ bool MultiPlayerGameMode::useItemOn(shared_ptr player, Level *level, sha float clickZ = (float) hit->z - z; bool didSomething = false; int t = level->getTile(x, y, z); - + if (t > 0 && player->isAllowedToUse(Tile::tiles[t])) { if(bTestUseOnly) { switch(t) { - case Tile::recordPlayer_Id: + case Tile::recordPlayer_Id: case Tile::bed_Id: // special case for a bed - if (Tile::tiles[t]->TestUse(level, x, y, z, player )) + if (Tile::tiles[t]->TestUse(level, x, y, z, player )) { return true; } @@ -283,7 +283,7 @@ bool MultiPlayerGameMode::useItemOn(shared_ptr player, Level *level, sha break; } } - else + else { if (Tile::tiles[t]->use(level, x, y, z, player, face, clickX, clickY, clickZ)) didSomething = true; } @@ -321,7 +321,7 @@ bool MultiPlayerGameMode::useItemOn(shared_ptr player, Level *level, sha } else { - // 4J - Bit of a hack, however seems preferable to any larger changes which would have more chance of causing unwanted side effects. + // 4J - Bit of a hack, however seems preferable to any larger changes which would have more chance of causing unwanted side effects. // If we aren't going to be actually performing the use method locally, then call this method with its "soundOnly" parameter set to true. // This is an addition from the java version, and as its name suggests, doesn't actually perform the use locally but just makes any sounds that // are meant to be directly caused by this. If we don't do this, then the sounds never happen as the tile's use method is only called on the @@ -333,17 +333,17 @@ bool MultiPlayerGameMode::useItemOn(shared_ptr player, Level *level, sha } } - // 4J Stu - Do the action before we send the packet, so that our predicted count is sent in the packet and the server + // 4J Stu - Do the action before we send the packet, so that our predicted count is sent in the packet and the server // doesn't think it has to update us // Fix for #7904 - Gameplay: Players can dupe torches by throwing them repeatedly into water. if(!bTestUseOnly) { - connection->send( shared_ptr( new UseItemPacket(x, y, z, face, player->inventory->getSelected(), clickX, clickY, clickZ) ) ); + connection->send( std::shared_ptr( new UseItemPacket(x, y, z, face, player->inventory->getSelected(), clickX, clickY, clickZ) ) ); } return didSomething; } -bool MultiPlayerGameMode::useItem(shared_ptr player, Level *level, shared_ptr item, bool bTestUseOnly) +bool MultiPlayerGameMode::useItem(std::shared_ptr player, Level *level, std::shared_ptr item, bool bTestUseOnly) { if(!player->isAllowedToUse(item)) return false; @@ -353,11 +353,11 @@ bool MultiPlayerGameMode::useItem(shared_ptr player, Level *level, share ensureHasSentCarriedItem(); } - // 4J Stu - Do the action before we send the packet, so that our predicted count is sent in the packet and the server + // 4J Stu - Do the action before we send the packet, so that our predicted count is sent in the packet and the server // doesn't think it has to update us, or can update us if we are wrong // Fix for #13120 - Using a bucket of water or lava in the spawn area (centre of the map) causes the inventory to get out of sync bool result = false; - + // 4J-PB added for tooltips to test use only if(bTestUseOnly) { @@ -366,7 +366,7 @@ bool MultiPlayerGameMode::useItem(shared_ptr player, Level *level, share else { int oldCount = item->count; - shared_ptr itemInstance = item->use(level, player); + std::shared_ptr itemInstance = item->use(level, player); if ((itemInstance != NULL && itemInstance != item) || (itemInstance != NULL && itemInstance->count != oldCount)) { player->inventory->items[player->inventory->selected] = itemInstance; @@ -377,68 +377,68 @@ bool MultiPlayerGameMode::useItem(shared_ptr player, Level *level, share result = true; } } - + if(!bTestUseOnly) { - connection->send( shared_ptr( new UseItemPacket(-1, -1, -1, 255, player->inventory->getSelected(), 0, 0, 0) ) ); + connection->send( std::shared_ptr( new UseItemPacket(-1, -1, -1, 255, player->inventory->getSelected(), 0, 0, 0) ) ); } return result; } -shared_ptr MultiPlayerGameMode::createPlayer(Level *level) +std::shared_ptr MultiPlayerGameMode::createPlayer(Level *level) { - return shared_ptr( new MultiplayerLocalPlayer(minecraft, level, minecraft->user, connection) ); + return std::shared_ptr( new MultiplayerLocalPlayer(minecraft, level, minecraft->user, connection) ); } -void MultiPlayerGameMode::attack(shared_ptr player, shared_ptr entity) +void MultiPlayerGameMode::attack(std::shared_ptr player, std::shared_ptr entity) { ensureHasSentCarriedItem(); - connection->send( shared_ptr( new InteractPacket(player->entityId, entity->entityId, InteractPacket::ATTACK) ) ); + connection->send( std::shared_ptr( new InteractPacket(player->entityId, entity->entityId, InteractPacket::ATTACK) ) ); player->attack(entity); } -bool MultiPlayerGameMode::interact(shared_ptr player, shared_ptr entity) +bool MultiPlayerGameMode::interact(std::shared_ptr player, std::shared_ptr entity) { ensureHasSentCarriedItem(); - connection->send(shared_ptr( new InteractPacket(player->entityId, entity->entityId, InteractPacket::INTERACT) ) ); + connection->send(std::shared_ptr( new InteractPacket(player->entityId, entity->entityId, InteractPacket::INTERACT) ) ); return player->interact(entity); } -shared_ptr MultiPlayerGameMode::handleInventoryMouseClick(int containerId, int slotNum, int buttonNum, bool quickKeyHeld, shared_ptr player) +std::shared_ptr MultiPlayerGameMode::handleInventoryMouseClick(int containerId, int slotNum, int buttonNum, bool quickKeyHeld, std::shared_ptr player) { short changeUid = player->containerMenu->backup(player->inventory); - shared_ptr clicked = player->containerMenu->clicked(slotNum, buttonNum, quickKeyHeld?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, player); - connection->send( shared_ptr( new ContainerClickPacket(containerId, slotNum, buttonNum, quickKeyHeld, clicked, changeUid) ) ); + std::shared_ptr clicked = player->containerMenu->clicked(slotNum, buttonNum, quickKeyHeld?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, player); + connection->send( std::shared_ptr( new ContainerClickPacket(containerId, slotNum, buttonNum, quickKeyHeld, clicked, changeUid) ) ); return clicked; } void MultiPlayerGameMode::handleInventoryButtonClick(int containerId, int buttonId) { - connection->send(shared_ptr( new ContainerButtonClickPacket(containerId, buttonId) )); + connection->send(std::shared_ptr( new ContainerButtonClickPacket(containerId, buttonId) )); } -void MultiPlayerGameMode::handleCreativeModeItemAdd(shared_ptr clicked, int slot) +void MultiPlayerGameMode::handleCreativeModeItemAdd(std::shared_ptr clicked, int slot) { if (localPlayerMode->isCreative()) { - connection->send(shared_ptr( new SetCreativeModeSlotPacket(slot, clicked) ) ); + connection->send(std::shared_ptr( new SetCreativeModeSlotPacket(slot, clicked) ) ); } } -void MultiPlayerGameMode::handleCreativeModeItemDrop(shared_ptr clicked) +void MultiPlayerGameMode::handleCreativeModeItemDrop(std::shared_ptr clicked) { if (localPlayerMode->isCreative() && clicked != NULL) { - connection->send(shared_ptr( new SetCreativeModeSlotPacket(-1, clicked) ) ); + connection->send(std::shared_ptr( new SetCreativeModeSlotPacket(-1, clicked) ) ); } } -void MultiPlayerGameMode::releaseUsingItem(shared_ptr player) +void MultiPlayerGameMode::releaseUsingItem(std::shared_ptr player) { ensureHasSentCarriedItem(); - connection->send(shared_ptr( new PlayerActionPacket(PlayerActionPacket::RELEASE_USE_ITEM, 0, 0, 0, 255) ) ); + connection->send(std::shared_ptr( new PlayerActionPacket(PlayerActionPacket::RELEASE_USE_ITEM, 0, 0, 0, 255) ) ); player->releaseUsingItem(); } @@ -462,17 +462,17 @@ bool MultiPlayerGameMode::hasFarPickRange() return localPlayerMode->isCreative(); } -bool MultiPlayerGameMode::handleCraftItem(int recipe, shared_ptr player) +bool MultiPlayerGameMode::handleCraftItem(int recipe, std::shared_ptr player) { short changeUid = player->containerMenu->backup(player->inventory); - connection->send( shared_ptr( new CraftItemPacket(recipe, changeUid) ) ); + connection->send( std::shared_ptr( new CraftItemPacket(recipe, changeUid) ) ); return true; } -void MultiPlayerGameMode::handleDebugOptions(unsigned int uiVal, shared_ptr player) +void MultiPlayerGameMode::handleDebugOptions(unsigned int uiVal, std::shared_ptr player) { player->SetDebugOptions(uiVal); - connection->send( shared_ptr( new DebugOptionsPacket(uiVal) ) ); + connection->send( std::shared_ptr( new DebugOptionsPacket(uiVal) ) ); } diff --git a/Minecraft.Client/MultiPlayerGameMode.h b/Minecraft.Client/MultiPlayerGameMode.h index c84410fa..8fc88df8 100644 --- a/Minecraft.Client/MultiPlayerGameMode.h +++ b/Minecraft.Client/MultiPlayerGameMode.h @@ -24,10 +24,10 @@ protected: public: MultiPlayerGameMode(Minecraft *minecraft, ClientConnection *connection); static void creativeDestroyBlock(Minecraft *minecraft, MultiPlayerGameMode *gameMode, int x, int y, int z, int face); - void adjustPlayer(shared_ptr player); + void adjustPlayer(std::shared_ptr player); bool isCutScene(); void setLocalMode(GameType *mode); - virtual void initPlayer(shared_ptr player); + virtual void initPlayer(std::shared_ptr player); virtual bool canHurtPlayer(); virtual bool destroyBlock(int x, int y, int z, int face); virtual void startDestroyBlock(int x, int y, int z, int face); @@ -41,24 +41,24 @@ private: private: void ensureHasSentCarriedItem(); public: - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL); - virtual bool useItem(shared_ptr player, Level *level, shared_ptr item, bool bTestUseOnly=false); - virtual shared_ptr createPlayer(Level *level); - virtual void attack(shared_ptr player, shared_ptr entity); - virtual bool interact(shared_ptr player, shared_ptr entity); - virtual shared_ptr handleInventoryMouseClick(int containerId, int slotNum, int buttonNum, bool quickKeyHeld, shared_ptr player); + virtual bool useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL); + virtual bool useItem(std::shared_ptr player, Level *level, std::shared_ptr item, bool bTestUseOnly=false); + virtual std::shared_ptr createPlayer(Level *level); + virtual void attack(std::shared_ptr player, std::shared_ptr entity); + virtual bool interact(std::shared_ptr player, std::shared_ptr entity); + virtual std::shared_ptr handleInventoryMouseClick(int containerId, int slotNum, int buttonNum, bool quickKeyHeld, std::shared_ptr player); virtual void handleInventoryButtonClick(int containerId, int buttonId); - virtual void handleCreativeModeItemAdd(shared_ptr clicked, int slot); - virtual void handleCreativeModeItemDrop(shared_ptr clicked); - virtual void releaseUsingItem(shared_ptr player); + virtual void handleCreativeModeItemAdd(std::shared_ptr clicked, int slot); + virtual void handleCreativeModeItemDrop(std::shared_ptr clicked); + virtual void releaseUsingItem(std::shared_ptr player); virtual bool hasExperience(); virtual bool hasMissTime(); virtual bool hasInfiniteItems(); virtual bool hasFarPickRange(); - + // 4J Stu - Added so we can send packets for this in the network game - virtual bool handleCraftItem(int recipe, shared_ptr player); - virtual void handleDebugOptions(unsigned int uiVal, shared_ptr player); + virtual bool handleCraftItem(int recipe, std::shared_ptr player); + virtual void handleDebugOptions(unsigned int uiVal, std::shared_ptr player); // 4J Stu - Added for tutorial checks virtual bool isInputAllowed(int mapping) { return true; } diff --git a/Minecraft.Client/MultiPlayerLevel.cpp b/Minecraft.Client/MultiPlayerLevel.cpp index 24b12bcd..16594955 100644 --- a/Minecraft.Client/MultiPlayerLevel.cpp +++ b/Minecraft.Client/MultiPlayerLevel.cpp @@ -24,7 +24,7 @@ MultiPlayerLevel::ResetInfo::ResetInfo(int x, int y, int z, int tile, int data) } MultiPlayerLevel::MultiPlayerLevel(ClientConnection *connection, LevelSettings *levelSettings, int dimension, int difficulty) - : Level(shared_ptr(new MockedLevelStorage()), L"MpServer", Dimension::getNew(dimension), levelSettings, false) + : Level(std::shared_ptr(new MockedLevelStorage()), L"MpServer", Dimension::getNew(dimension), levelSettings, false) { minecraft = Minecraft::GetInstance(); @@ -108,7 +108,7 @@ void MultiPlayerLevel::tick() EnterCriticalSection(&m_entitiesCS); for (int i = 0; i < 10 && !reEntries.empty(); i++) { - shared_ptr e = *(reEntries.begin()); + std::shared_ptr e = *(reEntries.begin()); if (find(entities.begin(), entities.end(), e) == entities.end() ) addEntity(e); } @@ -134,7 +134,7 @@ void MultiPlayerLevel::tick() { Level::setTileAndDataNoUpdate(r.x, r.y, r.z, r.tile, r.data); Level::sendTileUpdated(r.x, r.y, r.z); - + //updatesToReset.erase(updatesToReset.begin()+i); eraseElements = true; lastIndexToRemove = 0; @@ -156,7 +156,7 @@ void MultiPlayerLevel::tick() // 4J - added this section. Each tick we'll check a different block, and force it to share data if it has been // more than 2 minutes since we last wanted to unshare it. This shouldn't really ever happen, and is added // here as a safe guard against accumulated memory leaks should a lot of chunks become unshared over time. - + int ls = dimension->getXZSize(); if( g_NetworkManager.IsHost() ) { @@ -403,7 +403,7 @@ void MultiPlayerLevel::setChunkVisible(int x, int z, bool visible) } -bool MultiPlayerLevel::addEntity(shared_ptr e) +bool MultiPlayerLevel::addEntity(std::shared_ptr e) { bool ok = Level::addEntity(e); forced.insert(e); @@ -416,7 +416,7 @@ bool MultiPlayerLevel::addEntity(shared_ptr e) return ok; } -void MultiPlayerLevel::removeEntity(shared_ptr e) +void MultiPlayerLevel::removeEntity(std::shared_ptr e) { // 4J Stu - Add this remove from the reEntries collection to stop us continually removing and re-adding things, // in particular the MultiPlayerLocalPlayer when they die @@ -430,7 +430,7 @@ void MultiPlayerLevel::removeEntity(shared_ptr e) forced.erase(e); } -void MultiPlayerLevel::entityAdded(shared_ptr e) +void MultiPlayerLevel::entityAdded(std::shared_ptr e) { Level::entityAdded(e); AUTO_VAR(it, reEntries.find(e)); @@ -440,7 +440,7 @@ void MultiPlayerLevel::entityAdded(shared_ptr e) } } -void MultiPlayerLevel::entityRemoved(shared_ptr e) +void MultiPlayerLevel::entityRemoved(std::shared_ptr e) { Level::entityRemoved(e); AUTO_VAR(it, forced.find(e)); @@ -450,9 +450,9 @@ void MultiPlayerLevel::entityRemoved(shared_ptr e) } } -void MultiPlayerLevel::putEntity(int id, shared_ptr e) +void MultiPlayerLevel::putEntity(int id, std::shared_ptr e) { - shared_ptr old = getEntity(id); + std::shared_ptr old = getEntity(id); if (old != NULL) { removeEntity(old); @@ -467,16 +467,16 @@ void MultiPlayerLevel::putEntity(int id, shared_ptr e) entitiesById[id] = e; } -shared_ptr MultiPlayerLevel::getEntity(int id) +std::shared_ptr MultiPlayerLevel::getEntity(int id) { AUTO_VAR(it, entitiesById.find(id)); if( it == entitiesById.end() ) return nullptr; return it->second; } -shared_ptr MultiPlayerLevel::removeEntity(int id) +std::shared_ptr MultiPlayerLevel::removeEntity(int id) { - shared_ptr e; + std::shared_ptr e; AUTO_VAR(it, entitiesById.find(id)); if( it != entitiesById.end() ) { @@ -493,11 +493,11 @@ shared_ptr MultiPlayerLevel::removeEntity(int id) // 4J Added to remove the entities from the forced list // This gets called when a chunk is unloaded, but we only do half an unload to remove entities slightly differently -void MultiPlayerLevel::removeEntities(vector > *list) +void MultiPlayerLevel::removeEntities(vector > *list) { for(AUTO_VAR(it, list->begin()); it < list->end(); ++it) { - shared_ptr e = *it; + std::shared_ptr e = *it; AUTO_VAR(reIt, reEntries.find(e)); if (reIt!=reEntries.end()) @@ -582,7 +582,7 @@ bool MultiPlayerLevel::doSetTileAndData(int x, int y, int z, int tile, int data) // and so the thing being notified of any update through tileUpdated is the renderer int prevTile = getTile(x, y, z); bool visuallyImportant = (!( ( ( prevTile == Tile::water_Id ) && ( tile == Tile::calmWater_Id ) ) || - ( ( prevTile == Tile::calmWater_Id ) && ( tile == Tile::water_Id ) ) || + ( ( prevTile == Tile::calmWater_Id ) && ( tile == Tile::water_Id ) ) || ( ( prevTile == Tile::lava_Id ) && ( tile == Tile::calmLava_Id ) ) || ( ( prevTile == Tile::calmLava_Id ) && ( tile == Tile::calmLava_Id ) ) || ( ( prevTile == Tile::calmLava_Id ) && ( tile == Tile::lava_Id ) ) ) ); @@ -609,7 +609,7 @@ void MultiPlayerLevel::disconnect(bool sendDisconnect /*= true*/) { for(AUTO_VAR(it, connections.begin()); it < connections.end(); ++it ) { - (*it)->sendAndDisconnect( shared_ptr( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) ); + (*it)->sendAndDisconnect( std::shared_ptr( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) ); } } else @@ -687,7 +687,7 @@ void MultiPlayerLevel::animateTick(int xt, int yt, int zt) void MultiPlayerLevel::animateTickDoWork() { const int ticksPerChunk = 16; // This ought to give us roughly the same 1000/32768 chance of a tile being animated as the original - + // Horrible hack to communicate with the level renderer, which is just attached as a listener to this level. This let's the particle // rendering know to use this level (rather than try to work it out from the current player), and to not bother distance clipping particles // which would again be based on the current player. @@ -730,7 +730,7 @@ void MultiPlayerLevel::animateTickDoWork() } -void MultiPlayerLevel::playSound(shared_ptr entity, int iSound, float volume, float pitch) +void MultiPlayerLevel::playSound(std::shared_ptr entity, int iSound, float volume, float pitch) { playLocalSound(entity->x, entity->y - entity->heightOffset, entity->z, iSound, volume, pitch); } @@ -790,7 +790,7 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() AUTO_VAR(endIt, entitiesToRemove.end()); for (AUTO_VAR(it, entitiesToRemove.begin()); it != endIt; it++) { - shared_ptr e = *it; + std::shared_ptr e = *it; int xc = e->xChunk; int zc = e->zChunk; if (e->inChunk && hasChunk(xc, zc)) @@ -809,10 +809,10 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() //for (int i = 0; i < entities.size(); i++) EnterCriticalSection(&m_entitiesCS); - vector >::iterator it = entities.begin(); + vector >::iterator it = entities.begin(); while( it != entities.end() ) { - shared_ptr e = *it;//entities.at(i); + std::shared_ptr e = *it;//entities.at(i); if (e->riding != NULL) { @@ -821,7 +821,7 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() e->riding->rider = weak_ptr(); e->riding = nullptr; } - else + else { ++it; continue; @@ -853,7 +853,7 @@ void MultiPlayerLevel::removeClientConnection(ClientConnection *c, bool sendDisc { if( sendDisconnect ) { - c->sendAndDisconnect( shared_ptr( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) ); + c->sendAndDisconnect( std::shared_ptr( new DisconnectPacket(DisconnectPacket::eDisconnect_Quitting) ) ); } AUTO_VAR(it, find( connections.begin(), connections.end(), c )); @@ -886,7 +886,7 @@ void MultiPlayerLevel::removeUnusedTileEntitiesInRegion(int x0, int y0, int z0, for (unsigned int i = 0; i < tileEntityList.size();) { bool removed = false; - shared_ptr te = tileEntityList[i]; + std::shared_ptr te = tileEntityList[i]; if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && te->y < y1 && te->z < z1) { LevelChunk *lc = getChunk(te->x >> 4, te->z >> 4); diff --git a/Minecraft.Client/MultiPlayerLevel.h b/Minecraft.Client/MultiPlayerLevel.h index c07b5583..e075cb8d 100644 --- a/Minecraft.Client/MultiPlayerLevel.h +++ b/Minecraft.Client/MultiPlayerLevel.h @@ -54,21 +54,21 @@ public: void setChunkVisible(int x, int z, bool visible); private: - unordered_map, IntKeyHash2, IntKeyEq> entitiesById; // 4J - was IntHashMap - unordered_set > forced; - unordered_set > reEntries; + unordered_map, IntKeyHash2, IntKeyEq> entitiesById; // 4J - was IntHashMap + unordered_set > forced; + unordered_set > reEntries; public: - virtual bool addEntity(shared_ptr e); - virtual void removeEntity(shared_ptr e); + virtual bool addEntity(std::shared_ptr e); + virtual void removeEntity(std::shared_ptr e); protected: - virtual void entityAdded(shared_ptr e); - virtual void entityRemoved(shared_ptr e); + virtual void entityAdded(std::shared_ptr e); + virtual void entityRemoved(std::shared_ptr e); public: - void putEntity(int id, shared_ptr e); - shared_ptr getEntity(int id); - shared_ptr removeEntity(int id); - virtual void removeEntities(vector > *list); // 4J Added override + void putEntity(int id, std::shared_ptr e); + std::shared_ptr getEntity(int id); + std::shared_ptr removeEntity(int id); + virtual void removeEntities(vector > *list); // 4J Added override virtual bool setDataNoUpdate(int x, int y, int z, int data); virtual bool setTileAndDataNoUpdate(int x, int y, int z, int tile, int data); virtual bool setTileNoUpdate(int x, int y, int z, int tile); @@ -77,7 +77,7 @@ public: void animateTick(int xt, int yt, int zt); protected: virtual void tickWeather(); - + static const int ANIMATE_TICK_MAX_PARTICLES = 500; public: @@ -87,7 +87,7 @@ public: public: void removeAllPendingEntityRemovals(); - virtual void playSound(shared_ptr entity, int iSound, float volume, float pitch); + virtual void playSound(std::shared_ptr entity, int iSound, float volume, float pitch); virtual void playLocalSound(double x, double y, double z, int iSound, float volume, float pitch, float fClipSoundDist=16.0f); diff --git a/Minecraft.Client/MultiPlayerLocalPlayer.cpp b/Minecraft.Client/MultiPlayerLocalPlayer.cpp index bb2630e5..29d1caa8 100644 --- a/Minecraft.Client/MultiPlayerLocalPlayer.cpp +++ b/Minecraft.Client/MultiPlayerLocalPlayer.cpp @@ -49,18 +49,18 @@ void MultiplayerLocalPlayer::tick() /*if((app.GetGameSettings(m_iPad,eGameSetting_PlayerVisibleInMap)!=0) != m_bShownOnMaps) { m_bShownOnMaps = (app.GetGameSettings(m_iPad,eGameSetting_PlayerVisibleInMap)!=0); - if (m_bShownOnMaps) connection->send( shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::SHOW_ON_MAPS) ) ); - else connection->send( shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::HIDE_ON_MAPS) ) ); + if (m_bShownOnMaps) connection->send( std::shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::SHOW_ON_MAPS) ) ); + else connection->send( std::shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::HIDE_ON_MAPS) ) ); }*/ if (!level->hasChunkAt(Mth::floor(x), 0, Mth::floor(z))) return; double tempX = x, tempY = y, tempZ = z; LocalPlayer::tick(); - + //if( !minecraft->localgameModes[m_iPad]->isTutorial() || minecraft->localgameModes[m_iPad]->getTutorial()->canMoveToPosition(tempX, tempY, tempZ, x, y, z) ) if(minecraft->localgameModes[m_iPad]->getTutorial()->canMoveToPosition(tempX, tempY, tempZ, x, y, z)) - { + { sendPosition(); } else @@ -75,8 +75,8 @@ void MultiplayerLocalPlayer::sendPosition() bool sprinting = isSprinting(); if (sprinting != lastSprinting) { - if (sprinting) connection->send(shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::START_SPRINTING))); - else connection->send(shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::STOP_SPRINTING))); + if (sprinting) connection->send(std::shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::START_SPRINTING))); + else connection->send(std::shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::STOP_SPRINTING))); lastSprinting = sprinting; } @@ -84,8 +84,8 @@ void MultiplayerLocalPlayer::sendPosition() bool sneaking = isSneaking(); if (sneaking != lastSneaked) { - if (sneaking) connection->send( shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::START_SNEAKING) ) ); - else connection->send( shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::STOP_SNEAKING) ) ); + if (sneaking) connection->send( std::shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::START_SNEAKING) ) ); + else connection->send( std::shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::STOP_SNEAKING) ) ); lastSneaked = sneaking; } @@ -93,8 +93,8 @@ void MultiplayerLocalPlayer::sendPosition() bool idle = isIdle(); if (idle != lastIdle) { - if (idle) connection->send( shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::START_IDLEANIM) ) ); - else connection->send( shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::STOP_IDLEANIM) ) ); + if (idle) connection->send( std::shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::START_IDLEANIM) ) ); + else connection->send( std::shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::STOP_IDLEANIM) ) ); lastIdle = idle; } @@ -110,26 +110,26 @@ void MultiplayerLocalPlayer::sendPosition() bool rot = rydd != 0 || rxdd != 0; if (riding != NULL) { - connection->send( shared_ptr( new MovePlayerPacket::PosRot(xd, -999, -999, zd, yRot, xRot, onGround, abilities.flying) ) ); + connection->send( std::shared_ptr( new MovePlayerPacket::PosRot(xd, -999, -999, zd, yRot, xRot, onGround, abilities.flying) ) ); move = false; } else { if (move && rot) { - connection->send( shared_ptr( new MovePlayerPacket::PosRot(x, bb->y0, y, z, yRot, xRot, onGround, abilities.flying) ) ); + connection->send( std::shared_ptr( new MovePlayerPacket::PosRot(x, bb->y0, y, z, yRot, xRot, onGround, abilities.flying) ) ); } else if (move) { - connection->send( shared_ptr( new MovePlayerPacket::Pos(x, bb->y0, y, z, onGround, abilities.flying) ) ); + connection->send( std::shared_ptr( new MovePlayerPacket::Pos(x, bb->y0, y, z, onGround, abilities.flying) ) ); } else if (rot) { - connection->send( shared_ptr( new MovePlayerPacket::Rot(yRot, xRot, onGround, abilities.flying) ) ); + connection->send( std::shared_ptr( new MovePlayerPacket::Rot(yRot, xRot, onGround, abilities.flying) ) ); } else { - connection->send( shared_ptr( new MovePlayerPacket(onGround, abilities.flying) ) ); + connection->send( std::shared_ptr( new MovePlayerPacket(onGround, abilities.flying) ) ); } } @@ -152,31 +152,31 @@ void MultiplayerLocalPlayer::sendPosition() } -shared_ptr MultiplayerLocalPlayer::drop() +std::shared_ptr MultiplayerLocalPlayer::drop() { - connection->send( shared_ptr( new PlayerActionPacket(PlayerActionPacket::DROP_ITEM, 0, 0, 0, 0) ) ); + connection->send( std::shared_ptr( new PlayerActionPacket(PlayerActionPacket::DROP_ITEM, 0, 0, 0, 0) ) ); return nullptr; } -void MultiplayerLocalPlayer::reallyDrop(shared_ptr itemEntity) +void MultiplayerLocalPlayer::reallyDrop(std::shared_ptr itemEntity) { } void MultiplayerLocalPlayer::chat(const wstring& message) { - connection->send( shared_ptr( new ChatPacket(message) ) ); + connection->send( std::shared_ptr( new ChatPacket(message) ) ); } void MultiplayerLocalPlayer::swing() { LocalPlayer::swing(); - connection->send( shared_ptr( new AnimatePacket(shared_from_this(), AnimatePacket::SWING) ) ); + connection->send( std::shared_ptr( new AnimatePacket(shared_from_this(), AnimatePacket::SWING) ) ); } void MultiplayerLocalPlayer::respawn() { - connection->send( shared_ptr( new ClientCommandPacket(ClientCommandPacket::PERFORM_RESPAWN))); + connection->send( std::shared_ptr( new ClientCommandPacket(ClientCommandPacket::PERFORM_RESPAWN))); } @@ -238,7 +238,7 @@ void MultiplayerLocalPlayer::onEffectRemoved(MobEffectInstance *effect) void MultiplayerLocalPlayer::closeContainer() { - connection->send( shared_ptr( new ContainerClosePacket(containerMenu->containerId) ) ); + connection->send( std::shared_ptr( new ContainerClosePacket(containerMenu->containerId) ) ); inventory->setCarried(nullptr); LocalPlayer::closeContainer(); } @@ -286,7 +286,7 @@ void MultiplayerLocalPlayer::awardStatFromServer(Stat *stat, byteArray param) void MultiplayerLocalPlayer::onUpdateAbilities() { - connection->send(shared_ptr(new PlayerAbilitiesPacket(&abilities))); + connection->send(std::shared_ptr(new PlayerAbilitiesPacket(&abilities))); } bool MultiplayerLocalPlayer::isLocalPlayer() @@ -294,7 +294,7 @@ bool MultiplayerLocalPlayer::isLocalPlayer() return true; } -void MultiplayerLocalPlayer::ride(shared_ptr e) +void MultiplayerLocalPlayer::ride(std::shared_ptr e) { bool wasRiding = riding != NULL; LocalPlayer::ride(e); @@ -324,7 +324,7 @@ void MultiplayerLocalPlayer::ride(shared_ptr e) updateRichPresence(); Minecraft *pMinecraft = Minecraft::GetInstance(); - + if( pMinecraft->localgameModes[m_iPad] != NULL ) { TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[m_iPad]; @@ -344,7 +344,7 @@ void MultiplayerLocalPlayer::ride(shared_ptr e) void MultiplayerLocalPlayer::StopSleeping() { - connection->send( shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::STOP_SLEEPING) ) ); + connection->send( std::shared_ptr( new PlayerCommandPacket(shared_from_this(), PlayerCommandPacket::STOP_SLEEPING) ) ); } // 4J Added @@ -355,7 +355,7 @@ void MultiplayerLocalPlayer::setAndBroadcastCustomSkin(DWORD skinId) #ifndef _CONTENT_PACKAGE wprintf(L"Skin for local player %ls has changed to %ls (%d)\n", name.c_str(), customTextureUrl.c_str(), getPlayerDefaultSkin() ); #endif - if(getCustomSkin() != oldSkinIndex) connection->send( shared_ptr( new TextureAndGeometryChangePacket( shared_from_this(), app.GetPlayerSkinName(GetXboxPad()) ) ) ); + if(getCustomSkin() != oldSkinIndex) connection->send( std::shared_ptr( new TextureAndGeometryChangePacket( shared_from_this(), app.GetPlayerSkinName(GetXboxPad()) ) ) ); } void MultiplayerLocalPlayer::setAndBroadcastCustomCape(DWORD capeId) @@ -365,5 +365,5 @@ void MultiplayerLocalPlayer::setAndBroadcastCustomCape(DWORD capeId) #ifndef _CONTENT_PACKAGE wprintf(L"Cape for local player %ls has changed to %ls\n", name.c_str(), customTextureUrl2.c_str()); #endif - if(getCustomCape() != oldCapeIndex) connection->send( shared_ptr( new TextureChangePacket( shared_from_this(), TextureChangePacket::e_TextureChange_Cape, app.GetPlayerCapeName(GetXboxPad()) ) ) ); + if(getCustomCape() != oldCapeIndex) connection->send( std::shared_ptr( new TextureChangePacket( shared_from_this(), TextureChangePacket::e_TextureChange_Cape, app.GetPlayerCapeName(GetXboxPad()) ) ) ); } diff --git a/Minecraft.Client/MultiPlayerLocalPlayer.h b/Minecraft.Client/MultiPlayerLocalPlayer.h index 8687b36a..24244564 100644 --- a/Minecraft.Client/MultiPlayerLocalPlayer.h +++ b/Minecraft.Client/MultiPlayerLocalPlayer.h @@ -33,9 +33,9 @@ public: void sendPosition(); using Player::drop; - virtual shared_ptr drop(); + virtual std::shared_ptr drop(); protected: - virtual void reallyDrop(shared_ptr itemEntity); + virtual void reallyDrop(std::shared_ptr itemEntity); public: virtual void chat(const wstring& message); virtual void swing(); @@ -62,7 +62,7 @@ public: //void CustomSkin(PBYTE pbData, DWORD dwBytes); // 4J Overriding this so we can flag an event for the tutorial - virtual void ride(shared_ptr e); + virtual void ride(std::shared_ptr e); // 4J - added for the Stop Sleeping virtual void StopSleeping(); diff --git a/Minecraft.Client/MushroomCowRenderer.cpp b/Minecraft.Client/MushroomCowRenderer.cpp index 688fab5c..b34ffaf1 100644 --- a/Minecraft.Client/MushroomCowRenderer.cpp +++ b/Minecraft.Client/MushroomCowRenderer.cpp @@ -9,21 +9,21 @@ MushroomCowRenderer::MushroomCowRenderer(Model *model, float shadow) : MobRender { } -void MushroomCowRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void MushroomCowRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { - // 4J - original version used generics and thus had an input parameter of type MushroomCow rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type MushroomCow rather than std::shared_ptr we have here - // do some casting around instead - //shared_ptr mob = dynamic_pointer_cast(_mob); + //std::shared_ptr mob = dynamic_pointer_cast(_mob); // 4J Stu - No need to do the cast, just pass through as-is MobRenderer::render(_mob, x, y, z, rot, a); } -void MushroomCowRenderer::additionalRendering(shared_ptr _mob, float a) +void MushroomCowRenderer::additionalRendering(std::shared_ptr _mob, float a) { - // 4J - original version used generics and thus had an input parameter of type MushroomCow rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type MushroomCow rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); MobRenderer::additionalRendering(mob, a); if (mob->isBaby()) return; bindTexture(TN_TERRAIN); // 4J was "/terrain.png" diff --git a/Minecraft.Client/MushroomCowRenderer.h b/Minecraft.Client/MushroomCowRenderer.h index c5f6f3c4..8d01ea81 100644 --- a/Minecraft.Client/MushroomCowRenderer.h +++ b/Minecraft.Client/MushroomCowRenderer.h @@ -7,8 +7,8 @@ class MushroomCowRenderer : public MobRenderer public: MushroomCowRenderer(Model *model, float shadow); - virtual void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); protected: - virtual void additionalRendering(shared_ptr _mob, float a); + virtual void additionalRendering(std::shared_ptr _mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/OzelotModel.cpp b/Minecraft.Client/OzelotModel.cpp index 9c22cc4b..b0557012 100644 --- a/Minecraft.Client/OzelotModel.cpp +++ b/Minecraft.Client/OzelotModel.cpp @@ -78,7 +78,7 @@ OzelotModel::OzelotModel() backLegR->compile(1.0f/16.0f); } -void OzelotModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void OzelotModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); if (young) @@ -180,9 +180,9 @@ void OzelotModel::setupAnim(float time, float r, float bob, float yRot, float xR } } -void OzelotModel::prepareMobModel(shared_ptr mob, float time, float r, float a) +void OzelotModel::prepareMobModel(std::shared_ptr mob, float time, float r, float a) { - shared_ptr ozelot = dynamic_pointer_cast(mob); + std::shared_ptr ozelot = dynamic_pointer_cast(mob); body->y = bodyWalkY; body->z = bodyWalkZ; diff --git a/Minecraft.Client/OzelotModel.h b/Minecraft.Client/OzelotModel.h index 2c08f3df..cdccc8fe 100644 --- a/Minecraft.Client/OzelotModel.h +++ b/Minecraft.Client/OzelotModel.h @@ -36,8 +36,8 @@ private: public: OzelotModel(); - void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); void render(OzelotModel *model, float scale, bool usecompiled); void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); - void prepareMobModel(shared_ptr mob, float time, float r, float a); + void prepareMobModel(std::shared_ptr mob, float time, float r, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/OzelotRenderer.cpp b/Minecraft.Client/OzelotRenderer.cpp index d56b35f9..54c50d69 100644 --- a/Minecraft.Client/OzelotRenderer.cpp +++ b/Minecraft.Client/OzelotRenderer.cpp @@ -6,16 +6,16 @@ OzelotRenderer::OzelotRenderer(Model *model, float shadow) : MobRenderer(model, { } -void OzelotRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void OzelotRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { MobRenderer::render(_mob, x, y, z, rot, a); } -void OzelotRenderer::scale(shared_ptr _mob, float a) +void OzelotRenderer::scale(std::shared_ptr _mob, float a) { - // 4J - original version used generics and thus had an input parameter of type Blaze rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Blaze rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); MobRenderer::scale(mob, a); if (mob->isTame()) { diff --git a/Minecraft.Client/OzelotRenderer.h b/Minecraft.Client/OzelotRenderer.h index 9627b4f1..a9fc1223 100644 --- a/Minecraft.Client/OzelotRenderer.h +++ b/Minecraft.Client/OzelotRenderer.h @@ -7,8 +7,8 @@ class OzelotRenderer : public MobRenderer public: OzelotRenderer(Model *model, float shadow); - void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); protected: - void scale(shared_ptr _mob, float a); + void scale(std::shared_ptr _mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h index ade37607..6cacd7a0 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h @@ -25,7 +25,7 @@ using std::tr1::const_pointer_cast; using std::tr1::dynamic_pointer_cast; using std::tr1::enable_shared_from_this; using std::tr1::get_deleter; -using std::tr1::shared_ptr; +using std::tr1::std::shared_ptr; using std::tr1::static_pointer_cast; using std::tr1::swap; using std::tr1::weak_ptr; @@ -62,7 +62,7 @@ using boost::hash; class Cnullptr{ public: template - operator shared_ptr() { return shared_ptr(); } + operator std::shared_ptr() { return std::shared_ptr(); } }; extern Cnullptr nullptr; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/binary_iarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/binary_iarchive.hpp index 638d9967..9d786645 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/binary_iarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/binary_iarchive.hpp @@ -9,7 +9,7 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // binary_iarchive.hpp -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -25,7 +25,7 @@ # pragma warning(disable : 4511 4512) #endif -namespace boost { +namespace boost { namespace archive { // do not derive from the classes below. If you want to extend this functionality @@ -33,10 +33,10 @@ namespace archive { // preserve correct static polymorphism. // same as binary_iarchive below - without the shared_ptr_helper -class naked_binary_iarchive : +class naked_binary_iarchive : public binary_iarchive_impl< - boost::archive::naked_binary_iarchive, - std::istream::char_type, + boost::archive::naked_binary_iarchive, + std::istream::char_type, std::istream::traits_type > { @@ -56,22 +56,22 @@ public: } // namespace archive } // namespace boost -// note special treatment of shared_ptr. This type needs a special +// note special treatment of std::shared_ptr. This type needs a special // structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a +// class to provide this functionality. Since std::shared_ptr holds a // special esteem in the boost library - we included it here by default. #include -namespace boost { +namespace boost { namespace archive { // do not derive from this class. If you want to extend this functionality // via inhertance, derived from binary_iarchive_impl instead. This will // preserve correct static polymorphism. -class binary_iarchive : +class binary_iarchive : public binary_iarchive_impl< - boost::archive::binary_iarchive, - std::istream::char_type, + boost::archive::binary_iarchive, + std::istream::char_type, std::istream::traits_type >, public detail::shared_ptr_helper diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/binary_wiarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/binary_wiarchive.hpp index b5f6a710..81f67c04 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/binary_wiarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/binary_wiarchive.hpp @@ -9,7 +9,7 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // binary_wiarchive.hpp -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -25,29 +25,29 @@ #include #include -namespace boost { +namespace boost { namespace archive { // same as binary_wiarchive below - without the shared_ptr_helper -class naked_binary_wiarchive : +class naked_binary_wiarchive : public binary_iarchive_impl< - boost::archive::naked_binary_wiarchive, - std::wistream::char_type, + boost::archive::naked_binary_wiarchive, + std::wistream::char_type, std::wistream::traits_type > { public: naked_binary_wiarchive(std::wistream & is, unsigned int flags = 0) : binary_iarchive_impl< - naked_binary_wiarchive, - std::wistream::char_type, + naked_binary_wiarchive, + std::wistream::char_type, std::wistream::traits_type >(is, flags) {} naked_binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) : binary_iarchive_impl< - naked_binary_wiarchive, - std::wistream::char_type, + naked_binary_wiarchive, + std::wistream::char_type, std::wistream::traits_type >(bsb, flags) {} @@ -56,16 +56,16 @@ public: } // namespace archive } // namespace boost -// note special treatment of shared_ptr. This type needs a special +// note special treatment of std::shared_ptr. This type needs a special // structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a +// class to provide this functionality. Since std::shared_ptr holds a // special esteem in the boost library - we included it here by default. #include -namespace boost { +namespace boost { namespace archive { -class binary_wiarchive : +class binary_wiarchive : public binary_iarchive_impl< binary_wiarchive, std::wistream::char_type, std::wistream::traits_type > diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_iarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_iarchive.hpp index ce780c84..828f03f6 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_iarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_iarchive.hpp @@ -40,7 +40,7 @@ namespace std{ namespace boost { template -class shared_ptr; +class std::shared_ptr; namespace serialization { class extended_type_info; } // namespace serialization @@ -155,9 +155,9 @@ public: #include // pops abi_suffix.hpp pragmas -// note special treatment of shared_ptr. This type needs a special +// note special treatment of std::shared_ptr. This type needs a special // structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a +// class to provide this functionality. Since std::shared_ptr holds a // special esteem in the boost library - we included it here by default. #include diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_oarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_oarchive.hpp index 183140ee..458df7eb 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_oarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_oarchive.hpp @@ -39,7 +39,7 @@ namespace std{ namespace boost { template -class shared_ptr; +class std::shared_ptr; namespace serialization { class extended_type_info; } // namespace serialization diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/shared_ptr_helper.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/shared_ptr_helper.hpp index 39e6eb82..f49f768c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/shared_ptr_helper.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/shared_ptr_helper.hpp @@ -22,7 +22,7 @@ #include // NULL #include -#include +#include #include #include @@ -35,16 +35,16 @@ #include // must be the last headern namespace boost_132 { - template class shared_ptr; + template class std::shared_ptr; } namespace boost { - template class shared_ptr; + template class std::shared_ptr; namespace serialization { class extended_type_info; template inline void load( Archive & ar, - boost::shared_ptr< T > &t, + boost::std::shared_ptr< T > &t, const unsigned int file_version ); } @@ -57,14 +57,14 @@ namespace detail { class shared_ptr_helper { struct collection_type_compare { bool operator()( - const shared_ptr &lhs, - const shared_ptr &rhs + const std::shared_ptr &lhs, + const std::shared_ptr &rhs )const{ return lhs.get() < rhs.get(); } }; typedef std::set< - boost::shared_ptr, + boost::std::shared_ptr, collection_type_compare > collection_type; typedef collection_type::const_iterator iterator_type; @@ -72,7 +72,7 @@ class shared_ptr_helper { // is used to "match up" shared pointers loaded at different // points in the archive. Note, we delay construction until // it is actually used since this is by default included as - // a "mix-in" even if shared_ptr isn't used. + // a "mix-in" even if std::shared_ptr isn't used. collection_type * m_pointers; struct null_deleter { @@ -95,7 +95,7 @@ public: template friend inline void boost::serialization::load( Archive & ar, - boost::shared_ptr< T > &t, + boost::std::shared_ptr< T > &t, const unsigned int file_version ); #endif @@ -109,44 +109,44 @@ public: // new system which is disjoint from this set. This is implemented // by a change in load_construct_data below. It makes this file suitable // only for loading pointers into a 1.33 or later boost system. - std::list > * m_pointers_132; + std::list > * m_pointers_132; // #endif // returns pointer to object and an indicator whether this is a // new entry (true) or a previous one (false) - BOOST_ARCHIVE_DECL(shared_ptr) + BOOST_ARCHIVE_DECL(std::shared_ptr) get_od( const void * od, - const boost::serialization::extended_type_info * true_type, + const boost::serialization::extended_type_info * true_type, const boost::serialization::extended_type_info * this_type ); BOOST_ARCHIVE_DECL(void) - append(const boost::shared_ptr &); + append(const boost::std::shared_ptr &); template struct non_polymorphic { - static const boost::serialization::extended_type_info * + static const boost::serialization::extended_type_info * get_object_identifier(T &){ return & boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME + BOOST_DEDUCED_TYPENAME boost::serialization::type_info_implementation< T >::type >::get_const_instance(); } }; template struct polymorphic { - static const boost::serialization::extended_type_info * + static const boost::serialization::extended_type_info * get_object_identifier(T & t){ return boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME + BOOST_DEDUCED_TYPENAME boost::serialization::type_info_implementation< T >::type >::get_const_instance().get_derived_extended_type_info(t); } }; public: template - void reset(shared_ptr< T > & s, T * t){ + void reset(std::shared_ptr< T > & s, T * t){ if(NULL == t){ s.reset(); return; @@ -175,9 +175,9 @@ public: this_type->get_debug_info() ) ); - shared_ptr r = + std::shared_ptr r = get_od( - static_cast(t), + static_cast(t), true_type, this_type ); @@ -188,11 +188,11 @@ public: *this_type, static_cast(t) ); - shared_ptr sp(s, od); + std::shared_ptr sp(s, od); append(sp); } else{ - s = shared_ptr< T >( + s = std::shared_ptr< T >( r, static_cast(r.get()) ); @@ -201,7 +201,7 @@ public: // #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP BOOST_ARCHIVE_DECL(void) - append(const boost_132::shared_ptr & t); + append(const boost_132::std::shared_ptr & t); // #endif public: BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/text_iarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/text_iarchive.hpp index 298928b3..00be983e 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/text_iarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/text_iarchive.hpp @@ -9,7 +9,7 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // text_iarchive.hpp -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -32,11 +32,11 @@ # pragma warning(disable : 4511 4512) #endif -namespace boost { +namespace boost { namespace archive { template -class text_iarchive_impl : +class text_iarchive_impl : public basic_text_iprimitive, public basic_text_iarchive { @@ -62,16 +62,16 @@ protected: load(v); t = boost::serialization::item_version_type(v); } - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL(void) load(char * t); #ifndef BOOST_NO_INTRINSIC_WCHAR_T - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL(void) load(wchar_t * t); #endif - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL(void) load(std::string &s); #ifndef BOOST_NO_STD_WSTRING - BOOST_ARCHIVE_DECL(void) + BOOST_ARCHIVE_DECL(void) load(std::wstring &ws); #endif // note: the following should not needed - but one compiler (vc 7.1) @@ -85,10 +85,10 @@ protected: load_override(class_name_type & t, int); BOOST_ARCHIVE_DECL(void) init(); - BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) text_iarchive_impl(std::istream & is, unsigned int flags); // don't import inline definitions! leave this as a reminder. - //BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + //BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) ~text_iarchive_impl(){}; }; @@ -97,7 +97,7 @@ protected: // preserve correct static polymorphism. // same as text_iarchive below - without the shared_ptr_helper -class naked_text_iarchive : +class naked_text_iarchive : public text_iarchive_impl { public: @@ -117,9 +117,9 @@ public: #include // pops abi_suffix.hpp pragmas -// note special treatment of shared_ptr. This type needs a special +// note special treatment of std::shared_ptr. This type needs a special // structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a +// class to provide this functionality. Since std::shared_ptr holds a // special esteem in the boost library - we included it here by default. #include @@ -128,10 +128,10 @@ public: # pragma warning(disable : 4511 4512) #endif -namespace boost { +namespace boost { namespace archive { -class text_iarchive : +class text_iarchive : public text_iarchive_impl, public detail::shared_ptr_helper { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/text_wiarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/text_wiarchive.hpp index 7451f3a6..d96b816b 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/text_wiarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/text_wiarchive.hpp @@ -9,7 +9,7 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // text_wiarchive.hpp -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -36,11 +36,11 @@ # pragma warning(disable : 4511 4512) #endif -namespace boost { +namespace boost { namespace archive { template -class text_wiarchive_impl : +class text_wiarchive_impl : public basic_text_iprimitive, public basic_text_iarchive { @@ -84,7 +84,7 @@ protected: void load_override(T & t, BOOST_PFTO int){ basic_text_iarchive::load_override(t, 0); } - BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) text_wiarchive_impl(std::wistream & is, unsigned int flags); ~text_wiarchive_impl(){}; }; @@ -94,7 +94,7 @@ protected: // preserve correct static polymorphism. // same as text_wiarchive below - without the shared_ptr_helper -class naked_text_wiarchive : +class naked_text_wiarchive : public text_wiarchive_impl { public: @@ -113,9 +113,9 @@ public: #include // pops abi_suffix.hpp pragmas -// note special treatment of shared_ptr. This type needs a special +// note special treatment of std::shared_ptr. This type needs a special // structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a +// class to provide this functionality. Since std::shared_ptr holds a // special esteem in the boost library - we included it here by default. #include @@ -124,10 +124,10 @@ public: # pragma warning(disable : 4511 4512) #endif -namespace boost { +namespace boost { namespace archive { -class text_wiarchive : +class text_wiarchive : public text_wiarchive_impl, public detail::shared_ptr_helper { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/xml_iarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/xml_iarchive.hpp index be6cfe49..cdf51642 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/xml_iarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/xml_iarchive.hpp @@ -9,7 +9,7 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // xml_iarchive.hpp -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -32,7 +32,7 @@ # pragma warning(disable : 4511 4512) #endif -namespace boost { +namespace boost { namespace archive { template @@ -40,7 +40,7 @@ class basic_xml_grammar; typedef basic_xml_grammar xml_grammar; template -class xml_iarchive_impl : +class xml_iarchive_impl : public basic_text_iprimitive, public basic_xml_iarchive { @@ -64,13 +64,13 @@ protected: void load(T & t){ basic_text_iprimitive::load(t); } - void + void load(version_type & t){ unsigned int v; load(v); t = version_type(v); } - void + void load(boost::serialization::item_version_type & t){ unsigned int v; load(v); @@ -96,7 +96,7 @@ protected: load_override(class_name_type & t, int); BOOST_ARCHIVE_DECL(void) init(); - BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) xml_iarchive_impl(std::istream & is, unsigned int flags); BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) ~xml_iarchive_impl(); @@ -107,7 +107,7 @@ protected: // preserve correct static polymorphism. // same as xml_iarchive below - without the shared_ptr_helper -class naked_xml_iarchive : +class naked_xml_iarchive : public xml_iarchive_impl { public: @@ -126,9 +126,9 @@ public: #include // pops abi_suffix.hpp pragmas -// note special treatment of shared_ptr. This type needs a special +// note special treatment of std::shared_ptr. This type needs a special // structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a +// class to provide this functionality. Since std::shared_ptr holds a // special esteem in the boost library - we included it here by default. #include @@ -137,10 +137,10 @@ public: # pragma warning(disable : 4511 4512) #endif -namespace boost { +namespace boost { namespace archive { -class xml_iarchive : +class xml_iarchive : public xml_iarchive_impl, public detail::shared_ptr_helper { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/xml_wiarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/xml_wiarchive.hpp index 59ebbb5e..2fb0a538 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/xml_wiarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/xml_wiarchive.hpp @@ -9,7 +9,7 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // xml_wiarchive.hpp -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -37,7 +37,7 @@ # pragma warning(disable : 4511 4512) #endif -namespace boost { +namespace boost { namespace archive { template @@ -45,7 +45,7 @@ class basic_xml_grammar; typedef basic_xml_grammar xml_wgrammar; template -class xml_wiarchive_impl : +class xml_wiarchive_impl : public basic_text_iprimitive, public basic_xml_iarchive { @@ -65,17 +65,17 @@ protected: return is; } template - void + void load(T & t){ basic_text_iprimitive::load(t); } - void + void load(version_type & t){ unsigned int v; load(v); t = version_type(v); } - void + void load(boost::serialization::item_version_type & t){ unsigned int v; load(v); @@ -99,11 +99,11 @@ protected: } BOOST_WARCHIVE_DECL(void) load_override(class_name_type & t, int); - BOOST_WARCHIVE_DECL(void) + BOOST_WARCHIVE_DECL(void) init(); - BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) xml_wiarchive_impl(std::wistream & is, unsigned int flags) ; - BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) ~xml_wiarchive_impl(); }; @@ -112,7 +112,7 @@ protected: // preserve correct static polymorphism. // same as xml_wiarchive below - without the shared_ptr_helper -class naked_xml_wiarchive : +class naked_xml_wiarchive : public xml_wiarchive_impl { public: @@ -126,14 +126,14 @@ public: } // namespace boost #ifdef BOOST_MSVC -# pragma warning(pop) +# pragma warning(pop) #endif #include // pops abi_suffix.hpp pragmas -// note special treatment of shared_ptr. This type needs a special +// note special treatment of std::shared_ptr. This type needs a special // structure associated with every archive. We created a "mix-in" -// class to provide this functionality. Since shared_ptr holds a +// class to provide this functionality. Since std::shared_ptr holds a // special esteem in the boost library - we included it here by default. #include @@ -142,10 +142,10 @@ public: # pragma warning(disable : 4511 4512) #endif -namespace boost { +namespace boost { namespace archive { -class xml_wiarchive : +class xml_wiarchive : public xml_wiarchive_impl, public detail::shared_ptr_helper { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/config.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/config.hpp index 40f770ca..9c93a2c7 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/config.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/config.hpp @@ -144,7 +144,7 @@ # endif // defined(BOOST_MSVC) #endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY) -// Standard library support for shared_ptr and weak_ptr. +// Standard library support for std::shared_ptr and weak_ptr. #if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR) # if defined(__GNUC__) # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/shared_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/shared_ptr.hpp index 5f0da22e..30ce3ffd 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/shared_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/shared_ptr.hpp @@ -1,5 +1,5 @@ // -// detail/shared_ptr.hpp +// detail/std::shared_ptr.hpp // ~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) @@ -20,7 +20,7 @@ #if defined(BOOST_ASIO_HAS_STD_SHARED_PTR) # include #else // defined(BOOST_ASIO_HAS_STD_SHARED_PTR) -# include +# include #endif // defined(BOOST_ASIO_HAS_STD_SHARED_PTR) namespace boost { @@ -30,7 +30,7 @@ namespace detail { #if defined(BOOST_ASIO_HAS_STD_SHARED_PTR) using std::shared_ptr; #else // defined(BOOST_ASIO_HAS_STD_SHARED_PTR) -using boost::shared_ptr; +using boost::std::shared_ptr; #endif // defined(BOOST_ASIO_HAS_STD_SHARED_PTR) } // namespace detail diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/socket_ops.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/socket_ops.hpp index 92af9fbe..78b9da3f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/socket_ops.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/socket_ops.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -60,7 +60,7 @@ enum typedef unsigned char state_type; struct noop_deleter { void operator()(void*) {} }; -typedef shared_ptr shared_cancel_token_type; +typedef std::shared_ptr shared_cancel_token_type; typedef weak_ptr weak_cancel_token_type; BOOST_ASIO_DECL socket_type accept(socket_type s, socket_addr_type* addr, diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/io_service.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/io_service.hpp index 43b94e46..e56aea45 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/io_service.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/io_service.hpp @@ -232,19 +232,19 @@ public: * delete static_cast(svc). * * @note The destruction sequence described above permits programs to - * simplify their resource management by using @c shared_ptr<>. Where an + * simplify their resource management by using @c std::shared_ptr<>. Where an * object's lifetime is tied to the lifetime of a connection (or some other - * sequence of asynchronous operations), a @c shared_ptr to the object would + * sequence of asynchronous operations), a @c std::shared_ptr to the object would * be bound into the handlers for all asynchronous operations associated with * it. This works as follows: * * @li When a single connection ends, all associated asynchronous operations * complete. The corresponding handler objects are destroyed, and all - * @c shared_ptr references to the objects are destroyed. + * @c std::shared_ptr references to the objects are destroyed. * * @li To shut down the whole program, the io_service function stop() is * called to terminate any run() calls as soon as possible. The io_service - * destructor defined above destroys all handlers, causing all @c shared_ptr + * destructor defined above destroys all handlers, causing all @c std::shared_ptr * references to all connection objects to be destroyed. */ BOOST_ASIO_DECL ~io_service(); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ip/basic_resolver_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ip/basic_resolver_iterator.hpp index 6e52a852..fda14dcd 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ip/basic_resolver_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ip/basic_resolver_iterator.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -184,7 +184,7 @@ private: } typedef std::vector > values_type; - boost::asio::detail::shared_ptr values_; + boost::asio::detail::std::shared_ptr values_; std::size_t index_; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ssl/detail/impl/openssl_init.ipp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ssl/detail/impl/openssl_init.ipp index fe62e6ea..ec1b26d5 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ssl/detail/impl/openssl_init.ipp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ssl/detail/impl/openssl_init.ipp @@ -37,7 +37,7 @@ public: do_init() { ::SSL_library_init(); - ::SSL_load_error_strings(); + ::SSL_load_error_strings(); ::OpenSSL_add_all_algorithms(); mutexes_.resize(::CRYPTO_num_locks()); @@ -75,7 +75,7 @@ private: #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__) } - static void openssl_locking_func(int mode, int n, + static void openssl_locking_func(int mode, int n, const char* /*file*/, int /*line*/) { if (mode & CRYPTO_LOCK) @@ -85,7 +85,7 @@ private: } // Mutexes to be used in locking callbacks. - std::vector > mutexes_; #if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) @@ -94,10 +94,10 @@ private: #endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) }; -boost::asio::detail::shared_ptr +boost::asio::detail::std::shared_ptr openssl_init_base::instance() { - static boost::asio::detail::shared_ptr init(new do_init); + static boost::asio::detail::std::shared_ptr init(new do_init); return init; } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ssl/detail/openssl_init.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ssl/detail/openssl_init.hpp index c68909d1..24d033fe 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ssl/detail/openssl_init.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/ssl/detail/openssl_init.hpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include @@ -39,7 +39,7 @@ protected: // main, and therefore before any other threads can get started. The do_init // instance must be static in this function to ensure that it gets // initialised before any other global objects try to use it. - BOOST_ASIO_DECL static boost::asio::detail::shared_ptr instance(); + BOOST_ASIO_DECL static boost::asio::detail::std::shared_ptr instance(); }; template @@ -68,7 +68,7 @@ private: // Reference to singleton do_init object to ensure that openssl does not get // cleaned up until the last user has finished with it. - boost::asio::detail::shared_ptr ref_; + boost::asio::detail::std::shared_ptr ref_; }; template diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/gcc.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/gcc.hpp index c0ac30af..a3469766 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/gcc.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/gcc.hpp @@ -1,12 +1,12 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Darin Adler 2001 - 2002. -// (C) Copyright Jens Maurer 2001 - 2002. -// (C) Copyright Beman Dawes 2001 - 2003. -// (C) Copyright Douglas Gregor 2002. -// (C) Copyright David Abrahams 2002 - 2003. -// (C) Copyright Synge Todo 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001 - 2003. +// (C) Copyright Darin Adler 2001 - 2002. +// (C) Copyright Jens Maurer 2001 - 2002. +// (C) Copyright Beman Dawes 2001 - 2003. +// (C) Copyright Douglas Gregor 2002. +// (C) Copyright David Abrahams 2002 - 2003. +// (C) Copyright Synge Todo 2003. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. @@ -15,7 +15,7 @@ #if __GNUC__ < 3 # if __GNUC_MINOR__ == 91 - // egcs 1.1 won't parse shared_ptr.hpp without this: + // egcs 1.1 won't parse std::shared_ptr.hpp without this: # define BOOST_NO_AUTO_PTR # endif # if __GNUC_MINOR__ < 95 @@ -97,7 +97,7 @@ // #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__) # define BOOST_HAS_THREADS -#endif +#endif // // gcc has "long long" @@ -116,7 +116,7 @@ // #if __GNUC__ >= 4 # if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__) - // All Win32 development environments, including 64-bit Windows and MinGW, define + // All Win32 development environments, including 64-bit Windows and MinGW, define // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment, // so does not define _WIN32 or its variants. # define BOOST_HAS_DECLSPEC @@ -128,7 +128,7 @@ # endif # define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default"))) #else -// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined +// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined # define BOOST_SYMBOL_EXPORT #endif @@ -169,7 +169,7 @@ # define BOOST_NO_CXX11_RVALUE_REFERENCES # define BOOST_NO_CXX11_STATIC_ASSERT -// Variadic templates compiler: +// Variadic templates compiler: // http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html # if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__)) # define BOOST_HAS_VARIADIC_TMPL diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/sunpro_cc.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/sunpro_cc.hpp index 65beb501..e796a16d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/sunpro_cc.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/sunpro_cc.hpp @@ -1,10 +1,10 @@ -// (C) Copyright John Maddock 2001. -// (C) Copyright Jens Maurer 2001 - 2003. -// (C) Copyright Peter Dimov 2002. -// (C) Copyright Aleksey Gurtovoy 2002 - 2003. -// (C) Copyright David Abrahams 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001. +// (C) Copyright Jens Maurer 2001 - 2003. +// (C) Copyright Peter Dimov 2002. +// (C) Copyright Aleksey Gurtovoy 2002 - 2003. +// (C) Copyright David Abrahams 2002. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. @@ -34,7 +34,7 @@ # define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # endif -# if (__SUNPRO_CC <= 0x530) +# if (__SUNPRO_CC <= 0x530) // Requesting debug info (-g) with Boost.Python results // in an internal compiler error for "static const" // initialized in-class. @@ -44,7 +44,7 @@ # define BOOST_NO_INCLASS_MEMBER_INITIALIZATION // SunPro 5.3 has better support for partial specialization, - // but breaks when compiling std::less > + // but breaks when compiling std::less > // (Jens Maurer 4 Nov 2001). // std::less specialization fixed as reported by George @@ -57,7 +57,7 @@ # define BOOST_NO_INTEGRAL_INT64_T # endif -# if (__SUNPRO_CC < 0x570) +# if (__SUNPRO_CC < 0x570) # define BOOST_NO_TEMPLATE_TEMPLATES // see http://lists.boost.org/MailArchives/boost/msg47184.php // and http://lists.boost.org/MailArchives/boost/msg47220.php @@ -65,7 +65,7 @@ # define BOOST_NO_SFINAE # define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS # endif -# if (__SUNPRO_CC <= 0x580) +# if (__SUNPRO_CC <= 0x580) # define BOOST_NO_IS_ABSTRACT # endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/platform/win32.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/platform/win32.hpp index 39220127..066b2e88 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/platform/win32.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/platform/win32.hpp @@ -1,9 +1,9 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Bill Kempf 2001. -// (C) Copyright Aleksey Gurtovoy 2003. +// (C) Copyright John Maddock 2001 - 2003. +// (C) Copyright Bill Kempf 2001. +// (C) Copyright Aleksey Gurtovoy 2003. // (C) Copyright Rene Rivera 2005. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. @@ -46,11 +46,11 @@ // // Win32 will normally be using native Win32 threads, // but there is a pthread library avaliable as an option, -// we used to disable this when BOOST_DISABLE_WIN32 was +// we used to disable this when BOOST_DISABLE_WIN32 was // defined but no longer - this should allow some // files to be compiled in strict mode - while maintaining // a consistent setting of BOOST_HAS_THREADS across -// all translation units (needed for shared_ptr etc). +// all translation units (needed for std::shared_ptr etc). // #ifdef _WIN32_WCE diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/gregorian/greg_month.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/gregorian/greg_month.hpp index b48a8a89..f326f91a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/gregorian/greg_month.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/gregorian/greg_month.hpp @@ -2,7 +2,7 @@ #define GREG_MONTH_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst @@ -11,7 +11,7 @@ #include "boost/date_time/constrained_value.hpp" #include "boost/date_time/date_defs.hpp" -#include "boost/shared_ptr.hpp" +#include "boost/std::shared_ptr.hpp" #include "boost/date_time/compiler_config.hpp" #include #include @@ -39,7 +39,7 @@ namespace gregorian { using date_time::Dec; using date_time::NotAMonth; using date_time::NumMonths; - + //! Exception thrown if a greg_month is constructed with a value out of range struct bad_month : public std::out_of_range { @@ -50,15 +50,15 @@ namespace gregorian { //! A constrained range that implements the gregorian_month rules typedef CV::constrained_value greg_month_rep; - + //! Wrapper class to represent months in gregorian based calendar class BOOST_DATE_TIME_DECL greg_month : public greg_month_rep { public: typedef date_time::months_of_year month_enum; typedef std::map month_map_type; - typedef boost::shared_ptr month_map_ptr_type; + typedef boost::std::shared_ptr month_map_ptr_type; //! Construct a month from the months_of_year enumeration - greg_month(month_enum theMonth) : + greg_month(month_enum theMonth) : greg_month_rep(static_cast(theMonth)) {} //! Construct from a short value greg_month(unsigned short theMonth) : greg_month_rep(theMonth) {} diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/custom_time_zone.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/custom_time_zone.hpp index 84c59a3a..1c36d575 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/custom_time_zone.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/custom_time_zone.hpp @@ -14,7 +14,7 @@ #include "boost/date_time/local_time/dst_transition_day_rules.hpp" #include "boost/date_time/string_convert.hpp" //#include "boost/date_time/special_defs.hpp" -#include "boost/shared_ptr.hpp" +#include "boost/std::shared_ptr.hpp" namespace boost { namespace local_time { @@ -22,7 +22,7 @@ namespace local_time { //typedef boost::date_time::time_zone_names time_zone_names; typedef boost::date_time::dst_adjustment_offsets dst_adjustment_offsets; //typedef boost::date_time::time_zone_base time_zone; - typedef boost::shared_ptr dst_calc_rule_ptr; + typedef boost::std::shared_ptr dst_calc_rule_ptr; //! A real time zone template @@ -38,7 +38,7 @@ namespace local_time { custom_time_zone_base(const time_zone_names& zone_names, const time_duration_type& utc_offset, const dst_adjustment_offsets& dst_shift, - boost::shared_ptr calc_rule) : + boost::std::shared_ptr calc_rule) : zone_names_(zone_names), base_utc_offset_(utc_offset), dst_offsets_(dst_shift), @@ -100,7 +100,7 @@ namespace local_time { // std offset dst [offset],start[/time],end[/time] - w/o spaces stringstream_type ss; ss.fill('0'); - boost::shared_ptr no_rules; + boost::std::shared_ptr no_rules; // std ss << std_zone_abbrev(); // offset @@ -157,7 +157,7 @@ namespace local_time { bool has_dst_; time_duration_type base_utc_offset_; dst_adjustment_offsets dst_offsets_; - boost::shared_ptr dst_calc_rules_; + boost::std::shared_ptr dst_calc_rules_; }; typedef custom_time_zone_base custom_time_zone; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/local_date_time.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/local_date_time.hpp index 96b29158..3eed3eff 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/local_date_time.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/local_date_time.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include //todo remove? @@ -57,7 +57,7 @@ namespace local_time { * to wall clock time are made as needed. This approach allows for * operations between wall-clock times in different time zones, and * daylight savings time considerations, to be made. Time zones are - * required to be in the form of a boost::shared_ptr. + * required to be in the form of a boost::std::shared_ptr. */ template > @@ -79,7 +79,7 @@ namespace local_time { *@param tz Timezone for to adjust the UTC time to. */ local_date_time_base(utc_time_type t, - boost::shared_ptr tz) : + boost::std::shared_ptr tz) : date_time::base_time(t), zone_(tz) { @@ -99,12 +99,12 @@ namespace local_time { */ local_date_time_base(date_type d, time_duration_type td, - boost::shared_ptr tz, + boost::std::shared_ptr tz, bool dst_flag) : //necessary for constr_adj() date_time::base_time(construction_adjustment(utc_time_type(d, td), tz, dst_flag)), zone_(tz) { - if(tz != boost::shared_ptr() && tz->has_dst()){ + if(tz != boost::std::shared_ptr() && tz->has_dst()){ // d & td are already local so we use them time_is_dst_result result = check_dst(d, td, tz); @@ -140,7 +140,7 @@ namespace local_time { */ local_date_time_base(date_type d, time_duration_type td, - boost::shared_ptr tz, + boost::std::shared_ptr tz, DST_CALC_OPTIONS calc_option) : // dummy value - time_ is set in constructor code date_time::base_time(utc_time_type(d,td)), @@ -189,9 +189,9 @@ namespace local_time { */ static time_is_dst_result check_dst(date_type d, time_duration_type td, - boost::shared_ptr tz) + boost::std::shared_ptr tz) { - if(tz != boost::shared_ptr() && tz->has_dst()) { + if(tz != boost::std::shared_ptr() && tz->has_dst()) { typedef typename date_time::dst_calculator dst_calculator; return dst_calculator::local_is_dst( d, td, @@ -218,20 +218,20 @@ namespace local_time { //! Special values constructor explicit local_date_time_base(const boost::date_time::special_values sv, - boost::shared_ptr tz = boost::shared_ptr()) : + boost::std::shared_ptr tz = boost::std::shared_ptr()) : date_time::base_time(utc_time_type(sv)), zone_(tz) {} //! returns time zone associated with calling instance - boost::shared_ptr zone() const + boost::std::shared_ptr zone() const { return zone_; } //! returns false is time_zone is NULL and if time value is a special_value bool is_dst() const { - if(zone_ != boost::shared_ptr() && zone_->has_dst() && !this->is_special()) { + if(zone_ != boost::std::shared_ptr() && zone_->has_dst() && !this->is_special()) { // check_dst takes a local time, *this is utc utc_time_type lt(this->time_); lt += zone_->base_utc_offset(); @@ -265,7 +265,7 @@ namespace local_time { //! Returns object's time value as a local representation utc_time_type local_time() const { - if(zone_ != boost::shared_ptr()){ + if(zone_ != boost::std::shared_ptr()){ utc_time_type lt = this->utc_time() + zone_->base_utc_offset(); if (is_dst()) { lt += zone_->dst_offset(); @@ -286,7 +286,7 @@ namespace local_time { ss << utc_time(); return ss.str(); } - if(zone_ == boost::shared_ptr()) { + if(zone_ == boost::std::shared_ptr()) { ss << utc_time() << " UTC"; return ss.str(); } @@ -306,7 +306,7 @@ namespace local_time { } /*! returns a local_date_time_base in the given time zone with the * optional time_duration added. */ - local_date_time_base local_time_in(boost::shared_ptr new_tz, + local_date_time_base local_time_in(boost::std::shared_ptr new_tz, time_duration_type td=time_duration_type(0,0,0)) const { return local_date_time_base(utc_time_type(this->time_) + td, new_tz); @@ -318,7 +318,7 @@ namespace local_time { * classes that do not use a time_zone */ std::string zone_name(bool as_offset=false) const { - if(zone_ == boost::shared_ptr()) { + if(zone_ == boost::std::shared_ptr()) { if(as_offset) { return std::string("Z"); } @@ -352,7 +352,7 @@ namespace local_time { * that do not use a time_zone */ std::string zone_abbrev(bool as_offset=false) const { - if(zone_ == boost::shared_ptr()) { + if(zone_ == boost::std::shared_ptr()) { if(as_offset) { return std::string("Z"); } @@ -384,7 +384,7 @@ namespace local_time { //! returns a posix_time_zone string for the associated time_zone. If no time_zone, "UTC+00" is returned. std::string zone_as_posix_string() const { - if(zone_ == shared_ptr()) { + if(zone_ == std::shared_ptr()) { return std::string("UTC+00"); } return zone_->to_posix_string(); @@ -477,16 +477,16 @@ namespace local_time { return utc_time_type(this->time_) - utc_time_type(rhs.time_); } private: - boost::shared_ptr zone_; + boost::std::shared_ptr zone_; //bool is_dst_; /*! Adjust the passed in time to UTC? */ utc_time_type construction_adjustment(utc_time_type t, - boost::shared_ptr z, + boost::std::shared_ptr z, bool dst_flag) { - if(z != boost::shared_ptr()) { + if(z != boost::std::shared_ptr()) { if(dst_flag && z->has_dst()) { t -= z->dst_offset(); } // else no adjust diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/local_time_types.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/local_time_types.hpp index 5e04422e..30b0540b 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/local_time_types.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/local_time_types.hpp @@ -2,7 +2,7 @@ #define LOCAL_TIME_LOCAL_TIME_TYPES_HPP__ /* Copyright (c) 2003-2004 CrystalClear Software, Inc. - * Subject to the Boost Software License, Version 1.0. + * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ @@ -20,21 +20,21 @@ namespace boost { namespace local_time { - typedef boost::date_time::period local_time_period; typedef date_time::time_itr local_time_iterator; - typedef date_time::second_clock local_sec_clock; + typedef date_time::second_clock local_sec_clock; typedef date_time::microsec_clock local_microsec_clock; - + typedef date_time::time_zone_base time_zone; typedef date_time::time_zone_base wtime_zone; //! Shared Pointer for custom_time_zone and posix_time_zone objects - typedef boost::shared_ptr time_zone_ptr; - typedef boost::shared_ptr wtime_zone_ptr; - + typedef boost::std::shared_ptr time_zone_ptr; + typedef boost::std::shared_ptr wtime_zone_ptr; + typedef date_time::time_zone_names_base time_zone_names; typedef date_time::time_zone_names_base wtime_zone_names; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/posix_time_zone.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/posix_time_zone.hpp index ee1b553e..1d886983 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/posix_time_zone.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/posix_time_zone.hpp @@ -184,7 +184,7 @@ namespace local_time{ // std offset dst [offset],start[/time],end[/time] - w/o spaces stringstream_type ss; ss.fill('0'); - boost::shared_ptr no_rules; + boost::std::shared_ptr no_rules; // std ss << std_zone_abbrev(); // offset @@ -241,7 +241,7 @@ namespace local_time{ bool has_dst_; time_duration_type base_utc_offset_; dst_adjustment_offsets dst_offsets_; - boost::shared_ptr dst_calc_rules_; + boost::std::shared_ptr dst_calc_rules_; /*! Extract time zone abbreviations for STD & DST as well * as the offsets for the time shift that occurs and how @@ -399,7 +399,7 @@ namespace local_time{ ew = lexical_cast(*it++); ed = lexical_cast(*it); - dst_calc_rules_ = shared_ptr( + dst_calc_rules_ = std::shared_ptr( new nth_kday_dst_rule( nth_last_dst_rule::start_rule( static_cast(sw),sd,sm), @@ -427,7 +427,7 @@ namespace local_time{ ed -= calendar::end_of_month_day(year,em++); } - dst_calc_rules_ = shared_ptr( + dst_calc_rules_ = std::shared_ptr( new partial_date_dst_rule( partial_date_dst_rule::start_rule( sd, static_cast(sm)), @@ -443,7 +443,7 @@ namespace local_time{ int sd=0, ed=0; sd = lexical_cast(s); ed = lexical_cast(e); - dst_calc_rules_ = shared_ptr( + dst_calc_rules_ = std::shared_ptr( new partial_date_dst_rule( partial_date_dst_rule::start_rule(++sd),// args are 0-365 partial_date_dst_rule::end_rule(++ed) // pd expects 1-366 diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/tz_database.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/tz_database.hpp index aceda939..26afe449 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/tz_database.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/local_time/tz_database.hpp @@ -2,7 +2,7 @@ #define BOOST_DATE_TIME_TZ_DATABASE_HPP__ /* Copyright (c) 2003-2004 CrystalClear Software, Inc. - * Subject to the Boost Software License, Version 1.0. + * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ @@ -17,11 +17,11 @@ namespace boost { namespace local_time { - using date_time::data_not_accessible; - using date_time::bad_field_count; + using date_time::data_not_accessible; + using date_time::bad_field_count; - //! Object populated with boost::shared_ptr objects - /*! Object populated with boost::shared_ptr objects + //! Object populated with boost::std::shared_ptr objects + /*! Object populated with boost::std::shared_ptr objects * Database is populated from specs stored in external csv file. See * date_time::tz_db_base for greater detail */ typedef date_time::tz_db_base tz_database; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/microsec_time_clock.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/microsec_time_clock.hpp index 177811ee..beb1d70d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/microsec_time_clock.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/microsec_time_clock.hpp @@ -15,7 +15,7 @@ */ #include -#include +#include #include #include #include @@ -50,7 +50,7 @@ namespace date_time { //! return a local time object for the given zone, based on computer clock //JKG -- looks like we could rewrite this against universal_time template - static time_type local_time(shared_ptr tz_ptr) + static time_type local_time(std::shared_ptr tz_ptr) { typedef typename time_type::utc_time_type utc_time_type; typedef second_clock second_clock; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/time_clock.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/time_clock.hpp index 9aa2ff0e..c73466ed 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/time_clock.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/time_clock.hpp @@ -14,7 +14,7 @@ */ #include "boost/date_time/c_time.hpp" -#include "boost/shared_ptr.hpp" +#include "boost/std::shared_ptr.hpp" namespace boost { namespace date_time { @@ -54,7 +54,7 @@ namespace date_time { } template - static time_type local_time(boost::shared_ptr tz_ptr) + static time_type local_time(boost::std::shared_ptr tz_ptr) { typedef typename time_type::utc_time_type utc_time_type; utc_time_type utc_time = second_clock::universal_time(); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/tz_db_base.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/tz_db_base.hpp index a6d8ea9e..fff9f91e 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/tz_db_base.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/date_time/tz_db_base.hpp @@ -2,7 +2,7 @@ #define DATE_TIME_TZ_DB_BASE_HPP__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. - * Subject to the Boost Software License, Version 1.0. + * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst * $Date: 2012-09-22 09:04:10 -0700 (Sat, 22 Sep 2012) $ @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -29,20 +29,20 @@ namespace boost { class data_not_accessible : public std::logic_error { public: - data_not_accessible() : - std::logic_error(std::string("Unable to locate or access the required datafile.")) + data_not_accessible() : + std::logic_error(std::string("Unable to locate or access the required datafile.")) {} - data_not_accessible(const std::string& filespec) : - std::logic_error(std::string("Unable to locate or access the required datafile. Filespec: " + filespec)) + data_not_accessible(const std::string& filespec) : + std::logic_error(std::string("Unable to locate or access the required datafile. Filespec: " + filespec)) {} }; - + //! Exception thrown when tz database locates incorrect field structure in data file class bad_field_count : public std::out_of_range { public: - bad_field_count(const std::string& s) : - std::out_of_range(s) + bad_field_count(const std::string& s) : + std::out_of_range(s) {} }; @@ -51,48 +51,48 @@ namespace boost { * tz_db_base is intended to be customized by the * library user. When customizing this file (or creating your own) the * file must follow a specific format. - * + * * This first line is expected to contain column headings and is therefore * not processed by the tz_db_base. * * Each record (line) must have eleven fields. Some of those fields can - * be empty. Every field (even empty ones) must be enclosed in + * be empty. Every field (even empty ones) must be enclosed in * double-quotes. * Ex: * @code * "America/Phoenix" <- string enclosed in quotes * "" <- empty field * @endcode - * - * Some fields represent a length of time. The format of these fields + * + * Some fields represent a length of time. The format of these fields * must be: * @code * "{+|-}hh:mm[:ss]" <- length-of-time format * @endcode * Where the plus or minus is mandatory and the seconds are optional. - * - * Since some time zones do not use daylight savings it is not always - * necessary for every field in a zone_spec to contain a value. All - * zone_specs must have at least ID and GMT offset. Zones that use - * daylight savings must have all fields filled except: - * STD ABBR, STD NAME, DST NAME. You should take note - * that DST ABBR is mandatory for zones that use daylight savings + * + * Since some time zones do not use daylight savings it is not always + * necessary for every field in a zone_spec to contain a value. All + * zone_specs must have at least ID and GMT offset. Zones that use + * daylight savings must have all fields filled except: + * STD ABBR, STD NAME, DST NAME. You should take note + * that DST ABBR is mandatory for zones that use daylight savings * (see field descriptions for further details). * - * ******* Fields and their description/details ********* - * - * ID: + * ******* Fields and their description/details ********* + * + * ID: * Contains the identifying string for the zone_spec. Any string will - * do as long as it's unique. No two ID's can be the same. + * do as long as it's unique. No two ID's can be the same. * * STD ABBR: * STD NAME: * DST ABBR: * DST NAME: - * These four are all the names and abbreviations used by the time - * zone being described. While any string will do in these fields, - * care should be taken. These fields hold the strings that will be - * used in the output of many of the local_time classes. + * These four are all the names and abbreviations used by the time + * zone being described. While any string will do in these fields, + * care should be taken. These fields hold the strings that will be + * used in the output of many of the local_time classes. * Ex: * @code * time_zone nyc = tz_db.time_zone_from_region("America/New_York"); @@ -103,42 +103,42 @@ namespace boost { * // 2004-Aug-30 00:00:00 EDT * @endcode * - * NOTE: The exact format/function names may vary - see local_time + * NOTE: The exact format/function names may vary - see local_time * documentation for further details. * * GMT offset: - * This is the number of hours added to utc to get the local time - * before any daylight savings adjustments are made. Some examples + * This is the number of hours added to utc to get the local time + * before any daylight savings adjustments are made. Some examples * are: America/New_York offset -5 hours, & Africa/Cairo offset +2 hours. * The format must follow the length-of-time format described above. * * DST adjustment: - * The amount of time added to gmt_offset when daylight savings is in + * The amount of time added to gmt_offset when daylight savings is in * effect. The format must follow the length-of-time format described * above. * * DST Start Date rule: * This is a specially formatted string that describes the day of year * in which the transition take place. It holds three fields of it's own, - * separated by semicolons. - * The first field indicates the "nth" weekday of the month. The possible - * values are: 1 (first), 2 (second), 3 (third), 4 (fourth), 5 (fifth), + * separated by semicolons. + * The first field indicates the "nth" weekday of the month. The possible + * values are: 1 (first), 2 (second), 3 (third), 4 (fourth), 5 (fifth), * and -1 (last). * The second field indicates the day-of-week from 0-6 (Sun=0). * The third field indicates the month from 1-12 (Jan=1). - * - * Examples are: "-1;5;9"="Last Friday of September", + * + * Examples are: "-1;5;9"="Last Friday of September", * "2;1;3"="Second Monday of March" * * Start time: * Start time is the number of hours past midnight, on the day of the - * start transition, the transition takes place. More simply put, the + * start transition, the transition takes place. More simply put, the * time of day the transition is made (in 24 hours format). The format - * must follow the length-of-time format described above with the + * must follow the length-of-time format described above with the * exception that it must always be positive. * * DST End date rule: - * See DST Start date rule. The difference here is this is the day + * See DST Start date rule. The difference here is this is the day * daylight savings ends (transition to STD). * * End time: @@ -147,13 +147,13 @@ namespace boost { template class tz_db_base { public: - /* Having CharT as a template parameter created problems - * with posix_time::duration_from_string. Templatizing - * duration_from_string was not possible at this time, however, - * it should be possible in the future (when poor compilers get - * fixed or stop being used). - * Since this class was designed to use CharT as a parameter it - * is simply typedef'd here to ease converting in back to a + /* Having CharT as a template parameter created problems + * with posix_time::duration_from_string. Templatizing + * duration_from_string was not possible at this time, however, + * it should be possible in the future (when poor compilers get + * fixed or stop being used). + * Since this class was designed to use CharT as a parameter it + * is simply typedef'd here to ease converting in back to a * parameter the future */ typedef char char_type; @@ -182,7 +182,7 @@ namespace boost { { string_type in_str; std::string buff; - + std::ifstream ifs(pathspec.c_str()); if(!ifs){ boost::throw_exception(data_not_accessible(pathspec)); @@ -192,27 +192,27 @@ namespace boost { } //! returns true if record successfully added to map - /*! Takes a region name in the form of "America/Phoenix", and a - * time_zone object for that region. The id string must be a unique + /*! Takes a region name in the form of "America/Phoenix", and a + * time_zone object for that region. The id string must be a unique * name that does not already exist in the database. */ - bool add_record(const string_type& region, - boost::shared_ptr tz) + bool add_record(const string_type& region, + boost::std::shared_ptr tz) { - typename map_type::value_type p(region, tz); + typename map_type::value_type p(region, tz); return (m_zone_map.insert(p)).second; } //! Returns a time_zone object built from the specs for the given region - /*! Returns a time_zone object built from the specs for the given - * region. If region does not exist a local_time::record_not_found + /*! Returns a time_zone object built from the specs for the given + * region. If region does not exist a local_time::record_not_found * exception will be thrown */ - boost::shared_ptr - time_zone_from_region(const string_type& region) const + boost::std::shared_ptr + time_zone_from_region(const string_type& region) const { // get the record typename map_type::const_iterator record = m_zone_map.find(region); if(record == m_zone_map.end()){ - return boost::shared_ptr(); //null pointer + return boost::std::shared_ptr(); //null pointer } return record->second; } @@ -229,9 +229,9 @@ namespace boost { } return regions; } - + private: - typedef std::map > map_type; + typedef std::map > map_type; map_type m_zone_map; // start and end rule are of the same type @@ -240,27 +240,27 @@ namespace boost { /* TODO: mechanisms need to be put in place to handle different * types of rule specs. parse_rules() only handles nth_kday * rule types. */ - + //! parses rule specs for transition day rules rule_type* parse_rules(const string_type& sr, const string_type& er) const { using namespace gregorian; - // start and end rule are of the same type, + // start and end rule are of the same type, // both are included here for readability typedef typename rule_type::start_rule start_rule; typedef typename rule_type::end_rule end_rule; - + // these are: [start|end] nth, day, month int s_nth = 0, s_d = 0, s_m = 0; int e_nth = 0, e_d = 0, e_m = 0; split_rule_spec(s_nth, s_d, s_m, sr); split_rule_spec(e_nth, e_d, e_m, er); - + typename start_rule::week_num s_wn, e_wn; s_wn = get_week_num(s_nth); e_wn = get_week_num(e_nth); - - + + return new rule_type(start_rule(s_wn, s_d, s_m), end_rule(e_wn, e_d, e_m)); } @@ -286,7 +286,7 @@ namespace boost { } return start_rule::fifth; // silence warnings } - + //! splits the [start|end]_date_rule string into 3 ints void split_rule_spec(int& nth, int& d, int& m, string_type rule) const { @@ -297,22 +297,22 @@ namespace boost { typedef boost::tokenizer::const_iterator, std::basic_string >::iterator tokenizer_iterator; - + const char_type sep_char[] = { ';', '\0'}; char_separator_type sep(sep_char); tokenizer tokens(rule, sep); // 3 fields - - tokenizer_iterator tok_iter = tokens.begin(); + + tokenizer_iterator tok_iter = tokens.begin(); nth = std::atoi(tok_iter->c_str()); ++tok_iter; d = std::atoi(tok_iter->c_str()); ++tok_iter; m = std::atoi(tok_iter->c_str()); } - + //! Take a line from the csv, turn it into a time_zone_type. /*! Take a line from the csv, turn it into a time_zone_type, - * and add it to the map. Zone_specs in csv file are expected to - * have eleven fields that describe the time zone. Returns true if + * and add it to the map. Zone_specs in csv file are expected to + * have eleven fields that describe the time zone. Returns true if * zone_spec successfully added to database */ bool parse_string(string_type& s) { @@ -333,16 +333,16 @@ namespace boost { //take a shot at fixing gcc 4.x error const unsigned int expected_fields = static_cast(FIELD_COUNT); - if (result.size() != expected_fields) { + if (result.size() != expected_fields) { std::ostringstream msg; - msg << "Expecting " << FIELD_COUNT << " fields, got " + msg << "Expecting " << FIELD_COUNT << " fields, got " << result.size() << " fields in line: " << s; boost::throw_exception(bad_field_count(msg.str())); BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return false); // should never reach } // initializations - bool has_dst = true; + bool has_dst = true; if(result[DSTABBR] == std::string()){ has_dst = false; } @@ -352,14 +352,14 @@ namespace boost { time_zone_names names(result[STDNAME], result[STDABBR], result[DSTNAME], result[DSTABBR]); - time_duration_type utc_offset = + time_duration_type utc_offset = str_from_delimited_time_duration(result[GMTOFFSET]); - + dst_adjustment_offsets adjust(time_duration_type(0,0,0), time_duration_type(0,0,0), time_duration_type(0,0,0)); - boost::shared_ptr rules; + boost::std::shared_ptr rules; if(has_dst){ adjust = dst_adjustment_offsets( @@ -368,16 +368,16 @@ namespace boost { str_from_delimited_time_duration(result[END_TIME]) ); - rules = - boost::shared_ptr(parse_rules(result[START_DATE_RULE], + rules = + boost::std::shared_ptr(parse_rules(result[START_DATE_RULE], result[END_DATE_RULE])); } string_type id(result[ID]); - boost::shared_ptr zone(new time_zone_type(names, utc_offset, adjust, rules)); + boost::std::shared_ptr zone(new time_zone_type(names, utc_offset, adjust, rules)); return (add_record(id, zone)); - - } - + + } + }; } } // namespace diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/detail/exception_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/detail/exception_ptr.hpp index 5e5a2679..283cdad4 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/detail/exception_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/detail/exception_ptr.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -37,7 +37,7 @@ boost class exception_ptr { - typedef boost::shared_ptr impl; + typedef boost::std::shared_ptr impl; impl ptr_; friend void rethrow_exception( exception_ptr const & ); typedef exception_detail::clone_base const * (impl::*unspecified_bool_type)() const; @@ -122,7 +122,7 @@ boost throw_function(BOOST_CURRENT_FUNCTION) << throw_file(__FILE__) << throw_line(__LINE__); - static exception_ptr ep(shared_ptr(new exception_detail::clone_impl(c))); + static exception_ptr ep(std::shared_ptr(new exception_detail::clone_impl(c))); return ep; } @@ -305,7 +305,7 @@ boost success: { BOOST_ASSERT(e!=0); - return exception_ptr(shared_ptr(e)); + return exception_ptr(std::shared_ptr(e)); } case exception_detail::clone_current_exception_result:: bad_alloc: @@ -332,7 +332,7 @@ boost catch( exception_detail::clone_base & e ) { - return exception_ptr(shared_ptr(e.clone())); + return exception_ptr(std::shared_ptr(e.clone())); } catch( std::domain_error & e ) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/exception.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/exception.hpp index 42d27871..6cd51f88 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/exception.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/exception.hpp @@ -145,7 +145,7 @@ boost #endif template - class shared_ptr; + class std::shared_ptr; namespace exception_detail @@ -157,8 +157,8 @@ boost error_info_container { virtual char const * diagnostic_information( char const * ) const = 0; - virtual shared_ptr get( type_info_ const & ) const = 0; - virtual void set( shared_ptr const &, type_info_ const & ) = 0; + virtual std::shared_ptr get( type_info_ const & ) const = 0; + virtual void set( std::shared_ptr const &, type_info_ const & ) = 0; virtual void add_ref() const = 0; virtual bool release() const = 0; virtual refcount_ptr clone() const = 0; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/get_error_info.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/get_error_info.hpp index 046f05ae..e9b7ce8d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/get_error_info.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/get_error_info.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include namespace boost @@ -32,7 +32,7 @@ boost get( exception const & x ) { if( exception_detail::error_info_container * c=x.data_.get() ) - if( shared_ptr eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) ) + if( std::shared_ptr eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) ) { #ifndef BOOST_NO_RTTI BOOST_ASSERT( 0!=dynamic_cast(eib.get()) ); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/info.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/info.hpp index 7b56076d..bae6ffcf 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/info.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/exception/info.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include @@ -82,26 +82,26 @@ boost } void - set( shared_ptr const & x, type_info_ const & typeid_ ) + set( std::shared_ptr const & x, type_info_ const & typeid_ ) { BOOST_ASSERT(x); info_[typeid_] = x; diagnostic_info_str_.clear(); } - shared_ptr + std::shared_ptr get( type_info_ const & ti ) const { error_info_map::const_iterator i=info_.find(ti); if( info_.end()!=i ) { - shared_ptr const & p = i->second; + std::shared_ptr const & p = i->second; #ifndef BOOST_NO_RTTI BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ ); #endif return p; } - return shared_ptr(); + return std::shared_ptr(); } char const * @@ -125,7 +125,7 @@ boost friend class boost::exception; - typedef std::map< type_info_, shared_ptr > error_info_map; + typedef std::map< type_info_, std::shared_ptr > error_info_map; error_info_map info_; mutable std::string diagnostic_info_str_; mutable int count_; @@ -168,7 +168,7 @@ boost set_info( E const & x, error_info const & v ) { typedef error_info error_info_tag_t; - shared_ptr p( new error_info_tag_t(v) ); + std::shared_ptr p( new error_info_tag_t(v) ); exception_detail::error_info_container * c=x.data_.get(); if( !c ) x.data_.adopt(c=new exception_detail::error_info_container_impl); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/filesystem/operations.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/filesystem/operations.hpp index dc01b7d8..43749ff9 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/filesystem/operations.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/filesystem/operations.hpp @@ -2,9 +2,9 @@ // Copyright Beman Dawes 2002-2009 // Copyright Jan Langer 2002 -// Copyright Dietmar Kuehl 2001 +// Copyright Dietmar Kuehl 2001 // Copyright Vladimir Prus 2002 - + // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -59,7 +59,7 @@ namespace boost //--------------------------------------------------------------------------------------// enum file_type - { + { status_error, # ifndef BOOST_FILESYSTEM_NO_DEPRECATED status_unknown = status_error, @@ -92,7 +92,7 @@ namespace boost // Values are from POSIX and are given in octal per the POSIX standard. // permission bits - + owner_read = 0400, // S_IRUSR, Read permission, owner owner_write = 0200, // S_IWUSR, Write permission, owner owner_exe = 0100, // S_IXUSR, Execute/search permission, owner @@ -115,8 +115,8 @@ namespace boost set_uid_on_exe = 04000, // S_ISUID, Set-user-ID on execution set_gid_on_exe = 02000, // S_ISGID, Set-group-ID on execution sticky_bit = 01000, // S_ISVTX, - // (POSIX XSI) On directories, restricted deletion flag - // (V7) 'sticky bit': save swapped text even after use + // (POSIX XSI) On directories, restricted deletion flag + // (V7) 'sticky bit': save swapped text even after use // (SunOS) On non-directories: don't cache this file // (SVID-v4.2) On directories: restricted deletion flag // Also see http://en.wikipedia.org/wiki/Sticky_bit @@ -151,13 +151,13 @@ namespace boost // observers file_type type() const { return m_value; } - perms permissions() const { return m_perms; } + perms permissions() const { return m_perms; } // modifiers void type(file_type v) { m_value = v; } void permissions(perms prms) { m_perms = prms; } - bool operator==(const file_status& rhs) const { return type() == rhs.type() && + bool operator==(const file_status& rhs) const { return type() == rhs.type() && permissions() == rhs.permissions(); } bool operator!=(const file_status& rhs) const { return !(*this == rhs); } @@ -260,7 +260,7 @@ namespace boost BOOST_FILESYSTEM_DECL void resize_file(const path& p, uintmax_t size, system::error_code* ec=0); BOOST_FILESYSTEM_DECL - space_info space(const path& p, system::error_code* ec=0); + space_info space(const path& p, system::error_code* ec=0); BOOST_FILESYSTEM_DECL path system_complete(const path& p, system::error_code* ec=0); BOOST_FILESYSTEM_DECL @@ -277,37 +277,37 @@ namespace boost inline file_status status(const path& p) {return detail::status(p);} - inline + inline file_status status(const path& p, system::error_code& ec) {return detail::status(p, &ec);} - inline + inline file_status symlink_status(const path& p) {return detail::symlink_status(p);} inline file_status symlink_status(const path& p, system::error_code& ec) {return detail::symlink_status(p, &ec);} - inline + inline bool exists(const path& p) {return exists(detail::status(p));} - inline + inline bool exists(const path& p, system::error_code& ec) {return exists(detail::status(p, &ec));} - inline + inline bool is_directory(const path& p) {return is_directory(detail::status(p));} - inline + inline bool is_directory(const path& p, system::error_code& ec) {return is_directory(detail::status(p, &ec));} - inline + inline bool is_regular_file(const path& p) {return is_regular_file(detail::status(p));} - inline + inline bool is_regular_file(const path& p, system::error_code& ec) {return is_regular_file(detail::status(p, &ec));} - inline + inline bool is_other(const path& p) {return is_other(detail::status(p));} - inline + inline bool is_other(const path& p, system::error_code& ec) {return is_other(detail::status(p, &ec));} inline bool is_symlink(const path& p) {return is_symlink(detail::symlink_status(p));} - inline + inline bool is_symlink(const path& p, system::error_code& ec) {return is_symlink(detail::symlink_status(p, &ec));} # ifndef BOOST_FILESYSTEM_NO_DEPRECATED @@ -330,7 +330,7 @@ namespace boost // in alphabetical order, unless otherwise noted // // // //--------------------------------------------------------------------------------------// - + // forward declarations path current_path(); // fwd declaration path initial_path(); @@ -367,7 +367,7 @@ namespace boost void copy(const path& from, const path& to) {detail::copy(from, to);} inline - void copy(const path& from, const path& to, system::error_code& ec) + void copy(const path& from, const path& to, system::error_code& ec) {detail::copy(from, to, &ec);} inline void copy_directory(const path& from, const path& to) @@ -500,7 +500,7 @@ namespace boost inline boost::uintmax_t remove_all(const path& p) {return detail::remove_all(p);} - + inline boost::uintmax_t remove_all(const path& p, system::error_code& ec) {return detail::remove_all(p, &ec);} @@ -517,10 +517,10 @@ namespace boost void resize_file(const path& p, uintmax_t size, system::error_code& ec) {detail::resize_file(p, size, &ec);} inline - space_info space(const path& p) {return detail::space(p);} + space_info space(const path& p) {return detail::space(p);} inline - space_info space(const path& p, system::error_code& ec) {return detail::space(p, &ec);} + space_info space(const path& p, system::error_code& ec) {return detail::space(p, &ec);} # ifndef BOOST_FILESYSTEM_NO_DEPRECATED inline bool symbolic_link_exists(const path& p) @@ -537,7 +537,7 @@ namespace boost path temp_directory_path() {return detail::temp_directory_path();} inline - path temp_directory_path(system::error_code& ec) + path temp_directory_path(system::error_code& ec) {return detail::temp_directory_path(&ec);} inline path unique_path(const path& p="%%%%-%%%%-%%%%-%%%%") @@ -552,7 +552,7 @@ namespace boost // // //--------------------------------------------------------------------------------------// -// GCC has a problem with a member function named path within a namespace or +// GCC has a problem with a member function named path within a namespace or // sub-namespace that also has a class named path. The workaround is to always // fully qualify the name path when it refers to the class name. @@ -593,12 +593,12 @@ public: file_status symlink_status() const {return m_get_symlink_status();} file_status symlink_status(system::error_code& ec) const {return m_get_symlink_status(&ec);} - bool operator==(const directory_entry& rhs) {return m_path == rhs.m_path;} - bool operator!=(const directory_entry& rhs) {return m_path != rhs.m_path;} - bool operator< (const directory_entry& rhs) {return m_path < rhs.m_path;} - bool operator<=(const directory_entry& rhs) {return m_path <= rhs.m_path;} - bool operator> (const directory_entry& rhs) {return m_path > rhs.m_path;} - bool operator>=(const directory_entry& rhs) {return m_path >= rhs.m_path;} + bool operator==(const directory_entry& rhs) {return m_path == rhs.m_path;} + bool operator!=(const directory_entry& rhs) {return m_path != rhs.m_path;} + bool operator< (const directory_entry& rhs) {return m_path < rhs.m_path;} + bool operator<=(const directory_entry& rhs) {return m_path <= rhs.m_path;} + bool operator> (const directory_entry& rhs) {return m_path > rhs.m_path;} + bool operator>=(const directory_entry& rhs) {return m_path >= rhs.m_path;} private: boost::filesystem::path m_path; @@ -625,7 +625,7 @@ namespace detail # if defined(BOOST_POSIX_API) , void *& buffer # endif - ); + ); struct dir_itr_imp { @@ -688,7 +688,7 @@ namespace detail ~directory_iterator() {} // never throws directory_iterator& increment(system::error_code& ec) - { + { detail::directory_iterator_increment(*this, &ec); return *this; } @@ -700,16 +700,16 @@ namespace detail friend BOOST_FILESYSTEM_DECL void detail::directory_iterator_increment(directory_iterator& it, system::error_code* ec); - // shared_ptr provides shallow-copy semantics required for InputIterators. + // std::shared_ptr provides shallow-copy semantics required for InputIterators. // m_imp.get()==0 indicates the end iterator. - boost::shared_ptr< detail::dir_itr_imp > m_imp; + boost::std::shared_ptr< detail::dir_itr_imp > m_imp; friend class boost::iterator_core_access; boost::iterator_facade< directory_iterator, directory_entry, - boost::single_pass_traversal_tag >::reference dereference() const + boost::single_pass_traversal_tag >::reference dereference() const { BOOST_ASSERT_MSG(m_imp.get(), "attempt to dereference end iterator"); return m_imp->dir_entry; @@ -884,7 +884,7 @@ namespace detail } int level() const - { + { BOOST_ASSERT_MSG(m_imp.get(), "level() on end recursive_directory_iterator"); return m_imp->m_level; @@ -903,7 +903,7 @@ namespace detail # endif void pop() - { + { BOOST_ASSERT_MSG(m_imp.get(), "pop() on end recursive_directory_iterator"); m_imp->pop(); @@ -936,17 +936,17 @@ namespace detail private: - // shared_ptr provides shallow-copy semantics required for InputIterators. + // std::shared_ptr provides shallow-copy semantics required for InputIterators. // m_imp.get()==0 indicates the end iterator. - boost::shared_ptr< detail::recur_dir_itr_imp > m_imp; + boost::std::shared_ptr< detail::recur_dir_itr_imp > m_imp; friend class boost::iterator_core_access; - boost::iterator_facade< + boost::iterator_facade< recursive_directory_iterator, directory_entry, boost::single_pass_traversal_tag >::reference - dereference() const + dereference() const { BOOST_ASSERT_MSG(m_imp.get(), "dereference of end recursive_directory_iterator"); @@ -954,7 +954,7 @@ namespace detail } void increment() - { + { BOOST_ASSERT_MSG(m_imp.get(), "increment of end recursive_directory_iterator"); m_imp->increment(0); @@ -976,7 +976,7 @@ namespace detail // class filesystem_error // // // //--------------------------------------------------------------------------------------// - + class BOOST_SYMBOL_VISIBLE filesystem_error : public system::system_error { // see http://www.boost.org/more/error_handling.html for design rationale @@ -1009,7 +1009,7 @@ namespace detail } catch (...) { m_imp_ptr.reset(); } } - + filesystem_error( const std::string & what_arg, const path& path1_arg, const path& path2_arg, system::error_code ec) @@ -1075,7 +1075,7 @@ namespace detail path m_path2; // may be empty() std::string m_what; // not built until needed }; - boost::shared_ptr m_imp_ptr; + boost::std::shared_ptr m_imp_ptr; }; // test helper -----------------------------------------------------------------------// diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/filesystem/path.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/filesystem/path.hpp index 2dd1b00e..90aff04b 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/filesystem/path.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/filesystem/path.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -62,11 +62,11 @@ namespace filesystem # ifdef BOOST_WINDOWS_API typedef wchar_t value_type; BOOST_STATIC_CONSTEXPR value_type preferred_separator = L'\\'; -# else +# else typedef char value_type; BOOST_STATIC_CONSTEXPR value_type preferred_separator = '/'; # endif - typedef std::basic_string string_type; + typedef std::basic_string string_type; typedef std::codecvt codecvt_type; @@ -89,7 +89,7 @@ namespace filesystem // // The path locale, which is global to the thread, can be changed by the // imbue() function. It is initialized to an implementation defined locale. - // + // // For Windows, wchar_t strings do not undergo conversion. char strings // are converted using the "ANSI" or "OEM" code pages, as determined by // the AreFileApisANSI() function, or, if a conversion argument is given, @@ -98,7 +98,7 @@ namespace filesystem // See m_pathname comments for further important rationale. // TODO: rules needed for operating systems that use / or . - // differently, or format directory paths differently from file paths. + // differently, or format directory paths differently from file paths. // // ********************************************************************************** // @@ -127,7 +127,7 @@ namespace filesystem // ----- constructors ----- - path(){} + path(){} path(const path& p) : m_pathname(p.m_pathname) {} @@ -159,7 +159,7 @@ namespace filesystem template path(InputIterator begin, InputIterator end) - { + { if (begin != end) { std::basic_string::value_type> @@ -170,7 +170,7 @@ namespace filesystem template path(InputIterator begin, InputIterator end, const codecvt_type& cvt) - { + { if (begin != end) { std::basic_string::value_type> @@ -225,7 +225,7 @@ namespace filesystem template path& assign(InputIterator begin, InputIterator end, const codecvt_type& cvt) - { + { m_pathname.clear(); if (begin != end) { @@ -270,13 +270,13 @@ namespace filesystem template path& concat(InputIterator begin, InputIterator end) - { + { return concat(begin, end, codecvt()); } template path& concat(InputIterator begin, InputIterator end, const codecvt_type& cvt) - { + { if (begin == end) return *this; std::basic_string::value_type> @@ -313,7 +313,7 @@ namespace filesystem template path& append(InputIterator begin, InputIterator end) - { + { return append(begin, end, codecvt()); } @@ -334,7 +334,7 @@ namespace filesystem void swap(path& rhs) { m_pathname.swap(rhs.m_pathname); } // ----- observers ----- - + // For operating systems that format file paths differently than directory // paths, return values from observers are formatted as file names unless there // is a trailing separator, in which case returns are formatted as directory @@ -364,16 +364,16 @@ namespace filesystem String string(const codecvt_type& cvt) const; # ifdef BOOST_WINDOWS_API - const std::string string() const { return string(codecvt()); } + const std::string string() const { return string(codecvt()); } const std::string string(const codecvt_type& cvt) const - { + { std::string tmp; if (!m_pathname.empty()) path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(), tmp, cvt); return tmp; } - + // string_type is std::wstring, so there is no conversion const std::wstring& wstring() const { return m_pathname; } const std::wstring& wstring(const codecvt_type&) const { return m_pathname; } @@ -385,7 +385,7 @@ namespace filesystem const std::wstring wstring() const { return wstring(codecvt()); } const std::wstring wstring(const codecvt_type& cvt) const - { + { std::wstring tmp; if (!m_pathname.empty()) path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(), @@ -404,8 +404,8 @@ namespace filesystem String generic_string(const codecvt_type& cvt) const; # ifdef BOOST_WINDOWS_API - const std::string generic_string() const { return generic_string(codecvt()); } - const std::string generic_string(const codecvt_type& cvt) const; + const std::string generic_string() const { return generic_string(codecvt()); } + const std::string generic_string(const codecvt_type& cvt) const; const std::wstring generic_wstring() const; const std::wstring generic_wstring(const codecvt_type&) const { return generic_wstring(); }; @@ -426,7 +426,7 @@ namespace filesystem // ----- decomposition ----- - path root_path() const; + path root_path() const; path root_name() const; // returns 0 or 1 element path // even on POSIX, root_name() is non-empty() for network paths path root_directory() const; // returns 0 or 1 element path @@ -455,7 +455,7 @@ namespace filesystem return has_root_directory(); # endif } - bool is_relative() const { return !is_absolute(); } + bool is_relative() const { return !is_absolute(); } // ----- iterators ----- @@ -489,7 +489,7 @@ namespace filesystem # if defined(BOOST_FILESYSTEM_DEPRECATED) // deprecated functions with enough signature or semantic changes that they are - // not supplied by default + // not supplied by default const std::string file_string() const { return string(); } const std::string directory_string() const { return string(); } const std::string native_file_string() const { return string(); } @@ -502,7 +502,7 @@ namespace filesystem //basic_path(const string_type& str, name_check) { operator/=(str); } //basic_path(const typename string_type::value_type* s, name_check) // { operator/=(s);} - //static bool default_name_check_writable() { return false; } + //static bool default_name_check_writable() { return false; } //static void default_name_check(name_check) {} //static name_check default_name_check() { return 0; } //basic_path& canonize(); @@ -529,7 +529,7 @@ namespace filesystem // slashes NOT converted to backslashes # if defined(_MSC_VER) # pragma warning(pop) // restore warning settings. -# endif +# endif string_type::size_type m_append_separator_if_needed(); // Returns: If separator is to be appended, m_pathname.size() before append. Otherwise 0. @@ -541,7 +541,7 @@ namespace filesystem path& m_normalize(); // Was qualified; como433beta8 reports: - // warning #427-D: qualified name is not allowed in member declaration + // warning #427-D: qualified name is not allowed in member declaration friend class iterator; friend bool operator<(const path& lhs, const path& rhs); @@ -565,7 +565,7 @@ namespace filesystem //------------------------------------------------------------------------------------// // class path::iterator // //------------------------------------------------------------------------------------// - + class path::iterator : public boost::iterator_facade< path::iterator, @@ -596,7 +596,7 @@ namespace filesystem // m_path_ptr->m_pathname. // if m_element is implicit dot, m_pos is the // position of the last separator in the path. - // end() iterator is indicated by + // end() iterator is indicated by // m_pos == m_path_ptr->m_pathname.size() }; // path::iterator @@ -611,15 +611,15 @@ namespace filesystem inline bool lexicographical_compare(path::iterator first1, path::iterator last1, path::iterator first2, path::iterator last2) { return detail::lex_compare(first1, last1, first2, last2) < 0; } - + inline bool operator==(const path& lhs, const path& rhs) {return lhs.compare(rhs) == 0;} - inline bool operator==(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) == 0;} + inline bool operator==(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) == 0;} inline bool operator==(const path::string_type& lhs, const path& rhs) {return rhs.compare(lhs) == 0;} inline bool operator==(const path& lhs, const path::value_type* rhs) {return lhs.compare(rhs) == 0;} inline bool operator==(const path::value_type* lhs, const path& rhs) {return rhs.compare(lhs) == 0;} - + inline bool operator!=(const path& lhs, const path& rhs) {return lhs.compare(rhs) != 0;} - inline bool operator!=(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) != 0;} + inline bool operator!=(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) != 0;} inline bool operator!=(const path::string_type& lhs, const path& rhs) {return rhs.compare(lhs) != 0;} inline bool operator!=(const path& lhs, const path::value_type* rhs) {return lhs.compare(rhs) != 0;} inline bool operator!=(const path::value_type* lhs, const path& rhs) {return rhs.compare(lhs) != 0;} @@ -658,7 +658,7 @@ namespace filesystem return os << boost::io::quoted(p.template string >(), static_cast('&')); } - + template inline std::basic_istream& operator>>(std::basic_istream& is, path& p) @@ -668,7 +668,7 @@ namespace filesystem p = str; return is; } - + // name_checks // These functions are holdovers from version 1. It isn't clear they have much @@ -680,14 +680,14 @@ namespace filesystem BOOST_FILESYSTEM_DECL bool portable_directory_name(const std::string & name); BOOST_FILESYSTEM_DECL bool portable_file_name(const std::string & name); BOOST_FILESYSTEM_DECL bool native(const std::string & name); - + //--------------------------------------------------------------------------------------// // class path member template implementation // //--------------------------------------------------------------------------------------// template path& path::append(InputIterator begin, InputIterator end, const codecvt_type& cvt) - { + { if (begin == end) return *this; string_type::size_type sep_pos(m_append_separator_if_needed()); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/format/alt_sstream.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/format/alt_sstream.hpp index e236be35..d513d243 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/format/alt_sstream.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/format/alt_sstream.hpp @@ -1,5 +1,5 @@ // ---------------------------------------------------------------------------- -// alt_sstream.hpp : alternative stringstream +// alt_sstream.hpp : alternative stringstream // ---------------------------------------------------------------------------- // Copyright Samuel Krempp 2003. Use, modification, and distribution are @@ -18,23 +18,23 @@ #include #include #include -#include +#include #include namespace boost { namespace io { - template, + template, class Alloc=::std::allocator > class basic_altstringbuf; - template, + template, class Alloc=::std::allocator > class basic_oaltstringstream; template - class basic_altstringbuf + class basic_altstringbuf : public ::std::basic_streambuf { typedef ::std::basic_streambuf streambuf_t; @@ -55,14 +55,14 @@ namespace boost { explicit basic_altstringbuf(std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) - : putend_(NULL), is_allocated_(false), mode_(mode) + : putend_(NULL), is_allocated_(false), mode_(mode) {} explicit basic_altstringbuf(const string_type& s, ::std::ios_base::openmode mode = ::std::ios_base::in | ::std::ios_base::out) - : putend_(NULL), is_allocated_(false), mode_(mode) + : putend_(NULL), is_allocated_(false), mode_(mode) { dealloc(); str(s); } - virtual ~basic_altstringbuf() + virtual ~basic_altstringbuf() { dealloc(); } using streambuf_t::pbase; using streambuf_t::pptr; @@ -70,36 +70,36 @@ namespace boost { using streambuf_t::eback; using streambuf_t::gptr; using streambuf_t::egptr; - + void clear_buffer(); void str(const string_type& s); // 0-copy access : - Ch * begin() const; + Ch * begin() const; size_type size() const; size_type cur_size() const; // stop at current pointer Ch * pend() const // the highest position reached by pptr() since creation { return ((putend_ < pptr()) ? pptr() : putend_); } - size_type pcount() const + size_type pcount() const { return static_cast( pptr() - pbase()) ;} // copy buffer to string : - string_type str() const + string_type str() const { return string_type(begin(), size()); } - string_type cur_str() const + string_type cur_str() const { return string_type(begin(), cur_size()); } protected: explicit basic_altstringbuf (basic_altstringbuf * s, - ::std::ios_base::openmode mode + ::std::ios_base::openmode mode = ::std::ios_base::in | ::std::ios_base::out) - : putend_(NULL), is_allocated_(false), mode_(mode) + : putend_(NULL), is_allocated_(false), mode_(mode) { dealloc(); str(s); } - virtual pos_type seekoff(off_type off, ::std::ios_base::seekdir way, - ::std::ios_base::openmode which + virtual pos_type seekoff(off_type off, ::std::ios_base::seekdir way, + ::std::ios_base::openmode which = ::std::ios_base::in | ::std::ios_base::out); - virtual pos_type seekpos (pos_type pos, - ::std::ios_base::openmode which + virtual pos_type seekpos (pos_type pos, + ::std::ios_base::openmode which = ::std::ios_base::in | ::std::ios_base::out); virtual int_type underflow(); virtual int_type pbackfail(int_type meta = compat_traits_type::eof()); @@ -117,53 +117,53 @@ namespace boost { // --- class basic_oaltstringstream ---------------------------------------- template - class basic_oaltstringstream - : private base_from_member< shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >, + class basic_oaltstringstream + : private base_from_member< std::shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >, public ::std::basic_ostream { - class No_Op { + class No_Op { // used as no-op deleter for (not-owner) shared_pointers - public: + public: template const T & operator()(const T & arg) { return arg; } }; typedef ::std::basic_ostream stream_t; - typedef boost::base_from_member > > + typedef boost::base_from_member > > pbase_type; typedef ::std::basic_string string_type; typedef typename string_type::size_type size_type; typedef basic_altstringbuf stringbuf_t; public: typedef Alloc allocator_type; - basic_oaltstringstream() - : pbase_type(new stringbuf_t), stream_t(rdbuf()) + basic_oaltstringstream() + : pbase_type(new stringbuf_t), stream_t(rdbuf()) { } - basic_oaltstringstream(::boost::shared_ptr buf) - : pbase_type(buf), stream_t(rdbuf()) + basic_oaltstringstream(::boost::std::shared_ptr buf) + : pbase_type(buf), stream_t(rdbuf()) { } - basic_oaltstringstream(stringbuf_t * buf) - : pbase_type(buf, No_Op() ), stream_t(rdbuf()) + basic_oaltstringstream(stringbuf_t * buf) + : pbase_type(buf, No_Op() ), stream_t(rdbuf()) { } - stringbuf_t * rdbuf() const + stringbuf_t * rdbuf() const { return pbase_type::member.get(); } - void clear_buffer() + void clear_buffer() { rdbuf()->clear_buffer(); } // 0-copy access : - Ch * begin() const + Ch * begin() const { return rdbuf()->begin(); } - size_type size() const + size_type size() const { return rdbuf()->size(); } size_type cur_size() const // stops at current position { return rdbuf()->cur_size(); } // copy buffer to string : string_type str() const // [pbase, epptr[ - { return rdbuf()->str(); } + { return rdbuf()->str(); } string_type cur_str() const // [pbase, pptr[ { return rdbuf()->cur_str(); } - void str(const string_type& s) + void str(const string_type& s) { rdbuf()->str(s); } }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/functional/hash/extensions.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/functional/hash/extensions.hpp index 998c08e4..2144e057 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/functional/hash/extensions.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/functional/hash/extensions.hpp @@ -5,7 +5,7 @@ // Based on Peter Dimov's proposal // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf -// issue 6.18. +// issue 6.18. // This implements the extensions to the standard. // It's undocumented, so you shouldn't use it.... @@ -358,12 +358,12 @@ namespace boost } }; }; - + template struct hash_impl_msvc2 : public hash_impl_msvc::value> ::BOOST_NESTED_TEMPLATE inner {}; - + template <> struct hash_impl { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/get_pointer.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/get_pointer.hpp index b27b98a6..7399d199 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/get_pointer.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/get_pointer.hpp @@ -9,11 +9,11 @@ // In order to avoid circular dependencies with Boost.TR1 // we make sure that our include of doesn't try to -// pull in the TR1 headers: that's why we use this header +// pull in the TR1 headers: that's why we use this header // rather than including directly: #include // std::auto_ptr -namespace boost { +namespace boost { // get_pointer(p) extracts a ->* capable pointer from p @@ -22,7 +22,7 @@ template T * get_pointer(T * p) return p; } -// get_pointer(shared_ptr const & p) has been moved to shared_ptr.hpp +// get_pointer(std::shared_ptr const & p) has been moved to std::shared_ptr.hpp template T * get_pointer(std::auto_ptr const& p) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/io_error.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/io_error.hpp index 5ea79c58..e74ca47a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/io_error.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/io_error.hpp @@ -1,6 +1,6 @@ /* Copyright 2005-2007 Adobe Systems Incorporated - + Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). @@ -20,7 +20,7 @@ #include #include "../../gil_config.hpp" -#include +#include namespace boost { namespace gil { @@ -30,7 +30,7 @@ inline void io_error_if(bool expr, const char* descr="") { if (expr) io_error(de namespace detail { class file_mgr { protected: - shared_ptr _fp; + std::shared_ptr _fp; struct null_deleter { void operator()(void const*) const {} }; file_mgr(FILE* file) : _fp(file, null_deleter()) {} @@ -38,7 +38,7 @@ namespace detail { file_mgr(const char* filename, const char* flags) { FILE* fp; io_error_if((fp=fopen(filename,flags))==NULL, "file_mgr: failed to open file"); - _fp=shared_ptr(fp,fclose); + _fp=std::shared_ptr(fp,fclose); } public: diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/jpeg_dynamic_io.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/jpeg_dynamic_io.hpp index b1108fe8..3140e728 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/jpeg_dynamic_io.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/jpeg_dynamic_io.hpp @@ -1,6 +1,6 @@ /* Copyright 2005-2007 Adobe Systems Incorporated - + Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "../dynamic_image/dynamic_image_all.hpp" #include "io_error.hpp" @@ -43,7 +43,7 @@ struct jpeg_write_is_supported { class jpeg_writer_dynamic : public jpeg_writer { int _quality; -public: +public: jpeg_writer_dynamic(FILE* file, int quality=100) : jpeg_writer(file) , _quality(quality) {} jpeg_writer_dynamic(const char* filename, int quality=100) : jpeg_writer(filename), _quality(quality) {} @@ -74,7 +74,7 @@ class jpeg_reader_dynamic : public jpeg_reader { public: jpeg_reader_dynamic(FILE* file) : jpeg_reader(file) {} jpeg_reader_dynamic(const char* filename) : jpeg_reader(filename){} - + template void read_image(any_image& im) { if (!construct_matched(im,detail::jpeg_type_format_checker(_cinfo.out_color_space))) { @@ -110,7 +110,7 @@ inline void jpeg_read_image(const std::string& filename,any_image& im) { /// \ingroup JPEG_IO /// \brief Saves the currently instantiated view to a jpeg file specified by the given jpeg image file name. -/// Throws std::ios_base::failure if the currently instantiated view type is not supported for writing by the I/O extension +/// Throws std::ios_base::failure if the currently instantiated view type is not supported for writing by the I/O extension /// or if it fails to create the file. template inline void jpeg_write_view(const char* filename,const any_image_view& runtime_view) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/jpeg_io.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/jpeg_io.hpp index b9adc023..bdeb56d5 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/jpeg_io.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/jpeg_io.hpp @@ -1,6 +1,6 @@ /* Copyright 2005-2007 Adobe Systems Incorporated - + Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). @@ -24,7 +24,7 @@ #include #include #include -#include +#include extern "C" { #include } @@ -64,7 +64,7 @@ inline point2 jpeg_read_dimensions(const std::string& filename) /// \ingroup JPEG_IO /// \brief Loads the image specified by the given jpeg image file name into the given view. /// Triggers a compile assert if the view color space and channel depth are not supported by the JPEG library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not /// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. template inline void jpeg_read_view(const char* filename,const View& view) { @@ -84,7 +84,7 @@ inline void jpeg_read_view(const std::string& filename,const View& view) { /// \ingroup JPEG_IO /// \brief Allocates a new image whose dimensions are determined by the given jpeg image file, and loads the pixels into it. /// Triggers a compile assert if the image color space or channel depth are not supported by the JPEG library or by the I/O extension. -/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not +/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not /// compatible with the ones specified by Image template inline void jpeg_read_image(const char* filename,Image& im) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/png_dynamic_io.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/png_dynamic_io.hpp index a3a25a97..616e2029 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/png_dynamic_io.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/gil/extension/io/png_dynamic_io.hpp @@ -1,6 +1,6 @@ /* Copyright 2005-2007 Adobe Systems Incorporated - + Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "../dynamic_image/dynamic_image_all.hpp" #include "io_error.hpp" #include "png_io.hpp" @@ -81,7 +81,7 @@ class png_reader_dynamic : public png_reader { public: png_reader_dynamic(FILE* file) : png_reader(file) {} png_reader_dynamic(const char* filename) : png_reader(filename){} - + template void read_image(any_image& im) { png_uint_32 width, height; @@ -99,7 +99,7 @@ public: } }; -} // namespace detail +} // namespace detail /// \ingroup PNG_IO /// \brief reads a PNG image into a run-time instantiated image @@ -121,7 +121,7 @@ inline void png_read_image(const std::string& filename,any_image& im) { /// \ingroup PNG_IO /// \brief Saves the currently instantiated view to a png file specified by the given png image file name. -/// Throws std::ios_base::failure if the currently instantiated view type is not supported for writing by the I/O extension +/// Throws std::ios_base::failure if the currently instantiated view type is not supported for writing by the I/O extension /// or if it fails to create the file. template inline void png_write_view(const char* filename,const any_image_view& runtime_view) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/detail/self_avoiding_walk.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/detail/self_avoiding_walk.hpp index c171897f..bd02797f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/detail/self_avoiding_walk.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/detail/self_avoiding_walk.hpp @@ -10,19 +10,19 @@ #define BOOST_SELF_AVOIDING_WALK_HPP /* - This file defines necessary components for SAW. + This file defines necessary components for SAW. mesh language: (defined by myself to clearify what is what) A triangle in mesh is called an triangle. - An edge in mesh is called an line. + An edge in mesh is called an line. A vertex in mesh is called a point. A triangular mesh corresponds to a graph in which a vertex is a - triangle and an edge(u, v) stands for triangle u and triangle v + triangle and an edge(u, v) stands for triangle u and triangle v share an line. After this point, a vertex always refers to vertex in graph, - therefore it is a traingle in mesh. + therefore it is a traingle in mesh. */ @@ -43,7 +43,7 @@ namespace boost { triple(const T1& a, const T2& b, const T3& c) : first(a), second(b), third(c) {} triple() : first(SAW_SENTINAL), second(SAW_SENTINAL), third(SAW_SENTINAL) {} }; - + typedef triple Triple; /* Define a vertex property which has a triangle inside. Triangle is @@ -70,14 +70,14 @@ namespace boost { if ( a.second == b.second || a.second == b.third ) l.second = a.second; else if ( a.third == b.second || a.third == b.third ) - l.second = a.third; + l.second = a.third; } else if ( a.first == b.second ) { l.first = a.first; if ( a.second == b.third ) l.second = a.second; else if ( a.third == b.third ) - l.second = a.third; + l.second = a.third; } else if ( a.first == b.third ) { l.first = a.first; @@ -90,17 +90,17 @@ namespace boost { } else if ( a.second == b.second ) { l.first = a.second; - if ( a.third == b.third ) + if ( a.third == b.third ) l.second = a.third; } else if ( a.second == b.third ) { l.first = a.second; - } else if ( a.third == b.first - || a.third == b.second + } else if ( a.third == b.first + || a.third == b.second || a.third == b.third ) - l.first = a.third; + l.first = a.third; /*Make it in order*/ if ( l.first > l.second ) { @@ -132,7 +132,7 @@ namespace boost { } TriangleDecorator td; }; - + /* HList has to be a handle of data holder so that pass-by-value is * in right logic. * @@ -146,7 +146,7 @@ namespace boost { : public bfs_visitor<>, public dfs_visitor<> { typedef typename boost::property_traits::value_type iter; - /*use boost shared_ptr*/ + /*use boost std::shared_ptr*/ typedef typename HList::element_type::value_type::second_type Line; public: @@ -176,12 +176,12 @@ namespace boost { using std::make_pair; typedef typename boost::graph_traits::vertex_descriptor Vertex; Vertex tau = target(e, G); - Vertex i = source(e, G); + Vertex i = source(e, G); get_vertex_sharing get_sharing_line(td); - + Line tau_i = get_sharing_line(tau, i); - + iter w_end = hlist->end(); iter w_i = iter_d[i]; @@ -197,7 +197,7 @@ namespace boost { *b w(i) |- w(i+1) w(i) ~> w(i+1) or no w(i+1) yet *---------------------------------------------------------- */ - + bool a = false, b = false; --w_i_m_1; @@ -206,13 +206,13 @@ namespace boost { if ( w_i_m_1 != w_end ) { a = ( w_i_m_1->second.first != SAW_SENTINAL ); - } - + } + if ( a ) { - + if ( b ) { - /*Case 1: - + /*Case 1: + w(i-1) |- w(i) |- w(i+1) */ Line l1 = get_sharing_line(*w_i_m_1, tau); @@ -221,7 +221,7 @@ namespace boost { --w_i_m_2; bool c = true; - + if ( w_i_m_2 != w_end ) { c = w_i_m_2->second != l1; } @@ -230,11 +230,11 @@ namespace boost { /*extension: w(i-1) -> tau |- w(i) */ w_i_m_1->second = l1; /*insert(pos, const T&) is to insert before pos*/ - iter_d[tau] = hlist->insert(w_i, make_pair(tau, tau_i)); - + iter_d[tau] = hlist->insert(w_i, make_pair(tau, tau_i)); + } else { /* w(i-1) ^ tau == w(i-2) ^ w(i-1) */ /*must be w(i-2) ~> w(i-1) */ - + bool d = true; //need to handle the case when w_i_p_1 is null Line l3 = get_sharing_line(*w_i_p_1, tau); @@ -261,15 +261,15 @@ namespace boost { ; } } - + } - } else { + } else { /*Case 2: - + w(i-1) |- w(i) ~> w(1+1) */ - - if ( w_i->second.second == tau_i.first + + if ( w_i->second.second == tau_i.first || w_i->second.second == tau_i.second ) { /*w(i) ^ w(i+1) < w(i) ^ tau*/ /*extension: w(i) |- tau -> w(i+1) */ w_i->second = tau_i; @@ -296,23 +296,23 @@ namespace boost { iter_d[w_i_m_1->first] = hlist->insert(w_i_p_1, *w_i_m_1); hlist->erase(w_i_m_1); } - - } - + + } + } - + } else { - + if ( b ) { /*Case 3: - + w(i-1) ~> w(i) |- w(i+1) */ bool c = false; if ( w_i_m_1 != w_end ) c = ( w_i_m_1->second.second == tau_i.first) || ( w_i_m_1->second.second == tau_i.second); - + if ( c ) { /*w(i-1) ^ w(i) < w(i) ^ tau*/ /* extension: w(i-1) -> tau |- w(i) */ if ( w_i_m_1 != w_end ) @@ -336,7 +336,7 @@ namespace boost { /*extension: w(i-1) -> w(i+1) |- w(i) |- tau -> w(i+2) */ iter w_i_p_2 = w_i_p_1; ++w_i_p_2; - + w_i_p_1->second = w_i->second; iter_d[i] = hlist->insert(w_i_p_2, make_pair(i, tau_i)); hlist->erase(w_i); @@ -344,16 +344,16 @@ namespace boost { iter_d[tau] = hlist->insert(w_i_p_2, make_pair(tau, l2)); } } - + } else { /*Case 4: - + w(i-1) ~> w(i) ~> w(i+1) - + */ bool c = false; if ( w_i_m_1 != w_end ) { - c = (w_i_m_1->second.second == tau_i.first) + c = (w_i_m_1->second.second == tau_i.first) || (w_i_m_1->second.second == tau_i.second); } if ( c ) { /*w(i-1) ^ w(i) < w(i) ^ tau */ @@ -361,48 +361,48 @@ namespace boost { if ( w_i_m_1 != w_end ) w_i_m_1->second = get_sharing_line(*w_i_m_1, tau); iter_d[tau] = hlist->insert(w_i, make_pair(tau, tau_i)); - } else { + } else { /*extension: w(i) |- tau -> w(i+1) */ w_i->second = tau_i; Line l1; l1.first = SAW_SENTINAL; l1.second = SAW_SENTINAL; - if ( w_i_p_1 != w_end ) + if ( w_i_p_1 != w_end ) l1 = get_sharing_line(*w_i_p_1, tau); iter_d[tau] = hlist->insert(w_i_p_1, make_pair(tau, l1)); } } - + } return true; } - + protected: TriangleDecorator td; /*a decorator for vertex*/ HList hlist; /*This must be a handle of list to record the SAW The element type of the list is pair */ - - IteratorD iter_d; + + IteratorD iter_d; /*Problem statement: Need a fast access to w for triangle i. - *Possible solution: mantain an array to record. - iter_d[i] will return an iterator + *Possible solution: mantain an array to record. + iter_d[i] will return an iterator which points to w(i), where i is a vertex representing triangle i. */ }; template - inline + inline SAW_visitor visit_SAW(Triangle t, HList hl, Iterator i) { return SAW_visitor(t, hl, i); } template - inline + inline SAW_visitor< random_access_iterator_property_map, HList, random_access_iterator_property_map > visit_SAW_ptr(Tri* t, HList hl, Iter* i) { @@ -412,7 +412,7 @@ namespace boost { } // should also have combo's of pointers, and also const :( - + } #endif /*BOOST_SAW_H*/ diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/detail/mpi_process_group.ipp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/detail/mpi_process_group.ipp index a4d35462..75a02fe2 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/detail/mpi_process_group.ipp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/detail/mpi_process_group.ipp @@ -40,7 +40,7 @@ namespace boost { namespace graph { namespace distributed { struct mpi_process_group::impl { - + typedef mpi_process_group::message_header message_header; typedef mpi_process_group::outgoing_messages outgoing_messages; @@ -71,7 +71,7 @@ struct mpi_process_group::impl std::size_t batch_header_number; std::size_t batch_buffer_size; std::size_t batch_message_size; - + /** * The actual MPI communicator used to transmit data. */ @@ -90,19 +90,19 @@ struct mpi_process_group::impl /// The numbers of processors that have entered a synchronization stage std::vector processors_synchronizing_stage; - + /// The synchronization stage of a processor std::vector synchronizing_stage; /// Number of processors still sending messages std::vector synchronizing_unfinished; - + /// Number of batches sent since last synchronization stage std::vector number_sent_batches; - + /// Number of batches received minus number of expected batches std::vector number_received_batches; - + /// The context of the currently-executing trigger, or @c trc_none /// if no trigger is executing. @@ -124,7 +124,7 @@ struct mpi_process_group::impl /// The MPI requests for posted sends of oob messages std::vector requests; - + /// The MPI buffers for posted irecvs of oob messages std::map buffers; @@ -144,14 +144,14 @@ struct mpi_process_group::impl std::stack free_batches; void free_sent_batches(); - + // Tag allocator detail::tag_allocator allocated_tags; impl(std::size_t num_headers, std::size_t buffers_size, communicator_type parent_comm); ~impl(); - + private: void set_batch_size(std::size_t header_num, std::size_t buffer_sz); }; @@ -175,7 +175,7 @@ mpi_process_group::send_impl(int dest, int tag, const T& value, header.source = process_id(*this); header.tag = tag; header.offset = outgoing.buffer.size(); - + boost::mpi::packed_oarchive oa(impl_->comm, outgoing.buffer); oa << value; @@ -237,7 +237,7 @@ send(const mpi_process_group& pg, mpi_process_group::process_id_type dest, int tag, const T values[], std::size_t n) { pg.send_impl(dest, pg.encode_tag(pg.my_block_number(), tag), - boost::serialization::make_array(values,n), + boost::serialization::make_array(values,n), boost::mpl::true_()); } @@ -279,7 +279,7 @@ typename disable_if, void>::type send(const mpi_process_group& pg, mpi_process_group::process_id_type dest, int tag, const T values[], std::size_t n) { - pg.array_send_impl(dest, pg.encode_tag(pg.my_block_number(), tag), + pg.array_send_impl(dest, pg.encode_tag(pg.my_block_number(), tag), values, n); } @@ -316,7 +316,7 @@ mpi_process_group::receive_impl(int source, int tag, T& value, // Unpack the data if (header->bytes > 0) { - boost::mpi::packed_iarchive ia(impl_->comm, incoming.buffer, + boost::mpi::packed_iarchive ia(impl_->comm, incoming.buffer, archive::no_header, header->offset); ia >> value; } @@ -364,7 +364,7 @@ mpi_process_group::receive_impl(int source, int tag, T& value, if (header == incoming.headers.end()) return false; // Deserialize the data - boost::mpi::packed_iarchive in(impl_->comm, incoming.buffer, + boost::mpi::packed_iarchive in(impl_->comm, incoming.buffer, archive::no_header, header->offset); in >> value; @@ -411,7 +411,7 @@ array_receive_impl(int source, int tag, T* values, std::size_t& n) const if (header == incoming.headers.end()) return false; // Deserialize the data - boost::mpi::packed_iarchive in(impl_->comm, incoming.buffer, + boost::mpi::packed_iarchive in(impl_->comm, incoming.buffer, archive::no_header, header->offset); std::size_t num_sent; in >> num_sent; @@ -455,7 +455,7 @@ template void mpi_process_group::trigger(int tag, const Handler& handler) { BOOST_ASSERT(block_num); - install_trigger(tag,my_block_number(),shared_ptr( + install_trigger(tag,my_block_number(),std::shared_ptr( new trigger_launcher(*this, tag, handler))); } @@ -463,28 +463,28 @@ template void mpi_process_group::trigger_with_reply(int tag, const Handler& handler) { BOOST_ASSERT(block_num); - install_trigger(tag,my_block_number(),shared_ptr( + install_trigger(tag,my_block_number(),std::shared_ptr( new reply_trigger_launcher(*this, tag, handler))); } template -void mpi_process_group::global_trigger(int tag, const Handler& handler, +void mpi_process_group::global_trigger(int tag, const Handler& handler, std::size_t sz) { if (sz==0) // normal trigger - install_trigger(tag,0,shared_ptr( + install_trigger(tag,0,std::shared_ptr( new global_trigger_launcher(*this, tag, handler))); else // trigger with irecv - install_trigger(tag,0,shared_ptr( + install_trigger(tag,0,std::shared_ptr( new global_irecv_trigger_launcher(*this, tag, handler,sz))); - + } namespace detail { template void do_oob_receive(mpi_process_group const& self, - int source, int tag, Type& data, mpl::true_ /*is_mpi_datatype*/) + int source, int tag, Type& data, mpl::true_ /*is_mpi_datatype*/) { using boost::mpi::get_mpi_datatype; @@ -495,7 +495,7 @@ void do_oob_receive(mpi_process_group const& self, template void do_oob_receive(mpi_process_group const& self, - int source, int tag, Type& data, mpl::false_ /*is_mpi_datatype*/) + int source, int tag, Type& data, mpl::false_ /*is_mpi_datatype*/) { // self.impl_->comm.recv(source,tag,data); // Receive the size of the data packet @@ -521,7 +521,7 @@ void do_oob_receive(mpi_process_group const& self, } template -void do_oob_receive(mpi_process_group const& self, int source, int tag, Type& data) +void do_oob_receive(mpi_process_group const& self, int source, int tag, Type& data) { do_oob_receive(self, source, tag, data, boost::mpi::is_mpi_datatype()); @@ -532,13 +532,13 @@ void do_oob_receive(mpi_process_group const& self, int source, int tag, Type& da template -void +void mpi_process_group::trigger_launcher:: -receive(mpi_process_group const&, int source, int tag, +receive(mpi_process_group const&, int source, int tag, trigger_receive_context context, int block) const { #ifdef PBGL_PROCESS_GROUP_DEBUG - std::cerr << (out_of_band? "OOB trigger" : "Trigger") + std::cerr << (out_of_band? "OOB trigger" : "Trigger") << " receive from source " << source << " and tag " << tag << " in block " << (block == -1 ? self.my_block_number() : block) << std::endl; #endif @@ -560,13 +560,13 @@ receive(mpi_process_group const&, int source, int tag, } template -void +void mpi_process_group::reply_trigger_launcher:: -receive(mpi_process_group const&, int source, int tag, +receive(mpi_process_group const&, int source, int tag, trigger_receive_context context, int block) const { #ifdef PBGL_PROCESS_GROUP_DEBUG - std::cerr << (out_of_band? "OOB reply trigger" : "Reply trigger") + std::cerr << (out_of_band? "OOB reply trigger" : "Reply trigger") << " receive from source " << source << " and tag " << tag << " in block " << (block == -1 ? self.my_block_number() : block) << std::endl; #endif @@ -581,18 +581,18 @@ receive(mpi_process_group const&, int source, int tag, // Pass the message off to the handler and send the result back to // the source. - send_oob(self, source, data.first, + send_oob(self, source, data.first, handler(source, tag, data.second, context), -2); } template -void +void mpi_process_group::global_trigger_launcher:: -receive(mpi_process_group const& self, int source, int tag, +receive(mpi_process_group const& self, int source, int tag, trigger_receive_context context, int block) const { #ifdef PBGL_PROCESS_GROUP_DEBUG - std::cerr << (out_of_band? "OOB trigger" : "Trigger") + std::cerr << (out_of_band? "OOB trigger" : "Trigger") << " receive from source " << source << " and tag " << tag << " in block " << (block == -1 ? self.my_block_number() : block) << std::endl; #endif @@ -615,13 +615,13 @@ receive(mpi_process_group const& self, int source, int tag, template -void +void mpi_process_group::global_irecv_trigger_launcher:: -receive(mpi_process_group const& self, int source, int tag, +receive(mpi_process_group const& self, int source, int tag, trigger_receive_context context, int block) const { #ifdef PBGL_PROCESS_GROUP_DEBUG - std::cerr << (out_of_band? "OOB trigger" : "Trigger") + std::cerr << (out_of_band? "OOB trigger" : "Trigger") << " receive from source " << source << " and tag " << tag << " in block " << (block == -1 ? self.my_block_number() : block) << std::endl; #endif @@ -644,12 +644,12 @@ receive(mpi_process_group const& self, int source, int tag, template -void +void mpi_process_group::global_irecv_trigger_launcher:: prepare_receive(mpi_process_group const& self, int tag, bool force) const { #ifdef PBGL_PROCESS_GROUP_DEBUG - std::cerr << ("Posting Irecv for trigger") + std::cerr << ("Posting Irecv for trigger") << " receive with tag " << tag << std::endl; #endif if (self.impl_->buffers.find(tag) == self.impl_->buffers.end()) { @@ -657,7 +657,7 @@ prepare_receive(mpi_process_group const& self, int tag, bool force) const force = true; } BOOST_ASSERT(static_cast(self.impl_->buffers[tag].size()) >= buffer_size); - + //BOOST_MPL_ASSERT(mpl::not_ >); if (force) { self.impl_->requests.push_back(MPI_Request()); @@ -681,8 +681,8 @@ receive(const mpi_process_group& pg, int tag, T& value) } template -typename - enable_if, +typename + enable_if, std::pair >::type receive(const mpi_process_group& pg, int tag, T values[], std::size_t n) { @@ -691,15 +691,15 @@ receive(const mpi_process_group& pg, int tag, T values[], std::size_t n) pg.receive_impl(source, pg.encode_tag(pg.my_block_number(), tag), boost::serialization::make_array(values,n), boost::mpl::true_()); - if (result) + if (result) return std::make_pair(source, n); } BOOST_ASSERT(false); } template -typename - disable_if, +typename + disable_if, std::pair >::type receive(const mpi_process_group& pg, int tag, T values[], std::size_t n) { @@ -730,14 +730,14 @@ receive(const mpi_process_group& pg, } template -typename - enable_if, +typename + enable_if, std::pair >::type -receive(const mpi_process_group& pg, int source, int tag, T values[], +receive(const mpi_process_group& pg, int source, int tag, T values[], std::size_t n) { if (pg.receive_impl(source, pg.encode_tag(pg.my_block_number(), tag), - boost::serialization::make_array(values,n), + boost::serialization::make_array(values,n), boost::mpl::true_())) return std::make_pair(source,n); else { @@ -751,10 +751,10 @@ receive(const mpi_process_group& pg, int source, int tag, T values[], } template -typename - disable_if, +typename + disable_if, std::pair >::type -receive(const mpi_process_group& pg, int source, int tag, T values[], +receive(const mpi_process_group& pg, int source, int tag, T values[], std::size_t n) { pg.array_receive_impl(source, pg.encode_tag(pg.my_block_number(), tag), @@ -775,7 +775,7 @@ all_reduce(const mpi_process_group& pg, T* first, T* last, T* out, if (inplace) out = new T [last-first]; boost::mpi::all_reduce(boost::mpi::communicator(communicator(pg), - boost::mpi::comm_attach), + boost::mpi::comm_attach), first, last-first, out, bin_op); if (inplace) { @@ -789,10 +789,10 @@ all_reduce(const mpi_process_group& pg, T* first, T* last, T* out, template void -broadcast(const mpi_process_group& pg, T& val, +broadcast(const mpi_process_group& pg, T& val, mpi_process_group::process_id_type root) { - // broadcast the seed + // broadcast the seed boost::mpi::communicator comm(communicator(pg),boost::mpi::comm_attach); boost::mpi::broadcast(comm,val,root); } @@ -914,7 +914,7 @@ Receiver* mpi_process_group::get_receiver() template typename enable_if >::type -receive_oob(const mpi_process_group& pg, +receive_oob(const mpi_process_group& pg, mpi_process_group::process_id_type source, int tag, T& value, int block) { using boost::mpi::get_mpi_datatype; @@ -926,8 +926,8 @@ receive_oob(const mpi_process_group& pg, // Post a non-blocking receive that waits until we complete this request. MPI_Request request; - MPI_Irecv(&value, 1, get_mpi_datatype(value), - source, actual.second, actual.first, &request); + MPI_Irecv(&value, 1, get_mpi_datatype(value), + source, actual.second, actual.first, &request); int done = 0; do { @@ -939,7 +939,7 @@ receive_oob(const mpi_process_group& pg, template typename disable_if >::type -receive_oob(const mpi_process_group& pg, +receive_oob(const mpi_process_group& pg, mpi_process_group::process_id_type source, int tag, T& value, int block) { // Determine the actual message we expect to receive, and which @@ -967,11 +967,11 @@ receive_oob(const mpi_process_group& pg, MPI_Get_count(&mpi_status, MPI_PACKED, &size); in.resize(size); #endif - + // Receive the message data MPI_Recv(in.address(), in.size(), MPI_PACKED, status->source(), status->tag(), actual.first, MPI_STATUS_IGNORE); - + // Unpack the message data in >> value; } @@ -979,7 +979,7 @@ receive_oob(const mpi_process_group& pg, template typename enable_if >::type -send_oob_with_reply(const mpi_process_group& pg, +send_oob_with_reply(const mpi_process_group& pg, mpi_process_group::process_id_type dest, int tag, const SendT& send_value, ReplyT& reply_value, int block) @@ -992,14 +992,14 @@ send_oob_with_reply(const mpi_process_group& pg, template typename disable_if >::type -send_oob_with_reply(const mpi_process_group& pg, +send_oob_with_reply(const mpi_process_group& pg, mpi_process_group::process_id_type dest, int tag, const SendT& send_value, ReplyT& reply_value, int block) { detail::tag_allocator::token reply_tag = pg.impl_->allocated_tags.get_tag(); - send_oob(pg, dest, tag, - boost::parallel::detail::make_untracked_pair((int)reply_tag, + send_oob(pg, dest, tag, + boost::parallel::detail::make_untracked_pair((int)reply_tag, send_value), block); receive_oob(pg, dest, reply_tag, reply_value); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/mpi_process_group.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/mpi_process_group.hpp index e0ee5790..57bbfbbc 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/mpi_process_group.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/mpi_process_group.hpp @@ -20,7 +20,7 @@ #define SEND_OOB_BSEND #include -#include +#include #include #include #include @@ -48,7 +48,7 @@ class mpi_process_group * The type of a "receive" handler, that will be provided with * (source, tag) pairs when a message is received. Users can provide a * receive handler for a distributed data structure, for example, to - * automatically pick up and respond to messages as needed. + * automatically pick up and respond to messages as needed. */ typedef function receiver_type; @@ -75,7 +75,7 @@ class mpi_process_group /// Classification of the capabilities of this process group struct communication_category - : virtual parallel::bsp_process_group_tag, + : virtual parallel::bsp_process_group_tag, virtual mpi_process_group_tag { }; // TBD: We can eliminate the "source" field and possibly the @@ -92,7 +92,7 @@ class mpi_process_group /// The length of the message in the buffer, in bytes std::size_t bytes; - + template void serialize(Archive& ar, int) { @@ -113,14 +113,14 @@ class mpi_process_group std::vector headers; buffer_type buffer; - + template void serialize(Archive& ar, int) { ar & headers & buffer; } - - void swap(outgoing_messages& x) + + void swap(outgoing_messages& x) { headers.swap(x.headers); buffer.swap(x.buffer); @@ -137,21 +137,21 @@ private: public: explicit trigger_base(int tag) : tag_(tag) { } - /// Retrieve the tag associated with this trigger + /// Retrieve the tag associated with this trigger int tag() const { return tag_; } virtual ~trigger_base() { } /** - * Invoked to receive a message that matches a particular trigger. + * Invoked to receive a message that matches a particular trigger. * * @param source the source of the message * @param tag the (local) tag of the message * @param context the context under which the trigger is being * invoked */ - virtual void - receive(mpi_process_group const& pg, int source, int tag, + virtual void + receive(mpi_process_group const& pg, int source, int tag, trigger_receive_context context, int block=-1) const = 0; protected: @@ -162,19 +162,19 @@ private: /** * Launches a specific handler in response to a trigger. This * function object wraps up the handler function object and a buffer - * for incoming data. + * for incoming data. */ template class trigger_launcher : public trigger_base { public: - explicit trigger_launcher(mpi_process_group& self, int tag, - const Handler& handler) - : trigger_base(tag), self(self), handler(handler) + explicit trigger_launcher(mpi_process_group& self, int tag, + const Handler& handler) + : trigger_base(tag), self(self), handler(handler) {} - void - receive(mpi_process_group const& pg, int source, int tag, + void + receive(mpi_process_group const& pg, int source, int tag, trigger_receive_context context, int block=-1) const; private: @@ -191,13 +191,13 @@ private: class reply_trigger_launcher : public trigger_base { public: - explicit reply_trigger_launcher(mpi_process_group& self, int tag, - const Handler& handler) - : trigger_base(tag), self(self), handler(handler) + explicit reply_trigger_launcher(mpi_process_group& self, int tag, + const Handler& handler) + : trigger_base(tag), self(self), handler(handler) {} - void - receive(mpi_process_group const& pg, int source, int tag, + void + receive(mpi_process_group const& pg, int source, int tag, trigger_receive_context context, int block=-1) const; private: @@ -209,14 +209,14 @@ private: class global_trigger_launcher : public trigger_base { public: - explicit global_trigger_launcher(mpi_process_group& self, int tag, - const Handler& handler) - : trigger_base(tag), handler(handler) - { + explicit global_trigger_launcher(mpi_process_group& self, int tag, + const Handler& handler) + : trigger_base(tag), handler(handler) + { } - void - receive(mpi_process_group const& pg, int source, int tag, + void + receive(mpi_process_group const& pg, int source, int tag, trigger_receive_context context, int block=-1) const; private: @@ -229,15 +229,15 @@ private: class global_irecv_trigger_launcher : public trigger_base { public: - explicit global_irecv_trigger_launcher(mpi_process_group& self, int tag, - const Handler& handler, int sz) + explicit global_irecv_trigger_launcher(mpi_process_group& self, int tag, + const Handler& handler, int sz) : trigger_base(tag), handler(handler), buffer_size(sz) - { + { prepare_receive(self,tag); } - void - receive(mpi_process_group const& pg, int source, int tag, + void + receive(mpi_process_group const& pg, int source, int tag, trigger_receive_context context, int block=-1) const; private: @@ -249,32 +249,32 @@ private: }; public: - /** + /** * Construct a new BSP process group from an MPI communicator. The * MPI communicator will be duplicated to create a new communicator * for this process group to use. */ mpi_process_group(communicator_type parent_comm = communicator_type()); - /** + /** * Construct a new BSP process group from an MPI communicator. The * MPI communicator will be duplicated to create a new communicator * for this process group to use. This constructor allows to tune the * size of message batches. - * + * * @param num_headers The maximum number of headers in a message batch * * @param buffer_size The maximum size of the message buffer in a batch. * */ - mpi_process_group( std::size_t num_headers, std::size_t buffer_size, + mpi_process_group( std::size_t num_headers, std::size_t buffer_size, communicator_type parent_comm = communicator_type()); /** * Construct a copy of the BSP process group for a new distributed * data structure. This data structure will synchronize with all * other members of the process group's equivalence class (including - * @p other), but will have its own set of tags. + * @p other), but will have its own set of tags. * * @param other The process group that this new process group will * be based on, using a different set of tags within the same @@ -296,9 +296,9 @@ public: * Construct a copy of the BSP process group for a new distributed * data structure. This data structure will synchronize with all * other members of the process group's equivalence class (including - * @p other), but will have its own set of tags. + * @p other), but will have its own set of tags. */ - mpi_process_group(const mpi_process_group& other, + mpi_process_group(const mpi_process_group& other, attach_distributed_object, bool out_of_band_receive = false); @@ -335,7 +335,7 @@ public: void replace_on_synchronize_handler(const on_synchronize_event_type& handler = 0); - /** + /** * Return the block number of the current data structure. A value of * 0 indicates that this particular instance of the process group is * not associated with any distributed data structure. @@ -350,7 +350,7 @@ public: { return block_num * max_tags + tag; } /** - * Decode an encoded tag into a block number/tag pair. + * Decode an encoded tag into a block number/tag pair. */ std::pair decode_tag(int encoded_tag) const { return std::make_pair(encoded_tag / max_tags, encoded_tag % max_tags); } @@ -366,13 +366,13 @@ public: */ int allocate_block(bool out_of_band_receive = false); - /** Potentially emit a receive event out of band. Returns true if an event - * was actually sent, false otherwise. + /** Potentially emit a receive event out of band. Returns true if an event + * was actually sent, false otherwise. */ bool maybe_emit_receive(int process, int encoded_tag) const; /** Emit a receive event. Returns true if an event was actually - * sent, false otherwise. + * sent, false otherwise. */ bool emit_receive(int process, int encoded_tag) const; @@ -450,7 +450,7 @@ public: void trigger_with_reply(int tag, const Handler& handler); template - void global_trigger(int tag, const Handler& handler, std::size_t buffer_size=0); + void global_trigger(int tag, const Handler& handler, std::size_t buffer_size=0); @@ -468,7 +468,7 @@ public: * @param synchronizing whether we are currently synchronizing the * process group */ - optional > + optional > poll(bool wait = false, int block = -1, bool synchronizing = false) const; /** @@ -489,11 +489,11 @@ public: /// /// Determine the actual communicator and tag will be used for a /// transmission with the given tag. - std::pair + std::pair actual_communicator_and_tag(int tag, int block) const; /// set the size of the message buffer used for buffered oob sends - + static void set_message_buffer_size(std::size_t s); /// get the size of the message buffer used for buffered oob sends @@ -503,12 +503,12 @@ public: static void* old_buffer; private: - void install_trigger(int tag, int block, - shared_ptr const& launcher); + void install_trigger(int tag, int block, + std::shared_ptr const& launcher); void poll_requests(int block=-1) const; - + // send a batch if the buffer is full now or would get full void maybe_send_batch(process_id_type dest) const; @@ -527,7 +527,7 @@ private: void receive_batch(boost::mpi::status& status) const; //void free_finished_sends() const; - + /// Status messages used internally by the process group enum status_messages { /// the first of the reserved message tags @@ -557,13 +557,13 @@ private: /// Handler for receive events receiver_type on_receive; - /// Handler executed at the start of synchronization + /// Handler executed at the start of synchronization on_synchronize_event_type on_synchronize; /// Individual message triggers. Note: at present, this vector is /// indexed by the (local) tag of the trigger. Any tags that /// don't have triggers will have NULL pointers in that spot. - std::vector > triggers; + std::vector > triggers; }; /** @@ -581,7 +581,7 @@ private: * @c block_num. */ struct deallocate_block; - + static std::vector message_buffer; public: @@ -589,17 +589,17 @@ public: * Data associated with the process group and all of its attached * distributed data structures. */ - shared_ptr impl_; + std::shared_ptr impl_; /** * When non-null, indicates that this copy of the process group is * associated with a particular distributed data structure. The * integer value contains the block number (a value > 0) associated - * with that data structure. The deleter for this @c shared_ptr is a + * with that data structure. The deleter for this @c std::shared_ptr is a * @c deallocate_block object that will deallocate the associated * block in @c impl_->blocks. */ - shared_ptr block_num; + std::shared_ptr block_num; /** * Rank of this process, to avoid having to call rank() repeatedly. @@ -615,11 +615,11 @@ public: -inline mpi_process_group::process_id_type +inline mpi_process_group::process_id_type process_id(const mpi_process_group& pg) { return pg.rank; } -inline mpi_process_group::process_size_type +inline mpi_process_group::process_size_type num_processes(const mpi_process_group& pg) { return pg.size; } @@ -683,7 +683,7 @@ process_subgroup(const mpi_process_group& pg, template void -broadcast(const mpi_process_group& pg, T& val, +broadcast(const mpi_process_group& pg, T& val, mpi_process_group::process_id_type root); @@ -705,15 +705,15 @@ send_oob(const mpi_process_group& pg, mpi_process_group::process_id_type dest, #ifdef SEND_OOB_BSEND if (mpi_process_group::message_buffer_size()) { - MPI_Bsend(const_cast(&value), 1, get_mpi_datatype(value), dest, + MPI_Bsend(const_cast(&value), 1, get_mpi_datatype(value), dest, actual.second, actual.first); return; } #endif MPI_Request request; - MPI_Isend(const_cast(&value), 1, get_mpi_datatype(value), dest, + MPI_Isend(const_cast(&value), 1, get_mpi_datatype(value), dest, actual.second, actual.first, &request); - + int done=0; do { pg.poll(); @@ -759,24 +759,24 @@ send_oob(const mpi_process_group& pg, mpi_process_group::process_id_type dest, template typename enable_if >::type -receive_oob(const mpi_process_group& pg, +receive_oob(const mpi_process_group& pg, mpi_process_group::process_id_type source, int tag, T& value, int block=-1); template typename disable_if >::type -receive_oob(const mpi_process_group& pg, +receive_oob(const mpi_process_group& pg, mpi_process_group::process_id_type source, int tag, T& value, int block=-1); template typename enable_if >::type -send_oob_with_reply(const mpi_process_group& pg, +send_oob_with_reply(const mpi_process_group& pg, mpi_process_group::process_id_type dest, int tag, const SendT& send_value, ReplyT& reply_value, int block = -1); template typename disable_if >::type -send_oob_with_reply(const mpi_process_group& pg, +send_oob_with_reply(const mpi_process_group& pg, mpi_process_group::process_id_type dest, int tag, const SendT& send_value, ReplyT& reply_value, int block = -1); @@ -791,7 +791,7 @@ namespace boost { namespace mpi { namespace std { /// optimized swap for outgoing messages -inline void +inline void swap(boost::graph::distributed::mpi_process_group::outgoing_messages& x, boost::graph::distributed::mpi_process_group::outgoing_messages& y) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/queue.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/queue.hpp index 7e84272a..e79c46ed 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/queue.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/queue.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include namespace boost { namespace graph { namespace distributed { @@ -213,12 +213,12 @@ class distributed_queue void setup_triggers(); // Message handlers - void - handle_push(int source, int tag, const value_type& value, + void + handle_push(int source, int tag, const value_type& value, trigger_receive_context); - void - handle_multipush(int source, int tag, const std::vector& values, + void + handle_multipush(int source, int tag, const std::vector& values, trigger_receive_context); mutable ProcessGroup process_group; @@ -229,7 +229,7 @@ class distributed_queue typedef std::vector outgoing_buffer_t; typedef std::vector outgoing_buffers_t; - shared_ptr outgoing_buffers; + std::shared_ptr outgoing_buffers; }; /// Helper macro containing the normal names for the template diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/rmat_graph_generator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/rmat_graph_generator.hpp index dec8250d..261794d8 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/rmat_graph_generator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/rmat_graph_generator.hpp @@ -25,7 +25,7 @@ namespace boost { // requires an MPI process group. Run-time is slightly worse than // the unique rmat generator. Edge list generated is sorted and // unique. - template class scalable_rmat_iterator { @@ -47,8 +47,8 @@ namespace boost { // Initialize for edge generation scalable_rmat_iterator(ProcessGroup pg, Distribution distrib, - RandomGenerator& gen, vertices_size_type n, - edges_size_type m, double a, double b, double c, + RandomGenerator& gen, vertices_size_type n, + edges_size_type m, double a, double b, double c, double d, bool permute_vertices = true) : gen(), done(false) { @@ -58,12 +58,12 @@ namespace boost { this->gen.reset(new uniform_01(gen)); std::vector vertexPermutation; - if (permute_vertices) + if (permute_vertices) generate_permutation_vector(gen, vertexPermutation, n); int SCALE = int(floor(log(double(n))/log(2.))); boost::uniform_01 prob(gen); - + std::map edge_map; edges_size_type generated = 0, local_edges = 0; @@ -121,13 +121,13 @@ namespace boost { reference operator*() const { return current; } pointer operator->() const { return ¤t; } - + scalable_rmat_iterator& operator++() { if (!values.empty()) { current = values.back(); values.pop_back(); - } else + } else done = true; return *this; @@ -151,7 +151,7 @@ namespace boost { private: // Parameters - shared_ptr > gen; + std::shared_ptr > gen; // Internal data structures std::vector values; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/vertex_list_adaptor.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/vertex_list_adaptor.hpp index 8928479a..1d7f9502 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/vertex_list_adaptor.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/distributed/vertex_list_adaptor.hpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include @@ -25,9 +25,9 @@ namespace boost { namespace graph { // -------------------------------------------------------------------------- -// Global index map built from a distribution +// Global index map built from a distribution // -------------------------------------------------------------------------- -template class distribution_global_index_map { @@ -47,16 +47,16 @@ class distribution_global_index_map LocalPropertyMap local; }; -template -inline +inline typename distribution_global_index_map::value_type get(const distribution_global_index_map& p, typename distribution_global_index_map::key_type x) -{ +{ using boost::get; return p.distribution_.global(get(p.owner, x), get(p.local, x)); } @@ -64,15 +64,15 @@ get(const distribution_global_index_map inline distribution_global_index_map< - Distribution, + Distribution, typename property_map::const_type, typename property_map::const_type> make_distribution_global_index_map(const Graph& g, const Distribution& d) { typedef distribution_global_index_map< - Distribution, + Distribution, typename property_map::const_type, - typename property_map::const_type> + typename property_map::const_type> result_type; return result_type(d, get(vertex_owner, g), get(vertex_local, g)); } @@ -86,7 +86,7 @@ class stored_global_index_map : public IndexMap public: typedef readable_property_map_tag category; - stored_global_index_map(const IndexMap& index_map) : IndexMap(index_map) { + stored_global_index_map(const IndexMap& index_map) : IndexMap(index_map) { // When we have a global index, we need to always have the indices // of every key we've seen this->set_max_ghost_cells(0); @@ -98,13 +98,13 @@ class stored_global_index_map : public IndexMap // -------------------------------------------------------------------------- namespace detail { template - inline void - initialize_global_index_map(const PropertyMap&, - ForwardIterator, ForwardIterator) + inline void + initialize_global_index_map(const PropertyMap&, + ForwardIterator, ForwardIterator) { } template - void + void initialize_global_index_map(stored_global_index_map& p, ForwardIterator first, ForwardIterator last) { @@ -126,18 +126,18 @@ class vertex_list_adaptor : public graph_traits typedef graph_traits inherited; typedef typename inherited::traversal_category base_traversal_category; - + public: typedef typename inherited::vertex_descriptor vertex_descriptor; typedef typename std::vector::iterator vertex_iterator; typedef typename std::vector::size_type vertices_size_type; - struct traversal_category + struct traversal_category : public virtual base_traversal_category, public virtual vertex_list_graph_tag {}; - vertex_list_adaptor(const Graph& g, + vertex_list_adaptor(const Graph& g, const GlobalIndexMap& index_map = GlobalIndexMap()) : g(&g), index_map(index_map) { @@ -146,7 +146,7 @@ class vertex_list_adaptor : public graph_traits all_vertices_.reset(new std::vector()); all_gather(process_group(), vertices(g).first, vertices(g).second, *all_vertices_); - detail::initialize_global_index_map(this->index_map, + detail::initialize_global_index_map(this->index_map, all_vertices_->begin(), all_vertices_->end()); } @@ -156,13 +156,13 @@ class vertex_list_adaptor : public graph_traits // -------------------------------------------------------------------------- // Distributed Container // -------------------------------------------------------------------------- - typedef typename boost::graph::parallel::process_group_type::type + typedef typename boost::graph::parallel::process_group_type::type process_group_type; - process_group_type process_group() const - { + process_group_type process_group() const + { using boost::graph::parallel::process_group; - return process_group(*g); + return process_group(*g); } std::pair vertices() const @@ -175,7 +175,7 @@ class vertex_list_adaptor : public graph_traits private: const Graph* g; GlobalIndexMap index_map; - shared_ptr > all_vertices_; + std::shared_ptr > all_vertices_; }; template @@ -197,18 +197,18 @@ namespace detail { } template -inline -vertex_list_adaptor::type> make_vertex_list_adaptor(const Graph& g) -{ - typedef typename detail::default_global_index_map::type +{ + typedef typename detail::default_global_index_map::type GlobalIndexMap; typedef typename detail::default_global_index_map::distributed_map DistributedMap; typedef vertex_list_adaptor result_type; - return result_type(g, - GlobalIndexMap(DistributedMap(num_vertices(g), + return result_type(g, + GlobalIndexMap(DistributedMap(num_vertices(g), get(vertex_index, g)))); } @@ -375,7 +375,7 @@ namespace boost { // Property Graph: vertex_index property // -------------------------------------------------------------------------- template -class property_map > { public: @@ -384,7 +384,7 @@ public: }; template -class property_map > { public: diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/erdos_renyi_generator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/erdos_renyi_generator.hpp index 5be06d79..d90ba36a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/erdos_renyi_generator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/erdos_renyi_generator.hpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -31,7 +31,7 @@ namespace boost { std::pair::vertices_size_type, typename graph_traits::vertices_size_type>, std::input_iterator_tag, - const + const std::pair::vertices_size_type, typename graph_traits::vertices_size_type>&> { @@ -97,7 +97,7 @@ namespace boost { std::pair::vertices_size_type, typename graph_traits::vertices_size_type>, std::input_iterator_tag, - const + const std::pair::vertices_size_type, typename graph_traits::vertices_size_type>&> { @@ -181,7 +181,7 @@ namespace boost { if (src == n) src = (std::numeric_limits::max)(); } - shared_ptr > gen; + std::shared_ptr > gen; geometric_distribution rand_vertex; vertices_size_type n; bool allow_self_loops; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/gursoy_atun_layout.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/gursoy_atun_layout.hpp index 9269c4b0..62587f9e 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/gursoy_atun_layout.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/gursoy_atun_layout.hpp @@ -26,13 +26,13 @@ #include #include #include -#include +#include #include #include #include #include -namespace boost { +namespace boost { namespace detail { @@ -62,12 +62,12 @@ struct update_position_visitor { double distance_limit, double learning_constant, double falloff_ratio): - position_map(position_map), node_distance(node_distance), + position_map(position_map), node_distance(node_distance), space(space), input_vector(input_vector), distance_limit(distance_limit), learning_constant(learning_constant), falloff_ratio(falloff_ratio) {} - void operator()(vertex_descriptor v, const Graph&) const + void operator()(vertex_descriptor v, const Graph&) const { #ifndef BOOST_NO_STDC_NAMESPACE using std::pow; @@ -77,7 +77,7 @@ struct update_position_visitor { BOOST_THROW_EXCEPTION(over_distance_limit()); Point old_position = get(position_map, v); double distance = get(node_distance, v); - double fraction = + double fraction = learning_constant * pow(falloff_ratio, distance * distance); put(position_map, v, space.move_position_toward(old_position, fraction, input_vector)); @@ -88,7 +88,7 @@ template struct gursoy_shortest { template - static inline void + static inline void run(const Graph& g, typename graph_traits::vertex_descriptor s, NodeDistanceMap node_distance, UpdatePosition& update_position, EdgeWeightMap weight) @@ -104,7 +104,7 @@ template<> struct gursoy_shortest { template - static inline void + static inline void run(const Graph& g, typename graph_traits::vertex_descriptor s, NodeDistanceMap node_distance, UpdatePosition& update_position, dummy_property_map) @@ -119,11 +119,11 @@ struct gursoy_shortest } // namespace detail template -void +void gursoy_atun_step - (const VertexListAndIncidenceGraph& graph, + (const VertexListAndIncidenceGraph& graph, const Topology& space, PositionMap position, Diameter diameter, @@ -143,21 +143,21 @@ gursoy_atun_step typedef typename Topology::point_type point_type; vertex_iterator i, iend; std::vector distance_from_input_vector(num_vertices(graph)); - typedef boost::iterator_property_map::iterator, + typedef boost::iterator_property_map::iterator, VertexIndexMap, double, double&> DistanceFromInputMap; DistanceFromInputMap distance_from_input(distance_from_input_vector.begin(), vertex_index_map); std::vector node_distance_map_vector(num_vertices(graph)); - typedef boost::iterator_property_map::iterator, + typedef boost::iterator_property_map::iterator, VertexIndexMap, double, double&> NodeDistanceMap; NodeDistanceMap node_distance(node_distance_map_vector.begin(), vertex_index_map); point_type input_vector = space.random_point(); - vertex_descriptor min_distance_loc + vertex_descriptor min_distance_loc = graph_traits::null_vertex(); double min_distance = 0.0; bool min_distance_unset = true; @@ -173,24 +173,24 @@ gursoy_atun_step BOOST_ASSERT (!min_distance_unset); // Graph must have at least one vertex boost::detail::update_position_visitor< PositionMap, NodeDistanceMap, Topology, - VertexListAndIncidenceGraph> + VertexListAndIncidenceGraph> update_position(position, node_distance, space, - input_vector, diameter, learning_constant, + input_vector, diameter, learning_constant, exp(-1. / (2 * diameter * diameter))); std::fill(node_distance_map_vector.begin(), node_distance_map_vector.end(), 0); try { typedef detail::gursoy_shortest shortest; shortest::run(graph, min_distance_loc, node_distance, update_position, - weight); - } catch (detail::over_distance_limit) { - /* Thrown to break out of BFS or Dijkstra early */ + weight); + } catch (detail::over_distance_limit) { + /* Thrown to break out of BFS or Dijkstra early */ } } template -void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph, +void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph, const Topology& space, PositionMap position, int nsteps, @@ -199,7 +199,7 @@ void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph, double learning_constant_initial, double learning_constant_final, VertexIndexMap vertex_index_map, - EdgeWeightMap weight) + EdgeWeightMap weight) { #ifndef BOOST_NO_STDC_NAMESPACE using std::pow; @@ -213,17 +213,17 @@ void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph, typedef typename Topology::point_type point_type; vertex_iterator i, iend; double diameter_ratio = (double)diameter_final / diameter_initial; - double learning_constant_ratio = + double learning_constant_ratio = learning_constant_final / learning_constant_initial; std::vector distance_from_input_vector(num_vertices(graph)); - typedef boost::iterator_property_map::iterator, + typedef boost::iterator_property_map::iterator, VertexIndexMap, double, double&> DistanceFromInputMap; DistanceFromInputMap distance_from_input(distance_from_input_vector.begin(), vertex_index_map); std::vector node_distance_map_vector(num_vertices(graph)); - typedef boost::iterator_property_map::iterator, + typedef boost::iterator_property_map::iterator, VertexIndexMap, double, double&> NodeDistanceMap; NodeDistanceMap node_distance(node_distance_map_vector.begin(), @@ -231,17 +231,17 @@ void gursoy_atun_refine(const VertexListAndIncidenceGraph& graph, for (int round = 0; round < nsteps; ++round) { double part_done = (double)round / (nsteps - 1); int diameter = (int)(diameter_initial * pow(diameter_ratio, part_done)); - double learning_constant = + double learning_constant = learning_constant_initial * pow(learning_constant_ratio, part_done); - gursoy_atun_step(graph, space, position, diameter, learning_constant, + gursoy_atun_step(graph, space, position, diameter, learning_constant, vertex_index_map, weight); } } template -void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, +void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, const Topology& space, PositionMap position, int nsteps, @@ -260,14 +260,14 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, } gursoy_atun_refine(graph, space, position, nsteps, - diameter_initial, diameter_final, + diameter_initial, diameter_final, learning_constant_initial, learning_constant_final, vertex_index_map, weight); } template -void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, +void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, const Topology& space, PositionMap position, int nsteps, @@ -277,15 +277,15 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, double learning_constant_final, VertexIndexMap vertex_index_map) { - gursoy_atun_layout(graph, space, position, nsteps, - diameter_initial, diameter_final, - learning_constant_initial, learning_constant_final, + gursoy_atun_layout(graph, space, position, nsteps, + diameter_initial, diameter_final, + learning_constant_initial, learning_constant_final, vertex_index_map, dummy_property_map()); } template -void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, +void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, const Topology& space, PositionMap position, int nsteps, @@ -293,15 +293,15 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, double diameter_final = 1.0, double learning_constant_initial = 0.8, double learning_constant_final = 0.2) -{ +{ gursoy_atun_layout(graph, space, position, nsteps, diameter_initial, diameter_final, learning_constant_initial, - learning_constant_final, get(vertex_index, graph)); + learning_constant_final, get(vertex_index, graph)); } template -void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, +void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, const Topology& space, PositionMap position, int nsteps) @@ -310,13 +310,13 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, using std::sqrt; #endif - gursoy_atun_layout(graph, space, position, nsteps, + gursoy_atun_layout(graph, space, position, nsteps, sqrt((double)num_vertices(graph))); } template -void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, +void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, const Topology& space, PositionMap position) { @@ -325,8 +325,8 @@ void gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, template -void -gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, +void +gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, const Topology& space, PositionMap position, const bgl_named_params& params) @@ -340,17 +340,17 @@ gursoy_atun_layout(const VertexListAndIncidenceGraph& graph, gursoy_atun_layout(graph, space, position, choose_param(get_param(params, iterations_t()), num_vertices(graph)), - choose_param(get_param(params, diameter_range_t()), + choose_param(get_param(params, diameter_range_t()), diam).first, - choose_param(get_param(params, diameter_range_t()), + choose_param(get_param(params, diameter_range_t()), diam).second, - choose_param(get_param(params, learning_constant_range_t()), + choose_param(get_param(params, learning_constant_range_t()), learn).first, - choose_param(get_param(params, learning_constant_range_t()), + choose_param(get_param(params, learning_constant_range_t()), learn).second, choose_const_pmap(get_param(params, vertex_index), graph, vertex_index), - choose_param(get_param(params, edge_weight), + choose_param(get_param(params, edge_weight), dummy_property_map())); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/incremental_components.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/incremental_components.hpp index fff3a324..63a9b838 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/incremental_components.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/incremental_components.hpp @@ -46,11 +46,11 @@ namespace boost { // Algorithms", and the application to connected components is // similar to the algorithm described in Ch. 22 of "Intro to // Algorithms" by Cormen, et. all. - // + // // An implementation of disjoint sets can be found in // boost/pending/disjoint_sets.hpp - + template void incremental_components(EdgeListGraph& g, DisjointSets& ds) { @@ -58,35 +58,35 @@ namespace boost { for (boost::tie(e,end) = edges(g); e != end; ++e) ds.union_set(source(*e,g),target(*e,g)); } - + template void compress_components(ParentIterator first, ParentIterator last) { - for (ParentIterator current = first; current != last; ++current) + for (ParentIterator current = first; current != last; ++current) detail::find_representative_with_full_compression(first, current-first); } - + template typename boost::detail::iterator_traits::difference_type component_count(ParentIterator first, ParentIterator last) { std::ptrdiff_t count = 0; - for (ParentIterator current = first; current != last; ++current) - if (*current == current - first) ++count; + for (ParentIterator current = first; current != last; ++current) + if (*current == current - first) ++count; return count; } - + // This algorithm can be applied to the result container of the // connected_components algorithm to normalize // the components. template void normalize_components(ParentIterator first, ParentIterator last) { - for (ParentIterator current = first; current != last; ++current) + for (ParentIterator current = first; current != last; ++current) detail::normalize_node(first, current - first); } - - template + + template void initialize_incremental_components(VertexListGraph& G, DisjointSets& ds) { typename graph_traits @@ -129,7 +129,7 @@ namespace boost { m_index_list(make_shared(m_num_elements)) { build_index_lists(parent_start, index_map); - + } // component_index template @@ -222,10 +222,10 @@ namespace boost { protected: IndexType m_num_elements; - shared_ptr m_components, m_index_list; + std::shared_ptr m_components, m_index_list; }; // class component_index - + } // namespace boost #endif // BOOST_INCREMENTAL_COMPONENTS_HPP diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/mcgregor_common_subgraphs.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/mcgregor_common_subgraphs.hpp index c46f7215..ed811172 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/mcgregor_common_subgraphs.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/mcgregor_common_subgraphs.hpp @@ -35,13 +35,13 @@ namespace boost { struct mcgregor_common_subgraph_traits { typedef typename graph_traits::vertex_descriptor vertex_first_type; typedef typename graph_traits::vertex_descriptor vertex_second_type; - + typedef shared_array_property_map correspondence_map_first_to_second_type; - + typedef shared_array_property_map correspondence_map_second_to_first_type; - }; + }; } // namespace detail @@ -52,7 +52,7 @@ namespace boost { template struct property_map_equivalent { - + property_map_equivalent(const PropertyMapFirst property_map1, const PropertyMapSecond property_map2) : m_property_map1(property_map1), @@ -63,7 +63,7 @@ namespace boost { bool operator()(const ItemFirst item1, const ItemSecond item2) { return (get(m_property_map1, item1) == get(m_property_map2, item2)); } - + private: const PropertyMapFirst m_property_map1; const PropertyMapSecond m_property_map2; @@ -86,7 +86,7 @@ namespace boost { // Binary function object that always returns true. Used when // vertices or edges are always equivalent (i.e. have no labels). struct always_equivalent { - + template bool operator()(const ItemFirst&, const ItemSecond&) { @@ -123,7 +123,7 @@ namespace boost { { typedef typename graph_traits::vertex_descriptor VertexFirst; typedef typename graph_traits::vertex_descriptor VertexSecond; - + typedef typename graph_traits::edge_descriptor EdgeFirst; typedef typename graph_traits::edge_descriptor EdgeSecond; @@ -153,7 +153,7 @@ namespace boost { // first matching edge is always chosen. EdgeFirst edge_to_new1, edge_from_new1; bool edge_to_new_exists1 = false, edge_from_new_exists1 = false; - + EdgeSecond edge_to_new2, edge_from_new2; bool edge_to_new_exists2 = false, edge_from_new_exists2 = false; @@ -179,7 +179,7 @@ namespace boost { if ((edge_to_new_exists1 != edge_to_new_exists2) || ((edge_to_new_exists1 && edge_to_new_exists2) && !edges_equivalent(edge_to_new1, edge_to_new2))) { - + return (false); } @@ -225,7 +225,7 @@ namespace boost { if ((edge_from_new_exists1 != edge_from_new_exists2) || ((edge_from_new_exists1 && edge_from_new_exists2) && !edges_equivalent(edge_from_new1, edge_from_new2))) { - + return (false); } @@ -244,7 +244,7 @@ namespace boost { } return (true); - } + } // Recursive method that does a depth-first search in the space of // potential subgraphs. At each level, every new vertex pair from @@ -284,14 +284,14 @@ namespace boost { // Get iterators for vertices from both graphs typename graph_traits::vertex_iterator vertex1_iter, vertex1_end; - + typename graph_traits::vertex_iterator vertex2_begin, vertex2_end, vertex2_iter; - + boost::tie(vertex1_iter, vertex1_end) = vertices(graph1); boost::tie(vertex2_begin, vertex2_end) = vertices(graph2); vertex2_iter = vertex2_begin; - + // Iterate until all vertices have been visited BGL_FORALL_VERTICES_T(new_vertex1, graph1, GraphFirst) { @@ -301,7 +301,7 @@ namespace boost { if (existing_vertex2 != graph_traits::null_vertex()) { continue; } - + BGL_FORALL_VERTICES_T(new_vertex2, graph2, GraphSecond) { VertexFirst existing_vertex1 = get(correspondence_map_2_to_1, new_vertex2); @@ -330,7 +330,7 @@ namespace boost { // Only output sub-graphs larger than a single vertex if (new_graph_size > 1) { - + // Returning false from the callback will cancel iteration if (!subgraph_callback(correspondence_map_1_to_2, correspondence_map_2_to_1, @@ -338,7 +338,7 @@ namespace boost { return (false); } } - + // Depth-first search into the state space of possible sub-graphs bool continue_iteration = mcgregor_common_subgraphs_internal @@ -352,10 +352,10 @@ namespace boost { if (!continue_iteration) { return (false); } - + // Restore previous state if (vertex_stack1.size() > old_graph_size) { - + VertexFirst stack_vertex1 = vertex_stack1.top(); VertexSecond stack_vertex2 = get(correspondence_map_1_to_2, stack_vertex1); @@ -363,10 +363,10 @@ namespace boost { // Contract subgraph put(correspondence_map_1_to_2, stack_vertex1, graph_traits::null_vertex()); - + put(correspondence_map_2_to_1, stack_vertex2, graph_traits::null_vertex()); - + vertex_stack1.pop(); } @@ -401,7 +401,7 @@ namespace boost { typedef mcgregor_common_subgraph_traits SubGraphTraits; - + typename SubGraphTraits::correspondence_map_first_to_second_type correspondence_map_1_to_2(num_vertices(graph1), vindex_map1); @@ -409,7 +409,7 @@ namespace boost { put(correspondence_map_1_to_2, vertex1, graph_traits::null_vertex()); } - + typename SubGraphTraits::correspondence_map_second_to_first_type correspondence_map_2_to_1(num_vertices(graph2), vindex_map2); @@ -420,7 +420,7 @@ namespace boost { typedef typename graph_traits::vertex_descriptor VertexFirst; - + std::stack vertex_stack1; mcgregor_common_subgraphs_internal @@ -432,7 +432,7 @@ namespace boost { only_connected_subgraphs, subgraph_callback); } - + } // namespace detail // ========================================================================== @@ -457,7 +457,7 @@ namespace boost { bool only_connected_subgraphs, SubGraphCallback user_callback) { - + detail::mcgregor_common_subgraphs_internal_init (graph1, graph2, vindex_map1, vindex_map2, @@ -465,7 +465,7 @@ namespace boost { only_connected_subgraphs, user_callback); } - + // Variant of mcgregor_common_subgraphs with all default parameters template & params) { - + detail::mcgregor_common_subgraphs_internal_init (graph1, graph2, choose_const_pmap(get_param(params, vertex_index1), @@ -532,7 +532,7 @@ namespace boost { typedef mcgregor_common_subgraph_traits SubGraphTraits; - + typedef typename SubGraphTraits::correspondence_map_first_to_second_type CachedCorrespondenceMapFirstToSecond; @@ -542,19 +542,19 @@ namespace boost { typedef std::pair > SubGraph; - + typedef std::vector SubGraphList; unique_subgraph_interceptor(const GraphFirst& graph1, const GraphSecond& graph2, const VertexIndexMapFirst vindex_map1, const VertexIndexMapSecond vindex_map2, - SubGraphCallback user_callback) : + SubGraphCallback user_callback) : m_graph1(graph1), m_graph2(graph2), m_vindex_map1(vindex_map1), m_vindex_map2(vindex_map2), m_subgraphs(make_shared()), m_user_callback(user_callback) { } - + template bool operator()(CorrespondenceMapFirstToSecond correspondence_map_1_to_2, @@ -572,16 +572,16 @@ namespace boost { if (subgraph_size != subgraph_cached.first) { continue; } - + if (!are_property_maps_different(correspondence_map_1_to_2, subgraph_cached.second.first, m_graph1)) { - + // New subgraph is a duplicate return (true); } } - + // Subgraph is unique, so make a cached copy CachedCorrespondenceMapFirstToSecond new_subgraph_1_to_2 = CachedCorrespondenceMapFirstToSecond @@ -602,21 +602,21 @@ namespace boost { m_subgraphs->push_back(std::make_pair(subgraph_size, std::make_pair(new_subgraph_1_to_2, new_subgraph_2_to_1))); - + return (m_user_callback(correspondence_map_1_to_2, correspondence_map_2_to_1, subgraph_size)); } - + private: const GraphFirst& m_graph1; const GraphFirst& m_graph2; const VertexIndexMapFirst m_vindex_map1; const VertexIndexMapSecond m_vindex_map2; - shared_ptr m_subgraphs; + std::shared_ptr m_subgraphs; SubGraphCallback m_user_callback; }; - + } // namespace detail // Enumerates all unique common subgraphs between graph1 and graph2. @@ -645,7 +645,7 @@ namespace boost { (graph1, graph2, vindex_map1, vindex_map2, user_callback); - + detail::mcgregor_common_subgraphs_internal_init (graph1, graph2, vindex_map1, vindex_map2, @@ -717,7 +717,7 @@ namespace boost { typedef mcgregor_common_subgraph_traits SubGraphTraits; - + typedef typename SubGraphTraits::correspondence_map_first_to_second_type CachedCorrespondenceMapFirstToSecond; @@ -753,7 +753,7 @@ namespace boost { } if (subgraph_size == *m_largest_size_so_far) { - + // Make a cached copy CachedCorrespondenceMapFirstToSecond new_subgraph_1_to_2 = CachedCorrespondenceMapFirstToSecond @@ -797,11 +797,11 @@ namespace boost { const GraphFirst& m_graph2; const VertexIndexMapFirst m_vindex_map1; const VertexIndexMapSecond m_vindex_map2; - shared_ptr m_subgraphs; - shared_ptr m_largest_size_so_far; + std::shared_ptr m_subgraphs; + std::shared_ptr m_largest_size_so_far; SubGraphCallback m_user_callback; }; - + } // namespace detail // Enumerates the largest common subgraphs found between graph1 @@ -828,7 +828,7 @@ namespace boost { VertexIndexMapFirst, VertexIndexMapSecond, SubGraphCallback> max_interceptor (graph1, graph2, vindex_map1, vindex_map2, user_callback); - + detail::mcgregor_common_subgraphs_internal_init (graph1, graph2, vindex_map1, vindex_map2, @@ -903,7 +903,7 @@ namespace boost { typedef mcgregor_common_subgraph_traits SubGraphTraits; - + typedef typename SubGraphTraits::correspondence_map_first_to_second_type CachedCorrespondenceMapFirstToSecond; @@ -920,13 +920,13 @@ namespace boost { const GraphSecond& graph2, const VertexIndexMapFirst vindex_map1, const VertexIndexMapSecond vindex_map2, - SubGraphCallback user_callback) : + SubGraphCallback user_callback) : m_graph1(graph1), m_graph2(graph2), m_vindex_map1(vindex_map1), m_vindex_map2(vindex_map2), m_subgraphs(make_shared()), m_largest_size_so_far(make_shared(0)), - m_user_callback(user_callback) { } - + m_user_callback(user_callback) { } + template bool operator()(CorrespondenceMapFirstToSecond correspondence_map_1_to_2, @@ -945,18 +945,18 @@ namespace boost { subgraph_iter = m_subgraphs->begin(); subgraph_iter != m_subgraphs->end(); ++subgraph_iter) { - + SubGraph subgraph_cached = *subgraph_iter; - + if (!are_property_maps_different(correspondence_map_1_to_2, subgraph_cached.second.first, m_graph1)) { - + // New subgraph is a duplicate return (true); } } - + // Subgraph is unique, so make a cached copy CachedCorrespondenceMapFirstToSecond new_subgraph_1_to_2 = CachedCorrespondenceMapFirstToSecond @@ -978,7 +978,7 @@ namespace boost { std::make_pair(new_subgraph_1_to_2, new_subgraph_2_to_1))); } - + return (true); } @@ -994,17 +994,17 @@ namespace boost { subgraph_cached.first); } } - + private: const GraphFirst& m_graph1; const GraphFirst& m_graph2; const VertexIndexMapFirst m_vindex_map1; const VertexIndexMapSecond m_vindex_map2; - shared_ptr m_subgraphs; - shared_ptr m_largest_size_so_far; + std::shared_ptr m_subgraphs; + std::shared_ptr m_largest_size_so_far; SubGraphCallback m_user_callback; }; - + } // namespace detail // Enumerates the largest, unique common subgraphs found between @@ -1031,7 +1031,7 @@ namespace boost { VertexIndexMapFirst, VertexIndexMapSecond, SubGraphCallback> unique_max_interceptor (graph1, graph2, vindex_map1, vindex_map2, user_callback); - + detail::mcgregor_common_subgraphs_internal_init (graph1, graph2, vindex_map1, vindex_map2, @@ -1122,7 +1122,7 @@ namespace boost { // Returns a filtered sub-graph of graph whose edge and vertex // inclusion is dictated by membership_map. template + typename MembershipMap> typename membership_filtered_graph_traits::graph_type make_membership_filtered_graph (const Graph& graph, @@ -1134,9 +1134,9 @@ namespace boost { typename MFGTraits::vertex_filter_type v_filter(membership_map); return (MembershipFilteredGraph(graph, keep_all(), v_filter)); - + } - + } // namespace boost #endif // BOOST_GRAPH_MCGREGOR_COMMON_SUBGRAPHS_HPP diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/metric_tsp_approx.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/metric_tsp_approx.hpp index dd0ff1d6..e3824666 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/metric_tsp_approx.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/metric_tsp_approx.hpp @@ -28,7 +28,7 @@ #include -#include +#include #include #include #include diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/parallel/distribution.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/parallel/distribution.hpp index 8256b197..51f820bd 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/parallel/distribution.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/parallel/distribution.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include namespace boost { namespace parallel { @@ -86,13 +86,13 @@ public: size_type block_size(process_id_type id, size_type n) const { return distribution_->block_size(id, n); } - + process_id_type operator()(size_type i) const { return distribution_->in_process(i); } - + size_type local(size_type i) const { return distribution_->local(i); } - + size_type global(size_type n) const { return distribution_->global(n); } @@ -122,13 +122,13 @@ public: } private: - shared_ptr distribution_; + std::shared_ptr distribution_; }; struct block { template - explicit block(const LinearProcessGroup& pg, std::size_t n) + explicit block(const LinearProcessGroup& pg, std::size_t n) : id(process_id(pg)), p(num_processes(pg)), n(n) { } // If there are n elements in the distributed data structure, returns the number of elements stored locally. @@ -144,7 +144,7 @@ struct block // Returns the processor on which element with global index i is stored template SizeType operator()(SizeType i) const - { + { SizeType cutoff_processor = n % p; SizeType cutoff = cutoff_processor * (n / p + 1); @@ -165,7 +165,7 @@ struct block // Find the local index for the ith global element template SizeType local(SizeType i) const - { + { SizeType owner = (*this)(i); return i - start(owner); } @@ -192,9 +192,9 @@ struct uneven_block typedef std::vector size_vector; template - explicit uneven_block(const LinearProcessGroup& pg, const std::vector& local_sizes) + explicit uneven_block(const LinearProcessGroup& pg, const std::vector& local_sizes) : id(process_id(pg)), p(num_processes(pg)), local_sizes(local_sizes) - { + { BOOST_ASSERT(local_sizes.size() == p); local_starts.resize(p + 1); local_starts[0] = 0; @@ -204,7 +204,7 @@ struct uneven_block // To do maybe: enter local size in each process and gather in constructor (much handier) // template - // explicit uneven_block(const LinearProcessGroup& pg, std::size_t my_local_size) + // explicit uneven_block(const LinearProcessGroup& pg, std::size_t my_local_size) // If there are n elements in the distributed data structure, returns the number of elements stored locally. template @@ -227,7 +227,7 @@ struct uneven_block // Find the starting index for processor with the given id template - std::size_t start(ID id) const + std::size_t start(ID id) const { return local_starts[id]; } @@ -235,7 +235,7 @@ struct uneven_block // Find the local index for the ith global element template SizeType local(SizeType i) const - { + { SizeType owner = (*this)(i); return i - start(owner); } @@ -264,10 +264,10 @@ struct oned_block_cyclic template explicit oned_block_cyclic(const LinearProcessGroup& pg, std::size_t size) : id(process_id(pg)), p(num_processes(pg)), size(size) { } - + template SizeType block_size(SizeType n) const - { + { return block_size(id, n); } @@ -279,20 +279,20 @@ struct oned_block_cyclic SizeType everyone_gets = all_blocks / p; SizeType extra_blocks = all_blocks % p; SizeType my_blocks = everyone_gets + (p < extra_blocks? 1 : 0); - SizeType my_elements = my_blocks * size + SizeType my_elements = my_blocks * size + (p == extra_blocks? extra_elements : 0); return my_elements; } template SizeType operator()(SizeType i) const - { + { return (i / size) % p; } template SizeType local(SizeType i) const - { + { return ((i / size) / p) * size + i % size; } @@ -302,7 +302,7 @@ struct oned_block_cyclic template SizeType global(ProcessID id, SizeType i) const - { + { return ((i / size) * p + id) * size + i % size; } @@ -318,14 +318,14 @@ struct twod_block_cyclic explicit twod_block_cyclic(const LinearProcessGroup& pg, std::size_t block_rows, std::size_t block_columns, std::size_t data_columns_per_row) - : id(process_id(pg)), p(num_processes(pg)), - block_rows(block_rows), block_columns(block_columns), + : id(process_id(pg)), p(num_processes(pg)), + block_rows(block_rows), block_columns(block_columns), data_columns_per_row(data_columns_per_row) { } - + template SizeType block_size(SizeType n) const - { + { return block_size(id, n); } @@ -346,7 +346,7 @@ struct twod_block_cyclic template SizeType operator()(SizeType i) const - { + { SizeType result = get_block_num(i) % p; // std::cerr << "Item " << i << " goes on processor " << result << std::endl; return result; @@ -354,7 +354,7 @@ struct twod_block_cyclic template SizeType local(SizeType i) const - { + { // Compute the start of the block std::size_t block_num = get_block_num(i); // std::cerr << "Item " << i << " is in block #" << block_num << std::endl; @@ -362,11 +362,11 @@ struct twod_block_cyclic std::size_t local_block_num = block_num / p; std::size_t block_start = local_block_num * block_rows * block_columns; - // Compute the offset into the block + // Compute the offset into the block std::size_t data_row = i / data_columns_per_row; std::size_t data_col = i % data_columns_per_row; - std::size_t block_offset = (data_row % block_rows) * block_columns - + (data_col % block_columns); + std::size_t block_offset = (data_row % block_rows) * block_columns + + (data_col % block_columns); // std::cerr << "Item " << i << " maps to local index " << block_start+block_offset << std::endl; return block_start + block_offset; @@ -374,7 +374,7 @@ struct twod_block_cyclic template SizeType global(SizeType i) const - { + { // Compute the (global) block in which this element resides SizeType local_block_num = i / (block_rows * block_columns); SizeType block_offset = i % (block_rows * block_columns); @@ -401,7 +401,7 @@ struct twod_block_cyclic + row_in_block * block_rows + col_in_block; - std::cerr << "global(" << i << "@" << id << ") = " << result + std::cerr << "global(" << i << "@" << id << ") = " << result << " =? " << local(result) << std::endl; BOOST_ASSERT(i == local(result)); return result; @@ -444,7 +444,7 @@ class twod_random private: RandomNumberGen& gen; }; - + public: template explicit twod_random(const LinearProcessGroup& pg, @@ -452,11 +452,11 @@ class twod_random std::size_t data_columns_per_row, std::size_t n, RandomNumberGen& gen) - : id(process_id(pg)), p(num_processes(pg)), - block_rows(block_rows), block_columns(block_columns), + : id(process_id(pg)), p(num_processes(pg)), + block_rows(block_rows), block_columns(block_columns), data_columns_per_row(data_columns_per_row), global_to_local(n / (block_rows * block_columns)) - { + { std::copy(make_counting_iterator(std::size_t(0)), make_counting_iterator(global_to_local.size()), global_to_local.begin()); @@ -464,10 +464,10 @@ class twod_random random_int rand(gen); std::random_shuffle(global_to_local.begin(), global_to_local.end(), rand); } - + template SizeType block_size(SizeType n) const - { + { return block_size(id, n); } @@ -488,7 +488,7 @@ class twod_random template SizeType operator()(SizeType i) const - { + { SizeType result = get_block_num(i) % p; // std::cerr << "Item " << i << " goes on processor " << result << std::endl; return result; @@ -496,7 +496,7 @@ class twod_random template SizeType local(SizeType i) const - { + { // Compute the start of the block std::size_t block_num = get_block_num(i); // std::cerr << "Item " << i << " is in block #" << block_num << std::endl; @@ -504,11 +504,11 @@ class twod_random std::size_t local_block_num = block_num / p; std::size_t block_start = local_block_num * block_rows * block_columns; - // Compute the offset into the block + // Compute the offset into the block std::size_t data_row = i / data_columns_per_row; std::size_t data_col = i % data_columns_per_row; - std::size_t block_offset = (data_row % block_rows) * block_columns - + (data_col % block_columns); + std::size_t block_offset = (data_row % block_rows) * block_columns + + (data_col % block_columns); // std::cerr << "Item " << i << " maps to local index " << block_start+block_offset << std::endl; return block_start + block_offset; @@ -552,7 +552,7 @@ class random_distribution private: RandomNumberGen& gen; }; - + public: template random_distribution(const LinearProcessGroup& pg, RandomNumberGen& gen, @@ -565,7 +565,7 @@ class random_distribution random_int rand(gen); std::random_shuffle(local_to_global.begin(), local_to_global.end(), rand); - + for (std::vector::size_type i = 0; i < n; ++i) global_to_local[local_to_global[i]] = i; @@ -587,19 +587,19 @@ class random_distribution template SizeType local(SizeType i) const - { + { return base.local(global_to_local[i]); } template SizeType global(ProcessID p, SizeType i) const - { + { return local_to_global[base.global(p, i)]; } template SizeType global(SizeType i) const - { + { return local_to_global[base.global(i)]; } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/planar_detail/boyer_myrvold_impl.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/planar_detail/boyer_myrvold_impl.hpp index 41ba2bc5..0eb76e21 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/planar_detail/boyer_myrvold_impl.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/planar_detail/boyer_myrvold_impl.hpp @@ -12,7 +12,7 @@ #include #include #include //for std::min macros -#include +#include #include #include #include @@ -34,26 +34,26 @@ namespace boost typename DFSParentEdgeMap, typename SizeType> struct planar_dfs_visitor : public dfs_visitor<> { - planar_dfs_visitor(LowPointMap lpm, DFSParentMap dfs_p, + planar_dfs_visitor(LowPointMap lpm, DFSParentMap dfs_p, DFSNumberMap dfs_n, LeastAncestorMap lam, - DFSParentEdgeMap dfs_edge) + DFSParentEdgeMap dfs_edge) : low(lpm), parent(dfs_p), df_number(dfs_n), least_ancestor(lam), df_edge(dfs_edge), - count(0) + count(0) {} - - + + template void start_vertex(const Vertex& u, Graph&) { put(parent, u, u); put(least_ancestor, u, count); } - - + + template void discover_vertex(const Vertex& u, Graph&) { @@ -61,7 +61,7 @@ namespace boost put(df_number, u, count); ++count; } - + template void tree_edge(const Edge& e, Graph& g) { @@ -73,13 +73,13 @@ namespace boost put(df_edge, t, e); put(least_ancestor, t, get(df_number, s)); } - + template void back_edge(const Edge& e, Graph& g) { typedef typename graph_traits::vertex_descriptor vertex_t; typedef typename graph_traits::vertices_size_type v_size_t; - + vertex_t s(source(e,g)); vertex_t t(target(e,g)); BOOST_USING_STD_MIN(); @@ -89,20 +89,20 @@ namespace boost v_size_t t_df_number = get(df_number, t); v_size_t s_least_ancestor_df_number = get(least_ancestor, s); - put(low, s, + put(low, s, min BOOST_PREVENT_MACRO_SUBSTITUTION(s_low_df_number, t_df_number) ); - - put(least_ancestor, s, - min BOOST_PREVENT_MACRO_SUBSTITUTION(s_least_ancestor_df_number, + + put(least_ancestor, s, + min BOOST_PREVENT_MACRO_SUBSTITUTION(s_least_ancestor_df_number, t_df_number ) ); } } - + template void finish_vertex(const Vertex& u, Graph&) { @@ -115,21 +115,21 @@ namespace boost if (u_parent != u) { - put(low, u_parent, - min BOOST_PREVENT_MACRO_SUBSTITUTION(u_lowpoint, + put(low, u_parent, + min BOOST_PREVENT_MACRO_SUBSTITUTION(u_lowpoint, u_parent_lowpoint ) ); } } - + LowPointMap low; DFSParentMap parent; DFSNumberMap df_number; LeastAncestorMap least_ancestor; DFSParentEdgeMap df_edge; SizeType count; - + }; @@ -150,7 +150,7 @@ namespace boost typedef typename graph_traits::edge_descriptor edge_t; typedef typename graph_traits::vertex_iterator vertex_iterator_t; typedef typename graph_traits::edge_iterator edge_iterator_t; - typedef typename graph_traits::out_edge_iterator + typedef typename graph_traits::out_edge_iterator out_edge_iterator_t; typedef graph::detail::face_handle face_handle_t; @@ -158,8 +158,8 @@ namespace boost typedef std::vector edge_vector_t; typedef std::list vertex_list_t; typedef std::list< face_handle_t > face_handle_list_t; - typedef boost::shared_ptr< face_handle_list_t > face_handle_list_ptr_t; - typedef boost::shared_ptr< vertex_list_t > vertex_list_ptr_t; + typedef boost::std::shared_ptr< face_handle_list_t > face_handle_list_ptr_t; + typedef boost::std::shared_ptr< vertex_list_t > vertex_list_ptr_t; typedef boost::tuple merge_stack_frame_t; typedef std::vector merge_stack_t; @@ -173,16 +173,16 @@ namespace boost typedef typename map_vertex_to_::type vertex_to_v_size_map_t; typedef typename map_vertex_to_::type vertex_to_vertex_map_t; typedef typename map_vertex_to_::type vertex_to_edge_map_t; - typedef typename map_vertex_to_::type + typedef typename map_vertex_to_::type vertex_to_vertex_list_ptr_map_t; - typedef typename map_vertex_to_< edge_vector_t >::type + typedef typename map_vertex_to_< edge_vector_t >::type vertex_to_edge_vector_map_t; typedef typename map_vertex_to_::type vertex_to_bool_map_t; - typedef typename map_vertex_to_::type + typedef typename map_vertex_to_::type vertex_to_face_handle_map_t; - typedef typename map_vertex_to_::type + typedef typename map_vertex_to_::type vertex_to_face_handle_list_ptr_map_t; - typedef typename map_vertex_to_::type + typedef typename map_vertex_to_::type vertex_to_separated_node_map_t; template struct face_vertex_iterator { - typedef face_iterator type; @@ -216,7 +216,7 @@ namespace boost public: - + boyer_myrvold_impl(const Graph& arg_g, VertexIndexMap arg_vm): g(arg_g), @@ -237,7 +237,7 @@ namespace boost flipped_vector(num_vertices(g), false), backedges_vector(num_vertices(g)), dfs_parent_edge_vector(num_vertices(g)), - + vertices_by_dfs_num(num_vertices(g)), low_point(low_point_vector.begin(), vm), @@ -271,72 +271,72 @@ namespace boost // Sort vertices by their lowpoint - need this later in the constructor vertex_vector_t vertices_by_lowpoint(num_vertices(g)); - std::copy( vertices(g).first, vertices(g).second, + std::copy( vertices(g).first, vertices(g).second, vertices_by_lowpoint.begin() ); - bucket_sort(vertices_by_lowpoint.begin(), - vertices_by_lowpoint.end(), + bucket_sort(vertices_by_lowpoint.begin(), + vertices_by_lowpoint.end(), low_point, num_vertices(g) ); - // Sort vertices by their dfs number - need this to iterate by reverse + // Sort vertices by their dfs number - need this to iterate by reverse // DFS number in the main loop. - std::copy( vertices(g).first, vertices(g).second, + std::copy( vertices(g).first, vertices(g).second, vertices_by_dfs_num.begin() ); - bucket_sort(vertices_by_dfs_num.begin(), - vertices_by_dfs_num.end(), + bucket_sort(vertices_by_dfs_num.begin(), + vertices_by_dfs_num.end(), dfs_number, num_vertices(g) ); - // Initialize face handles. A face handle is an abstraction that serves - // two uses in our implementation - it allows us to efficiently move - // along the outer face of embedded bicomps in a partially embedded - // graph, and it provides storage for the planar embedding. Face - // handles are implemented by a sequence of edges and are associated - // with a particular vertex - the sequence of edges represents the - // current embedding of edges around that vertex, and the first and - // last edges in the sequence represent the pair of edges on the outer - // face that are adjacent to the associated vertex. This lets us embed - // edges in the graph by just pushing them on the front or back of the + // Initialize face handles. A face handle is an abstraction that serves + // two uses in our implementation - it allows us to efficiently move + // along the outer face of embedded bicomps in a partially embedded + // graph, and it provides storage for the planar embedding. Face + // handles are implemented by a sequence of edges and are associated + // with a particular vertex - the sequence of edges represents the + // current embedding of edges around that vertex, and the first and + // last edges in the sequence represent the pair of edges on the outer + // face that are adjacent to the associated vertex. This lets us embed + // edges in the graph by just pushing them on the front or back of the // sequence of edges held by the face handles. - // + // // Our algorithm starts with a DFS tree of edges (where every vertex is - // an articulation point and every edge is a singleton bicomp) and - // repeatedly merges bicomps by embedding additional edges. Note that - // any bicomp at any point in the algorithm can be associated with a + // an articulation point and every edge is a singleton bicomp) and + // repeatedly merges bicomps by embedding additional edges. Note that + // any bicomp at any point in the algorithm can be associated with a // unique edge connecting the vertex of that bicomp with the lowest DFS - // number (which we refer to as the "root" of the bicomp) with its DFS + // number (which we refer to as the "root" of the bicomp) with its DFS // child in the bicomp: the existence of two such edges would contradict - // the properties of a DFS tree. We refer to the DFS child of the root - // of a bicomp as the "canonical DFS child" of the bicomp. Note that a + // the properties of a DFS tree. We refer to the DFS child of the root + // of a bicomp as the "canonical DFS child" of the bicomp. Note that a // vertex can be the root of more than one bicomp. // - // We move around the external faces of a bicomp using a few property + // We move around the external faces of a bicomp using a few property // maps, which we'll initialize presently: // - // - face_handles: maps a vertex to a face handle that can be used to - // move "up" a bicomp. For a vertex that isn't an articulation point, - // this holds the face handles that can be used to move around that + // - face_handles: maps a vertex to a face handle that can be used to + // move "up" a bicomp. For a vertex that isn't an articulation point, + // this holds the face handles that can be used to move around that // vertex's unique bicomp. For a vertex that is an articulation point, - // this holds the face handles associated with the unique bicomp that - // the vertex is NOT the root of. These handles can therefore be used - // to move from any point on the outer face of the tree of bicomps + // this holds the face handles associated with the unique bicomp that + // the vertex is NOT the root of. These handles can therefore be used + // to move from any point on the outer face of the tree of bicomps // around the current outer face towards the root of the DFS tree. // - // - dfs_child_handles: these are used to hold face handles for + // - dfs_child_handles: these are used to hold face handles for // vertices that are articulation points - dfs_child_handles[v] holds // the face handles corresponding to vertex u in the bicomp with root // u and canonical DFS child v. // // - canonical_dfs_child: this property map allows one to determine the // canonical DFS child of a bicomp while traversing the outer face. - // This property map is only valid when applied to one of the two + // This property map is only valid when applied to one of the two // vertices adjacent to the root of the bicomp on the outer face. To // be more precise, if v is the canonical DFS child of a bicomp, - // canonical_dfs_child[dfs_child_handles[v].first_vertex()] == v and + // canonical_dfs_child[dfs_child_handles[v].first_vertex()] == v and // canonical_dfs_child[dfs_child_handles[v].second_vertex()] == v. // // - pertinent_roots: given a vertex v, pertinent_roots[v] contains a @@ -365,19 +365,19 @@ namespace boost } canonical_dfs_child[v] = v; - pertinent_roots[v] = face_handle_list_ptr_t(new face_handle_list_t); + pertinent_roots[v] = face_handle_list_ptr_t(new face_handle_list_t); separated_dfs_child_list[v] = vertex_list_ptr_t(new vertex_list_t); } // We need to create a list of not-yet-merged depth-first children for - // each vertex that will be updated as bicomps get merged. We sort each - // list by ascending lowpoint, which allows the externally_active - // function to run in constant time, and we keep a pointer to each - // vertex's representation in its parent's list, which allows merging + // each vertex that will be updated as bicomps get merged. We sort each + // list by ascending lowpoint, which allows the externally_active + // function to run in constant time, and we keep a pointer to each + // vertex's representation in its parent's list, which allows merging //in constant time. - for(typename vertex_vector_t::iterator itr = + for(typename vertex_vector_t::iterator itr = vertices_by_lowpoint.begin(); itr != vertices_by_lowpoint.end(); ++itr) { @@ -389,7 +389,7 @@ namespace boost separated_dfs_child_list[parent]->insert (separated_dfs_child_list[parent]->end(), v); } - } + } // The merge stack holds path information during a walkdown iteration merge_stack.reserve(num_vertices(g)); @@ -404,11 +404,11 @@ namespace boost bool is_planar() { - // This is the main algorithm: starting with a DFS tree of embedded - // edges (which, since it's a tree, is planar), iterate through all + // This is the main algorithm: starting with a DFS tree of embedded + // edges (which, since it's a tree, is planar), iterate through all // vertices by reverse DFS number, attempting to embed all backedges // connecting the current vertex to vertices with higher DFS numbers. - // + // // The walkup is a procedure that examines all such backedges and sets // up the required data structures so that they can be searched by the // walkdown in linear time. The walkdown does the actual work of @@ -434,7 +434,7 @@ namespace boost store_old_face_handles(StoreOldHandlesPolicy()); vertex_t v(*vi); - + walkup(v); if (!walkdown(v)) @@ -445,7 +445,7 @@ namespace boost clean_up_embedding(StoreEmbeddingPolicy()); return true; - + } @@ -462,14 +462,14 @@ namespace boost void walkup(vertex_t v) { - // The point of the walkup is to follow all backedges from v to + // The point of the walkup is to follow all backedges from v to // vertices with higher DFS numbers, and update pertinent_roots // for the bicomp roots on the path from backedge endpoints up // to v. This will set the stage for the walkdown to efficiently // traverse the graph of bicomps down from v. typedef typename face_vertex_iterator::type walkup_iterator_t; - + out_edge_iterator_t oi, oi_end; for(boost::tie(oi,oi_end) = out_edges(v,g); oi != oi_end; ++oi) { @@ -491,7 +491,7 @@ namespace boost backedges[w].push_back(e); - v_size_t timestamp = dfs_number[v]; + v_size_t timestamp = dfs_number[v]; backedge_flag[w] = timestamp; walkup_iterator_t walkup_itr(w, face_handles); @@ -500,11 +500,11 @@ namespace boost while (true) { - + // Move to the root of the current bicomp or the first visited // vertex on the bicomp by going up each side in parallel - - while(walkup_itr != walkup_end && + + while(walkup_itr != walkup_end && visited[*walkup_itr] != timestamp ) { @@ -515,20 +515,20 @@ namespace boost // If we've found the root of a bicomp through a path we haven't // seen before, update pertinent_roots with a handle to the - // current bicomp. Otherwise, we've just seen a path we've been + // current bicomp. Otherwise, we've just seen a path we've been // up before, so break out of the main while loop. - + if (walkup_itr == walkup_end) { vertex_t dfs_child = canonical_dfs_child[lead_vertex]; vertex_t parent = dfs_parent[dfs_child]; - visited[dfs_child_handles[dfs_child].first_vertex()] + visited[dfs_child_handles[dfs_child].first_vertex()] = timestamp; - visited[dfs_child_handles[dfs_child].second_vertex()] + visited[dfs_child_handles[dfs_child].second_vertex()] = timestamp; - if (low_point[dfs_child] < dfs_number[v] || + if (low_point[dfs_child] < dfs_number[v] || least_ancestor[dfs_child] < dfs_number[v] ) { @@ -553,10 +553,10 @@ namespace boost break; } - } - + } + } - + @@ -577,19 +577,19 @@ namespace boost while (!pertinent_roots[v]->empty()) { - + face_handle_t root_face_handle = pertinent_roots[v]->front(); face_handle_t curr_face_handle = root_face_handle; - pertinent_roots[v]->pop_front(); + pertinent_roots[v]->pop_front(); merge_stack.clear(); while(true) { - typename face_vertex_iterator<>::type + typename face_vertex_iterator<>::type first_face_itr, second_face_itr, face_end; - vertex_t first_side_vertex + vertex_t first_side_vertex = graph_traits::null_vertex(); vertex_t second_side_vertex; vertex_t first_tail, second_tail; @@ -603,7 +603,7 @@ namespace boost for(; first_face_itr != face_end; ++first_face_itr) { vertex_t face_vertex(*first_face_itr); - if (pertinent(face_vertex, v) || + if (pertinent(face_vertex, v) || externally_active(face_vertex, v) ) { @@ -614,7 +614,7 @@ namespace boost first_tail = face_vertex; } - if (first_side_vertex == graph_traits::null_vertex() || + if (first_side_vertex == graph_traits::null_vertex() || first_side_vertex == curr_face_handle.get_anchor() ) break; @@ -622,7 +622,7 @@ namespace boost for(;second_face_itr != face_end; ++second_face_itr) { vertex_t face_vertex(*second_face_itr); - if (pertinent(face_vertex, v) || + if (pertinent(face_vertex, v) || externally_active(face_vertex, v) ) { @@ -654,14 +654,14 @@ namespace boost chosen = second_side_vertex; chose_first_upper_path = false; } - else + else { - // If there's a pertinent vertex on the lower face - // between the first_face_itr and the second_face_itr, + // If there's a pertinent vertex on the lower face + // between the first_face_itr and the second_face_itr, // this graph isn't planar. - for(; - *first_face_itr != second_side_vertex; + for(; + *first_face_itr != second_side_vertex; ++first_face_itr ) { @@ -675,85 +675,85 @@ namespace boost return false; } } - - // Otherwise, the fact that we didn't find a pertinent - // vertex on this face is fine - we should set the - // short-circuit edges and break out of this loop to + + // Otherwise, the fact that we didn't find a pertinent + // vertex on this face is fine - we should set the + // short-circuit edges and break out of this loop to // start looking at a different pertinent root. - + if (first_side_vertex == second_side_vertex) { if (first_tail != v) { - vertex_t first + vertex_t first = face_handles[first_tail].first_vertex(); - vertex_t second + vertex_t second = face_handles[first_tail].second_vertex(); - boost::tie(first_side_vertex, first_tail) - = make_tuple(first_tail, - first == first_side_vertex ? + boost::tie(first_side_vertex, first_tail) + = make_tuple(first_tail, + first == first_side_vertex ? second : first ); } else if (second_tail != v) { - vertex_t first + vertex_t first = face_handles[second_tail].first_vertex(); - vertex_t second + vertex_t second = face_handles[second_tail].second_vertex(); - boost::tie(second_side_vertex, second_tail) + boost::tie(second_side_vertex, second_tail) = make_tuple(second_tail, - first == second_side_vertex ? + first == second_side_vertex ? second : first); } else break; } - - canonical_dfs_child[first_side_vertex] + + canonical_dfs_child[first_side_vertex] = canonical_dfs_child[root_face_handle.first_vertex()]; - canonical_dfs_child[second_side_vertex] + canonical_dfs_child[second_side_vertex] = canonical_dfs_child[root_face_handle.second_vertex()]; root_face_handle.set_first_vertex(first_side_vertex); root_face_handle.set_second_vertex(second_side_vertex); - if (face_handles[first_side_vertex].first_vertex() == + if (face_handles[first_side_vertex].first_vertex() == first_tail ) face_handles[first_side_vertex].set_first_vertex(v); else face_handles[first_side_vertex].set_second_vertex(v); - if (face_handles[second_side_vertex].first_vertex() == + if (face_handles[second_side_vertex].first_vertex() == second_tail ) face_handles[second_side_vertex].set_first_vertex(v); else face_handles[second_side_vertex].set_second_vertex(v); - + break; - + } - // When we unwind the stack, we need to know which direction + // When we unwind the stack, we need to know which direction // we came down from on the top face handle - - bool chose_first_lower_path = - (chose_first_upper_path && - face_handles[chosen].first_vertex() == first_tail) + + bool chose_first_lower_path = + (chose_first_upper_path && + face_handles[chosen].first_vertex() == first_tail) || - (!chose_first_upper_path && + (!chose_first_upper_path && face_handles[chosen].first_vertex() == second_tail); //If there's a backedge at the chosen vertex, embed it now if (backedge_flag[chosen] == dfs_number[v]) { w = chosen; - + backedge_flag[chosen] = num_vertices(g) + 1; add_to_merge_points(chosen, StoreOldHandlesPolicy()); - + typename edge_vector_t::iterator ei, ei_end; ei_end = backedges[chosen].end(); for(ei = backedges[chosen].begin(); ei != ei_end; ++ei) @@ -778,7 +778,7 @@ namespace boost } //Unwind the merge stack to the root, merging all bicomps - + bool bottom_path_follows_first; bool top_path_follows_first; bool next_bottom_follows_first = chose_first_upper_path; @@ -790,8 +790,8 @@ namespace boost { bottom_path_follows_first = next_bottom_follows_first; - boost::tie(merge_point, - next_bottom_follows_first, + boost::tie(merge_point, + next_bottom_follows_first, top_path_follows_first ) = merge_stack.back(); merge_stack.pop_back(); @@ -799,7 +799,7 @@ namespace boost face_handle_t top_handle(face_handles[merge_point]); face_handle_t bottom_handle (*pertinent_roots[merge_point]->begin()); - + vertex_t bottom_dfs_child = canonical_dfs_child [pertinent_roots[merge_point]->begin()->first_vertex()]; @@ -810,23 +810,23 @@ namespace boost pertinent_roots[merge_point]->pop_front(); - add_to_merge_points(top_handle.get_anchor(), + add_to_merge_points(top_handle.get_anchor(), StoreOldHandlesPolicy() ); - + if (top_path_follows_first && bottom_path_follows_first) { bottom_handle.flip(); top_handle.glue_first_to_second(bottom_handle); - } - else if (!top_path_follows_first && + } + else if (!top_path_follows_first && bottom_path_follows_first ) { flipped[bottom_dfs_child] = true; top_handle.glue_second_to_first(bottom_handle); } - else if (top_path_follows_first && + else if (top_path_follows_first && !bottom_path_follows_first ) { @@ -842,17 +842,17 @@ namespace boost } //Finally, embed all edges (v,w) at their upper end points - canonical_dfs_child[w] + canonical_dfs_child[w] = canonical_dfs_child[root_face_handle.first_vertex()]; - - add_to_merge_points(root_face_handle.get_anchor(), + + add_to_merge_points(root_face_handle.get_anchor(), StoreOldHandlesPolicy() ); - + typename edge_vector_t::iterator ei, ei_end; ei_end = backedges[chosen].end(); for(ei = backedges[chosen].begin(); ei != ei_end; ++ei) - { + { if (next_bottom_follows_first) root_face_handle.push_first(*ei, g); else @@ -863,7 +863,7 @@ namespace boost curr_face_handle = root_face_handle; }//while(true) - + }//while(!pertinent_roots[v]->empty()) return true; @@ -879,14 +879,14 @@ namespace boost void store_old_face_handles(graph::detail::store_old_handles) { - for(typename std::vector::iterator mp_itr + for(typename std::vector::iterator mp_itr = current_merge_points.begin(); mp_itr != current_merge_points.end(); ++mp_itr) { face_handles[*mp_itr].store_old_face_handles(); } current_merge_points.clear(); - } + } void add_to_merge_points(vertex_t, graph::detail::no_old_handles) {} @@ -896,7 +896,7 @@ namespace boost current_merge_points.push_back(v); } - + void add_to_embedded_edges(edge_t, graph::detail::no_old_handles) {} void add_to_embedded_edges(edge_t e, graph::detail::store_old_handles) @@ -924,7 +924,7 @@ namespace boost { typename vertex_list_t::iterator yi, yi_end; yi_end = separated_dfs_child_list[*xi]->end(); - for(yi = separated_dfs_child_list[*xi]->begin(); + for(yi = separated_dfs_child_list[*xi]->begin(); yi != yi_end; ++yi ) { @@ -933,7 +933,7 @@ namespace boost (dfs_child_handles[*yi]); } } - } + } // Up until this point, we've flipped bicomps lazily by setting // flipped[v] to true if the bicomp rooted at v was flipped (the @@ -944,7 +944,7 @@ namespace boost typedef typename vertex_vector_t::iterator vertex_vector_itr_t; vertex_vector_itr_t vi_end = vertices_by_dfs_num.end(); - for(vertex_vector_itr_t vi = vertices_by_dfs_num.begin(); + for(vertex_vector_itr_t vi = vertices_by_dfs_num.begin(); vi != vi_end; ++vi ) { @@ -968,7 +968,7 @@ namespace boost // If there are any self-loops in the graph, they were flagged // during the walkup, and we should add them to the embedding now. - // Adding a self loop anywhere in the embedding could never + // Adding a self loop anywhere in the embedding could never // invalidate the embedding, but they would complicate the traversal // if they were added during the walkup/walkdown. @@ -979,13 +979,13 @@ namespace boost edge_t e(*ei); face_handles[source(e,g)].push_second(e,g); } - + } - + bool pertinent(vertex_t w, vertex_t v) { // w is pertinent with respect to v if there is a backedge (v,w) or if @@ -993,38 +993,38 @@ namespace boost return backedge_flag[w] == dfs_number[v] || !pertinent_roots[w]->empty(); } - + bool externally_active(vertex_t w, vertex_t v) { // Let a be any proper depth-first search ancestor of v. w is externally - // active with respect to v if there exists a backedge (a,w) or a + // active with respect to v if there exists a backedge (a,w) or a // backedge (a,w_0) for some w_0 in a descendent bicomp of w. v_size_t dfs_number_of_v = dfs_number[v]; return (least_ancestor[w] < dfs_number_of_v) || (!separated_dfs_child_list[w]->empty() && - low_point[separated_dfs_child_list[w]->front()] < dfs_number_of_v); + low_point[separated_dfs_child_list[w]->front()] < dfs_number_of_v); } - - + + bool internally_active(vertex_t w, vertex_t v) { return pertinent(w,v) && !externally_active(w,v); - } - + } + void remove_vertex_from_separated_dfs_child_list(vertex_t v) { - typename vertex_list_t::iterator to_delete + typename vertex_list_t::iterator to_delete = separated_node_in_parent_list[v]; - garbage.splice(garbage.end(), - *separated_dfs_child_list[dfs_parent[v]], - to_delete, + garbage.splice(garbage.end(), + *separated_dfs_child_list[dfs_parent[v]], + to_delete, boost::next(to_delete) ); } @@ -1032,9 +1032,9 @@ namespace boost - + // End of the implementation of the basic Boyer-Myrvold Algorithm. The rest - // of the code below implements the isolation of a Kuratowski subgraph in + // of the code below implements the isolation of a Kuratowski subgraph in // the case that the input graph is not planar. This is by far the most // complicated part of the implementation. @@ -1047,7 +1047,7 @@ namespace boost template - vertex_t kuratowski_walkup(vertex_t v, + vertex_t kuratowski_walkup(vertex_t v, EdgeToBoolPropertyMap forbidden_edge, EdgeToBoolPropertyMap goal_edge, EdgeToBoolPropertyMap is_embedded, @@ -1057,19 +1057,19 @@ namespace boost vertex_t current_endpoint; bool seen_goal_edge = false; out_edge_iterator_t oi, oi_end; - + for(boost::tie(oi,oi_end) = out_edges(v,g); oi != oi_end; ++oi) forbidden_edge[*oi] = true; - + for(boost::tie(oi,oi_end) = out_edges(v,g); oi != oi_end; ++oi) { path_edges.clear(); - + edge_t e(*oi); - current_endpoint = target(*oi,g) == v ? + current_endpoint = target(*oi,g) == v ? source(*oi,g) : target(*oi,g); - - if (dfs_number[current_endpoint] < dfs_number[v] || + + if (dfs_number[current_endpoint] < dfs_number[v] || is_embedded[e] || v == current_endpoint //self-loop ) @@ -1077,7 +1077,7 @@ namespace boost //Not a backedge continue; } - + path_edges.push_back(e); if (goal_edge[e]) { @@ -1085,30 +1085,30 @@ namespace boost } typedef typename face_edge_iterator<>::type walkup_itr_t; - - walkup_itr_t + + walkup_itr_t walkup_itr(current_endpoint, face_handles, first_side()); walkup_itr_t walkup_end; - + seen_goal_edge = false; - + while (true) - { - + { + if (walkup_itr != walkup_end && forbidden_edge[*walkup_itr]) break; - - while(walkup_itr != walkup_end && - !goal_edge[*walkup_itr] && + + while(walkup_itr != walkup_end && + !goal_edge[*walkup_itr] && !forbidden_edge[*walkup_itr] ) { edge_t f(*walkup_itr); forbidden_edge[f] = true; path_edges.push_back(f); - current_endpoint = - source(f, g) == current_endpoint ? - target(f, g) : + current_endpoint = + source(f, g) == current_endpoint ? + target(f, g) : source(f,g); ++walkup_itr; } @@ -1120,14 +1120,14 @@ namespace boost break; } - walkup_itr + walkup_itr = walkup_itr_t(current_endpoint, face_handles, first_side()); - + } - + if (seen_goal_edge) break; - + } if (seen_goal_edge) @@ -1157,9 +1157,9 @@ namespace boost // | there exists some bicomp containing three vertices // ----- x,y, and z as shown such that x and y are externally // | | active with respect to v (which means that there are - // x y two vertices x_0 and y_0 such that (1) both x_0 and - // | | y_0 are proper depth-first search ancestors of v and - // --z-- (2) there are two disjoint paths, one connecting x + // x y two vertices x_0 and y_0 such that (1) both x_0 and + // | | y_0 are proper depth-first search ancestors of v and + // --z-- (2) there are two disjoint paths, one connecting x // and x_0 and one connecting y and y_0, both consisting // fig. 1 entirely of unembedded edges). Furthermore, there // exists a vertex z_0 such that z is a depth-first @@ -1175,10 +1175,10 @@ namespace boost // properties of the Boyer-Myrvold algorithm to show the existence of an // "x-y path" connecting some vertex on the "left side" of the x,y,z // bicomp with some vertex on the "right side" of the bicomp (where the - // left and right are split by a line drawn through v and z.If either of - // the endpoints of the x-y path is above x or y on the bicomp, a K_3_3 - // can be isolated - this is a case C. Otherwise, both endpoints are at - // or below x and y on the bicomp. If there is a vertex alpha on the x-y + // left and right are split by a line drawn through v and z.If either of + // the endpoints of the x-y path is above x or y on the bicomp, a K_3_3 + // can be isolated - this is a case C. Otherwise, both endpoints are at + // or below x and y on the bicomp. If there is a vertex alpha on the x-y // path such that alpha is not x or y and there's a path from alpha to v // that's disjoint from any of the edges on the bicomp and the x-y path, // a K_3_3 can be isolated - this is a case D. Otherwise, properties of @@ -1192,8 +1192,8 @@ namespace boost out_edge_iterator_t oei, oei_end; typename std::vector::iterator xi, xi_end; - // Clear the short-circuit edges - these are needed for the planar - // testing/embedding algorithm to run in linear time, but they'll + // Clear the short-circuit edges - these are needed for the planar + // testing/embedding algorithm to run in linear time, but they'll // complicate the kuratowski subgraph isolation for(boost::tie(vi,vi_end) = vertices(g); vi != vi_end; ++vi) { @@ -1217,12 +1217,12 @@ namespace boost typename std::vector::iterator embedded_itr, embedded_end; embedded_end = embedded_edges.end(); - for(embedded_itr = embedded_edges.begin(); + for(embedded_itr = embedded_edges.begin(); embedded_itr != embedded_end; ++embedded_itr ) is_embedded[*embedded_itr] = true; - // upper_face_vertex is true for x,y, and all vertices above x and y in + // upper_face_vertex is true for x,y, and all vertices above x and y in // the bicomp std::vector upper_face_vertex_vector(num_vertices(g), false); vertex_to_bool_map_t upper_face_vertex @@ -1234,7 +1234,7 @@ namespace boost // These next few variable declarations are all things that we need // to find. - vertex_t z; + vertex_t z; vertex_t bicomp_root; vertex_t w = graph_traits::null_vertex(); face_handle_t w_handle; @@ -1256,13 +1256,13 @@ namespace boost //backedge from V, then goes up until it hits either X or Y //(but doesn't find X or Y as the root of a bicomp) - typename face_vertex_iterator<>::type + typename face_vertex_iterator<>::type x_upper_itr(x, face_handles, first_side()); - typename face_vertex_iterator<>::type + typename face_vertex_iterator<>::type x_lower_itr(x, face_handles, second_side()); typename face_vertex_iterator<>::type face_itr, face_end; - // Don't know which path from x is the upper or lower path - + // Don't know which path from x is the upper or lower path - // we'll find out here for(face_itr = x_upper_itr; face_itr != face_end; ++face_itr) { @@ -1284,9 +1284,9 @@ namespace boost upper_face_vertex[current_vertex] = true; } - v_dfchild_handle + v_dfchild_handle = dfs_child_handles[canonical_dfs_child[previous_vertex]]; - + for(face_itr = x_lower_itr; *face_itr != y; ++face_itr) { vertex_t current_vertex(*face_itr); @@ -1297,7 +1297,7 @@ namespace boost if (w == graph_traits::null_vertex()) //haven't found a w yet { roots_end = pertinent_roots[current_vertex]->end(); - for(roots_itr = pertinent_roots[current_vertex]->begin(); + for(roots_itr = pertinent_roots[current_vertex]->begin(); roots_itr != roots_end; ++roots_itr ) { @@ -1327,7 +1327,7 @@ namespace boost edge_to_bool_map_t outer_face_edge(outer_face_edge_vector.begin(), em); walkup_itr_t walkup_end; - for(walkup_itr_t walkup_itr(x, face_handles, first_side()); + for(walkup_itr_t walkup_itr(x, face_handles, first_side()); walkup_itr != walkup_end; ++walkup_itr ) { @@ -1335,7 +1335,7 @@ namespace boost is_in_subgraph[*walkup_itr] = true; } - for(walkup_itr_t walkup_itr(x, face_handles, second_side()); + for(walkup_itr_t walkup_itr(x, face_handles, second_side()); walkup_itr != walkup_end; ++walkup_itr ) { @@ -1355,53 +1355,53 @@ namespace boost for(boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { edge_t e(*ei); - goal_edge[e] + goal_edge[e] = !outer_face_edge[e] && (source(e,g) == x || target(e,g) == x); forbidden_edge[*ei] = outer_face_edge[*ei]; } vertex_t x_ancestor = v; vertex_t x_endpoint = graph_traits::null_vertex(); - + while(x_endpoint == graph_traits::null_vertex()) - { + { x_ancestor = dfs_parent[x_ancestor]; - x_endpoint = kuratowski_walkup(x_ancestor, - forbidden_edge, + x_endpoint = kuratowski_walkup(x_ancestor, + forbidden_edge, goal_edge, is_embedded, x_external_path ); - - } + + } for(boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { edge_t e(*ei); - goal_edge[e] + goal_edge[e] = !outer_face_edge[e] && (source(e,g) == y || target(e,g) == y); forbidden_edge[*ei] = outer_face_edge[*ei]; } vertex_t y_ancestor = v; vertex_t y_endpoint = graph_traits::null_vertex(); - + while(y_endpoint == graph_traits::null_vertex()) - { + { y_ancestor = dfs_parent[y_ancestor]; - y_endpoint = kuratowski_walkup(y_ancestor, - forbidden_edge, + y_endpoint = kuratowski_walkup(y_ancestor, + forbidden_edge, goal_edge, is_embedded, y_external_path ); - - } - + + } + vertex_t parent, child; - + //If v isn't on the same bicomp as x and y, it's a case A if (bicomp_root != v) { @@ -1412,13 +1412,13 @@ namespace boost for(boost::tie(oei,oei_end) = out_edges(*vi,g); oei != oei_end; ++oei) if(!outer_face_edge[*oei]) goal_edge[*oei] = true; - + for(boost::tie(ei,ei_end) = edges(g); ei != ei_end; ++ei) forbidden_edge[*ei] = outer_face_edge[*ei]; - + z = kuratowski_walkup (v, forbidden_edge, goal_edge, is_embedded, z_v_path); - + } else if (w != graph_traits::null_vertex()) { @@ -1430,17 +1430,17 @@ namespace boost goal_edge[e] = false; forbidden_edge[e] = outer_face_edge[e]; } - + goal_edge[w_handle.first_edge()] = true; goal_edge[w_handle.second_edge()] = true; z = kuratowski_walkup(v, - forbidden_edge, + forbidden_edge, goal_edge, is_embedded, z_v_path ); - + for(boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { @@ -1453,41 +1453,41 @@ namespace boost { goal_edge[*pi] = true; } - + w_ancestor = v; vertex_t w_endpoint = graph_traits::null_vertex(); - + while(w_endpoint == graph_traits::null_vertex()) - { + { w_ancestor = dfs_parent[w_ancestor]; - w_endpoint = kuratowski_walkup(w_ancestor, - forbidden_edge, + w_endpoint = kuratowski_walkup(w_ancestor, + forbidden_edge, goal_edge, is_embedded, w_path ); - - } - - // We really want both the w walkup and the z walkup to finish on - // exactly the same edge, but for convenience (since we don't have - // control over which side of a bicomp a walkup moves up) we've - // defined the walkup to either end at w_handle.first_edge() or - // w_handle.second_edge(). If both walkups ended at different edges, - // we'll do a little surgery on the w walkup path to make it follow + + } + + // We really want both the w walkup and the z walkup to finish on + // exactly the same edge, but for convenience (since we don't have + // control over which side of a bicomp a walkup moves up) we've + // defined the walkup to either end at w_handle.first_edge() or + // w_handle.second_edge(). If both walkups ended at different edges, + // we'll do a little surgery on the w walkup path to make it follow // the other side of the final bicomp. - if ((w_path.back() == w_handle.first_edge() && - z_v_path.back() == w_handle.second_edge()) + if ((w_path.back() == w_handle.first_edge() && + z_v_path.back() == w_handle.second_edge()) || - (w_path.back() == w_handle.second_edge() && + (w_path.back() == w_handle.second_edge() && z_v_path.back() == w_handle.first_edge()) ) { walkup_itr_t wi, wi_end; edge_t final_edge = w_path.back(); - vertex_t anchor - = source(final_edge, g) == w_handle.get_anchor() ? + vertex_t anchor + = source(final_edge, g) == w_handle.get_anchor() ? target(final_edge, g) : source(final_edge, g); if (face_handles[anchor].first_edge() == final_edge) wi = walkup_itr_t(anchor, face_handles, second_side()); @@ -1506,9 +1506,9 @@ namespace boost } } - + } - else + else { //We need to find a valid z, since the x-y path re-defines the lower @@ -1519,7 +1519,7 @@ namespace boost // The z we've used so far is just an externally active vertex on the // lower face path, but may not be the z we need for a case C, D, or - // E subgraph. the z we need now is any externally active vertex on + // E subgraph. the z we need now is any externally active vertex on // the lower face path with both old_face_handles edges on the outer // face. Since we know an x-y path exists, such a z must also exist. @@ -1530,7 +1530,7 @@ namespace boost for(face_itr = x_lower_itr; *face_itr != y; ++face_itr) { vertex_t possible_z(*face_itr); - if (pertinent(possible_z,v) && + if (pertinent(possible_z,v) && outer_face_edge[face_handles[possible_z].old_first_edge()] && outer_face_edge[face_handles[possible_z].old_second_edge()] ) @@ -1544,14 +1544,14 @@ namespace boost if (externally_active(z,v)) w = z; - + typedef typename face_edge_iterator - ::type old_face_iterator_t; + ::type old_face_iterator_t; - old_face_iterator_t + old_face_iterator_t first_old_face_itr(z, face_handles, first_side()); - old_face_iterator_t + old_face_iterator_t second_old_face_itr(z, face_handles, second_side()); old_face_iterator_t old_face_itr, old_face_end; @@ -1563,10 +1563,10 @@ namespace boost vertex_to_bool_map_t x_y_path_vertex (x_y_path_vertex_vector.begin(), vm); - typename std::vector::iterator + typename std::vector::iterator of_itr, of_itr_end; - of_itr_end = old_face_iterators.end(); - for(of_itr = old_face_iterators.begin(); + of_itr_end = old_face_iterators.end(); + for(of_itr = old_face_iterators.begin(); of_itr != of_itr_end; ++of_itr ) { @@ -1580,13 +1580,13 @@ namespace boost { edge_t e(*old_face_itr); previous_vertex = current_vertex; - current_vertex = source(e,g) == current_vertex ? + current_vertex = source(e,g) == current_vertex ? target(e,g) : source(e,g); - + if (current_vertex == x || current_vertex == y) seen_x_or_y = true; - if (w == graph_traits::null_vertex() && + if (w == graph_traits::null_vertex() && externally_active(current_vertex,v) && outer_face_edge[e] && outer_face_edge[*boost::next(old_face_itr)] && @@ -1595,10 +1595,10 @@ namespace boost { w = current_vertex; } - + if (!outer_face_edge[e]) { - if (!upper_face_vertex[current_vertex] && + if (!upper_face_vertex[current_vertex] && !lower_face_vertex[current_vertex] ) { @@ -1606,22 +1606,22 @@ namespace boost } is_in_subgraph[e] = true; - if (upper_face_vertex[source(e,g)] || + if (upper_face_vertex[source(e,g)] || lower_face_vertex[source(e,g)] ) { - if (first_x_y_path_endpoint == + if (first_x_y_path_endpoint == graph_traits::null_vertex() ) first_x_y_path_endpoint = source(e,g); else second_x_y_path_endpoint = source(e,g); } - if (upper_face_vertex[target(e,g)] || + if (upper_face_vertex[target(e,g)] || lower_face_vertex[target(e,g)] ) { - if (first_x_y_path_endpoint == + if (first_x_y_path_endpoint == graph_traits::null_vertex() ) first_x_y_path_endpoint = target(e,g); @@ -1635,35 +1635,35 @@ namespace boost { chosen_case = detail::BM_CASE_C; } - + } } - // Look for a case D - one of v's embedded edges will connect to the + // Look for a case D - one of v's embedded edges will connect to the // x-y path along an inner face path. //First, get a list of all of v's embedded child edges out_edge_iterator_t v_edge_itr, v_edge_end; - for(boost::tie(v_edge_itr,v_edge_end) = out_edges(v,g); + for(boost::tie(v_edge_itr,v_edge_end) = out_edges(v,g); v_edge_itr != v_edge_end; ++v_edge_itr ) { edge_t embedded_edge(*v_edge_itr); - - if (!is_embedded[embedded_edge] || + + if (!is_embedded[embedded_edge] || embedded_edge == dfs_parent_edge[v] ) continue; case_d_edges.push_back(embedded_edge); - vertex_t current_vertex - = source(embedded_edge,g) == v ? + vertex_t current_vertex + = source(embedded_edge,g) == v ? target(embedded_edge,g) : source(embedded_edge,g); - typename face_edge_iterator<>::type + typename face_edge_iterator<>::type internal_face_itr, internal_face_end; if (face_handles[current_vertex].first_vertex() == v) { @@ -1677,13 +1677,13 @@ namespace boost } while(internal_face_itr != internal_face_end && - !outer_face_edge[*internal_face_itr] && + !outer_face_edge[*internal_face_itr] && !x_y_path_vertex[current_vertex] ) { edge_t e(*internal_face_itr); case_d_edges.push_back(e); - current_vertex = + current_vertex = source(e,g) == current_vertex ? target(e,g) : source(e,g); ++internal_face_itr; } @@ -1699,7 +1699,7 @@ namespace boost } } - + } @@ -1714,25 +1714,25 @@ namespace boost for(boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { edge_t e(*ei); - goal_edge[e] = !outer_face_edge[e] && + goal_edge[e] = !outer_face_edge[e] && (source(e,g) == z || target(e,g) == z); forbidden_edge[e] = outer_face_edge[e]; } kuratowski_walkup(v, - forbidden_edge, + forbidden_edge, goal_edge, is_embedded, z_v_path ); - + if (chosen_case == detail::BM_CASE_E) { for(boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { forbidden_edge[*ei] = outer_face_edge[*ei]; - goal_edge[*ei] = !outer_face_edge[*ei] && + goal_edge[*ei] = !outer_face_edge[*ei] && (source(*ei,g) == w || target(*ei,g) == w); } @@ -1748,22 +1748,22 @@ namespace boost { goal_edge[*pi] = true; } - + w_ancestor = v; vertex_t w_endpoint = graph_traits::null_vertex(); - + while(w_endpoint == graph_traits::null_vertex()) - { + { w_ancestor = dfs_parent[w_ancestor]; - w_endpoint = kuratowski_walkup(w_ancestor, - forbidden_edge, + w_endpoint = kuratowski_walkup(w_ancestor, + forbidden_edge, goal_edge, is_embedded, w_path ); - - } - + + } + } @@ -1794,7 +1794,7 @@ namespace boost xi_end = w_path.end(); for(xi = w_path.begin(); xi != xi_end; ++xi) is_in_subgraph[*xi] = true; - + child = bicomp_root; parent = dfs_parent[child]; while(child != parent) @@ -1806,10 +1806,10 @@ namespace boost - // At this point, we've already isolated the Kuratowski subgraph and - // collected all of the edges that compose it in the is_in_subgraph - // property map. But we want the verification of such a subgraph to be - // a deterministic process, and we can simplify the function + // At this point, we've already isolated the Kuratowski subgraph and + // collected all of the edges that compose it in the is_in_subgraph + // property map. But we want the verification of such a subgraph to be + // a deterministic process, and we can simplify the function // is_kuratowski_subgraph by cleaning up some edges here. if (chosen_case == detail::BM_CASE_B) @@ -1821,13 +1821,13 @@ namespace boost // In a case C subgraph, at least one of the x-y path endpoints // (call it alpha) is above either x or y on the outer face. The // other endpoint may be attached at x or y OR above OR below. In - // any of these three cases, we can form a K_3_3 by removing the - // edge attached to v on the outer face that is NOT on the path to + // any of these three cases, we can form a K_3_3 by removing the + // edge attached to v on the outer face that is NOT on the path to // alpha. - typename face_vertex_iterator::type + typename face_vertex_iterator::type face_itr, face_end; - if (face_handles[v_dfchild_handle.first_vertex()].first_edge() == + if (face_handles[v_dfchild_handle.first_vertex()].first_edge() == v_dfchild_handle.first_edge() ) { @@ -1857,13 +1857,13 @@ namespace boost break; } } - + } else if (chosen_case == detail::BM_CASE_D) { // Need to remove both of the edges adjacent to v on the outer face. // remove the connecting edges from v to bicomp, then - // is_kuratowski_subgraph will shrink vertices of degree 1 + // is_kuratowski_subgraph will shrink vertices of degree 1 // automatically... is_in_subgraph[v_dfchild_handle.first_edge()] = false; @@ -1872,8 +1872,8 @@ namespace boost } else if (chosen_case == detail::BM_CASE_E) { - // Similarly to case C, if the endpoints of the x-y path are both - // below x and y, we should remove an edge to allow the subgraph to + // Similarly to case C, if the endpoints of the x-y path are both + // below x and y, we should remove an edge to allow the subgraph to // contract to a K_3_3. @@ -1881,7 +1881,7 @@ namespace boost (second_x_y_path_endpoint != x && second_x_y_path_endpoint != y) ) { - is_in_subgraph[dfs_parent_edge[v]] = false; + is_in_subgraph[dfs_parent_edge[v]] = false; vertex_t deletion_endpoint, other_endpoint; if (lower_face_vertex[first_x_y_path_endpoint]) @@ -1890,13 +1890,13 @@ namespace boost other_endpoint = first_x_y_path_endpoint; } else - { + { deletion_endpoint = first_x_y_path_endpoint; other_endpoint = second_x_y_path_endpoint; } typename face_edge_iterator<>::type face_itr, face_end; - + bool found_other_endpoint = false; for(face_itr = typename face_edge_iterator<>::type (deletion_endpoint, face_handles, first_side()); @@ -1904,7 +1904,7 @@ namespace boost ) { edge_t e(*face_itr); - if (source(e,g) == other_endpoint || + if (source(e,g) == other_endpoint || target(e,g) == other_endpoint ) { @@ -1915,7 +1915,7 @@ namespace boost if (found_other_endpoint) { - is_in_subgraph[face_handles[deletion_endpoint].first_edge()] + is_in_subgraph[face_handles[deletion_endpoint].first_edge()] = false; } else @@ -1924,14 +1924,14 @@ namespace boost = false; } } - + } for(boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) if (is_in_subgraph[*ei]) *o_itr = *ei; - + } @@ -1957,14 +1957,14 @@ namespace boost vertex_t kuratowski_v; vertex_t kuratowski_x; vertex_t kuratowski_y; - - vertex_list_t garbage; // we delete items from linked lists by + + vertex_list_t garbage; // we delete items from linked lists by // splicing them into garbage //only need these two for kuratowski subgraph isolation std::vector current_merge_points; std::vector embedded_edges; - + //property map storage std::vector low_point_vector; std::vector dfs_parent_vector; @@ -1976,7 +1976,7 @@ namespace boost std::vector< face_handle_t > face_handles_vector; std::vector< face_handle_t > dfs_child_handles_vector; std::vector< vertex_list_ptr_t > separated_dfs_child_list_vector; - std::vector< typename vertex_list_t::iterator > + std::vector< typename vertex_list_t::iterator > separated_node_in_parent_list_vector; std::vector canonical_dfs_child_vector; std::vector flipped_vector; @@ -1993,20 +1993,20 @@ namespace boost vertex_to_face_handle_list_ptr_map_t pertinent_roots; vertex_to_v_size_map_t backedge_flag; vertex_to_v_size_map_t visited; - vertex_to_face_handle_map_t face_handles; + vertex_to_face_handle_map_t face_handles; vertex_to_face_handle_map_t dfs_child_handles; vertex_to_vertex_list_ptr_map_t separated_dfs_child_list; vertex_to_separated_node_map_t separated_node_in_parent_list; - vertex_to_vertex_map_t canonical_dfs_child; + vertex_to_vertex_map_t canonical_dfs_child; vertex_to_bool_map_t flipped; vertex_to_edge_vector_map_t backedges; vertex_to_edge_map_t dfs_parent_edge; //only need for kuratowski merge_stack_t merge_stack; - + }; - - + + } //namespace boost #endif //__BOYER_MYRVOLD_IMPL_HPP__ diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/planar_detail/face_handles.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/planar_detail/face_handles.hpp index 4e28d4af..99b4eec3 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/planar_detail/face_handles.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/planar_detail/face_handles.hpp @@ -12,7 +12,7 @@ #include #include -#include +#include // A "face handle" is an optimization meant to serve two purposes in @@ -26,7 +26,7 @@ // sequence of edges. The functions first_vertex/second_vertex and // first_edge/second_edge allow fast access to the beginning and end of the // stored sequence, which allows one to traverse the outer face of the partial -// planar embedding as it's being created. +// planar embedding as it's being created. // // There are some policies below that define the contents of the face handles: // in the case no embedding is needed (for example, if one just wants to use @@ -48,7 +48,7 @@ namespace boost { namespace graph { namespace detail { //face handle policies - + //EmbeddingStorage policy struct store_embedding {}; struct recursive_lazy_list : public store_embedding {}; @@ -65,14 +65,14 @@ namespace boost { namespace graph { namespace detail { template struct lazy_list_node { - typedef shared_ptr< lazy_list_node > ptr_t; + typedef std::shared_ptr< lazy_list_node > ptr_t; lazy_list_node(const DataType& data) : m_reversed(false), m_data(data), m_has_data(true) {} - + lazy_list_node(ptr_t left_child, ptr_t right_child) : m_reversed(false), m_has_data(false), @@ -83,10 +83,10 @@ namespace boost { namespace graph { namespace detail { bool m_reversed; DataType m_data; bool m_has_data; - shared_ptr m_left_child; - shared_ptr m_right_child; + std::shared_ptr m_left_child; + std::shared_ptr m_right_child; }; - + template @@ -139,7 +139,7 @@ namespace boost { namespace graph { namespace detail { struct edge_list_storage { typedef lazy_list_node node_type; - typedef shared_ptr< node_type > type; + typedef std::shared_ptr< node_type > type; type value; void push_back(Edge e) @@ -178,17 +178,17 @@ namespace boost { namespace graph { namespace detail { private: template - void get_list_helper(OutputIterator o_itr, + void get_list_helper(OutputIterator o_itr, type root, bool flipped = false ) { if (!root) return; - + if (root->m_has_data) *o_itr = root->m_data; - + if ((flipped && !root->m_reversed) || (!flipped && root->m_reversed) ) @@ -201,9 +201,9 @@ namespace boost { namespace graph { namespace detail { get_list_helper(o_itr, root->m_left_child, false); get_list_helper(o_itr, root->m_right_child, false); } - + } - + }; @@ -254,20 +254,20 @@ namespace boost { namespace graph { namespace detail { - - template struct face_handle_impl { typedef typename graph_traits::vertex_descriptor vertex_t; typedef typename graph_traits::edge_descriptor edge_t; - typedef typename edge_list_storage::type + typedef typename edge_list_storage::type edge_list_storage_t; - face_handle_impl() : + face_handle_impl() : cached_first_vertex(graph_traits::null_vertex()), cached_second_vertex(graph_traits::null_vertex()), true_first_vertex(graph_traits::null_vertex()), @@ -308,11 +308,11 @@ namespace boost { namespace graph { namespace detail { - template - class face_handle + class face_handle { public: typedef typename graph_traits::vertex_descriptor vertex_t; @@ -347,19 +347,19 @@ namespace boost { namespace graph { namespace detail { } //default copy construction, assignment okay. - - void push_first(edge_t e, const Graph& g) - { + + void push_first(edge_t e, const Graph& g) + { pimpl->edge_list.push_front(e); - pimpl->cached_first_vertex = pimpl->true_first_vertex = + pimpl->cached_first_vertex = pimpl->true_first_vertex = source(e, g) == pimpl->anchor ? target(e,g) : source(e,g); pimpl->cached_first_edge = e; } - - void push_second(edge_t e, const Graph& g) - { + + void push_second(edge_t e, const Graph& g) + { pimpl->edge_list.push_back(e); - pimpl->cached_second_vertex = pimpl->true_second_vertex = + pimpl->cached_second_vertex = pimpl->true_second_vertex = source(e, g) == pimpl->anchor ? target(e,g) : source(e,g); pimpl->cached_second_edge = e; } @@ -370,22 +370,22 @@ namespace boost { namespace graph { namespace detail { } inline vertex_t first_vertex() const - { + { return pimpl->cached_first_vertex; } - - inline vertex_t second_vertex() const - { + + inline vertex_t second_vertex() const + { return pimpl->cached_second_vertex; } - inline vertex_t true_first_vertex() const - { + inline vertex_t true_first_vertex() const + { return pimpl->true_first_vertex; } - inline vertex_t true_second_vertex() const - { + inline vertex_t true_second_vertex() const + { return pimpl->true_second_vertex; } @@ -413,17 +413,17 @@ namespace boost { namespace graph { namespace detail { { return pimpl->cached_first_edge; } - + inline edge_t second_edge() const { return pimpl->cached_second_edge; } - + inline vertex_t get_anchor() const { return pimpl->anchor; } - + void glue_first_to_second (face_handle& bottom) { @@ -432,7 +432,7 @@ namespace boost { namespace graph { namespace detail { pimpl->cached_first_vertex = bottom.pimpl->cached_first_vertex; pimpl->cached_first_edge = bottom.pimpl->cached_first_edge; } - + void glue_second_to_first (face_handle& bottom) { @@ -441,7 +441,7 @@ namespace boost { namespace graph { namespace detail { pimpl->cached_second_vertex = bottom.pimpl->cached_second_vertex; pimpl->cached_second_edge = bottom.pimpl->cached_second_edge; } - + void flip() { pimpl->edge_list.reverse(); @@ -449,7 +449,7 @@ namespace boost { namespace graph { namespace detail { std::swap(pimpl->cached_first_vertex, pimpl->cached_second_vertex); std::swap(pimpl->cached_first_edge, pimpl->cached_second_edge); } - + template void get_list(OutputIterator o_itr) { @@ -481,12 +481,12 @@ namespace boost { namespace graph { namespace detail { pimpl->old_handles.first_edge = pimpl->cached_first_edge; pimpl->old_handles.second_edge = pimpl->cached_second_edge; } - + void store_old_face_handles_dispatch(no_old_handles) {} - boost::shared_ptr pimpl; + boost::std::shared_ptr pimpl; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/plod_generator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/plod_generator.hpp index 4e557cf0..d0684d88 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/plod_generator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/plod_generator.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -21,7 +21,7 @@ namespace boost { template - class out_directed_plod_iterator + class out_directed_plod_iterator { public: typedef std::forward_iterator_tag iterator_category; @@ -32,10 +32,10 @@ namespace boost { out_directed_plod_iterator() : gen(0), at_end(true) { } - out_directed_plod_iterator(RandomGenerator& gen, std::size_t n, - double alpha, double beta, + out_directed_plod_iterator(RandomGenerator& gen, std::size_t n, + double alpha, double beta, bool allow_self_loops) - : gen(&gen), n(n), alpha(alpha), beta(beta), + : gen(&gen), n(n), alpha(alpha), beta(beta), allow_self_loops(allow_self_loops), at_end(false), degree(0), current(0, 0) { @@ -50,7 +50,7 @@ namespace boost { pointer operator->() const { return ¤t; } out_directed_plod_iterator& operator++() - { + { using std::pow; uniform_int x(0, n-1); @@ -66,7 +66,7 @@ namespace boost { } std::size_t xv = x(*gen); - degree = (xv == 0? 0 : std::size_t(beta * pow(xv, -alpha))); + degree = (xv == 0? 0 : std::size_t(beta * pow(xv, -alpha))); } do { @@ -85,16 +85,16 @@ namespace boost { } bool operator==(const out_directed_plod_iterator& other) const - { - return at_end == other.at_end; + { + return at_end == other.at_end; } bool operator!=(const out_directed_plod_iterator& other) const - { - return !(*this == other); + { + return !(*this == other); } - private: + private: RandomGenerator* gen; std::size_t n; double alpha; @@ -106,7 +106,7 @@ namespace boost { }; template - class undirected_plod_iterator + class undirected_plod_iterator { typedef std::vector > out_degrees_t; @@ -117,11 +117,11 @@ namespace boost { typedef const value_type* pointer; typedef std::ptrdiff_t difference_type; - undirected_plod_iterator() + undirected_plod_iterator() : gen(0), out_degrees(), degrees_left(0), allow_self_loops(false) { } - undirected_plod_iterator(RandomGenerator& gen, std::size_t n, - double alpha, double beta, + undirected_plod_iterator(RandomGenerator& gen, std::size_t n, + double alpha, double beta, bool allow_self_loops = false) : gen(&gen), n(n), out_degrees(new out_degrees_t), degrees_left(0), allow_self_loops(allow_self_loops) @@ -145,7 +145,7 @@ namespace boost { pointer operator->() const { return ¤t; } undirected_plod_iterator& operator++() - { + { next(); return *this; } @@ -158,8 +158,8 @@ namespace boost { } bool operator==(const undirected_plod_iterator& other) const - { - return degrees_left == other.degrees_left; + { + return degrees_left == other.degrees_left; } bool operator!=(const undirected_plod_iterator& other) const @@ -192,7 +192,7 @@ namespace boost { (*out_degrees)[source] = out_degrees->back(); out_degrees->pop_back(); continue; - } + } // Select target vertex target = x(*gen); @@ -200,7 +200,7 @@ namespace boost { (*out_degrees)[target] = out_degrees->back(); out_degrees->pop_back(); continue; - } else if (source != target + } else if (source != target || (allow_self_loops && (*out_degrees)[source].second > 2)) { break; } @@ -217,7 +217,7 @@ namespace boost { RandomGenerator* gen; std::size_t n; - shared_ptr out_degrees; + std::shared_ptr out_degrees; std::size_t degrees_left; bool allow_self_loops; value_type current; @@ -243,7 +243,7 @@ namespace boost { public: plod_iterator() : inherited() { } - plod_iterator(RandomGenerator& gen, std::size_t n, + plod_iterator(RandomGenerator& gen, std::size_t n, double alpha, double beta, bool allow_self_loops = false) : inherited(gen, n, alpha, beta, allow_self_loops) { } }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/rmat_graph_generator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/rmat_graph_generator.hpp index 4256d7a8..f51e9e27 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/rmat_graph_generator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/rmat_graph_generator.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -24,7 +24,7 @@ #include #include -using boost::shared_ptr; +using boost::std::shared_ptr; using boost::uniform_01; // Returns floor(log_2(n)), and -1 when n is 0 @@ -76,7 +76,7 @@ generate_permutation_vector(RandomGenerator& gen, std::vector& vertexPermutat template std::pair -generate_edge(shared_ptr > prob, T n, +generate_edge(std::shared_ptr > prob, T n, unsigned int SCALE, double a, double b, double c, double d) { T u = 0, v = 0; @@ -213,7 +213,7 @@ namespace boost { private: // Parameters - shared_ptr > gen; + std::shared_ptr > gen; vertices_size_type n; double a, b, c, d; int edge; @@ -328,7 +328,7 @@ namespace boost { private: // Parameters - shared_ptr > gen; + std::shared_ptr > gen; bool permute_vertices; // Internal data structures @@ -442,7 +442,7 @@ namespace boost { private: // Parameters - shared_ptr > gen; + std::shared_ptr > gen; // Internal data structures std::vector values; @@ -576,7 +576,7 @@ namespace boost { private: // Parameters - shared_ptr > gen; + std::shared_ptr > gen; bool bidirectional; // Internal data structures diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/topology.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/topology.hpp index ada36d19..8e64d090 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/topology.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/graph/topology.hpp @@ -29,10 +29,10 @@ namespace boost { * Topologies * ***********************************************************/ template -class convex_topology +class convex_topology { public: // For VisualAge C++ - struct point + struct point { BOOST_STATIC_CONSTANT(std::size_t, dimensions = Dims); point() { } @@ -129,7 +129,7 @@ class convex_topology typedef point point_type; typedef point_difference point_difference_type; - double distance(point a, point b) const + double distance(point a, point b) const { double dist = 0.; for (std::size_t i = 0; i < Dims; ++i) { @@ -142,7 +142,7 @@ class convex_topology return dist; } - point move_position_toward(point a, double fraction, point b) const + point move_position_toward(point a, double fraction, point b) const { point result; for (std::size_t i = 0; i < Dims; ++i) @@ -206,15 +206,15 @@ class hypercube_topology : public convex_topology typedef typename convex_topology::point_type point_type; typedef typename convex_topology::point_difference_type point_difference_type; - explicit hypercube_topology(double scaling = 1.0) - : gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)), - scaling(scaling) + explicit hypercube_topology(double scaling = 1.0) + : gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)), + scaling(scaling) { } - hypercube_topology(RandomNumberGenerator& gen, double scaling = 1.0) + hypercube_topology(RandomNumberGenerator& gen, double scaling = 1.0) : gen_ptr(), rand(new rand_t(gen)), scaling(scaling) { } - - point_type random_point() const + + point_type random_point() const { point_type p; for (std::size_t i = 0; i < Dims; ++i) @@ -268,8 +268,8 @@ class hypercube_topology : public convex_topology } private: - shared_ptr gen_ptr; - shared_ptr rand; + std::shared_ptr gen_ptr; + std::shared_ptr rand; double scaling; }; @@ -280,8 +280,8 @@ class square_topology : public hypercube_topology<2, RandomNumberGenerator> public: explicit square_topology(double scaling = 1.0) : inherited(scaling) { } - - square_topology(RandomNumberGenerator& gen, double scaling = 1.0) + + square_topology(RandomNumberGenerator& gen, double scaling = 1.0) : inherited(gen, scaling) { } }; @@ -308,7 +308,7 @@ class rectangle_topology : public convex_topology<2> typedef typename convex_topology<2>::point_type point_type; typedef typename convex_topology<2>::point_difference_type point_difference_type; - point_type random_point() const + point_type random_point() const { point_type p; p[0] = (*rand)() * (right - left) + left; @@ -362,8 +362,8 @@ class rectangle_topology : public convex_topology<2> } private: - shared_ptr gen_ptr; - shared_ptr rand; + std::shared_ptr gen_ptr; + std::shared_ptr rand; double left, top, right, bottom; }; @@ -374,8 +374,8 @@ class cube_topology : public hypercube_topology<3, RandomNumberGenerator> public: explicit cube_topology(double scaling = 1.0) : inherited(scaling) { } - - cube_topology(RandomNumberGenerator& gen, double scaling = 1.0) + + cube_topology(RandomNumberGenerator& gen, double scaling = 1.0) : inherited(gen, scaling) { } }; @@ -389,15 +389,15 @@ class ball_topology : public convex_topology typedef typename convex_topology::point_type point_type; typedef typename convex_topology::point_difference_type point_difference_type; - explicit ball_topology(double radius = 1.0) - : gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)), - radius(radius) + explicit ball_topology(double radius = 1.0) + : gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)), + radius(radius) { } - ball_topology(RandomNumberGenerator& gen, double radius = 1.0) + ball_topology(RandomNumberGenerator& gen, double radius = 1.0) : gen_ptr(), rand(new rand_t(gen)), radius(radius) { } - - point_type random_point() const + + point_type random_point() const { point_type p; double dist_sum; @@ -457,8 +457,8 @@ class ball_topology : public convex_topology } private: - shared_ptr gen_ptr; - shared_ptr rand; + std::shared_ptr gen_ptr; + std::shared_ptr rand; double radius; }; @@ -469,8 +469,8 @@ class circle_topology : public ball_topology<2, RandomNumberGenerator> public: explicit circle_topology(double radius = 1.0) : inherited(radius) { } - - circle_topology(RandomNumberGenerator& gen, double radius = 1.0) + + circle_topology(RandomNumberGenerator& gen, double radius = 1.0) : inherited(gen, radius) { } }; @@ -481,13 +481,13 @@ class sphere_topology : public ball_topology<3, RandomNumberGenerator> public: explicit sphere_topology(double radius = 1.0) : inherited(radius) { } - - sphere_topology(RandomNumberGenerator& gen, double radius = 1.0) + + sphere_topology(RandomNumberGenerator& gen, double radius = 1.0) : inherited(gen, radius) { } }; template -class heart_topology +class heart_topology { // Heart is defined as the union of three shapes: // Square w/ corners (+-1000, -1000), (0, 0), (0, -2000) @@ -495,7 +495,7 @@ class heart_topology // Circle centered at (500, -500) radius 500*sqrt(2) // Bounding box (-1000, -2000) - (1000, 500*(sqrt(2) - 1)) - struct point + struct point { point() { values[0] = 0.0; values[1] = 0.0; } point(double x, double y) { values[0] = x; values[1] = y; } @@ -507,7 +507,7 @@ class heart_topology double values[2]; }; - bool in_heart(point p) const + bool in_heart(point p) const { #ifndef BOOST_NO_STDC_NAMESPACE using std::abs; @@ -522,7 +522,7 @@ class heart_topology return false; } - bool segment_within_heart(point p1, point p2) const + bool segment_within_heart(point p1, point p2) const { // Assumes that p1 and p2 are within the heart if ((p1[0] < 0) == (p2[0] < 0)) return true; // Same side of symmetry line @@ -538,13 +538,13 @@ class heart_topology public: typedef point point_type; - heart_topology() + heart_topology() : gen_ptr(new RandomNumberGenerator), rand(new rand_t(*gen_ptr)) { } - heart_topology(RandomNumberGenerator& gen) + heart_topology(RandomNumberGenerator& gen) : gen_ptr(), rand(new rand_t(gen)) { } - point random_point() const + point random_point() const { point result; do { @@ -556,7 +556,7 @@ class heart_topology // Not going to provide clipping to bounding region or distance from boundary - double distance(point a, point b) const + double distance(point a, point b) const { if (segment_within_heart(a, b)) { // Straight line @@ -567,7 +567,7 @@ class heart_topology } } - point move_position_toward(point a, double fraction, point b) const + point move_position_toward(point a, double fraction, point b) const { if (segment_within_heart(a, b)) { // Straight line @@ -576,10 +576,10 @@ class heart_topology } else { double distance_to_point_a = boost::math::hypot(a[0], a[1]); double distance_to_point_b = boost::math::hypot(b[0], b[1]); - double location_of_point = distance_to_point_a / + double location_of_point = distance_to_point_a / (distance_to_point_a + distance_to_point_b); if (fraction < location_of_point) - return point(a[0] * (1 - fraction / location_of_point), + return point(a[0] * (1 - fraction / location_of_point), a[1] * (1 - fraction / location_of_point)); else return point( @@ -589,8 +589,8 @@ class heart_topology } private: - shared_ptr gen_ptr; - shared_ptr rand; + std::shared_ptr gen_ptr; + std::shared_ptr rand; }; } // namespace boost diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/interprocess_fwd.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/interprocess_fwd.hpp index 42f170a6..0309d6b6 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/interprocess_fwd.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/interprocess_fwd.hpp @@ -393,7 +393,7 @@ template class intrusive_ptr; template -class shared_ptr; +class std::shared_ptr; template class weak_ptr; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/enable_shared_from_this.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/enable_shared_from_this.hpp index d9f16aec..98c48c5d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/enable_shared_from_this.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/enable_shared_from_this.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include //!\file //!Describes an utility to form a shared pointer from this @@ -27,10 +27,10 @@ namespace boost{ namespace interprocess{ -//!This class is used as a base class that allows a shared_ptr to the current +//!This class is used as a base class that allows a std::shared_ptr to the current //!object to be obtained from within a member function. //!enable_shared_from_this defines two member functions called shared_from_this -//!that return a shared_ptr and shared_ptr, depending on constness, to this. +//!that return a std::shared_ptr and std::shared_ptr, depending on constness, to this. template class enable_shared_from_this { @@ -50,16 +50,16 @@ class enable_shared_from_this /// @endcond public: - shared_ptr shared_from_this() + std::shared_ptr shared_from_this() { - shared_ptr p(_internal_weak_this); + std::shared_ptr p(_internal_weak_this); BOOST_ASSERT(ipcdetail::to_raw_pointer(p.get()) == this); return p; } - shared_ptr shared_from_this() const + std::shared_ptr shared_from_this() const { - shared_ptr p(_internal_weak_this); + std::shared_ptr p(_internal_weak_this); BOOST_ASSERT(ipcdetail::to_raw_pointer(p.get()) == this); return p; } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/shared_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/shared_ptr.hpp index 302eb149..29844a97 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/shared_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/shared_ptr.hpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////////// // -// This file is the adaptation for Interprocess of boost/shared_ptr.hpp +// This file is the adaptation for Interprocess of boost/std::shared_ptr.hpp // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // (C) Copyright Peter Dimov 2001, 2002, 2003 @@ -37,7 +37,7 @@ #include // for std::basic_ostream //!\file -//!Describes the smart pointer shared_ptr +//!Describes the smart pointer std::shared_ptr namespace boost{ namespace interprocess{ @@ -66,11 +66,11 @@ inline void sp_enable_shared_from_this(shared_count c } // namespace ipcdetail -//!shared_ptr stores a pointer to a dynamically allocated object. -//!The object pointed to is guaranteed to be deleted when the last shared_ptr pointing to +//!std::shared_ptr stores a pointer to a dynamically allocated object. +//!The object pointed to is guaranteed to be deleted when the last std::shared_ptr pointing to //!it is destroyed or reset. //! -//!shared_ptr is parameterized on +//!std::shared_ptr is parameterized on //!T (the type of the object pointed to), VoidAllocator (the void allocator to be used //!to allocate the auxiliary data) and Deleter (the deleter whose //!operator() will be used to delete the object. @@ -79,18 +79,18 @@ inline void sp_enable_shared_from_this(shared_count c //!VoidAllocator::pointer type (that is, if typename VoidAllocator::pointer is //!offset_ptr, the internal pointer will be offset_ptr). //! -//!Because the implementation uses reference counting, cycles of shared_ptr +//!Because the implementation uses reference counting, cycles of std::shared_ptr //!instances will not be reclaimed. For example, if main() holds a -//!shared_ptr to A, which directly or indirectly holds a shared_ptr back -//!to A, A's use count will be 2. Destruction of the original shared_ptr +//!std::shared_ptr to A, which directly or indirectly holds a std::shared_ptr back +//!to A, A's use count will be 2. Destruction of the original std::shared_ptr //!will leave A dangling with a use count of 1. //!Use weak_ptr to "break cycles." template -class shared_ptr +class std::shared_ptr { /// @cond private: - typedef shared_ptr this_type; + typedef std::shared_ptr this_type; /// @endcond public: @@ -111,19 +111,19 @@ class shared_ptr pointer_traits::template rebind_pointer::type const_allocator_pointer; - BOOST_COPYABLE_AND_MOVABLE(shared_ptr) + BOOST_COPYABLE_AND_MOVABLE(std::shared_ptr) public: - //!Constructs an empty shared_ptr. + //!Constructs an empty std::shared_ptr. //!Use_count() == 0 && get()== 0. - shared_ptr() + std::shared_ptr() : m_pn() // never throws {} - //!Constructs a shared_ptr that owns the pointer p. Auxiliary data will be allocated + //!Constructs a std::shared_ptr that owns the pointer p. Auxiliary data will be allocated //!with a copy of a and the object will be deleted with a copy of d. //!Requirements: Deleter and A's copy constructor must not throw. - explicit shared_ptr(const pointer&p, const VoidAllocator &a = VoidAllocator(), const Deleter &d = Deleter()) + explicit std::shared_ptr(const pointer&p, const VoidAllocator &a = VoidAllocator(), const Deleter &d = Deleter()) : m_pn(p, a, d) { //Check that the pointer passed is of the same type that @@ -137,55 +137,55 @@ class shared_ptr ipcdetail::sp_enable_shared_from_this( m_pn, ipcdetail::to_raw_pointer(p), ipcdetail::to_raw_pointer(p) ); } - //!Copy constructs a shared_ptr. If r is empty, constructs an empty shared_ptr. Otherwise, constructs - //!a shared_ptr that shares ownership with r. Never throws. - shared_ptr(const shared_ptr &r) + //!Copy constructs a std::shared_ptr. If r is empty, constructs an empty std::shared_ptr. Otherwise, constructs + //!a std::shared_ptr that shares ownership with r. Never throws. + std::shared_ptr(const std::shared_ptr &r) : m_pn(r.m_pn) // never throws {} - //!Constructs a shared_ptr that shares ownership with other and stores p. + //!Constructs a std::shared_ptr that shares ownership with other and stores p. //!Postconditions: get() == p && use_count() == r.use_count(). //!Throws: nothing. - shared_ptr(const shared_ptr &other, const pointer &p) + std::shared_ptr(const std::shared_ptr &other, const pointer &p) : m_pn(other.m_pn, p) {} - //!If r is empty, constructs an empty shared_ptr. Otherwise, constructs - //!a shared_ptr that shares ownership with r. Never throws. + //!If r is empty, constructs an empty std::shared_ptr. Otherwise, constructs + //!a std::shared_ptr that shares ownership with r. Never throws. template - shared_ptr(shared_ptr const & r) + std::shared_ptr(std::shared_ptr const & r) : m_pn(r.m_pn) // never throws {} - //!Constructs a shared_ptr that shares ownership with r and stores + //!Constructs a std::shared_ptr that shares ownership with r and stores //!a copy of the pointer stored in r. template - explicit shared_ptr(weak_ptr const & r) + explicit std::shared_ptr(weak_ptr const & r) : m_pn(r.m_pn) // may throw {} - //!Move-Constructs a shared_ptr that takes ownership of other resource and + //!Move-Constructs a std::shared_ptr that takes ownership of other resource and //!other is put in default-constructed state. //!Throws: nothing. - explicit shared_ptr(BOOST_RV_REF(shared_ptr) other) + explicit std::shared_ptr(BOOST_RV_REF(std::shared_ptr) other) : m_pn() { this->swap(other); } /// @cond template - shared_ptr(shared_ptr const & r, ipcdetail::static_cast_tag) + std::shared_ptr(std::shared_ptr const & r, ipcdetail::static_cast_tag) : m_pn( pointer(static_cast(ipcdetail::to_raw_pointer(r.m_pn.to_raw_pointer()))) , r.m_pn) {} template - shared_ptr(shared_ptr const & r, ipcdetail::const_cast_tag) + std::shared_ptr(std::shared_ptr const & r, ipcdetail::const_cast_tag) : m_pn( pointer(const_cast(ipcdetail::to_raw_pointer(r.m_pn.to_raw_pointer()))) , r.m_pn) {} template - shared_ptr(shared_ptr const & r, ipcdetail::dynamic_cast_tag) + std::shared_ptr(std::shared_ptr const & r, ipcdetail::dynamic_cast_tag) : m_pn( pointer(dynamic_cast(ipcdetail::to_raw_pointer(r.m_pn.to_raw_pointer()))) , r.m_pn) { @@ -195,26 +195,26 @@ class shared_ptr } /// @endcond - //!Equivalent to shared_ptr(r).swap(*this). + //!Equivalent to std::shared_ptr(r).swap(*this). //!Never throws template - shared_ptr & operator=(shared_ptr const & r) + std::shared_ptr & operator=(std::shared_ptr const & r) { m_pn = r.m_pn; // shared_count::op= doesn't throw return *this; } - //!Equivalent to shared_ptr(r).swap(*this). + //!Equivalent to std::shared_ptr(r).swap(*this). //!Never throws - shared_ptr & operator=(BOOST_COPY_ASSIGN_REF(shared_ptr) r) + std::shared_ptr & operator=(BOOST_COPY_ASSIGN_REF(std::shared_ptr) r) { m_pn = r.m_pn; // shared_count::op= doesn't throw return *this; } - //!Move-assignment. Equivalent to shared_ptr(other).swap(*this). + //!Move-assignment. Equivalent to std::shared_ptr(other).swap(*this). //!Never throws - shared_ptr & operator=(BOOST_RV_REF(shared_ptr) other) // never throws + std::shared_ptr & operator=(BOOST_RV_REF(std::shared_ptr) other) // never throws { this_type(other).swap(*this); return *this; @@ -243,7 +243,7 @@ class shared_ptr } template - void reset(shared_ptr const & r, const pointer &p) + void reset(std::shared_ptr const & r, const pointer &p) { this_type(r, p).swap(*this); } @@ -282,7 +282,7 @@ class shared_ptr bool unique() const // never throws { return m_pn.unique(); } - //!Returns the number of shared_ptr objects, *this included, + //!Returns the number of std::shared_ptr objects, *this included, //!that share ownership with *this, or an unspecified nonnegative //!value when *this is empty. //!use_count() is not necessarily efficient. Use only for @@ -292,13 +292,13 @@ class shared_ptr //!Exchanges the contents of the two //!smart pointers. - void swap(shared_ptr & other) // never throws + void swap(std::shared_ptr & other) // never throws { m_pn.swap(other.m_pn); } /// @cond template - bool _internal_less(shared_ptr const & rhs) const + bool _internal_less(std::shared_ptr const & rhs) const { return m_pn < rhs.m_pn; } const_deleter_pointer get_deleter() const @@ -309,50 +309,50 @@ class shared_ptr private: - template friend class shared_ptr; + template friend class std::shared_ptr; template friend class weak_ptr; ipcdetail::shared_count m_pn; // reference counter /// @endcond -}; // shared_ptr +}; // std::shared_ptr template inline -bool operator==(shared_ptr const & a, shared_ptr const & b) +bool operator==(std::shared_ptr const & a, std::shared_ptr const & b) { return a.get() == b.get(); } template inline -bool operator!=(shared_ptr const & a, shared_ptr const & b) +bool operator!=(std::shared_ptr const & a, std::shared_ptr const & b) { return a.get() != b.get(); } template inline -bool operator<(shared_ptr const & a, shared_ptr const & b) +bool operator<(std::shared_ptr const & a, std::shared_ptr const & b) { return a._internal_less(b); } template inline -void swap(shared_ptr & a, shared_ptr & b) +void swap(std::shared_ptr & a, std::shared_ptr & b) { a.swap(b); } template inline -shared_ptr static_pointer_cast(shared_ptr const & r) -{ return shared_ptr(r, ipcdetail::static_cast_tag()); } +std::shared_ptr static_pointer_cast(std::shared_ptr const & r) +{ return std::shared_ptr(r, ipcdetail::static_cast_tag()); } template inline -shared_ptr const_pointer_cast(shared_ptr const & r) -{ return shared_ptr(r, ipcdetail::const_cast_tag()); } +std::shared_ptr const_pointer_cast(std::shared_ptr const & r) +{ return std::shared_ptr(r, ipcdetail::const_cast_tag()); } template inline -shared_ptr dynamic_pointer_cast(shared_ptr const & r) -{ return shared_ptr(r, ipcdetail::dynamic_cast_tag()); } +std::shared_ptr dynamic_pointer_cast(std::shared_ptr const & r) +{ return std::shared_ptr(r, ipcdetail::dynamic_cast_tag()); } -// to_raw_pointer() enables boost::mem_fn to recognize shared_ptr +// to_raw_pointer() enables boost::mem_fn to recognize std::shared_ptr template inline -T * to_raw_pointer(shared_ptr const & p) +T * to_raw_pointer(std::shared_ptr const & p) { return p.get(); } // operator<< template inline std::basic_ostream & operator<< - (std::basic_ostream & os, shared_ptr const & p) + (std::basic_ostream & os, std::shared_ptr const & p) { os << p.get(); return os; } //!Returns the type of a shared pointer @@ -364,7 +364,7 @@ struct managed_shared_ptr { typedef typename ManagedMemory::template allocator::type void_allocator; typedef typename ManagedMemory::template deleter::type deleter; - typedef shared_ptr< T, void_allocator, deleter> type; + typedef std::shared_ptr< T, void_allocator, deleter> type; }; //!Returns an instance of a shared pointer constructed @@ -407,9 +407,9 @@ inline typename managed_shared_ptr::type /// @cond #if defined(_MSC_VER) && (_MSC_VER < 1400) -// to_raw_pointer() enables boost::mem_fn to recognize shared_ptr +// to_raw_pointer() enables boost::mem_fn to recognize std::shared_ptr template inline -T * to_raw_pointer(boost::interprocess::shared_ptr const & p) +T * to_raw_pointer(boost::interprocess::std::shared_ptr const & p) { return p.get(); } #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/weak_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/weak_ptr.hpp index 99c8a631..6b91cf87 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/weak_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/smart_ptr/weak_ptr.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -31,13 +31,13 @@ namespace boost{ namespace interprocess{ //!The weak_ptr class template stores a "weak reference" to an object -//!that's already managed by a shared_ptr. To access the object, a weak_ptr -//!can be converted to a shared_ptr using the shared_ptr constructor or the -//!member function lock. When the last shared_ptr to the object goes away -//!and the object is deleted, the attempt to obtain a shared_ptr from the +//!that's already managed by a std::shared_ptr. To access the object, a weak_ptr +//!can be converted to a std::shared_ptr using the std::shared_ptr constructor or the +//!member function lock. When the last std::shared_ptr to the object goes away +//!and the object is deleted, the attempt to obtain a std::shared_ptr from the //!weak_ptr instances that refer to the deleted object will fail: the constructor //!will throw an exception of type bad_weak_ptr, and weak_ptr::lock will -//!return an empty shared_ptr. +//!return an empty std::shared_ptr. //! //!Every weak_ptr meets the CopyConstructible and Assignable requirements //!of the C++ Standard Library, and so can be used in standard library containers. @@ -100,9 +100,9 @@ class weak_ptr weak_ptr(weak_ptr const & r) : m_pn(r.m_pn) // never throws { - //Construct a temporary shared_ptr so that nobody + //Construct a temporary std::shared_ptr so that nobody //can destroy the value while constructing this - const shared_ptr &ref = r.lock(); + const std::shared_ptr &ref = r.lock(); m_pn.set_pointer(ref.get()); } @@ -114,7 +114,7 @@ class weak_ptr //! //!Throws: nothing. template - weak_ptr(shared_ptr const & r) + weak_ptr(std::shared_ptr const & r) : m_pn(r.m_pn) // never throws {} @@ -127,9 +127,9 @@ class weak_ptr template weak_ptr & operator=(weak_ptr const & r) // never throws { - //Construct a temporary shared_ptr so that nobody + //Construct a temporary std::shared_ptr so that nobody //can destroy the value while constructing this - const shared_ptr &ref = r.lock(); + const std::shared_ptr &ref = r.lock(); m_pn = r.m_pn; m_pn.set_pointer(ref.get()); return *this; @@ -142,30 +142,30 @@ class weak_ptr //!Notes: The implementation is free to meet the effects (and the //!implied guarantees) via different means, without creating a temporary. template - weak_ptr & operator=(shared_ptr const & r) // never throws + weak_ptr & operator=(std::shared_ptr const & r) // never throws { m_pn = r.m_pn; return *this; } - //!Returns: expired()? shared_ptr(): shared_ptr(*this). + //!Returns: expired()? std::shared_ptr(): std::shared_ptr(*this). //! //!Throws: nothing. - shared_ptr lock() const // never throws + std::shared_ptr lock() const // never throws { // optimization: avoid throw overhead if(expired()){ - return shared_ptr(); + return std::shared_ptr(); } BOOST_TRY{ - return shared_ptr(*this); + return std::shared_ptr(*this); } BOOST_CATCH(bad_weak_ptr const &){ // Q: how can we get here? // A: another thread may have invalidated r after the use_count test above. - return shared_ptr(); + return std::shared_ptr(); } BOOST_CATCH_END } - //!Returns: 0 if *this is empty; otherwise, the number of shared_ptr objects + //!Returns: 0 if *this is empty; otherwise, the number of std::shared_ptr objects //!that share ownership with *this. //! //!Throws: nothing. @@ -209,7 +209,7 @@ class weak_ptr private: - template friend class shared_ptr; + template friend class std::shared_ptr; template friend class weak_ptr; ipcdetail::weak_count m_pn; // reference counter diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/chain.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/chain.hpp index 4af8cc98..4b046508 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/chain.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/chain.hpp @@ -22,7 +22,7 @@ #include // logic_error, out_of_range. #include #include // BOOST_MSVC, template friends, -#include // BOOST_NESTED_TEMPLATE +#include // BOOST_NESTED_TEMPLATE #include #include #include @@ -34,7 +34,7 @@ #include // is_filter. #include #include -#include +#include #include #include #include @@ -141,7 +141,7 @@ protected: chain_base(const chain_base& rhs): pimpl_(rhs.pimpl_) { } public: - // dual_use is a pseudo-mode to facilitate filter writing, + // dual_use is a pseudo-mode to facilitate filter writing, // not a genuine mode. BOOST_STATIC_ASSERT((!is_convertible::value)); @@ -150,19 +150,19 @@ public: // Sets the size of the buffer created for the devices to be added to this // chain. Does not affect the size of the buffer for devices already // added. - void set_device_buffer_size(std::streamsize n) + void set_device_buffer_size(std::streamsize n) { pimpl_->device_buffer_size_ = n; } // Sets the size of the buffer created for the filters to be added // to this chain. Does not affect the size of the buffer for filters already // added. - void set_filter_buffer_size(std::streamsize n) + void set_filter_buffer_size(std::streamsize n) { pimpl_->filter_buffer_size_ = n; } // Sets the size of the putback buffer for filters and devices to be added // to this chain. Does not affect the size of the buffer for filters or // devices already added. - void set_pback_size(std::streamsize n) + void set_pback_size(std::streamsize n) { pimpl_->pback_size_ = n; } //----------Device interface----------------------------------------------// @@ -189,7 +189,7 @@ public: T* component(int n) const { return component(n, boost::type()); } // Deprecated. - template + template T* component() const { return component(N); } #endif @@ -230,7 +230,7 @@ public: bool strict_sync(); private: template - void push_impl(const T& t, std::streamsize buffer_size = -1, + void push_impl(const T& t, std::streamsize buffer_size = -1, std::streamsize pback_size = -1) { typedef typename iostreams::category_of::type category; @@ -331,20 +331,20 @@ private: links_.front()->BOOST_IOSTREAMS_PUBSYNC(); try { boost::iostreams::detail::execute_foreach( - links_.rbegin(), links_.rend(), + links_.rbegin(), links_.rend(), closer(BOOST_IOS::in) ); } catch (...) { try { boost::iostreams::detail::execute_foreach( - links_.begin(), links_.end(), + links_.begin(), links_.end(), closer(BOOST_IOS::out) ); } catch (...) { } throw; } boost::iostreams::detail::execute_foreach( - links_.begin(), links_.end(), + links_.begin(), links_.end(), closer(BOOST_IOS::out) ); } @@ -382,7 +382,7 @@ private: //----------Member data---------------------------------------------------// private: - shared_ptr pimpl_; + std::shared_ptr pimpl_; }; } // End namespace detail. diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/code_converter.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/code_converter.hpp index 280a5d09..8ff85a18 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/code_converter.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/code_converter.hpp @@ -24,7 +24,7 @@ #include // max. #include // memcpy. #include -#include // DEDUCED_TYPENAME, +#include // DEDUCED_TYPENAME, #include #include // default_filter_buffer_size. #include @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ namespace boost { namespace iostreams { struct code_conversion_error : BOOST_IOSTREAMS_FAILURE { - code_conversion_error() + code_conversion_error() : BOOST_IOSTREAMS_FAILURE("code conversion error") { } }; @@ -91,28 +91,28 @@ Tgt* strncpy_if_same(Tgt* tgt, const Src* src, std::streamsize n) // Buffer and conversion state for reading. template -class conversion_buffer +class conversion_buffer : public buffer< BOOST_DEDUCED_TYPENAME detail::codecvt_extern::type, Alloc - > + > { public: typedef typename Codecvt::state_type state_type; - conversion_buffer() + conversion_buffer() : buffer< BOOST_DEDUCED_TYPENAME detail::codecvt_extern::type, Alloc - >(0) - { - reset(); + >(0) + { + reset(); } state_type& state() { return state_; } - void reset() - { - if (this->size()) + void reset() + { + if (this->size()) this->set(0, 0); - state_ = state_type(); + state_ = state_type(); } private: state_type state_; @@ -128,12 +128,12 @@ struct code_converter_impl { typedef is_convertible can_read; typedef is_convertible can_write; typedef is_convertible is_bidir; - typedef typename + typedef typename iostreams::select< // Disambiguation for Tru64. is_bidir, bidirectional, can_read, input, can_write, output - >::type mode; + >::type mode; typedef typename mpl::if_< is_direct, @@ -147,10 +147,10 @@ struct code_converter_impl { code_converter_impl() : cvt_(), flags_(0) { } ~code_converter_impl() - { - try { - if (flags_ & f_open) close(); - } catch (...) { /* */ } + { + try { + if (flags_ & f_open) close(); + } catch (...) { /* */ } } template @@ -213,7 +213,7 @@ struct code_converter_impl { codecvt_holder cvt_; storage_type dev_; double_object< - buffer_type, + buffer_type, is_double > buf_; int flags_; @@ -232,13 +232,13 @@ struct code_converter_base { Device, Codecvt, Alloc > impl_type; code_converter_base() : pimpl_(new impl_type) { } - shared_ptr pimpl_; + std::shared_ptr pimpl_; }; -template< typename Device, - typename Codecvt = detail::default_codecvt, +template< typename Device, + typename Codecvt = detail::default_codecvt, typename Alloc = std::allocator > -class code_converter +class code_converter : protected code_converter_base { private: @@ -252,28 +252,28 @@ private: typedef typename detail::codecvt_extern::type extern_type; typedef typename detail::codecvt_state::type state_type; public: - typedef intern_type char_type; - struct category + typedef intern_type char_type; + struct category : impl_type::mode, device_tag, closable_tag, localizable_tag { }; BOOST_STATIC_ASSERT(( is_same< - extern_type, + extern_type, BOOST_DEDUCED_TYPENAME char_type_of::type >::value )); public: code_converter() { } #if BOOST_WORKAROUND(__GNUC__, < 3) - code_converter(code_converter& rhs) + code_converter(code_converter& rhs) : code_converter_base(rhs) { } - code_converter(const code_converter& rhs) + code_converter(const code_converter& rhs) : code_converter_base(rhs) { } #endif BOOST_IOSTREAMS_FORWARD( code_converter, open_impl, Device, - BOOST_IOSTREAMS_CONVERTER_PARAMS, + BOOST_IOSTREAMS_CONVERTER_PARAMS, BOOST_IOSTREAMS_CONVERTER_ARGS ) // fstream-like interface. @@ -294,9 +294,9 @@ public: Device* operator->() { return &detail::unwrap_direct(dev()); } private: template // Used for forwarding. - void open_impl(const T& t BOOST_IOSTREAMS_CONVERTER_PARAMS()) - { - impl().open(t BOOST_IOSTREAMS_CONVERTER_ARGS()); + void open_impl(const T& t BOOST_IOSTREAMS_CONVERTER_PARAMS()) + { + impl().open(t BOOST_IOSTREAMS_CONVERTER_ARGS()); } const codecvt_type& cvt() { return impl().cvt_.get(); } @@ -347,7 +347,7 @@ std::streamsize code_converter::read break; case std::codecvt_base::noconv: { - std::streamsize amt = + std::streamsize amt = std::min(next - buf.ptr(), n - total); detail::strncpy_if_same(s + total, buf.ptr(), amt); total += amt; @@ -382,7 +382,7 @@ std::streamsize code_converter::write break; partial = false; } - + // Convert. std::codecvt_base::result result = cvt().out( buf.state(), @@ -399,8 +399,8 @@ std::streamsize code_converter::write break; case std::codecvt_base::noconv: { - std::streamsize amt = - std::min( nint - total - s, + std::streamsize amt = + std::min( nint - total - s, buf.end() - buf.eptr() ); detail::strncpy_if_same(buf.eptr(), s + total, amt); total += amt; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/file.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/file.hpp index f701c9d6..c04b2536 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/file.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/file.hpp @@ -21,7 +21,7 @@ #include // openmode, seekdir, int types. #include #include // seek. -#include +#include // Must come last. #include // MSVC. @@ -46,8 +46,8 @@ public: std::streamsize read(char_type* s, std::streamsize n); bool putback(char_type c); std::streamsize write(const char_type* s, std::streamsize n); - std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, - BOOST_IOS::openmode which = + std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, + BOOST_IOS::openmode which = BOOST_IOS::in | BOOST_IOS::out ); void open( const std::string& path, BOOST_IOS::openmode mode = @@ -67,7 +67,7 @@ private: ~impl() { if (file_.is_open()) file_.close(); } BOOST_IOSTREAMS_BASIC_FILEBUF(Ch) file_; }; - shared_ptr pimpl_; + std::shared_ptr pimpl_; }; typedef basic_file file; @@ -87,7 +87,7 @@ struct basic_file_source : private basic_file { using basic_file::is_open; using basic_file::close; basic_file_source( const std::string& path, - BOOST_IOS::openmode mode = + BOOST_IOS::openmode mode = BOOST_IOS::in ) : basic_file(path, mode & ~BOOST_IOS::out, BOOST_IOS::in) { } @@ -128,29 +128,29 @@ struct basic_file_sink : private basic_file { typedef basic_file_sink file_sink; typedef basic_file_sink wfile_sink; - + //------------------Implementation of basic_file------------------------------// template basic_file::basic_file - ( const std::string& path, BOOST_IOS::openmode mode, + ( const std::string& path, BOOST_IOS::openmode mode, BOOST_IOS::openmode base_mode ) -{ +{ open(path, mode, base_mode); } template inline std::streamsize basic_file::read (char_type* s, std::streamsize n) -{ - std::streamsize result = pimpl_->file_.sgetn(s, n); +{ + std::streamsize result = pimpl_->file_.sgetn(s, n); return result != 0 ? result : -1; } template inline bool basic_file::putback(char_type c) -{ - return !!pimpl_->file_.sputbackc(c); +{ + return !!pimpl_->file_.sputbackc(c); } template @@ -160,15 +160,15 @@ inline std::streamsize basic_file::write template std::streampos basic_file::seek - ( stream_offset off, BOOST_IOS::seekdir way, + ( stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode ) { return iostreams::seek(pimpl_->file_, off, way); } template void basic_file::open - ( const std::string& path, BOOST_IOS::openmode mode, + ( const std::string& path, BOOST_IOS::openmode mode, BOOST_IOS::openmode base_mode ) -{ +{ pimpl_.reset(new impl(path, mode | base_mode)); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/file_descriptor.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/file_descriptor.hpp index bb470589..1237ea8a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/file_descriptor.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/file_descriptor.hpp @@ -25,7 +25,7 @@ #include // openmode, seekdir, int types. #include #include -#include +#include // Must come last. #include @@ -86,9 +86,9 @@ public: explicit file_descriptor( const Path& path, BOOST_IOS::openmode mode = BOOST_IOS::in | BOOST_IOS::out ) - { + { init(); - open(detail::path(path), mode); + open(detail::path(path), mode); } // Copy constructor @@ -135,12 +135,12 @@ private: void init(); // open overload taking a detail::path - void open( const detail::path& path, - BOOST_IOS::openmode, + void open( const detail::path& path, + BOOST_IOS::openmode, BOOST_IOS::openmode = BOOST_IOS::openmode(0) ); typedef detail::file_descriptor_impl impl_type; - shared_ptr pimpl_; + std::shared_ptr pimpl_; }; class BOOST_IOSTREAMS_DECL file_descriptor_source : private file_descriptor { @@ -293,16 +293,16 @@ public: #endif // open overload taking a std::string - void open( const std::string& path, + void open( const std::string& path, BOOST_IOS::openmode mode = BOOST_IOS::out ); // open overload taking C-style string - void open( const char* path, + void open( const char* path, BOOST_IOS::openmode mode = BOOST_IOS::out ); // open overload taking a Boost.Filesystem path template - void open( const Path& path, + void open( const Path& path, BOOST_IOS::openmode mode = BOOST_IOS::out ) { open(detail::path(path), mode); } private: diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/mapped_file.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/mapped_file.hpp index 8493b177..11c0e2c1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/mapped_file.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/device/mapped_file.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,25 +54,25 @@ public: }; // Bitmask operations for mapped_file_base::mapmode -mapped_file_base::mapmode +mapped_file_base::mapmode operator|(mapped_file_base::mapmode a, mapped_file_base::mapmode b); -mapped_file_base::mapmode +mapped_file_base::mapmode operator&(mapped_file_base::mapmode a, mapped_file_base::mapmode b); -mapped_file_base::mapmode +mapped_file_base::mapmode operator^(mapped_file_base::mapmode a, mapped_file_base::mapmode b); -mapped_file_base::mapmode +mapped_file_base::mapmode operator~(mapped_file_base::mapmode a); -mapped_file_base::mapmode +mapped_file_base::mapmode operator|=(mapped_file_base::mapmode& a, mapped_file_base::mapmode b); -mapped_file_base::mapmode +mapped_file_base::mapmode operator&=(mapped_file_base::mapmode& a, mapped_file_base::mapmode b); -mapped_file_base::mapmode +mapped_file_base::mapmode operator^=(mapped_file_base::mapmode& a, mapped_file_base::mapmode b); //------------------Definition of mapped_file_params--------------------------// @@ -81,8 +81,8 @@ namespace detail { struct mapped_file_params_base { mapped_file_params_base() - : flags(static_cast(0)), - mode(), offset(0), length(static_cast(-1)), + : flags(static_cast(0)), + mode(), offset(0), length(static_cast(-1)), new_file_size(0), hint(0) { } private: @@ -102,16 +102,16 @@ public: // This template allows Boost.Filesystem paths to be specified when creating or // reopening a memory mapped file, without creating a dependence on // Boost.Filesystem. Possible values of Path include std::string, -// boost::filesystem::path, boost::filesystem::wpath, +// boost::filesystem::path, boost::filesystem::wpath, // and boost::iostreams::detail::path (used to store either a std::string or a // std::wstring). template -struct basic_mapped_file_params - : detail::mapped_file_params_base +struct basic_mapped_file_params + : detail::mapped_file_params_base { typedef detail::mapped_file_params_base base_type; - // For wide paths, instantiate basic_mapped_file_params + // For wide paths, instantiate basic_mapped_file_params // with boost::filesystem::wpath #ifndef BOOST_IOSTREAMS_NO_WIDE_STREAMS BOOST_STATIC_ASSERT((!is_same::value)); @@ -215,7 +215,7 @@ private: void init(); void open_impl(const param_type& p); - boost::shared_ptr pimpl_; + boost::std::shared_ptr pimpl_; }; //------------------Definition of mapped_file---------------------------------// @@ -253,7 +253,7 @@ public: size_type length = max_length, stream_offset offset = 0 ); - // Constructor taking a list of parameters, including a + // Constructor taking a list of parameters, including a // std::ios_base::openmode (deprecated) template explicit mapped_file( const Path& path, @@ -283,7 +283,7 @@ public: size_type length = max_length, stream_offset offset = 0 ); - // open overload taking a list of parameters, including a + // open overload taking a list of parameters, including a // std::ios_base::openmode (deprecated) template void open( const Path& path, @@ -387,7 +387,7 @@ mapped_file_source::mapped_file_source(const basic_mapped_file_params& p) { init(); open(p); } template -mapped_file_source::mapped_file_source( +mapped_file_source::mapped_file_source( const Path& path, size_type length, boost::intmax_t offset) { init(); open(path, length, offset); } @@ -423,14 +423,14 @@ mapped_file::mapped_file(const basic_mapped_file_params& p) { open(p); } template -mapped_file::mapped_file( - const Path& path, mapmode flags, +mapped_file::mapped_file( + const Path& path, mapmode flags, size_type length, stream_offset offset ) { open(path, flags, length, offset); } template -mapped_file::mapped_file( - const Path& path, BOOST_IOS::openmode mode, +mapped_file::mapped_file( + const Path& path, BOOST_IOS::openmode mode, size_type length, stream_offset offset ) { open(path, mode, length, offset); } @@ -439,8 +439,8 @@ void mapped_file::open(const basic_mapped_file_params& p) { delegate_.open_impl(p); } template -void mapped_file::open( - const Path& path, mapmode flags, +void mapped_file::open( + const Path& path, mapmode flags, size_type length, stream_offset offset ) { param_type p(path); @@ -451,8 +451,8 @@ void mapped_file::open( } template -void mapped_file::open( - const Path& path, BOOST_IOS::openmode mode, +void mapped_file::open( + const Path& path, BOOST_IOS::openmode mode, size_type length, stream_offset offset ) { param_type p(path); @@ -462,7 +462,7 @@ void mapped_file::open( open(p); } -inline char* mapped_file::data() const +inline char* mapped_file::data() const { return (flags() != readonly) ? const_cast(delegate_.data()) : 0; } //------------------Implementation of mapped_file_sink------------------------// @@ -524,13 +524,13 @@ struct operations { static std::pair input_sequence(mapped_file& file) - { - return std::make_pair(file.begin(), file.end()); + { + return std::make_pair(file.begin(), file.end()); } static std::pair output_sequence(mapped_file& file) - { - return std::make_pair(file.begin(), file.end()); + { + return std::make_pair(file.begin(), file.end()); } }; @@ -540,28 +540,28 @@ struct operations { static std::pair output_sequence(mapped_file_sink& sink) - { - return std::make_pair(sink.begin(), sink.end()); + { + return std::make_pair(sink.begin(), sink.end()); } }; - + //------------------Definition of mapmode operators---------------------------// -inline mapped_file::mapmode +inline mapped_file::mapmode operator|(mapped_file::mapmode a, mapped_file::mapmode b) { return static_cast (static_cast(a) | static_cast(b)); } -inline mapped_file::mapmode +inline mapped_file::mapmode operator&(mapped_file::mapmode a, mapped_file::mapmode b) { return static_cast (static_cast(a) & static_cast(b)); } -inline mapped_file::mapmode +inline mapped_file::mapmode operator^(mapped_file::mapmode a, mapped_file::mapmode b) { return static_cast @@ -574,19 +574,19 @@ operator~(mapped_file::mapmode a) return static_cast(~static_cast(a)); } -inline mapped_file::mapmode +inline mapped_file::mapmode operator|=(mapped_file::mapmode& a, mapped_file::mapmode b) { return a = a | b; } -inline mapped_file::mapmode +inline mapped_file::mapmode operator&=(mapped_file::mapmode& a, mapped_file::mapmode b) { return a = a & b; } -inline mapped_file::mapmode +inline mapped_file::mapmode operator^=(mapped_file::mapmode& a, mapped_file::mapmode b) { return a = a ^ b; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/filter/symmetric.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/filter/symmetric.hpp index cc92b0cf..1feff246 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/filter/symmetric.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/filter/symmetric.hpp @@ -20,12 +20,12 @@ // // Consume as many characters as possible from the interval // // [begin_in, end_in), without exhausting the output range // // [begin_out, end_out). If flush is true, write as mush output -// // as possible. -// // A return value of true indicates that filter should be called -// // again. More precisely, if flush is false, a return value of +// // as possible. +// // A return value of true indicates that filter should be called +// // again. More precisely, if flush is false, a return value of // // false indicates that the natural end of stream has been reached // // and that all filtered data has been forwarded; if flush is -// // true, a return value of false indicates that all filtered data +// // true, a return value of false indicates that all filtered data // // has been forwarded. // } // void close() { /* Reset filter's state. */ } @@ -57,7 +57,7 @@ #include #include #include -#include +#include // Must come last. #include // MSVC. @@ -188,7 +188,7 @@ public: string_type unconsumed_input() const; // Give impl access to buffer_type on Tru64 -#if !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) +#if !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) private: #endif typedef detail::buffer buffer_type; @@ -266,7 +266,7 @@ private: int state_; }; - shared_ptr pimpl_; + std::shared_ptr pimpl_; }; BOOST_IOSTREAMS_PIPABLE(symmetric_filter, 2) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/invert.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/invert.hpp index 82e6a4b4..2348a2fe 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/invert.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/invert.hpp @@ -10,11 +10,11 @@ #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once -#endif +#endif -#include // copy, min. +#include // copy, min. #include -#include // BOOST_DEDUCED_TYPENAME. +#include // BOOST_DEDUCED_TYPENAME. #include // default_filter_buffer_size. #include #include @@ -26,7 +26,7 @@ #include // clear_flags, call_reset #include #include -#include +#include #include // Must come last. @@ -51,7 +51,7 @@ public: typedef typename char_type_of::type char_type; typedef typename int_type_of::type int_type; typedef char_traits traits_type; - typedef typename + typedef typename mpl::if_< is_convertible< base_category, @@ -60,15 +60,15 @@ public: output, input >::type mode; - struct category - : mode, - filter_tag, - multichar_tag, - closable_tag + struct category + : mode, + filter_tag, + multichar_tag, + closable_tag { }; - explicit inverse( const Filter& filter, - std::streamsize buffer_size = - default_filter_buffer_size) + explicit inverse( const Filter& filter, + std::streamsize buffer_size = + default_filter_buffer_size) : pimpl_(new impl(filter, buffer_size)) { } @@ -93,10 +93,10 @@ public: buf().flush(snk); } return snk.second().count() == 0 && - status == traits_type::eof() - ? + status == traits_type::eof() + ? -1 - : + : snk.second().count(); } @@ -111,7 +111,7 @@ public: flags() = f_write; buf().set(0, 0); } - + filtered_array_source src(filter(), array_source(s, n)); for (bool good = true; src.second().count() < n && good; ) { buf().fill(src); @@ -133,20 +133,20 @@ private: filter_ref filter() { return boost::ref(pimpl_->filter_); } detail::buffer& buf() { return pimpl_->buf_; } int& flags() { return pimpl_->flags_; } - + enum flags_ { f_read = 1, f_write = 2 }; struct impl { - impl(const Filter& filter, std::streamsize n) + impl(const Filter& filter, std::streamsize n) : filter_(filter), buf_(n), flags_(0) { buf_.set(0, 0); } Filter filter_; detail::buffer buf_; int flags_; }; - shared_ptr pimpl_; + std::shared_ptr pimpl_; }; // @@ -157,7 +157,7 @@ private: // template inverse invert(const Filter& f) { return inverse(f); } - + //----------------------------------------------------------------------------// } } // End namespaces iostreams, boost. diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iterator/indirect_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iterator/indirect_iterator.hpp index abff7e76..00fdedff 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iterator/indirect_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iterator/indirect_iterator.hpp @@ -26,11 +26,11 @@ #include #ifdef BOOST_MPL_CFG_NO_HAS_XXX -# include +# include # include # include # include -#endif +#endif #include // must be last #include @@ -45,7 +45,7 @@ namespace boost struct indirect_base { typedef typename iterator_traits::value_type dereferenceable; - + typedef iterator_adaptor< indirect_iterator , Iter @@ -69,7 +69,7 @@ namespace boost struct indirect_base {}; } // namespace detail - + template < class Iterator , class Value = use_default @@ -107,14 +107,14 @@ namespace boost : super_t(y.base()) {} - private: + private: typename super_t::reference dereference() const { # if BOOST_WORKAROUND(__BORLANDC__, < 0x5A0 ) return const_cast(**this->base()); # else return **this->base(); -# endif +# endif } }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/locale/boundary/index.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/locale/boundary/index.hpp index 5948dcca..81adff7e 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/locale/boundary/index.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/locale/boundary/index.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #ifdef BOOST_MSVC @@ -34,7 +34,7 @@ namespace boost { namespace locale { - + namespace boundary { /// /// \defgroup boundary Boundary Analysis @@ -88,7 +88,7 @@ namespace boost { // // C++0x requires that string is continious in memory and all known // string implementations - // do this because of c_str() support. + // do this because of c_str() support. // if(linear_iterator_traits::is_linear && b!=e) @@ -117,8 +117,8 @@ namespace boost { mapping(boundary_type type, base_iterator begin, base_iterator end, - std::locale const &loc) - : + std::locale const &loc) + : index_(new index_type()), begin_(begin), end_(end) @@ -147,12 +147,12 @@ namespace boost { } private: - boost::shared_ptr index_; + boost::std::shared_ptr index_; base_iterator begin_,end_; }; template - class segment_index_iterator : + class segment_index_iterator : public boost::iterator_facade< segment_index_iterator, segment, @@ -164,7 +164,7 @@ namespace boost { typedef BaseIterator base_iterator; typedef mapping mapping_type; typedef segment segment_type; - + segment_index_iterator() : current_(0,0),map_(0) { } @@ -267,13 +267,13 @@ namespace boost { { size_t dist=std::distance(map_->begin(),p); index_type::const_iterator b=map_->index().begin(),e=map_->index().end(); - index_type::const_iterator + index_type::const_iterator boundary_point=std::upper_bound(b,e,break_info(dist)); while(boundary_point != e && (boundary_point->rule & mask_)==0) boundary_point++; current_.first = current_.second = boundary_point - b; - + if(full_select_) { while(current_.first > 0) { current_.first --; @@ -318,31 +318,31 @@ namespace boost { bool valid_offset(size_t offset) const { - return offset == 0 + return offset == 0 || offset == size() // make sure we not acess index[size] || (index()[offset].rule & mask_)!=0; } - + size_t size() const { return index().size(); } - + index_type const &index() const { return map_->index(); } - - + + segment_type value_; std::pair current_; mapping_type const *map_; rule_type mask_; bool full_select_; }; - + template - class boundary_point_index_iterator : + class boundary_point_index_iterator : public boost::iterator_facade< boundary_point_index_iterator, boundary_point, @@ -354,7 +354,7 @@ namespace boost { typedef BaseIterator base_iterator; typedef mapping mapping_type; typedef boundary_point boundary_point_type; - + boundary_point_index_iterator() : current_(0),map_(0) { } @@ -466,22 +466,22 @@ namespace boost { bool valid_offset(size_t offset) const { - return offset == 0 + return offset == 0 || offset + 1 >= size() // last and first are always valid regardless of mark || (index()[offset].rule & mask_)!=0; } - + size_t size() const { return index().size(); } - + index_type const &index() const { return map_->index(); } - - + + boundary_point_type value_; size_t current_; mapping_type const *map_; @@ -498,10 +498,10 @@ namespace boost { template class boundary_point_index; - + /// - /// \brief This class holds an index of segments in the text range and allows to iterate over them + /// \brief This class holds an index of segments in the text range and allows to iterate over them /// /// This class is provides \ref begin() and \ref end() member functions that return bidirectional iterators /// to the \ref segment objects. @@ -512,7 +512,7 @@ namespace boost { /// various masks %as \ref word_any. /// \n /// The default is to select any types of boundaries. - /// \n + /// \n /// For example: using word %boundary analysis, when the provided mask is \ref word_kana then the iterators /// would iterate only over the words containing Kana letters and \ref word_any would select all types of /// words excluding ranges that consist of white space and punctuation marks. So iterating over the text @@ -533,7 +533,7 @@ namespace boost { /// terminator "!" or "?". But changing \ref full_select() to true, the selected segment would include /// all the text up to previous valid %boundary point and would return two expected sentences: /// "Hello!" and "How\nare you?". - /// + /// /// This class allows to find a segment according to the given iterator in range using \ref find() member /// function. /// @@ -555,7 +555,7 @@ namespace boost { template class segment_index { public: - + /// /// The type of the iterator used to iterate over the original text /// @@ -591,7 +591,7 @@ namespace boost { typedef segment value_type; /// - /// Default constructor. + /// Default constructor. /// /// \note /// @@ -610,7 +610,7 @@ namespace boost { base_iterator begin, base_iterator end, rule_type mask, - std::locale const &loc=std::locale()) + std::locale const &loc=std::locale()) : map_(type,begin,end,loc), mask_(mask), @@ -624,7 +624,7 @@ namespace boost { segment_index(boundary_type type, base_iterator begin, base_iterator end, - std::locale const &loc=std::locale()) + std::locale const &loc=std::locale()) : map_(type,begin,end,loc), mask_(0xFFFFFFFFu), @@ -655,7 +655,7 @@ namespace boost { /// segment_index const &operator = (boundary_point_index const &); - + /// /// Create a new index for %boundary analysis \ref boundary_type "type" of the text /// in range [begin,end) for locale \a loc. @@ -694,7 +694,7 @@ namespace boost { } /// - /// Find a first valid segment following a position \a p. + /// Find a first valid segment following a position \a p. /// /// If \a p is inside a valid segment this segment is selected: /// @@ -704,7 +704,7 @@ namespace boost { /// - "t|o be or ", would point to "to", /// - "to be or| ", would point to end. /// - /// + /// /// Preconditions: the segment_index should have a mapping and \a p should be valid iterator /// to the text in the mapped range. /// @@ -714,17 +714,17 @@ namespace boost { { return iterator(p,&map_,mask_,full_select_); } - + /// /// Get the mask of rules that are used - /// + /// rule_type rule() const { return mask_; } /// /// Set the mask of rules that are used - /// + /// void rule(rule_type v) { mask_ = v; @@ -743,7 +743,7 @@ namespace boost { /// following part "are you?" /// - bool full_select() const + bool full_select() const { return full_select_; } @@ -761,11 +761,11 @@ namespace boost { /// following part "are you?" /// - void full_select(bool v) + void full_select(bool v) { full_select_ = v; } - + private: friend class boundary_point_index; typedef details::mapping mapping_type; @@ -793,14 +793,14 @@ namespace boost { /// - "Hello! How\n|are you?" /// - "Hello! How\nare you?|" /// - /// However if \ref rule() is set to \ref sentence_term then the selected %boundary points would be: + /// However if \ref rule() is set to \ref sentence_term then the selected %boundary points would be: /// /// - "|Hello! How\nare you?" /// - "Hello! |How\nare you?" /// - "Hello! How\nare you?|" - /// + /// /// Such that a %boundary point defined by a line feed character would be ignored. - /// + /// /// This class allows to find a boundary_point according to the given iterator in range using \ref find() member /// function. /// @@ -858,9 +858,9 @@ namespace boost { /// an object that represents the selected \ref boundary_point "boundary point". /// typedef boundary_point value_type; - + /// - /// Default constructor. + /// Default constructor. /// /// \note /// @@ -871,7 +871,7 @@ namespace boost { boundary_point_index() : mask_(0xFFFFFFFFu) { } - + /// /// Create a segment_index for %boundary analysis \ref boundary_type "type" of the text /// in range [begin,end) using a rule \a mask for locale \a loc. @@ -880,7 +880,7 @@ namespace boost { base_iterator begin, base_iterator end, rule_type mask, - std::locale const &loc=std::locale()) + std::locale const &loc=std::locale()) : map_(type,begin,end,loc), mask_(mask) @@ -893,7 +893,7 @@ namespace boost { boundary_point_index(boundary_type type, base_iterator begin, base_iterator end, - std::locale const &loc=std::locale()) + std::locale const &loc=std::locale()) : map_(type,begin,end,loc), mask_(0xFFFFFFFFu) @@ -969,7 +969,7 @@ namespace boost { /// /// - "|to be", would return %boundary point at "|to be", /// - "t|o be", would point to "to| be" - /// + /// /// Preconditions: the boundary_point_index should have a mapping and \a p should be valid iterator /// to the text in the mapped range. /// @@ -979,17 +979,17 @@ namespace boost { { return iterator(p,&map_,mask_); } - + /// /// Get the mask of rules that are used - /// + /// rule_type rule() const { return mask_; } /// /// Set the mask of rules that are used - /// + /// void rule(rule_type v) { mask_ = v; @@ -1002,8 +1002,8 @@ namespace boost { mapping_type map_; rule_type mask_; }; - - /// \cond INTERNAL + + /// \cond INTERNAL template segment_index::segment_index(boundary_point_index const &other) : map_(other.map_), @@ -1011,7 +1011,7 @@ namespace boost { full_select_(false) { } - + template boundary_point_index::boundary_point_index(segment_index const &other) : map_(other.map_), @@ -1025,7 +1025,7 @@ namespace boost { map_ = other.map_; return *this; } - + template boundary_point_index const &boundary_point_index::operator=(segment_index const &other) { @@ -1033,7 +1033,7 @@ namespace boost { return *this; } /// \endcond - + typedef segment_index ssegment_index; ///< convenience typedef typedef segment_index wssegment_index; ///< convenience typedef #ifdef BOOST_HAS_CHAR16_T @@ -1042,7 +1042,7 @@ namespace boost { #ifdef BOOST_HAS_CHAR32_T typedef segment_index u32ssegment_index;///< convenience typedef #endif - + typedef segment_index csegment_index; ///< convenience typedef typedef segment_index wcsegment_index; ///< convenience typedef #ifdef BOOST_HAS_CHAR16_T @@ -1060,7 +1060,7 @@ namespace boost { #ifdef BOOST_HAS_CHAR32_T typedef boundary_point_index u32sboundary_point_index;///< convenience typedef #endif - + typedef boundary_point_index cboundary_point_index; ///< convenience typedef typedef boundary_point_index wcboundary_point_index; ///< convenience typedef #ifdef BOOST_HAS_CHAR16_T diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/locale/generator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/locale/generator.hpp index cd34a6fc..e586b32c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/locale/generator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/locale/generator.hpp @@ -20,10 +20,10 @@ namespace boost { template - class shared_ptr; + class std::shared_ptr; /// - /// \brief This is the main namespace that encloses all localization classes + /// \brief This is the main namespace that encloses all localization classes /// namespace locale { @@ -39,7 +39,7 @@ namespace boost { static const uint32_t character_first_facet = char_facet; ///< First facet specific for character type static const uint32_t character_last_facet = char32_t_facet; ///< Last facet specific for character type static const uint32_t all_characters = 0xFFFF; ///< Special mask -- generate all - + typedef uint32_t character_facet_type; /// backend,std::string const &id) const; + void set_all_options(std::shared_ptr backend,std::string const &id) const; generator(generator const &); void operator=(generator const &); @@ -231,5 +231,5 @@ namespace boost { #endif -// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/communicator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/communicator.hpp index e450e2a5..68b7afea 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/communicator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/communicator.hpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -89,7 +89,7 @@ enum comm_create_kind { comm_duplicate, comm_take_ownership, comm_attach }; /** * INTERNAL ONLY - * + * * Forward declaration of @c group needed for the @c group * constructor and accessor. */ @@ -436,7 +436,7 @@ class BOOST_MPI_DECL communicator * @brief Receive an array of values from a remote process. * * This routine blocks until it receives an array of values from the - * process @p source with the given @p tag. If the type @c T is + * process @p source with the given @p tag. If the type @c T is * * @param source The process that will be sending data. This will * either be a process rank within the communicator or the @@ -518,7 +518,7 @@ class BOOST_MPI_DECL communicator * @c skeleton_proxy objects except that @c isend will not block * while waiting for the data to be transmitted. Instead, a request * object will be immediately returned, allowing one to query the - * status of the communication or wait until it has completed. + * status of the communication or wait until it has completed. * * The semantics of this routine are equivalent to a non-blocking * send of a @c packed_skeleton_oarchive storing the skeleton of @@ -628,7 +628,7 @@ class BOOST_MPI_DECL communicator * @brief Initiate receipt of an array of values from a remote process. * * This routine initiates a receive operation for an array of values - * transmitted by process @p source with the given @p tag. + * transmitted by process @p source with the given @p tag. * * @param source The process that will be sending data. This will * either be a process rank within the communicator or the @@ -824,9 +824,9 @@ class BOOST_MPI_DECL communicator #if 0 template - communicator - with_cartesian_topology(const Extents& extents, - bool periodic = false, + communicator + with_cartesian_topology(const Extents& extents, + bool periodic = false, bool reorder = false) const; template @@ -863,7 +863,7 @@ class BOOST_MPI_DECL communicator * * Function object that frees an MPI communicator and deletes the * memory associated with it. Intended to be used as a deleter with - * shared_ptr. + * std::shared_ptr. */ struct comm_free { @@ -877,7 +877,7 @@ class BOOST_MPI_DECL communicator } }; - + /** * INTERNAL ONLY * @@ -904,7 +904,7 @@ class BOOST_MPI_DECL communicator * datatype, so we map directly to that datatype. */ template - void + void array_send_impl(int dest, int tag, const T* values, int n, mpl::true_) const; /** @@ -915,8 +915,8 @@ class BOOST_MPI_DECL communicator * data, to be deserialized on the receiver side. */ template - void - array_send_impl(int dest, int tag, const T* values, int n, + void + array_send_impl(int dest, int tag, const T* values, int n, mpl::false_) const; /** @@ -945,8 +945,8 @@ class BOOST_MPI_DECL communicator * datatype, so we map directly to that datatype. */ template - request - array_isend_impl(int dest, int tag, const T* values, int n, + request + array_isend_impl(int dest, int tag, const T* values, int n, mpl::true_) const; /** @@ -957,8 +957,8 @@ class BOOST_MPI_DECL communicator * data, to be deserialized on the receiver side. */ template - request - array_isend_impl(int dest, int tag, const T* values, int n, + request + array_isend_impl(int dest, int tag, const T* values, int n, mpl::false_) const; /** @@ -987,7 +987,7 @@ class BOOST_MPI_DECL communicator * datatype, so we map directly to that datatype. */ template - status + status array_recv_impl(int source, int tag, T* values, int n, mpl::true_) const; /** @@ -998,7 +998,7 @@ class BOOST_MPI_DECL communicator * MPI_PACKED. We'll receive it and then deserialize. */ template - status + status array_recv_impl(int source, int tag, T* values, int n, mpl::false_) const; /** @@ -1027,7 +1027,7 @@ class BOOST_MPI_DECL communicator * map directly to that datatype. */ template - request + request array_irecv_impl(int source, int tag, T* values, int n, mpl::true_) const; /** @@ -1038,10 +1038,10 @@ class BOOST_MPI_DECL communicator * MPI_PACKED. We'll receive it and then deserialize. */ template - request + request array_irecv_impl(int source, int tag, T* values, int n, mpl::false_) const; - shared_ptr comm_ptr; + std::shared_ptr comm_ptr; }; /** @@ -1070,13 +1070,13 @@ inline bool operator!=(const communicator& comm1, const communicator& comm2) * Implementation details * ************************************************************************/ // Count elements in a message -template +template inline optional status::count() const { return count_impl(is_mpi_datatype()); } -template +template optional status::count_impl(mpl::true_) const { if (m_count != -1) @@ -1092,7 +1092,7 @@ optional status::count_impl(mpl::true_) const return m_count = return_value; } -template +template inline optional status::count_impl(mpl::false_) const { if (m_count == -1) @@ -1140,7 +1140,7 @@ communicator::array_send_impl(int dest, int tag, const T* values, int n, mpl::true_) const { BOOST_MPI_CHECK_RESULT(MPI_Send, - (const_cast(values), n, + (const_cast(values), n, get_mpi_datatype(*values), dest, tag, MPI_Comm(*this))); } @@ -1173,7 +1173,7 @@ status communicator::recv_impl(int source, int tag, T& value, mpl::true_) const status stat; BOOST_MPI_CHECK_RESULT(MPI_Recv, - (const_cast(&value), 1, + (const_cast(&value), 1, get_mpi_datatype(value), source, tag, MPI_Comm(*this), &stat.m_status)); return stat; @@ -1202,13 +1202,13 @@ status communicator::recv(int source, int tag, T& value) const } template -status -communicator::array_recv_impl(int source, int tag, T* values, int n, +status +communicator::array_recv_impl(int source, int tag, T* values, int n, mpl::true_) const { status stat; BOOST_MPI_CHECK_RESULT(MPI_Recv, - (const_cast(values), n, + (const_cast(values), n, get_mpi_datatype(*values), source, tag, MPI_Comm(*this), &stat.m_status)); return stat; @@ -1216,7 +1216,7 @@ communicator::array_recv_impl(int source, int tag, T* values, int n, template status -communicator::array_recv_impl(int source, int tag, T* values, int n, +communicator::array_recv_impl(int source, int tag, T* values, int n, mpl::false_) const { // Receive the message @@ -1255,7 +1255,7 @@ communicator::isend_impl(int dest, int tag, const T& value, mpl::true_) const { request req; BOOST_MPI_CHECK_RESULT(MPI_Isend, - (const_cast(&value), 1, + (const_cast(&value), 1, get_mpi_datatype(value), dest, tag, MPI_Comm(*this), &req.m_requests[0])); return req; @@ -1268,7 +1268,7 @@ template request communicator::isend_impl(int dest, int tag, const T& value, mpl::false_) const { - shared_ptr archive(new packed_oarchive(*this)); + std::shared_ptr archive(new packed_oarchive(*this)); *archive << value; request result = isend(dest, tag, *archive); result.m_data = archive; @@ -1290,7 +1290,7 @@ communicator::array_isend_impl(int dest, int tag, const T* values, int n, { request req; BOOST_MPI_CHECK_RESULT(MPI_Isend, - (const_cast(values), n, + (const_cast(values), n, get_mpi_datatype(*values), dest, tag, MPI_Comm(*this), &req.m_requests[0])); return req; @@ -1298,10 +1298,10 @@ communicator::array_isend_impl(int dest, int tag, const T* values, int n, template request -communicator::array_isend_impl(int dest, int tag, const T* values, int n, +communicator::array_isend_impl(int dest, int tag, const T* values, int n, mpl::false_) const { - shared_ptr archive(new packed_oarchive(*this)); + std::shared_ptr archive(new packed_oarchive(*this)); *archive << n << boost::serialization::make_array(values, n); request result = isend(dest, tag, *archive); result.m_data = archive; @@ -1324,15 +1324,15 @@ namespace detail { template struct serialized_irecv_data { - serialized_irecv_data(const communicator& comm, int source, int tag, + serialized_irecv_data(const communicator& comm, int source, int tag, T& value) - : comm(comm), source(source), tag(tag), ia(comm), value(value) - { + : comm(comm), source(source), tag(tag), ia(comm), value(value) + { } - void deserialize(status& stat) - { - ia >> value; + void deserialize(status& stat) + { + ia >> value; stat.m_count = 1; } @@ -1347,7 +1347,7 @@ namespace detail { template<> struct serialized_irecv_data { - serialized_irecv_data(const communicator& comm, int source, int tag, + serialized_irecv_data(const communicator& comm, int source, int tag, packed_iarchive& ia) : comm(comm), source(source), tag(tag), ia(ia) { } @@ -1367,10 +1367,10 @@ namespace detail { template struct serialized_array_irecv_data { - serialized_array_irecv_data(const communicator& comm, int source, int tag, + serialized_array_irecv_data(const communicator& comm, int source, int tag, T* values, int n) : comm(comm), source(source), tag(tag), ia(comm), values(values), n(n) - { + { } void deserialize(status& stat); @@ -1390,26 +1390,26 @@ namespace detail { // Determine how much data we are going to receive int count; ia >> count; - + // Deserialize the data in the message boost::serialization::array arr(values, count > n? n : count); ia >> arr; - + if (count > n) { boost::throw_exception( std::range_error("communicator::recv: message receive overflow")); } - + stat.m_count = count; } } template -optional +optional request::handle_serialized_irecv(request* self, request_action action) { typedef detail::serialized_irecv_data data_t; - shared_ptr data = static_pointer_cast(self->m_data); + std::shared_ptr data = static_pointer_cast(self->m_data); if (action == ra_wait) { status stat; @@ -1421,7 +1421,7 @@ request::handle_serialized_irecv(request* self, request_action action) data->ia.resize(data->count); BOOST_MPI_CHECK_RESULT(MPI_Irecv, (data->ia.address(), data->ia.size(), MPI_PACKED, - stat.source(), stat.tag(), + stat.source(), stat.tag(), MPI_Comm(data->comm), self->m_requests + 1)); } @@ -1444,11 +1444,11 @@ request::handle_serialized_irecv(request* self, request_action action) data->ia.resize(data->count); BOOST_MPI_CHECK_RESULT(MPI_Irecv, (data->ia.address(), data->ia.size(),MPI_PACKED, - stat.source(), stat.tag(), + stat.source(), stat.tag(), MPI_Comm(data->comm), self->m_requests + 1)); } else return optional(); // We have not finished yet - } + } // Check if we have received the message data BOOST_MPI_CHECK_RESULT(MPI_Test, @@ -1456,7 +1456,7 @@ request::handle_serialized_irecv(request* self, request_action action) if (flag) { data->deserialize(stat); return stat; - } else + } else return optional(); } else { return optional(); @@ -1464,11 +1464,11 @@ request::handle_serialized_irecv(request* self, request_action action) } template -optional +optional request::handle_serialized_array_irecv(request* self, request_action action) { typedef detail::serialized_array_irecv_data data_t; - shared_ptr data = static_pointer_cast(self->m_data); + std::shared_ptr data = static_pointer_cast(self->m_data); if (action == ra_wait) { status stat; @@ -1480,7 +1480,7 @@ request::handle_serialized_array_irecv(request* self, request_action action) data->ia.resize(data->count); BOOST_MPI_CHECK_RESULT(MPI_Irecv, (data->ia.address(), data->ia.size(), MPI_PACKED, - stat.source(), stat.tag(), + stat.source(), stat.tag(), MPI_Comm(data->comm), self->m_requests + 1)); } @@ -1503,11 +1503,11 @@ request::handle_serialized_array_irecv(request* self, request_action action) data->ia.resize(data->count); BOOST_MPI_CHECK_RESULT(MPI_Irecv, (data->ia.address(), data->ia.size(),MPI_PACKED, - stat.source(), stat.tag(), + stat.source(), stat.tag(), MPI_Comm(data->comm), self->m_requests + 1)); } else return optional(); // We have not finished yet - } + } // Check if we have received the message data BOOST_MPI_CHECK_RESULT(MPI_Test, @@ -1515,7 +1515,7 @@ request::handle_serialized_array_irecv(request* self, request_action action) if (flag) { data->deserialize(stat); return stat; - } else + } else return optional(); } else { return optional(); @@ -1525,12 +1525,12 @@ request::handle_serialized_array_irecv(request* self, request_action action) // We're receiving a type that has an associated MPI datatype, so we // map directly to that datatype. template -request +request communicator::irecv_impl(int source, int tag, T& value, mpl::true_) const { request req; BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (const_cast(&value), 1, + (const_cast(&value), 1, get_mpi_datatype(value), source, tag, MPI_Comm(*this), &req.m_requests[0])); return req; @@ -1541,34 +1541,34 @@ request communicator::irecv_impl(int source, int tag, T& value, mpl::false_) const { typedef detail::serialized_irecv_data data_t; - shared_ptr data(new data_t(*this, source, tag, value)); + std::shared_ptr data(new data_t(*this, source, tag, value)); request req; req.m_data = data; req.m_handler = request::handle_serialized_irecv; BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (&data->count, 1, + (&data->count, 1, get_mpi_datatype(data->count), source, tag, MPI_Comm(*this), &req.m_requests[0])); - + return req; } template -request +request communicator::irecv(int source, int tag, T& value) const { return this->irecv_impl(source, tag, value, is_mpi_datatype()); } template -request -communicator::array_irecv_impl(int source, int tag, T* values, int n, +request +communicator::array_irecv_impl(int source, int tag, T* values, int n, mpl::true_) const { request req; BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (const_cast(values), n, + (const_cast(values), n, get_mpi_datatype(*values), source, tag, MPI_Comm(*this), &req.m_requests[0])); return req; @@ -1576,17 +1576,17 @@ communicator::array_irecv_impl(int source, int tag, T* values, int n, template request -communicator::array_irecv_impl(int source, int tag, T* values, int n, +communicator::array_irecv_impl(int source, int tag, T* values, int n, mpl::false_) const { typedef detail::serialized_array_irecv_data data_t; - shared_ptr data(new data_t(*this, source, tag, values, n)); + std::shared_ptr data(new data_t(*this, source, tag, values, n)); request req; req.m_data = data; req.m_handler = request::handle_serialized_array_irecv; BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (&data->count, 1, + (&data->count, 1, get_mpi_datatype(data->count), source, tag, MPI_Comm(*this), &req.m_requests[0])); @@ -1657,7 +1657,7 @@ communicator::recv(int source, int tag, content& c) const { return recv(source,tag,c); -} +} /** * INTERNAL ONLY diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/detail/communicator_sc.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/detail/communicator_sc.hpp index 1dfcc3c5..1102675f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/detail/communicator_sc.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/detail/communicator_sc.hpp @@ -45,7 +45,7 @@ template request communicator::isend(int dest, int tag, const skeleton_proxy& proxy) const { - shared_ptr + std::shared_ptr archive(new packed_skeleton_oarchive(*this)); *archive << proxy.object; @@ -58,13 +58,13 @@ namespace detail { template struct serialized_irecv_data > { - serialized_irecv_data(const communicator& comm, int source, int tag, + serialized_irecv_data(const communicator& comm, int source, int tag, skeleton_proxy proxy) - : comm(comm), source(source), tag(tag), isa(comm), + : comm(comm), source(source), tag(tag), isa(comm), ia(isa.get_skeleton()), proxy(proxy) { } - void deserialize(status& stat) - { + void deserialize(status& stat) + { isa >> proxy.object; stat.m_count = 1; } @@ -84,7 +84,7 @@ namespace detail { { typedef serialized_irecv_data > inherited; - serialized_irecv_data(const communicator& comm, int source, int tag, + serialized_irecv_data(const communicator& comm, int source, int tag, const skeleton_proxy& proxy) : inherited(comm, source, tag, proxy) { } }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/graph_communicator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/graph_communicator.hpp index 6cafb1fe..f9747c77 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/graph_communicator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/graph_communicator.hpp @@ -59,7 +59,7 @@ class BOOST_MPI_DECL graph_communicator : public communicator * underlying MPI_Comm. This operation is used for "casting" from a * communicator to a graph communicator. */ - explicit graph_communicator(const shared_ptr& comm_ptr) + explicit graph_communicator(const std::shared_ptr& comm_ptr) { #ifndef BOOST_DISABLE_ASSERTS int status; @@ -99,7 +99,7 @@ public: */ graph_communicator(const MPI_Comm& comm, comm_create_kind kind) : communicator(comm, kind) - { + { #ifndef BOOST_DISABLE_ASSERTS int status; BOOST_MPI_CHECK_RESULT(MPI_Topo_test, ((MPI_Comm)*this, &status)); @@ -116,8 +116,8 @@ public: * resulting communicator will be a NULL communicator. * * @param comm The communicator that the new, graph communicator - * will be based on. - * + * will be based on. + * * @param graph Any type that meets the requirements of the * Incidence Graph and Vertex List Graph concepts from the Boost Graph * Library. This structure of this graph will become the topology @@ -130,8 +130,8 @@ public: * within the original communicator. */ template - explicit - graph_communicator(const communicator& comm, const Graph& graph, + explicit + graph_communicator(const communicator& comm, const Graph& graph, bool reorder = false); /** @@ -145,7 +145,7 @@ public: * @param comm The communicator that the new, graph communicator * will be based on. The ranks in @c rank refer to the processes in * this communicator. - * + * * @param graph Any type that meets the requirements of the * Incidence Graph and Vertex List Graph concepts from the Boost Graph * Library. This structure of this graph will become the topology @@ -164,8 +164,8 @@ public: * within the original communicator. */ template - explicit - graph_communicator(const communicator& comm, const Graph& graph, + explicit + graph_communicator(const communicator& comm, const Graph& graph, RankMap rank, bool reorder = false); protected: @@ -177,7 +177,7 @@ protected: */ template void - setup_graph(const communicator& comm, const Graph& graph, RankMap rank, + setup_graph(const communicator& comm, const Graph& graph, RankMap rank, bool reorder); }; @@ -186,16 +186,16 @@ protected: ****************************************************************************/ template -graph_communicator::graph_communicator(const communicator& comm, - const Graph& graph, +graph_communicator::graph_communicator(const communicator& comm, + const Graph& graph, bool reorder) { this->setup_graph(comm, graph, get(vertex_index, graph), reorder); } template -graph_communicator::graph_communicator(const communicator& comm, - const Graph& graph, +graph_communicator::graph_communicator(const communicator& comm, + const Graph& graph, RankMap rank, bool reorder) { this->setup_graph(comm, graph, rank, reorder); @@ -204,7 +204,7 @@ graph_communicator::graph_communicator(const communicator& comm, template void -graph_communicator::setup_graph(const communicator& comm, const Graph& graph, +graph_communicator::setup_graph(const communicator& comm, const Graph& graph, RankMap rank, bool reorder) { typedef typename graph_traits::vertex_descriptor vertex_descriptor; @@ -234,7 +234,7 @@ graph_communicator::setup_graph(const communicator& comm, const Graph& graph, // Create the new communicator MPI_Comm newcomm; BOOST_MPI_CHECK_RESULT(MPI_Graph_create, - ((MPI_Comm)comm, + ((MPI_Comm)comm, nvertices, &indices[0], edges.empty()? (int*)0 : &edges[0], @@ -254,10 +254,10 @@ namespace detail { * communicator's graph topology. */ class comm_out_edge_iterator - : public iterator_facade, random_access_traversal_tag, - const std::pair&, + const std::pair&, int> { public: @@ -304,10 +304,10 @@ namespace detail { * communicator's graph topology. */ class comm_adj_iterator - : public iterator_facade { public: @@ -349,10 +349,10 @@ namespace detail { * topology. */ class comm_edge_iterator - : public iterator_facade, forward_traversal_tag, - const std::pair&, + const std::pair&, int> { public: @@ -381,9 +381,9 @@ namespace detail { return edge_index == other.edge_index; } - void increment() - { - ++edge_index; + void increment() + { + ++edge_index; } shared_array indices; @@ -478,7 +478,7 @@ int num_edges(const graph_communicator& comm); /** * @brief Returns a property map that maps from vertices in a - * communicator's graph topology to their index values. + * communicator's graph topology to their index values. * * Since the vertices are ranks in the communicator, the returned * property map is the identity property map. @@ -522,16 +522,16 @@ struct graph_traits { typedef std::pair edge_descriptor; typedef directed_tag directed_category; typedef disallow_parallel_edge_tag edge_parallel_category; - + /** * INTERNAL ONLY */ struct traversal_category - : incidence_graph_tag, - adjacency_graph_tag, - vertex_list_graph_tag, - edge_list_graph_tag - { + : incidence_graph_tag, + adjacency_graph_tag, + vertex_list_graph_tag, + edge_list_graph_tag + { }; /** diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/group.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/group.hpp index 103b35a1..5fa5e4b5 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/group.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/group.hpp @@ -16,7 +16,7 @@ #define BOOST_MPI_GROUP_HPP #include -#include +#include #include #include @@ -62,7 +62,7 @@ public: /** * @brief Determine the rank of the calling process in the group. - * + * * This routine is equivalent to @c MPI_Group_rank. * * @returns The rank of the calling process in the group, which will @@ -167,11 +167,11 @@ public: * * @returns A new group containing all of the processes in the * current group except those processes with ranks @c [first, last) - * in the current group. + * in the current group. */ template group exclude(InputIterator first, InputIterator last); - + protected: /** @@ -179,7 +179,7 @@ protected: * * Function object that frees an MPI group and deletes the * memory associated with it. Intended to be used as a deleter with - * shared_ptr. + * std::shared_ptr. */ struct group_free { @@ -199,7 +199,7 @@ protected: * @c group class. When there are no more such instances, the group * will be automatically freed. */ - shared_ptr group_ptr; + std::shared_ptr group_ptr; }; /** @@ -223,7 +223,7 @@ BOOST_MPI_DECL bool operator==(const group& g1, const group& g2); * processes in the same order. */ inline bool operator!=(const group& g1, const group& g2) -{ +{ return !(g1 == g2); } @@ -260,7 +260,7 @@ BOOST_MPI_DECL group operator-(const group& g1, const group& g2); * Implementation details * ************************************************************************/ template -OutputIterator +OutputIterator group::translate_ranks(InputIterator first, InputIterator last, const group& to_group, OutputIterator out) { @@ -283,11 +283,11 @@ group::translate_ranks(InputIterator first, InputIterator last, /** * INTERNAL ONLY - * + * * Specialization of translate_ranks that handles the one case where * we can avoid any memory allocation or copying. */ -template<> +template<> BOOST_MPI_DECL int* group::translate_ranks(int* first, int* last, const group& to_group, int* out); @@ -306,7 +306,7 @@ group group::include(InputIterator first, InputIterator last) /** * INTERNAL ONLY - * + * * Specialization of group::include that handles the one case where we * can avoid any memory allocation or copying before creating the * group. @@ -328,7 +328,7 @@ group group::exclude(InputIterator first, InputIterator last) /** * INTERNAL ONLY - * + * * Specialization of group::exclude that handles the one case where we * can avoid any memory allocation or copying before creating the * group. diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/intercommunicator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/intercommunicator.hpp index ad246b59..d57c79e2 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/intercommunicator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/intercommunicator.hpp @@ -24,7 +24,7 @@ namespace boost { namespace mpi { * * Forward declaration of the MPI "group" representation, for use in * the description of the @c intercommunicator class. - */ + */ class group; /** @@ -45,8 +45,8 @@ class group; * intercommunicators occurs between the processes in the local group * and the processes in the remote group; communication within a group * must use a different (intra-)communicator. - * - */ + * + */ class BOOST_MPI_DECL intercommunicator : public communicator { private: @@ -59,7 +59,7 @@ private: * underlying MPI_Comm. This operation is used for "casting" from a * communicator to an intercommunicator. */ - explicit intercommunicator(const shared_ptr& cp) + explicit intercommunicator(const std::shared_ptr& cp) { this->comm_ptr = cp; } @@ -149,7 +149,7 @@ public: * Merge the local and remote groups in this intercommunicator into * a new intracommunicator containing the union of the processes in * both groups. This method is equivalent to @c MPI_Intercomm_merge. - * + * * @param high Whether the processes in this group should have the * higher rank numbers than the processes in the other group. Each * of the processes within a particular group shall have the same diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/request.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/request.hpp index cb36cc5a..e43f00a8 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/request.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/request.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include namespace boost { namespace mpi { @@ -29,7 +29,7 @@ class communicator; * receive and will be returned from @c isend or @c irecv, * respectively. */ -class BOOST_MPI_DECL request +class BOOST_MPI_DECL request { public: /** @@ -62,7 +62,7 @@ class BOOST_MPI_DECL request private: enum request_action { ra_wait, ra_test, ra_cancel }; - typedef optional (*handler_type)(request* self, + typedef optional (*handler_type)(request* self, request_action action); /** @@ -71,7 +71,7 @@ class BOOST_MPI_DECL request * Handles the non-blocking receive of a serialized value. */ template - static optional + static optional handle_serialized_irecv(request* self, request_action action); /** @@ -80,7 +80,7 @@ class BOOST_MPI_DECL request * Handles the non-blocking receive of an array of serialized values. */ template - static optional + static optional handle_serialized_array_irecv(request* self, request_action action); public: // template friends are not portable @@ -92,7 +92,7 @@ class BOOST_MPI_DECL request handler_type m_handler; /// INTERNAL ONLY - shared_ptr m_data; + std::shared_ptr m_data; friend class communicator; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/skeleton_and_content.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/skeleton_and_content.hpp index dcd13bfe..78c5fb27 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/skeleton_and_content.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/skeleton_and_content.hpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include namespace boost { namespace mpi { @@ -197,7 +197,7 @@ public: } private: - boost::shared_ptr holder; + boost::std::shared_ptr holder; }; /** @brief Returns the content of an object, suitable for transmission diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/pointee.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/pointee.hpp index 9794b8e7..d4d24f49 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/pointee.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/pointee.hpp @@ -8,7 +8,7 @@ // // typename pointee

::type provides the pointee type of P. // -// For example, it is T for T* and X for shared_ptr. +// For example, it is T for T* and X for std::shared_ptr. // // http://www.boost.org/libs/iterator/doc/pointee.html // @@ -20,7 +20,7 @@ # include # include -namespace boost { +namespace boost { namespace detail { @@ -34,25 +34,25 @@ namespace detail struct iterator_pointee { typedef typename iterator_traits::value_type value_type; - + struct impl { template static char test(T const&); - + static char (& test(value_type&) )[2]; - + static Iterator& x; }; - + BOOST_STATIC_CONSTANT(bool, is_constant = sizeof(impl::test(*impl::x)) == 1); - + typedef typename mpl::if_c< # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) ::boost::detail::iterator_pointee::is_constant # else is_constant -# endif +# endif , typename add_const::type , value_type >::type type; @@ -68,7 +68,7 @@ struct pointee > { }; - + } // namespace boost #endif // POINTEE_DWA200415_HPP diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/detail/config_file.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/detail/config_file.hpp index 4c2c15b9..0aa83ba1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/detail/config_file.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/detail/config_file.hpp @@ -25,7 +25,7 @@ #include #include -#include +#include @@ -38,7 +38,7 @@ namespace boost { namespace program_options { namespace detail { for(; i !=e; ++i) { *i; } - + Syntax conventions: - config file can not contain positional options @@ -47,10 +47,10 @@ namespace boost { namespace program_options { namespace detail { - variable assignments are in the form name '=' value. spaces around '=' are trimmed. - - Section names are given in brackets. + - Section names are given in brackets. The actual option name is constructed by combining current section - name and specified option name, with dot between. If section_name + name and specified option name, with dot between. If section_name already contains dot at the end, new dot is not inserted. For example: @verbatim [gui.accessibility] @@ -61,8 +61,8 @@ namespace boost { namespace program_options { namespace detail { TODO: maybe, we should just accept a pointer to options_description class. - */ - class common_config_file_iterator + */ + class common_config_file_iterator : public eof_iterator { public: @@ -74,9 +74,9 @@ namespace boost { namespace program_options { namespace detail { virtual ~common_config_file_iterator() {} public: // Method required by eof_iterator - + void get(); - + protected: // Stubs for derived classes // Obtains next line from the config file @@ -85,7 +85,7 @@ namespace boost { namespace program_options { namespace detail { // constructor of this class, but to avoid templating this class // we'd need polymorphic iterator, which does not exist yet. virtual bool getline(std::string&) { return false; } - + private: /** Adds another allowed option. If the 'name' ends with '*', then all options with the same prefix are @@ -94,7 +94,7 @@ namespace boost { namespace program_options { namespace detail { void add_option(const char* name); // Returns true if 's' is a registered option name. - bool allowed_option(const std::string& s) const; + bool allowed_option(const std::string& s) const; // That's probably too much data for iterator, since // it will be copied, but let's not bother for now. @@ -113,20 +113,20 @@ namespace boost { namespace program_options { namespace detail { found_eof(); } - /** Creates a config file parser for the specified stream. + /** Creates a config file parser for the specified stream. */ - basic_config_file_iterator(std::basic_istream& is, + basic_config_file_iterator(std::basic_istream& is, const std::set& allowed_options, - bool allow_unregistered = false); + bool allow_unregistered = false); private: // base overrides bool getline(std::string&); private: // internal data - shared_ptr > is; + std::shared_ptr > is; }; - + typedef basic_config_file_iterator config_file_iterator; typedef basic_config_file_iterator wconfig_file_iterator; @@ -139,12 +139,12 @@ namespace boost { namespace program_options { namespace detail { template basic_config_file_iterator:: - basic_config_file_iterator(std::basic_istream& is, + basic_config_file_iterator(std::basic_istream& is, const std::set& allowed_options, bool allow_unregistered) : common_config_file_iterator(allowed_options, allow_unregistered) { - this->is.reset(&is, null_deleter()); + this->is.reset(&is, null_deleter()); get(); } @@ -173,7 +173,7 @@ namespace boost { namespace program_options { namespace detail { basic_config_file_iterator::getline(std::string& s); #endif - + }}} diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/options_description.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/options_description.hpp index 62530b2d..2b5dee37 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/options_description.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/options_description.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -27,12 +27,12 @@ #if defined(BOOST_MSVC) # pragma warning (push) -# pragma warning (disable:4251) // class 'boost::shared_ptr' needs to have dll-interface to be used by clients of class 'boost::program_options::option_description' +# pragma warning (disable:4251) // class 'boost::std::shared_ptr' needs to have dll-interface to be used by clients of class 'boost::program_options::option_description' #endif /** Boost namespace */ -namespace boost { +namespace boost { /** Namespace for the library. */ namespace program_options { @@ -67,7 +67,7 @@ namespace program_options { So, we have to use plain old pointers. Besides, users are not expected to use the constructor directly. - + The 'name' parameter is interpreted by the following rules: - if there's no "," character in 'name', it specifies long name - otherwise, the part before "," specifies long name and the part @@ -76,7 +76,7 @@ namespace program_options { option_description(const char* name, const value_semantic* s); - /** Initializes the class with the passed data. + /** Initializes the class with the passed data. */ option_description(const char* name, const value_semantic* s, @@ -118,9 +118,9 @@ namespace program_options { const std::string& description() const; /// Semantic of option's value - shared_ptr semantic() const; - - /// Returns the option name, formatted suitably for usage message. + std::shared_ptr semantic() const; + + /// Returns the option name, formatted suitably for usage message. std::string format_name() const; /** Returns the parameter name and properties, formatted suitably for @@ -128,19 +128,19 @@ namespace program_options { std::string format_parameter() const; private: - + option_description& set_name(const char* name); std::string m_short_name, m_long_name, m_description; - // shared_ptr is needed to simplify memory management in + // std::shared_ptr is needed to simplify memory management in // copy ctor and destructor. - shared_ptr m_value_semantic; + std::shared_ptr m_value_semantic; }; class options_description; - /** Class which provides convenient creation syntax to option_description. - */ + /** Class which provides convenient creation syntax to option_description. + */ class BOOST_PROGRAM_OPTIONS_DECL options_description_easy_init { public: options_description_easy_init(options_description* owner); @@ -152,12 +152,12 @@ namespace program_options { options_description_easy_init& operator()(const char* name, const value_semantic* s); - + options_description_easy_init& operator()(const char* name, const value_semantic* s, const char* description); - + private: options_description* owner; }; @@ -166,14 +166,14 @@ namespace program_options { /** A set of option descriptions. This provides convenient interface for adding new option (the add_options) method, and facilities to search for options by name. - + See @ref a_adding_options "here" for option adding interface discussion. @sa option_description */ class BOOST_PROGRAM_OPTIONS_DECL options_description { public: static const unsigned m_default_line_length; - + /** Creates the instance. */ options_description(unsigned line_length = m_default_line_length, unsigned min_description_length = m_default_line_length / 2); @@ -188,11 +188,11 @@ namespace program_options { unsigned line_length = m_default_line_length, unsigned min_description_length = m_default_line_length / 2); /** Adds new variable description. Throws duplicate_variable_error if - either short or long name matches that of already present one. + either short or long name matches that of already present one. */ - void add(shared_ptr desc); + void add(std::shared_ptr desc); /** Adds a group of option description. This has the same - effect as adding all option_descriptions in 'desc' + effect as adding all option_descriptions in 'desc' individually, except that output operator will show a separate group. Returns *this. @@ -202,29 +202,29 @@ namespace program_options { public: /** Returns an object of implementation-defined type suitable for adding options to options_description. The returned object will - have overloaded operator() with parameter type matching + have overloaded operator() with parameter type matching 'option_description' constructors. Calling the operator will create new option_description instance and add it. */ options_description_easy_init add_options(); - const option_description& find(const std::string& name, - bool approx, + const option_description& find(const std::string& name, + bool approx, bool long_ignore_case = false, bool short_ignore_case = false) const; - const option_description* find_nothrow(const std::string& name, + const option_description* find_nothrow(const std::string& name, bool approx, bool long_ignore_case = false, bool short_ignore_case = false) const; - const std::vector< shared_ptr >& options() const; + const std::vector< std::shared_ptr >& options() const; /** Produces a human readable output of 'desc', listing options, their descriptions and allowed parameters. Other options_description instances previously passed to add will be output separately. */ - friend BOOST_PROGRAM_OPTIONS_DECL std::ostream& operator<<(std::ostream& os, + friend BOOST_PROGRAM_OPTIONS_DECL std::ostream& operator<<(std::ostream& os, const options_description& desc); /** Outputs 'desc' to the specified stream, calling 'f' to output each @@ -233,7 +233,7 @@ namespace program_options { private: typedef std::map::const_iterator name2index_iterator; - typedef std::pair + typedef std::pair approximation_range; //approximation_range find_approximation(const std::string& prefix) const; @@ -241,11 +241,11 @@ namespace program_options { std::string m_caption; const unsigned m_line_length; const unsigned m_min_description_length; - + // Data organization is chosen because: // - there could be two names for one option // - option_add_proxy needs to know the last added option - std::vector< shared_ptr > m_options; + std::vector< std::shared_ptr > m_options; // Whether the option comes from one of declared groups. #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, BOOST_TESTED_AT(313)) @@ -256,7 +256,7 @@ namespace program_options { std::vector belong_to_group; #endif - std::vector< shared_ptr > groups; + std::vector< std::shared_ptr > groups; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/variables_map.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/variables_map.hpp index be0a4b64..47811f78 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/variables_map.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/program_options/variables_map.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -31,35 +31,35 @@ namespace boost { namespace program_options { // forward declaration - /** Stores in 'm' all options that are defined in 'options'. + /** Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value - is not changed, even if 'options' specify some value. + is not changed, even if 'options' specify some value. */ - BOOST_PROGRAM_OPTIONS_DECL + BOOST_PROGRAM_OPTIONS_DECL void store(const basic_parsed_options& options, variables_map& m, bool utf8 = false); - /** Stores in 'm' all options that are defined in 'options'. + /** Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value - is not changed, even if 'options' specify some value. + is not changed, even if 'options' specify some value. This is wide character variant. */ - BOOST_PROGRAM_OPTIONS_DECL - void store(const basic_parsed_options& options, + BOOST_PROGRAM_OPTIONS_DECL + void store(const basic_parsed_options& options, variables_map& m); /** Runs all 'notify' function for options in 'm'. */ BOOST_PROGRAM_OPTIONS_DECL void notify(variables_map& m); - /** Class holding value of option. Contains details about how the + /** Class holding value of option. Contains details about how the value is set and allows to conveniently obtain the value. */ class BOOST_PROGRAM_OPTIONS_DECL variable_value { public: variable_value() : m_defaulted(false) {} - variable_value(const boost::any& xv, bool xdefaulted) - : v(xv), m_defaulted(xdefaulted) + variable_value(const boost::any& xv, bool xdefaulted) + : v(xv), m_defaulted(xdefaulted) {} /** If stored value if of type T, returns that value. Otherwise, @@ -92,10 +92,10 @@ namespace boost { namespace program_options { // they are known only after all sources are stored. By that // time options_description for the first source might not // be easily accessible, so we need to store semantic here. - shared_ptr m_value_semantic; + std::shared_ptr m_value_semantic; friend BOOST_PROGRAM_OPTIONS_DECL - void store(const basic_parsed_options& options, + void store(const basic_parsed_options& options, variables_map& m, bool); friend BOOST_PROGRAM_OPTIONS_DECL class variables_map; @@ -138,8 +138,8 @@ namespace boost { namespace program_options { const abstract_variables_map* m_next; }; - /** Concrete variables map which store variables in real map. - + /** Concrete variables map which store variables in real map. + This class is derived from std::map, so you can use all map operators to examine its content. */ @@ -155,8 +155,8 @@ namespace boost { namespace program_options { { return abstract_variables_map::operator[](name); } // Override to clear some extra fields. - void clear(); - + void clear(); + void notify(); private: @@ -169,10 +169,10 @@ namespace boost { namespace program_options { std::set m_final; friend BOOST_PROGRAM_OPTIONS_DECL - void store(const basic_parsed_options& options, + void store(const basic_parsed_options& options, variables_map& xm, bool utf8); - + /** Names of required options, filled by parser which has access to options_description. The map values are the "canonical" names for each corresponding option. diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/dynamic_property_map.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/dynamic_property_map.hpp index f5f4230e..e470ad0e 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/dynamic_property_map.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/dynamic_property_map.hpp @@ -206,9 +206,9 @@ private: // struct dynamic_properties { - typedef std::multimap > + typedef std::multimap > property_maps_type; - typedef boost::function3, + typedef boost::function3, const std::string&, const boost::any&, const boost::any&> generate_fn_type; @@ -226,7 +226,7 @@ public: dynamic_properties& property(const std::string& name, PropertyMap property_map_) { - boost::shared_ptr pm( + boost::std::shared_ptr pm( boost::static_pointer_cast( boost::make_shared >(property_map_))); property_maps.insert(property_maps_type::value_type(name, pm)); @@ -246,13 +246,13 @@ public: { return property_maps.lower_bound(name); } void - insert(const std::string& name, boost::shared_ptr pm) + insert(const std::string& name, boost::std::shared_ptr pm) { property_maps.insert(property_maps_type::value_type(name, pm)); } template - boost::shared_ptr + boost::std::shared_ptr generate(const std::string& name, const Key& key, const Value& value) { if(!generate_fn) { @@ -280,7 +280,7 @@ put(const std::string& name, dynamic_properties& dp, const Key& key, } } - boost::shared_ptr new_map = dp.generate(name, key, value); + boost::std::shared_ptr new_map = dp.generate(name, key, value); if (new_map.get()) { new_map->put(key, value); dp.insert(name, new_map); @@ -290,7 +290,7 @@ put(const std::string& name, dynamic_properties& dp, const Key& key, } } -#ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS +#ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS template Value get(const std::string& name, const dynamic_properties& dp, const Key& key) @@ -333,11 +333,11 @@ get(const std::string& name, const dynamic_properties& dp, const Key& key) // The easy way to ignore properties. inline -boost::shared_ptr +boost::std::shared_ptr ignore_other_properties(const std::string&, const boost::any&, const boost::any&) { - return boost::shared_ptr(); + return boost::std::shared_ptr(); } } // namespace boost diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/distributed_property_map.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/distributed_property_map.hpp index c34e073e..b39202ed 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/distributed_property_map.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/distributed_property_map.hpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include @@ -93,10 +93,10 @@ namespace detail { template static inline void do_put(PropertyMap pm, const Key& key, const Value& value) - { + { using boost::put; - put(pm, key, value); + put(pm, key, value); } }; @@ -240,7 +240,7 @@ class distributed_property_map property_map_put, /** A request to retrieve a particular value in a property - * map. The message contains a key. The owner of that key will + * map. The message contains a key. The owner of that key will * reply with a value. */ property_map_get, @@ -377,7 +377,7 @@ class distributed_property_map reference operator[](const key_type& key) const { owner_local_pair p = get(data->global, key); - + if (p.first == process_id(data->process_group)) { return data->storage[p.second]; } else { @@ -397,11 +397,11 @@ class distributed_property_map * \internal * */ - void + void request_put(process_id_type p, const key_type& k, const value_type& v) const - { - send(data->process_group, p, property_map_put, - boost::parallel::detail::make_untracked_pair(k, v)); + { + send(data->process_group, p, property_map_put, + boost::parallel::detail::make_untracked_pair(k, v)); } /** Access the ghost cell for the given key. @@ -419,11 +419,11 @@ class distributed_property_map struct data_t { - data_t(const ProcessGroup& pg, const GlobalMap& global, + data_t(const ProcessGroup& pg, const GlobalMap& global, const StorageMap& pm, const function1& dv, bool has_default_resolver) - : process_group(pg), global(global), storage(pm), - ghost_cells(), max_ghost_cells(1000000), get_default_value(dv), + : process_group(pg), global(global), storage(pm), + ghost_cells(), max_ghost_cells(1000000), get_default_value(dv), has_default_resolver(has_default_resolver), model(cm_forward) { } /// The process group @@ -437,7 +437,7 @@ class distributed_property_map StorageMap storage; /// The ghost cells - shared_ptr ghost_cells; + std::shared_ptr ghost_cells; /// The maximum number of ghost cells we are permitted to hold. If /// zero, we are permitted to have an infinite number of ghost @@ -478,7 +478,7 @@ class distributed_property_map }; friend struct data_t; - shared_ptr data; + std::shared_ptr data; private: // Prunes the least recently used ghost cells until we have @c @@ -493,36 +493,36 @@ class distributed_property_map template struct handle_message { - explicit handle_message(const shared_ptr& data, + explicit handle_message(const std::shared_ptr& data, const Reduce& reduce = Reduce()) : data_ptr(data), reduce(reduce) { } void operator()(process_id_type source, int tag); /// Individual message handlers - void - handle_put(int source, int tag, - const boost::parallel::detail::untracked_pair& data, + void + handle_put(int source, int tag, + const boost::parallel::detail::untracked_pair& data, trigger_receive_context); value_type - handle_get(int source, int tag, const key_type& data, + handle_get(int source, int tag, const key_type& data, trigger_receive_context); void - handle_multiget(int source, int tag, + handle_multiget(int source, int tag, const std::vector& data, trigger_receive_context); void handle_multiget_reply - (int source, int tag, + (int source, int tag, const std::vector >& msg, trigger_receive_context); void handle_multiput - (int source, int tag, + (int source, int tag, const std::vector >& data, trigger_receive_context); @@ -537,7 +537,7 @@ class distributed_property_map bidirectional consistency. */ struct on_synchronize { - explicit on_synchronize(const shared_ptr& data) : data_ptr(data) { } + explicit on_synchronize(const std::shared_ptr& data) : data_ptr(data) { } void operator()(); @@ -581,7 +581,7 @@ get(const PBGL_DISTRIB_PMAP& pm, { using boost::get; - typename property_traits::value_type p = + typename property_traits::value_type p = get(pm.data->global, key); if (p.first == process_id(pm.data->process_group)) { @@ -609,13 +609,13 @@ put(const PBGL_DISTRIB_PMAP& pm, { using boost::put; - typename property_traits::value_type p = + typename property_traits::value_type p = get(pm.data->global, key); if (p.first == process_id(pm.data->process_group)) { put(pm.data->storage, p.second, value); } else { - if (pm.data->model & cm_forward) + if (pm.data->model & cm_forward) pm.request_put(p.first, key, value); pm.cell(key, false) = value; @@ -637,7 +637,7 @@ local_put(const PBGL_DISTRIB_PMAP& pm, { using boost::put; - typename property_traits::value_type p = + typename property_traits::value_type p = get(pm.data->global, key); if (p.first == process_id(pm.data->process_group)) @@ -669,7 +669,7 @@ synchronize(PBGL_DISTRIB_PMAP& pm) /// Create a distributed property map. template inline distributed_property_map -make_distributed_property_map(const ProcessGroup& pg, GlobalMap global, +make_distributed_property_map(const ProcessGroup& pg, GlobalMap global, StorageMap storage) { typedef distributed_property_map @@ -680,10 +680,10 @@ make_distributed_property_map(const ProcessGroup& pg, GlobalMap global, /** * \overload */ -template inline distributed_property_map -make_distributed_property_map(const ProcessGroup& pg, GlobalMap global, +make_distributed_property_map(const ProcessGroup& pg, GlobalMap global, StorageMap storage, Reduce reduce) { typedef distributed_property_map diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/global_index_map.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/global_index_map.hpp index e40d27a0..eae5d112 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/global_index_map.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/global_index_map.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include namespace boost { namespace parallel { @@ -29,7 +29,7 @@ public: typedef readable_property_map_tag category; template - global_index_map(ProcessGroup pg, value_type num_local_indices, + global_index_map(ProcessGroup pg, value_type num_local_indices, IndexMap index_map, GlobalMap global) : index_map(index_map), global(global) { @@ -37,7 +37,7 @@ public: starting_index.reset(new std::vector(num_processes(pg) + 1)); send(pg, 0, 0, num_local_indices); synchronize(pg); - + // Populate starting_index in all processes if (process_id(pg) == 0) { (*starting_index)[0] = 0; @@ -55,7 +55,7 @@ public: } } - friend inline value_type + friend inline value_type get(const global_index_map& gim, const key_type& x) { using boost::get; @@ -64,7 +64,7 @@ public: } private: - shared_ptr > starting_index; + std::shared_ptr > starting_index; IndexMap index_map; GlobalMap global; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/impl/distributed_property_map.ipp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/impl/distributed_property_map.ipp index ef20817f..d47d6856 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/impl/distributed_property_map.ipp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/parallel/impl/distributed_property_map.ipp @@ -41,7 +41,7 @@ PBGL_DISTRIB_PMAP::~distributed_property_map() { } template template -void +void PBGL_DISTRIB_PMAP::set_reduce(const Reduce& reduce) { typedef handle_message Handler; @@ -69,7 +69,7 @@ void PBGL_DISTRIB_PMAP::prune_ghost_cells() const // We need to flush values when we evict them. boost::parallel::detail::untracked_pair const& victim = data->ghost_cells->back(); - send(data->process_group, get(data->global, victim.first).first, + send(data->process_group, get(data->global, victim.first).first, property_map_put, victim); } @@ -83,11 +83,11 @@ typename PBGL_DISTRIB_PMAP::value_type& PBGL_DISTRIB_PMAP::cell(const key_type& key, bool request_if_missing) const { // Index by key - ghost_cells_key_index_type const& key_index + ghost_cells_key_index_type const& key_index = data->ghost_cells->template get<1>(); // Search for the ghost cell by key, and project back to the sequence - iterator ghost_cell + iterator ghost_cell = data->ghost_cells->template project<0>(key_index.find(key)); if (ghost_cell == data->ghost_cells->end()) { value_type value; @@ -97,13 +97,13 @@ PBGL_DISTRIB_PMAP::cell(const key_type& key, bool request_if_missing) const value = data->get_default_value(key); else if (request_if_missing) // Request the actual value of this key from its owner - send_oob_with_reply(data->process_group, get(data->global, key).first, + send_oob_with_reply(data->process_group, get(data->global, key).first, property_map_get, key, value); else value = value_type(); // Create a ghost cell containing the new value - ghost_cell + ghost_cell = data->ghost_cells->push_front(std::make_pair(key, value)).first; // If we need to, prune the ghost cells @@ -129,12 +129,12 @@ template template void PBGL_DISTRIB_PMAP::handle_message:: -handle_put(int /*source*/, int /*tag*/, +handle_put(int /*source*/, int /*tag*/, const boost::parallel::detail::untracked_pair& req, trigger_receive_context) { using boost::get; - shared_ptr data(data_ptr); + std::shared_ptr data(data_ptr); owner_local_pair p = get(data->global, req.first); BOOST_ASSERT(p.first == process_id(data->process_group)); @@ -149,12 +149,12 @@ template template typename PBGL_DISTRIB_PMAP::value_type PBGL_DISTRIB_PMAP::handle_message:: -handle_get(int source, int /*tag*/, const key_type& key, +handle_get(int source, int /*tag*/, const key_type& key, trigger_receive_context) { using boost::get; - shared_ptr data(data_ptr); + std::shared_ptr data(data_ptr); BOOST_ASSERT(data); owner_local_pair p = get(data->global, key); @@ -168,7 +168,7 @@ PBGL_DISTRIB_PMAP::handle_message:: handle_multiget(int source, int tag, const std::vector& keys, trigger_receive_context) { - shared_ptr data(data_ptr); + std::shared_ptr data(data_ptr); BOOST_ASSERT(data); typedef boost::parallel::detail::untracked_pair key_value; @@ -190,15 +190,15 @@ template void PBGL_DISTRIB_PMAP::handle_message:: handle_multiget_reply - (int source, int tag, + (int source, int tag, const std::vector >& msg, trigger_receive_context) { - shared_ptr data(data_ptr); + std::shared_ptr data(data_ptr); BOOST_ASSERT(data); // Index by key - ghost_cells_key_index_type const& key_index + ghost_cells_key_index_type const& key_index = data->ghost_cells->template get<1>(); std::size_t n = msg.size(); @@ -217,13 +217,13 @@ template void PBGL_DISTRIB_PMAP::handle_message:: handle_multiput - (int source, int tag, + (int source, int tag, const std::vector >& values, trigger_receive_context) { using boost::get; - shared_ptr data(data_ptr); + std::shared_ptr data(data_ptr); BOOST_ASSERT(data); std::size_t n = values.size(); @@ -247,11 +247,11 @@ setup_triggers(process_group_type& pg) simple_trigger(pg, property_map_put, this, &handle_message::handle_put); simple_trigger(pg, property_map_get, this, &handle_message::handle_get); - simple_trigger(pg, property_map_multiget, this, + simple_trigger(pg, property_map_multiget, this, &handle_message::handle_multiget); - simple_trigger(pg, property_map_multiget_reply, this, + simple_trigger(pg, property_map_multiget_reply, this, &handle_message::handle_multiget_reply); - simple_trigger(pg, property_map_multiput, this, + simple_trigger(pg, property_map_multiput, this, &handle_message::handle_multiput); } @@ -261,7 +261,7 @@ PBGL_DISTRIB_PMAP ::on_synchronize::operator()() { int stage=0; // we only get called at the start now - shared_ptr data(data_ptr); + std::shared_ptr data(data_ptr); BOOST_ASSERT(data); // Determine in which stage backward consistency messages should be sent. @@ -371,7 +371,7 @@ void PBGL_DISTRIB_PMAP::data_t::refresh_ghost_cells() for (process_size_type p = (id + 1) % n ; p != id ; p = (p + 1) % n) { if (!keys[p].empty()) send(process_group, p, property_map_multiget, keys[p]); - } + } } template diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/vector_property_map.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/vector_property_map.hpp index a97fb810..46d7924a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/vector_property_map.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/property_map/vector_property_map.hpp @@ -11,29 +11,29 @@ #define VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04 #include -#include +#include #include namespace boost { template class vector_property_map - : public boost::put_get_helper< - typename std::iterator_traits< + : public boost::put_get_helper< + typename std::iterator_traits< typename std::vector::iterator >::reference, vector_property_map > { public: typedef typename property_traits::key_type key_type; typedef T value_type; - typedef typename std::iterator_traits< + typedef typename std::iterator_traits< typename std::vector::iterator >::reference reference; typedef boost::lvalue_property_map_tag category; - + vector_property_map(const IndexMap& index = IndexMap()) : store(new std::vector()), index(index) {} - vector_property_map(unsigned initial_size, + vector_property_map(unsigned initial_size, const IndexMap& index = IndexMap()) : store(new std::vector(initial_size)), index(index) {} @@ -57,15 +57,15 @@ namespace boost { { return store->end(); } - + IndexMap& get_index_map() { return index; } const IndexMap& get_index_map() const { return index; } - + public: // Copy ctor absent, default semantics is OK. // Assignment operator absent, default semantics is OK. // CONSIDER: not sure that assignment to 'index' is correct. - + reference operator[](const key_type& v) const { typename property_traits::value_type i = get(index, v); if (static_cast(i) >= store->size()) { @@ -74,16 +74,16 @@ namespace boost { return (*store)[i]; } private: - // Conceptually, we have a vector of infinite size. For practical + // Conceptually, we have a vector of infinite size. For practical // purposes, we start with an empty vector and grow it as needed. // Note that we cannot store pointer to vector here -- we cannot // store pointer to data, because if copy of property map resizes - // the vector, the pointer to data will be invalidated. + // the vector, the pointer to data will be invalidated. // I wonder if class 'pmap_ref' is simply needed. - shared_ptr< std::vector > store; + std::shared_ptr< std::vector > store; IndexMap index; }; - + template vector_property_map make_vector_property_map(IndexMap index) @@ -103,15 +103,15 @@ namespace boost { * This specialization of @ref vector_property_map builds a * distributed vector property map given the local index maps * generated by distributed graph types that automatically have index - * properties. + * properties. * * This specialization is useful when creating external distributed * property maps via the same syntax used to create external * sequential property maps. */ -template -class vector_property_map > : public parallel::distributed_property_map< @@ -119,7 +119,7 @@ class vector_property_map local_iterator_map; - typedef parallel::distributed_property_map inherited; typedef local_property_map index_map_type; @@ -129,7 +129,7 @@ public: : inherited(index.process_group(), index.global(), local_iterator_map(index.base())) { } - vector_property_map(unsigned inital_size, + vector_property_map(unsigned inital_size, const index_map_type& index = index_map_type()) : inherited(index.process_group(), index.global(), local_iterator_map(inital_size, index.base())) { } @@ -140,31 +140,31 @@ public: * This specialization of @ref vector_property_map builds a * distributed vector property map given the local index maps * generated by distributed graph types that automatically have index - * properties. + * properties. * * This specialization is useful when creating external distributed * property maps via the same syntax used to create external * sequential property maps. */ -template class vector_property_map< - T, + T, parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap > - > + > : public parallel::distributed_property_map< ProcessGroup, GlobalMap, vector_property_map > { typedef vector_property_map local_iterator_map; - typedef parallel::distributed_property_map inherited; - typedef parallel::distributed_property_map index_map_type; @@ -173,7 +173,7 @@ public: : inherited(index.process_group(), index.global(), local_iterator_map(index.base())) { } - vector_property_map(unsigned inital_size, + vector_property_map(unsigned inital_size, const index_map_type& index = index_map_type()) : inherited(index.process_group(), index.global(), local_iterator_map(inital_size, index.base())) { } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/ptr_container/clone_allocator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/ptr_container/clone_allocator.hpp index 6d396e80..f0842884 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/ptr_container/clone_allocator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/ptr_container/clone_allocator.hpp @@ -19,9 +19,9 @@ namespace boost { ///////////////////////////////////////////////////////////////////////// - // Clonable concept + // Clonable concept ///////////////////////////////////////////////////////////////////////// - + template< class T > inline T* new_clone( const T& r ) { @@ -43,13 +43,13 @@ namespace boost return r ? new_clone( *r ) : 0; } - // + // // @remark: to make new_clone() work - // with scope_ptr/shared_ptr ect. + // with scope_ptr/std::shared_ptr ect. // simply overload for those types // in the appropriate namespace. - // - + // + template< class T > inline void delete_clone( const T* r ) { @@ -59,7 +59,7 @@ namespace boost ///////////////////////////////////////////////////////////////////////// // CloneAllocator concept ///////////////////////////////////////////////////////////////////////// - + struct heap_clone_allocator { template< class U > @@ -77,7 +77,7 @@ namespace boost }; - + struct view_clone_allocator { template< class U > diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registered.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registered.hpp index 2404cb0f..36816b1f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registered.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registered.hpp @@ -16,12 +16,12 @@ namespace boost { -// You'll see shared_ptr mentioned in this header because we need to +// You'll see std::shared_ptr mentioned in this header because we need to // note which types are shared_ptrs in their registrations, to -// implement special shared_ptr handling for rvalue conversions. -template class shared_ptr; +// implement special std::shared_ptr handling for rvalue conversions. +template class std::shared_ptr; -namespace python { namespace converter { +namespace python { namespace converter { struct registration; @@ -64,23 +64,23 @@ namespace detail register_shared_ptr0(...) { } - + template inline void - register_shared_ptr0(shared_ptr*) + register_shared_ptr0(std::shared_ptr*) { - registry::lookup_shared_ptr(type_id >()); + registry::lookup_shared_ptr(type_id >()); } - + template inline void register_shared_ptr1(T const volatile*) { detail::register_shared_ptr0((T*)0); } - + template - inline registration const& + inline registration const& registry_lookup2(T&(*)()) { detail::register_shared_ptr1((T*)0); @@ -88,13 +88,13 @@ namespace detail } template - inline registration const& + inline registration const& registry_lookup1(type) { return registry_lookup2((T(*)())0); } - inline registration const& + inline registration const& registry_lookup1(type) { detail::register_shared_ptr1((void*)0); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registrations.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registrations.hpp index 7ef74e8f..2c88b7ad 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registrations.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registrations.hpp @@ -15,7 +15,7 @@ # include -namespace boost { namespace python { namespace converter { +namespace boost { namespace python { namespace converter { struct lvalue_from_python_chain { @@ -36,7 +36,7 @@ struct BOOST_PYTHON_DECL registration public: // member functions explicit registration(type_info target, bool is_shared_ptr = false); ~registration(); - + // Convert the appropriately-typed data to Python PyObject* to_python(void const volatile*) const; @@ -44,7 +44,7 @@ struct BOOST_PYTHON_DECL registration // exception if no class has been registered. PyTypeObject* get_class_object() const; - // Return common denominator of the python class objects, + // Return common denominator of the python class objects, // convertable to target. Inspects the m_class_object and the value_chains. PyTypeObject const* expected_from_python_type() const; PyTypeObject const* to_python_target_type() const; @@ -57,7 +57,7 @@ struct BOOST_PYTHON_DECL registration // The chain of eligible from_python converters when an rvalue is acceptable rvalue_from_python_chain* rvalue_chain; - + // The class object associated with this type PyTypeObject* m_class_object; @@ -66,14 +66,14 @@ struct BOOST_PYTHON_DECL registration PyTypeObject const* (*m_to_python_target_type)(); - // True iff this type is a shared_ptr. Needed for special rvalue + // True iff this type is a std::shared_ptr. Needed for special rvalue // from_python handling. const bool is_shared_ptr; # if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) private: void operator=(registration); // This is not defined, and just keeps MWCW happy. -# endif +# endif }; // diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registry.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registry.hpp index 368adcc6..f09356d6 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registry.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/registry.hpp @@ -21,12 +21,12 @@ namespace registry BOOST_PYTHON_DECL registration const& lookup(type_info); // Get the registration corresponding to the type, creating it if - // necessary. Use this first when the type is a shared_ptr. + // necessary. Use this first when the type is a std::shared_ptr. BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info); // Return a pointer to the corresponding registration, if one exists BOOST_PYTHON_DECL registration const* query(type_info); - + BOOST_PYTHON_DECL void insert(to_python_function_t, type_info, PyTypeObject const* (*to_python_target_type)() = 0); // Insert an lvalue from_python converter @@ -39,7 +39,7 @@ namespace registry , type_info , PyTypeObject const* (*expected_pytype)() = 0 ); - + // Insert an rvalue from_python converter at the tail of the // chain. Used for implicit conversions BOOST_PYTHON_DECL void push_back( diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/shared_ptr_from_python.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/shared_ptr_from_python.hpp index c0910776..d7905d2c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/shared_ptr_from_python.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/shared_ptr_from_python.hpp @@ -13,16 +13,16 @@ #ifndef BOOST_PYTHON_NO_PY_SIGNATURES # include #endif -# include +# include -namespace boost { namespace python { namespace converter { +namespace boost { namespace python { namespace converter { template struct shared_ptr_from_python { shared_ptr_from_python() { - converter::registry::insert(&convertible, &construct, type_id >() + converter::registry::insert(&convertible, &construct, type_id >() #ifndef BOOST_PYTHON_NO_PY_SIGNATURES , &converter::expected_from_python_type_direct::get_pytype #endif @@ -34,26 +34,26 @@ struct shared_ptr_from_python { if (p == Py_None) return p; - + return converter::get_lvalue_from_python(p, registered::converters); } - + static void construct(PyObject* source, rvalue_from_python_stage1_data* data) { - void* const storage = ((converter::rvalue_from_python_storage >*)data)->storage.bytes; + void* const storage = ((converter::rvalue_from_python_storage >*)data)->storage.bytes; // Deal with the "None" case. if (data->convertible == source) - new (storage) shared_ptr(); + new (storage) std::shared_ptr(); else { - boost::shared_ptr hold_convertible_ref_count( + boost::std::shared_ptr hold_convertible_ref_count( (void*)0, shared_ptr_deleter(handle<>(borrowed(source))) ); // use aliasing constructor - new (storage) shared_ptr( + new (storage) std::shared_ptr( hold_convertible_ref_count, static_cast(data->convertible)); } - + data->convertible = storage; } }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/shared_ptr_to_python.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/shared_ptr_to_python.hpp index fe867ace..cba75647 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/shared_ptr_to_python.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/converter/shared_ptr_to_python.hpp @@ -7,20 +7,20 @@ # include # include -# include +# include # include -namespace boost { namespace python { namespace converter { +namespace boost { namespace python { namespace converter { template -PyObject* shared_ptr_to_python(shared_ptr const& x) +PyObject* shared_ptr_to_python(std::shared_ptr const& x) { if (!x) return python::detail::none(); else if (shared_ptr_deleter* d = boost::get_deleter(x)) return incref( get_pointer( d->owner ) ); else - return converter::registered const&>::converters.to_python(&x); + return converter::registered const&>::converters.to_python(&x); } }}} // namespace boost::python::converter diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/detail/is_shared_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/detail/is_shared_ptr.hpp index 547af3f1..ae94c900 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/detail/is_shared_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/detail/is_shared_ptr.hpp @@ -6,12 +6,12 @@ # define IS_SHARED_PTR_DWA2003224_HPP # include -# include +# include -namespace boost { namespace python { namespace detail { +namespace boost { namespace python { namespace detail { + +BOOST_PYTHON_IS_XXX_DEF(std::shared_ptr, std::shared_ptr, 1) -BOOST_PYTHON_IS_XXX_DEF(shared_ptr, shared_ptr, 1) - }}} // namespace boost::python::detail #endif // IS_SHARED_PTR_DWA2003224_HPP diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/detail/value_is_shared_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/detail/value_is_shared_ptr.hpp index 361c369b..f2952cbb 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/detail/value_is_shared_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/detail/value_is_shared_ptr.hpp @@ -6,12 +6,12 @@ # define VALUE_IS_SHARED_PTR_DWA2003224_HPP # include -# include +# include -namespace boost { namespace python { namespace detail { +namespace boost { namespace python { namespace detail { + +BOOST_PYTHON_VALUE_IS_XXX_DEF(std::shared_ptr, std::shared_ptr, 1) -BOOST_PYTHON_VALUE_IS_XXX_DEF(shared_ptr, shared_ptr, 1) - }}} // namespace boost::python::detail #endif // VALUE_IS_SHARED_PTR_DWA2003224_HPP diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/instance_holder.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/instance_holder.hpp index 933f50d1..86d82964 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/instance_holder.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/instance_holder.hpp @@ -11,7 +11,7 @@ # include # include -namespace boost { namespace python { +namespace boost { namespace python { // Base class for all holders struct BOOST_PYTHON_DECL instance_holder : private noncopyable @@ -19,13 +19,13 @@ struct BOOST_PYTHON_DECL instance_holder : private noncopyable public: instance_holder(); virtual ~instance_holder(); - + // return the next holder in a chain instance_holder* next() const; // When the derived holder actually holds by [smart] pointer and // null_ptr_only is set, only report that the type is held when - // the pointer is null. This is needed for proper shared_ptr + // the pointer is null. This is needed for proper std::shared_ptr // support, to prevent holding shared_ptrs from being found when // converting from python so that we can use the conversion method // that always holds the Python object. @@ -34,7 +34,7 @@ struct BOOST_PYTHON_DECL instance_holder : private noncopyable void install(PyObject* inst) throw(); // These functions should probably be located elsewhere. - + // Allocate storage for an object of the given size at the given // offset in the Python instance<> object if bytes are available // there. Otherwise allocate size bytes of heap memory. diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/object/find_instance.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/object/find_instance.hpp index 3202c1cd..76b57a0f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/object/find_instance.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/object/find_instance.hpp @@ -7,12 +7,12 @@ # include -namespace boost { namespace python { namespace objects { +namespace boost { namespace python { namespace objects { // Given a type_id, find the instance data which corresponds to it, or // return 0 in case no such type is held. If null_shared_ptr_only is -// true and the type being sought is a shared_ptr, only find an -// instance if it turns out to be NULL. Needed for shared_ptr rvalue +// true and the type being sought is a std::shared_ptr, only find an +// instance if it turns out to be NULL. Needed for std::shared_ptr rvalue // from_python support. BOOST_PYTHON_DECL void* find_instance_impl(PyObject*, type_info, bool null_shared_ptr_only = false); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/object/inheritance.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/object/inheritance.hpp index b49a0442..948baa42 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/object/inheritance.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/object/inheritance.hpp @@ -6,7 +6,7 @@ # define INHERITANCE_DWA200216_HPP # include -# include +# include # include # include # include @@ -88,7 +88,7 @@ struct dynamic_cast_generator return dynamic_cast( static_cast(source)); } - + }; template diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/to_python_indirect.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/to_python_indirect.hpp index 23ad0263..df660a3a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/to_python_indirect.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/to_python_indirect.hpp @@ -23,9 +23,9 @@ # include -# if defined(__ICL) && __ICL < 600 -# include -# else +# if defined(__ICL) && __ICL < 600 +# include +# else # include # endif @@ -57,7 +57,7 @@ struct to_python_indirect else return this->execute(*ptr, mpl::false_()); } - + template inline PyObject* execute(U const& x, mpl::false_) const { @@ -84,9 +84,9 @@ namespace detail // can't use auto_ptr with Intel 5 and VC6 Dinkum library // for some reason. We get link errors against the auto_ptr // copy constructor. -# if defined(__ICL) && __ICL < 600 - typedef boost::shared_ptr smart_pointer; -# else +# if defined(__ICL) && __ICL < 600 + typedef boost::std::shared_ptr smart_pointer; +# else typedef std::auto_ptr smart_pointer; # endif typedef objects::pointer_holder holder_t; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/to_python_value.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/to_python_value.hpp index a48948d2..1628a93b 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/to_python_value.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/python/to_python_value.hpp @@ -26,7 +26,7 @@ # include # include -namespace boost { namespace python { +namespace boost { namespace python { namespace detail { @@ -58,7 +58,7 @@ struct object_manager_get_pytype struct object_manager_to_python_value { typedef typename value_arg::type argument_type; - + PyObject* operator()(argument_type) const; #ifndef BOOST_PYTHON_NO_PY_SIGNATURES typedef boost::mpl::bool_::value> is_t_handle; @@ -68,13 +68,13 @@ struct object_manager_get_pytype } inline static PyTypeObject const* get_pytype_aux(mpl::true_*) {return converter::object_manager_traits::get_pytype();} - - inline static PyTypeObject const* get_pytype_aux(mpl::false_* ) + + inline static PyTypeObject const* get_pytype_aux(mpl::false_* ) { return object_manager_get_pytype::get((T(*)())0); } - -#endif + +#endif // This information helps make_getter() decide whether to try to // return an internal reference or not. I don't like it much, @@ -82,12 +82,12 @@ struct object_manager_get_pytype BOOST_STATIC_CONSTANT(bool, uses_registry = false); }; - + template struct registry_to_python_value { typedef typename value_arg::type argument_type; - + PyObject* operator()(argument_type) const; #ifndef BOOST_PYTHON_NO_PY_SIGNATURES PyTypeObject const* get_pytype() const {return converter::registered::converters.to_python_target_type();} @@ -103,11 +103,11 @@ struct object_manager_get_pytype struct shared_ptr_to_python_value { typedef typename value_arg::type argument_type; - + PyObject* operator()(argument_type) const; #ifndef BOOST_PYTHON_NO_PY_SIGNATURES PyTypeObject const* get_pytype() const {return get_pytype((boost::type*)0);} -#endif +#endif // This information helps make_getter() decide whether to try to // return an internal reference or not. I don't like it much, // but it will have to serve for now. @@ -115,9 +115,9 @@ struct object_manager_get_pytype private: #ifndef BOOST_PYTHON_NO_PY_SIGNATURES template - PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} + PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} template - PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} + PyTypeObject const* get_pytype(boost::type &> *) const {return converter::registered::converters.to_python_target_type();} #endif }; } @@ -140,7 +140,7 @@ struct to_python_value }; // -// implementation +// implementation // namespace detail { @@ -151,7 +151,7 @@ namespace detail # if BOOST_WORKAROUND(__GNUC__, < 3) // suppresses an ICE, somehow (void)r::converters; -# endif +# endif return converter::registered::converters.to_python(&x); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/icu.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/icu.hpp index 772806e9..a3d84b74 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/icu.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/icu.hpp @@ -3,8 +3,8 @@ * Copyright (c) 2004 * John Maddock * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ @@ -36,7 +36,7 @@ namespace boost{ namespace re_detail{ -// +// // Implementation details: // class BOOST_REGEX_DECL icu_regex_traits_implementation @@ -85,9 +85,9 @@ private: boost::scoped_ptr< U_NAMESPACE_QUALIFIER Collator> m_primary_collator; // The primary collation object }; -inline boost::shared_ptr get_icu_regex_traits_implementation(const U_NAMESPACE_QUALIFIER Locale& loc) +inline boost::std::shared_ptr get_icu_regex_traits_implementation(const U_NAMESPACE_QUALIFIER Locale& loc) { - return boost::shared_ptr(new icu_regex_traits_implementation(loc)); + return boost::std::shared_ptr(new icu_regex_traits_implementation(loc)); } } @@ -208,7 +208,7 @@ private: static char_class_type lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2); - boost::shared_ptr< ::boost::re_detail::icu_regex_traits_implementation> m_pimpl; + boost::std::shared_ptr< ::boost::re_detail::icu_regex_traits_implementation> m_pimpl; }; } // namespace boost @@ -245,9 +245,9 @@ namespace re_detail{ #if !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__) template -inline u32regex do_make_u32regex(InputIterator i, - InputIterator j, - boost::regex_constants::syntax_option_type opt, +inline u32regex do_make_u32regex(InputIterator i, + InputIterator j, + boost::regex_constants::syntax_option_type opt, const boost::mpl::int_<1>*) { typedef boost::u8_to_u32_iterator conv_type; @@ -255,9 +255,9 @@ inline u32regex do_make_u32regex(InputIterator i, } template -inline u32regex do_make_u32regex(InputIterator i, - InputIterator j, - boost::regex_constants::syntax_option_type opt, +inline u32regex do_make_u32regex(InputIterator i, + InputIterator j, + boost::regex_constants::syntax_option_type opt, const boost::mpl::int_<2>*) { typedef boost::u16_to_u32_iterator conv_type; @@ -265,18 +265,18 @@ inline u32regex do_make_u32regex(InputIterator i, } template -inline u32regex do_make_u32regex(InputIterator i, - InputIterator j, - boost::regex_constants::syntax_option_type opt, +inline u32regex do_make_u32regex(InputIterator i, + InputIterator j, + boost::regex_constants::syntax_option_type opt, const boost::mpl::int_<4>*) { return u32regex(i, j, opt); } #else template -inline u32regex do_make_u32regex(InputIterator i, - InputIterator j, - boost::regex_constants::syntax_option_type opt, +inline u32regex do_make_u32regex(InputIterator i, + InputIterator j, + boost::regex_constants::syntax_option_type opt, const boost::mpl::int_<1>*) { typedef boost::u8_to_u32_iterator conv_type; @@ -294,9 +294,9 @@ inline u32regex do_make_u32regex(InputIterator i, } template -inline u32regex do_make_u32regex(InputIterator i, - InputIterator j, - boost::regex_constants::syntax_option_type opt, +inline u32regex do_make_u32regex(InputIterator i, + InputIterator j, + boost::regex_constants::syntax_option_type opt, const boost::mpl::int_<2>*) { typedef boost::u16_to_u32_iterator conv_type; @@ -314,9 +314,9 @@ inline u32regex do_make_u32regex(InputIterator i, } template -inline u32regex do_make_u32regex(InputIterator i, - InputIterator j, - boost::regex_constants::syntax_option_type opt, +inline u32regex do_make_u32regex(InputIterator i, + InputIterator j, + boost::regex_constants::syntax_option_type opt, const boost::mpl::int_<4>*) { typedef std::vector vector_type; @@ -337,8 +337,8 @@ inline u32regex do_make_u32regex(InputIterator i, // Construction from an iterator pair: // template -inline u32regex make_u32regex(InputIterator i, - InputIterator j, +inline u32regex make_u32regex(InputIterator i, + InputIterator j, boost::regex_constants::syntax_option_type opt) { return re_detail::do_make_u32regex(i, j, opt, static_cast const*>(0)); @@ -406,18 +406,18 @@ void copy_results(MR1& out, MR2 const& in) } template -inline bool do_regex_match(BidiIterator first, BidiIterator last, - match_results& m, - const u32regex& e, +inline bool do_regex_match(BidiIterator first, BidiIterator last, + match_results& m, + const u32regex& e, match_flag_type flags, boost::mpl::int_<4> const*) { return ::boost::regex_match(first, last, m, e, flags); } template -bool do_regex_match(BidiIterator first, BidiIterator last, - match_results& m, - const u32regex& e, +bool do_regex_match(BidiIterator first, BidiIterator last, + match_results& m, + const u32regex& e, match_flag_type flags, boost::mpl::int_<2> const*) { @@ -431,9 +431,9 @@ bool do_regex_match(BidiIterator first, BidiIterator last, return result; } template -bool do_regex_match(BidiIterator first, BidiIterator last, - match_results& m, - const u32regex& e, +bool do_regex_match(BidiIterator first, BidiIterator last, + match_results& m, + const u32regex& e, match_flag_type flags, boost::mpl::int_<1> const*) { @@ -449,62 +449,62 @@ bool do_regex_match(BidiIterator first, BidiIterator last, } // namespace re_detail template -inline bool u32regex_match(BidiIterator first, BidiIterator last, - match_results& m, - const u32regex& e, +inline bool u32regex_match(BidiIterator first, BidiIterator last, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_match(first, last, m, e, flags, static_cast const*>(0)); } -inline bool u32regex_match(const UChar* p, - match_results& m, - const u32regex& e, +inline bool u32regex_match(const UChar* p, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast const*>(0)); } #if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX) -inline bool u32regex_match(const wchar_t* p, - match_results& m, - const u32regex& e, +inline bool u32regex_match(const wchar_t* p, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast const*>(0)); } #endif -inline bool u32regex_match(const char* p, - match_results& m, - const u32regex& e, +inline bool u32regex_match(const char* p, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast const*>(0)); } -inline bool u32regex_match(const unsigned char* p, - match_results& m, - const u32regex& e, +inline bool u32regex_match(const unsigned char* p, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast const*>(0)); } -inline bool u32regex_match(const std::string& s, - match_results& m, - const u32regex& e, +inline bool u32regex_match(const std::string& s, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); } #ifndef BOOST_NO_STD_WSTRING -inline bool u32regex_match(const std::wstring& s, - match_results& m, - const u32regex& e, +inline bool u32regex_match(const std::wstring& s, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); } #endif -inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, - match_results& m, - const u32regex& e, +inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_match(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, static_cast const*>(0)); @@ -513,61 +513,61 @@ inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, // regex_match overloads that do not return what matched: // template -inline bool u32regex_match(BidiIterator first, BidiIterator last, - const u32regex& e, +inline bool u32regex_match(BidiIterator first, BidiIterator last, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_match(first, last, m, e, flags, static_cast const*>(0)); } -inline bool u32regex_match(const UChar* p, - const u32regex& e, +inline bool u32regex_match(const UChar* p, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_match(p, p+u_strlen(p), m, e, flags, static_cast const*>(0)); } #if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX) -inline bool u32regex_match(const wchar_t* p, - const u32regex& e, +inline bool u32regex_match(const wchar_t* p, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_match(p, p+std::wcslen(p), m, e, flags, static_cast const*>(0)); } #endif -inline bool u32regex_match(const char* p, - const u32regex& e, +inline bool u32regex_match(const char* p, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_match(p, p+std::strlen(p), m, e, flags, static_cast const*>(0)); } -inline bool u32regex_match(const unsigned char* p, - const u32regex& e, +inline bool u32regex_match(const unsigned char* p, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_match(p, p+std::strlen((const char*)p), m, e, flags, static_cast const*>(0)); } -inline bool u32regex_match(const std::string& s, - const u32regex& e, +inline bool u32regex_match(const std::string& s, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); } #ifndef BOOST_NO_STD_WSTRING -inline bool u32regex_match(const std::wstring& s, - const u32regex& e, +inline bool u32regex_match(const std::wstring& s, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast const*>(0)); } #endif -inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, - const u32regex& e, +inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, + const u32regex& e, match_flag_type flags = match_default) { match_results m; @@ -579,9 +579,9 @@ inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, // namespace re_detail{ template -inline bool do_regex_search(BidiIterator first, BidiIterator last, - match_results& m, - const u32regex& e, +inline bool do_regex_search(BidiIterator first, BidiIterator last, + match_results& m, + const u32regex& e, match_flag_type flags, BidiIterator base, boost::mpl::int_<4> const*) @@ -589,9 +589,9 @@ inline bool do_regex_search(BidiIterator first, BidiIterator last, return ::boost::regex_search(first, last, m, e, flags, base); } template -bool do_regex_search(BidiIterator first, BidiIterator last, - match_results& m, - const u32regex& e, +bool do_regex_search(BidiIterator first, BidiIterator last, + match_results& m, + const u32regex& e, match_flag_type flags, BidiIterator base, boost::mpl::int_<2> const*) @@ -606,9 +606,9 @@ bool do_regex_search(BidiIterator first, BidiIterator last, return result; } template -bool do_regex_search(BidiIterator first, BidiIterator last, - match_results& m, - const u32regex& e, +bool do_regex_search(BidiIterator first, BidiIterator last, + match_results& m, + const u32regex& e, match_flag_type flags, BidiIterator base, boost::mpl::int_<1> const*) @@ -625,131 +625,131 @@ bool do_regex_search(BidiIterator first, BidiIterator last, } template -inline bool u32regex_search(BidiIterator first, BidiIterator last, - match_results& m, - const u32regex& e, +inline bool u32regex_search(BidiIterator first, BidiIterator last, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast const*>(0)); } template -inline bool u32regex_search(BidiIterator first, BidiIterator last, - match_results& m, - const u32regex& e, +inline bool u32regex_search(BidiIterator first, BidiIterator last, + match_results& m, + const u32regex& e, match_flag_type flags, BidiIterator base) { return re_detail::do_regex_search(first, last, m, e, flags, base, static_cast const*>(0)); } -inline bool u32regex_search(const UChar* p, - match_results& m, - const u32regex& e, +inline bool u32regex_search(const UChar* p, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast const*>(0)); } #if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX) -inline bool u32regex_search(const wchar_t* p, - match_results& m, - const u32regex& e, +inline bool u32regex_search(const wchar_t* p, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast const*>(0)); } #endif -inline bool u32regex_search(const char* p, - match_results& m, - const u32regex& e, +inline bool u32regex_search(const char* p, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast const*>(0)); } -inline bool u32regex_search(const unsigned char* p, - match_results& m, - const u32regex& e, +inline bool u32regex_search(const unsigned char* p, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast const*>(0)); } -inline bool u32regex_search(const std::string& s, - match_results& m, - const u32regex& e, +inline bool u32regex_search(const std::string& s, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); } #ifndef BOOST_NO_STD_WSTRING -inline bool u32regex_search(const std::wstring& s, - match_results& m, - const u32regex& e, +inline bool u32regex_search(const std::wstring& s, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); } #endif -inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, - match_results& m, - const u32regex& e, +inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, + match_results& m, + const u32regex& e, match_flag_type flags = match_default) { return re_detail::do_regex_search(s.getBuffer(), s.getBuffer() + s.length(), m, e, flags, s.getBuffer(), static_cast const*>(0)); } template -inline bool u32regex_search(BidiIterator first, BidiIterator last, - const u32regex& e, +inline bool u32regex_search(BidiIterator first, BidiIterator last, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_search(first, last, m, e, flags, first, static_cast const*>(0)); } -inline bool u32regex_search(const UChar* p, - const u32regex& e, +inline bool u32regex_search(const UChar* p, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_search(p, p+u_strlen(p), m, e, flags, p, static_cast const*>(0)); } #if !defined(U_WCHAR_IS_UTF16) && (U_SIZEOF_WCHAR_T != 2) && !defined(BOOST_NO_WREGEX) -inline bool u32regex_search(const wchar_t* p, - const u32regex& e, +inline bool u32regex_search(const wchar_t* p, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_search(p, p+std::wcslen(p), m, e, flags, p, static_cast const*>(0)); } #endif -inline bool u32regex_search(const char* p, - const u32regex& e, +inline bool u32regex_search(const char* p, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_search(p, p+std::strlen(p), m, e, flags, p, static_cast const*>(0)); } -inline bool u32regex_search(const unsigned char* p, - const u32regex& e, +inline bool u32regex_search(const unsigned char* p, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_search(p, p+std::strlen((const char*)p), m, e, flags, p, static_cast const*>(0)); } -inline bool u32regex_search(const std::string& s, - const u32regex& e, +inline bool u32regex_search(const std::string& s, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); } #ifndef BOOST_NO_STD_WSTRING -inline bool u32regex_search(const std::wstring& s, - const u32regex& e, +inline bool u32regex_search(const std::wstring& s, + const u32regex& e, match_flag_type flags = match_default) { match_results m; return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast const*>(0)); } #endif -inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, - const u32regex& e, +inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, + const u32regex& e, match_flag_type flags = match_default) { match_results m; @@ -817,8 +817,8 @@ inline utf8_output_iterator make_utf32_out(OutputIterator o, mpl template OutputIterator do_regex_replace(OutputIterator out, std::pair const& in, - const u32regex& e, - const std::pair& fmt, + const u32regex& e, + const std::pair& fmt, match_flag_type flags ) { @@ -832,7 +832,7 @@ OutputIterator do_regex_replace(OutputIterator out, while(pos != fmt.second) f.push_back(*pos++); #endif - + regex_iterator i(in.first, in.second, e, flags); regex_iterator j; if(i == j) @@ -846,7 +846,7 @@ OutputIterator do_regex_replace(OutputIterator out, while(i != j) { if(!(flags & regex_constants::format_no_copy)) - out = re_detail::copy(i->prefix().first, i->prefix().second, out); + out = re_detail::copy(i->prefix().first, i->prefix().second, out); if(f.size()) out = ::boost::re_detail::regex_format_imp(out, *i, &*f.begin(), &*f.begin() + f.size(), flags, e.get_traits()); else @@ -882,8 +882,8 @@ template inline OutputIterator u32regex_replace(OutputIterator out, BidirectionalIterator first, BidirectionalIterator last, - const u32regex& e, - const charT* fmt, + const u32regex& e, + const charT* fmt, match_flag_type flags = match_default) { return re_detail::extract_output_base @@ -904,7 +904,7 @@ template inline OutputIterator u32regex_replace(OutputIterator out, Iterator first, Iterator last, - const u32regex& e, + const u32regex& e, const std::basic_string& fmt, match_flag_type flags = match_default) { @@ -926,7 +926,7 @@ template inline OutputIterator u32regex_replace(OutputIterator out, Iterator first, Iterator last, - const u32regex& e, + const u32regex& e, const U_NAMESPACE_QUALIFIER UnicodeString& fmt, match_flag_type flags = match_default) { @@ -946,7 +946,7 @@ inline OutputIterator u32regex_replace(OutputIterator out, template std::basic_string u32regex_replace(const std::basic_string& s, - const u32regex& e, + const u32regex& e, const charT* fmt, match_flag_type flags = match_default) { @@ -958,7 +958,7 @@ std::basic_string u32regex_replace(const std::basic_string& s, template std::basic_string u32regex_replace(const std::basic_string& s, - const u32regex& e, + const u32regex& e, const std::basic_string& fmt, match_flag_type flags = match_default) { @@ -978,10 +978,10 @@ public: unicode_string_out_iterator& operator++() { return *this; } unicode_string_out_iterator& operator++(int) { return *this; } unicode_string_out_iterator& operator*() { return *this; } - unicode_string_out_iterator& operator=(UChar v) - { - *out += v; - return *this; + unicode_string_out_iterator& operator=(UChar v) + { + *out += v; + return *this; } typedef std::ptrdiff_t difference_type; typedef UChar value_type; @@ -993,7 +993,7 @@ public: } inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QUALIFIER UnicodeString& s, - const u32regex& e, + const u32regex& e, const UChar* fmt, match_flag_type flags = match_default) { @@ -1004,7 +1004,7 @@ inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QU } inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QUALIFIER UnicodeString& s, - const u32regex& e, + const u32regex& e, const U_NAMESPACE_QUALIFIER UnicodeString& fmt, match_flag_type flags = match_default) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/pending/object_cache.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/pending/object_cache.hpp index d47fbba9..8346166d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/pending/object_cache.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/pending/object_cache.hpp @@ -3,8 +3,8 @@ * Copyright (c) 2004 * John Maddock * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ @@ -24,7 +24,7 @@ #include #include #include -#include +#include #ifdef BOOST_HAS_THREADS #include #endif @@ -35,16 +35,16 @@ template class object_cache { public: - typedef std::pair< ::boost::shared_ptr, Key const*> value_type; + typedef std::pair< ::boost::std::shared_ptr, Key const*> value_type; typedef std::list list_type; typedef typename list_type::iterator list_iterator; typedef std::map map_type; typedef typename map_type::iterator map_iterator; typedef typename list_type::size_type size_type; - static boost::shared_ptr get(const Key& k, size_type l_max_cache_size); + static boost::std::shared_ptr get(const Key& k, size_type l_max_cache_size); private: - static boost::shared_ptr do_get(const Key& k, size_type l_max_cache_size); + static boost::std::shared_ptr do_get(const Key& k, size_type l_max_cache_size); struct data { @@ -58,7 +58,7 @@ private: }; template -boost::shared_ptr object_cache::get(const Key& k, size_type l_max_cache_size) +boost::std::shared_ptr object_cache::get(const Key& k, size_type l_max_cache_size) { #ifdef BOOST_HAS_THREADS static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT; @@ -74,7 +74,7 @@ boost::shared_ptr object_cache::get(const Key& k, siz // ::boost::throw_exception(std::runtime_error("Error in thread safety code: could not acquire a lock")); #if defined(BOOST_NO_UNREACHABLE_RETURN_DETECTION) || defined(BOOST_NO_EXCEPTIONS) - return boost::shared_ptr(); + return boost::std::shared_ptr(); #endif #else return do_get(k, l_max_cache_size); @@ -82,7 +82,7 @@ boost::shared_ptr object_cache::get(const Key& k, siz } template -boost::shared_ptr object_cache::do_get(const Key& k, size_type l_max_cache_size) +boost::std::shared_ptr object_cache::do_get(const Key& k, size_type l_max_cache_size) { typedef typename object_cache::data object_data; typedef typename map_type::size_type map_size_type; @@ -95,7 +95,7 @@ boost::shared_ptr object_cache::do_get(const Key& k, if(mpos != s_data.index.end()) { // - // Eureka! + // Eureka! // We have a cached item, bump it up the list and return it: // if(--(s_data.cont.end()) != mpos->second) @@ -117,7 +117,7 @@ boost::shared_ptr object_cache::do_get(const Key& k, // if we get here then the item is not in the cache, // so create it: // - boost::shared_ptr result(new Object(k)); + boost::std::shared_ptr result(new Object(k)); // // Add it to the list, and index it: // @@ -143,11 +143,11 @@ boost::shared_ptr object_cache::do_get(const Key& k, { list_iterator condemmed(pos); ++pos; - // now remove the items from our containers, + // now remove the items from our containers, // then order has to be as follows: BOOST_ASSERT(s_data.index.find(*(condemmed->second)) != s_data.index.end()); s_data.index.erase(*(condemmed->second)); - s_data.cont.erase(condemmed); + s_data.cont.erase(condemmed); --s; } else diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/basic_regex.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/basic_regex.hpp index 0b63e3aa..7d70105d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/basic_regex.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/basic_regex.hpp @@ -80,13 +80,13 @@ public: { template name(const charT* i, const charT* j, int idx) - : index(idx) - { - hash = hash_value_from_capture_name(i, j); + : index(idx) + { + hash = hash_value_from_capture_name(i, j); } name(int h, int idx) : index(idx), hash(h) - { + { } int index; int hash; @@ -96,7 +96,7 @@ public: } bool operator == (const name& other)const { - return hash == other.hash; + return hash == other.hash; } void swap(name& other) { @@ -160,15 +160,15 @@ template struct regex_data : public named_subexpressions { typedef regex_constants::syntax_option_type flag_type; - typedef std::size_t size_type; + typedef std::size_t size_type; - regex_data(const ::boost::shared_ptr< - ::boost::regex_traits_wrapper >& t) + regex_data(const ::boost::std::shared_ptr< + ::boost::regex_traits_wrapper >& t) : m_ptraits(t), m_expression(0), m_expression_len(0) {} - regex_data() + regex_data() : m_ptraits(new ::boost::regex_traits_wrapper()), m_expression(0), m_expression_len(0) {} - ::boost::shared_ptr< + ::boost::std::shared_ptr< ::boost::regex_traits_wrapper > m_ptraits; // traits class instance flag_type m_flags; // flags with which we were compiled @@ -198,12 +198,12 @@ class basic_regex_implementation public: typedef regex_constants::syntax_option_type flag_type; typedef std::ptrdiff_t difference_type; - typedef std::size_t size_type; + typedef std::size_t size_type; typedef typename traits::locale_type locale_type; typedef const charT* const_iterator; basic_regex_implementation(){} - basic_regex_implementation(const ::boost::shared_ptr< + basic_regex_implementation(const ::boost::std::shared_ptr< ::boost::regex_traits_wrapper >& t) : regex_data(t) {} void assign(const charT* arg_first, @@ -216,12 +216,12 @@ public: } locale_type BOOST_REGEX_CALL imbue(locale_type l) - { - return this->m_ptraits->imbue(l); + { + return this->m_ptraits->imbue(l); } locale_type BOOST_REGEX_CALL getloc()const - { - return this->m_ptraits->getloc(); + { + return this->m_ptraits->getloc(); } std::basic_string BOOST_REGEX_CALL str()const { @@ -245,12 +245,12 @@ public: // // begin, end: const_iterator BOOST_REGEX_CALL begin()const - { - return (this->m_status ? 0 : this->m_expression); + { + return (this->m_status ? 0 : this->m_expression); } const_iterator BOOST_REGEX_CALL end()const - { - return (this->m_status ? 0 : this->m_expression + this->m_expression_len); + { + return (this->m_status ? 0 : this->m_expression + this->m_expression_len); } flag_type BOOST_REGEX_CALL flags()const { @@ -322,13 +322,13 @@ public: typedef const charT* const_iterator; typedef const_iterator iterator; typedef std::ptrdiff_t difference_type; - typedef std::size_t size_type; + typedef std::size_t size_type; typedef regex_constants::syntax_option_type flag_type; // locale_type // placeholder for actual locale type used by the // traits class to localise *this. typedef typename traits::locale_type locale_type; - + public: explicit basic_regex(){} explicit basic_regex(const charT* p, flag_type f = regex_constants::normal) @@ -358,9 +358,9 @@ public: // // assign: basic_regex& assign(const basic_regex& that) - { + { m_pimpl = that.m_pimpl; - return *this; + return *this; } basic_regex& assign(const charT* p, flag_type f = regex_constants::normal) { @@ -385,14 +385,14 @@ public: template unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string& p, flag_type f = regex_constants::normal) - { - return set_expression(p.data(), p.data() + p.size(), f); + { + return set_expression(p.data(), p.data() + p.size(), f); } template explicit basic_regex(const std::basic_string& p, flag_type f = regex_constants::normal) - { - assign(p, f); + { + assign(p, f); } template @@ -437,13 +437,13 @@ public: } #else unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string& p, flag_type f = regex_constants::normal) - { - return set_expression(p.data(), p.data() + p.size(), f); + { + return set_expression(p.data(), p.data() + p.size(), f); } basic_regex(const std::basic_string& p, flag_type f = regex_constants::normal) - { - assign(p, f); + { + assign(p, f); } basic_regex& BOOST_REGEX_CALL operator=(const std::basic_string& p) @@ -464,19 +464,19 @@ public: // locale: locale_type BOOST_REGEX_CALL imbue(locale_type l); locale_type BOOST_REGEX_CALL getloc()const - { - return m_pimpl.get() ? m_pimpl->getloc() : locale_type(); + { + return m_pimpl.get() ? m_pimpl->getloc() : locale_type(); } // // getflags: // retained for backwards compatibility only, "flags" // is now the preferred name: flag_type BOOST_REGEX_CALL getflags()const - { + { return flags(); } flag_type BOOST_REGEX_CALL flags()const - { + { return m_pimpl.get() ? m_pimpl->flags() : 0; } // @@ -494,12 +494,12 @@ public: return m_pimpl->subexpression(n); } const_iterator BOOST_REGEX_CALL begin()const - { - return (m_pimpl.get() ? m_pimpl->begin() : 0); + { + return (m_pimpl.get() ? m_pimpl->begin() : 0); } const_iterator BOOST_REGEX_CALL end()const - { - return (m_pimpl.get() ? m_pimpl->end() : 0); + { + return (m_pimpl.get() ? m_pimpl->end() : 0); } // // swap: @@ -510,25 +510,25 @@ public: // // size: size_type BOOST_REGEX_CALL size()const - { - return (m_pimpl.get() ? m_pimpl->size() : 0); + { + return (m_pimpl.get() ? m_pimpl->size() : 0); } // // max_size: size_type BOOST_REGEX_CALL max_size()const - { - return UINT_MAX; + { + return UINT_MAX; } // // empty: bool BOOST_REGEX_CALL empty()const - { - return (m_pimpl.get() ? 0 != m_pimpl->status() : true); + { + return (m_pimpl.get() ? 0 != m_pimpl->status() : true); } - size_type BOOST_REGEX_CALL mark_count()const - { - return (m_pimpl.get() ? m_pimpl->mark_count() : 0); + size_type BOOST_REGEX_CALL mark_count()const + { + return (m_pimpl.get() ? m_pimpl->mark_count() : 0); } int status()const @@ -551,45 +551,45 @@ public: return str().compare(that.str()); } bool BOOST_REGEX_CALL operator==(const basic_regex& e)const - { - return compare(e) == 0; + { + return compare(e) == 0; } bool BOOST_REGEX_CALL operator != (const basic_regex& e)const - { - return compare(e) != 0; + { + return compare(e) != 0; } bool BOOST_REGEX_CALL operator<(const basic_regex& e)const - { - return compare(e) < 0; + { + return compare(e) < 0; } bool BOOST_REGEX_CALL operator>(const basic_regex& e)const - { - return compare(e) > 0; + { + return compare(e) > 0; } bool BOOST_REGEX_CALL operator<=(const basic_regex& e)const - { - return compare(e) <= 0; + { + return compare(e) <= 0; } bool BOOST_REGEX_CALL operator>=(const basic_regex& e)const - { - return compare(e) >= 0; + { + return compare(e) >= 0; } // // The following are deprecated as public interfaces // but are available for compatibility with earlier versions. - const charT* BOOST_REGEX_CALL expression()const - { - return (m_pimpl.get() && !m_pimpl->status() ? m_pimpl->expression() : 0); + const charT* BOOST_REGEX_CALL expression()const + { + return (m_pimpl.get() && !m_pimpl->status() ? m_pimpl->expression() : 0); } unsigned int BOOST_REGEX_CALL set_expression(const charT* p1, const charT* p2, flag_type f = regex_constants::normal) { assign(p1, p2, f | regex_constants::no_except); return status(); } - unsigned int BOOST_REGEX_CALL set_expression(const charT* p, flag_type f = regex_constants::normal) - { - assign(p, f | regex_constants::no_except); + unsigned int BOOST_REGEX_CALL set_expression(const charT* p, flag_type f = regex_constants::normal) + { + assign(p, f | regex_constants::no_except); return status(); } unsigned int BOOST_REGEX_CALL error_code()const @@ -629,13 +629,13 @@ public: BOOST_ASSERT(0 != m_pimpl.get()); return m_pimpl->get_data(); } - boost::shared_ptr get_named_subs()const + boost::std::shared_ptr get_named_subs()const { return m_pimpl; } private: - shared_ptr > m_pimpl; + std::shared_ptr > m_pimpl; }; // @@ -649,14 +649,14 @@ basic_regex& basic_regex::do_assign(const charT* p const charT* p2, flag_type f) { - shared_ptr > temp; + std::shared_ptr > temp; if(!m_pimpl.get()) { - temp = shared_ptr >(new re_detail::basic_regex_implementation()); + temp = std::shared_ptr >(new re_detail::basic_regex_implementation()); } else { - temp = shared_ptr >(new re_detail::basic_regex_implementation(m_pimpl->m_ptraits)); + temp = std::shared_ptr >(new re_detail::basic_regex_implementation(m_pimpl->m_ptraits)); } temp->assign(p1, p2, f); temp.swap(m_pimpl); @@ -665,8 +665,8 @@ basic_regex& basic_regex::do_assign(const charT* p template typename basic_regex::locale_type BOOST_REGEX_CALL basic_regex::imbue(locale_type l) -{ - shared_ptr > temp(new re_detail::basic_regex_implementation()); +{ + std::shared_ptr > temp(new re_detail::basic_regex_implementation()); locale_type result = temp->imbue(l); temp.swap(m_pimpl); return result; @@ -683,8 +683,8 @@ void swap(basic_regex& e1, basic_regex& e2) #ifndef BOOST_NO_STD_LOCALE template -std::basic_ostream& - operator << (std::basic_ostream& os, +std::basic_ostream& + operator << (std::basic_ostream& os, const basic_regex& e) { return (os << e.str()); @@ -731,7 +731,7 @@ public: template explicit reg_expression(const std::basic_string& p, flag_type f = regex_constants::normal) : basic_regex(p, f) - { + { } template @@ -749,7 +749,7 @@ public: #else explicit reg_expression(const std::basic_string& p, flag_type f = regex_constants::normal) : basic_regex(p, f) - { + { } reg_expression& BOOST_REGEX_CALL operator=(const std::basic_string& p) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/cpp_regex_traits.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/cpp_regex_traits.hpp index d60942f0..17fe2b63 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/cpp_regex_traits.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/cpp_regex_traits.hpp @@ -3,12 +3,12 @@ * Copyright (c) 2004 John Maddock * Copyright 2011 Garmin Ltd. or its subsidiaries * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ - + /* * LOCATION: see http://www.boost.org for most recent version. * FILE cpp_regex_traits.hpp @@ -60,14 +60,14 @@ #pragma warning(disable:4786 4251) #endif -namespace boost{ +namespace boost{ // // forward declaration is needed by some compilers: // template class cpp_regex_traits; - + namespace re_detail{ // @@ -201,9 +201,9 @@ struct cpp_regex_traits_base } bool operator==(const cpp_regex_traits_base& b)const { - return (m_pctype == b.m_pctype) + return (m_pctype == b.m_pctype) #ifndef BOOST_NO_STD_MESSAGES - && (m_pmessages == b.m_pmessages) + && (m_pmessages == b.m_pmessages) #endif && (m_pcollate == b.m_pcollate); } @@ -283,7 +283,7 @@ void cpp_regex_traits_char_layer::init() if(cat_name.size() && (this->m_pmessages != 0)) { cat = this->m_pmessages->open( - cat_name, + cat_name, this->m_locale); if((int)cat < 0) { @@ -337,7 +337,7 @@ void cpp_regex_traits_char_layer::init() } template -typename cpp_regex_traits_char_layer::string_type +typename cpp_regex_traits_char_layer::string_type cpp_regex_traits_char_layer::get_default_message(regex_constants::syntax_type i) { const char* ptr = get_default_syntax(i); @@ -386,16 +386,16 @@ private: #ifdef BOOST_REGEX_BUGGY_CTYPE_FACET enum { - char_class_space=1<<0, - char_class_print=1<<1, - char_class_cntrl=1<<2, - char_class_upper=1<<3, + char_class_space=1<<0, + char_class_print=1<<1, + char_class_cntrl=1<<2, + char_class_upper=1<<3, char_class_lower=1<<4, - char_class_alpha=1<<5, - char_class_digit=1<<6, - char_class_punct=1<<7, + char_class_alpha=1<<5, + char_class_digit=1<<6, + char_class_punct=1<<7, char_class_xdigit=1<<8, - char_class_alnum=char_class_alpha|char_class_digit, + char_class_alnum=char_class_alpha|char_class_digit, char_class_graph=char_class_alnum|char_class_punct, char_class_blank=1<<9, char_class_word=1<<10, @@ -495,14 +495,14 @@ typename cpp_regex_traits_implementation::char_class_type const cpp_regex #endif template -typename cpp_regex_traits_implementation::string_type +typename cpp_regex_traits_implementation::string_type cpp_regex_traits_implementation::transform_primary(const charT* p1, const charT* p2) const { // // PRECONDITIONS: // // A bug in gcc 3.2 (and maybe other versions as well) treats - // p1 as a null terminated string, for efficiency reasons + // p1 as a null terminated string, for efficiency reasons // we work around this elsewhere, but just assert here that // we adhere to gcc's (buggy) preconditions... // @@ -565,14 +565,14 @@ typename cpp_regex_traits_implementation::string_type } template -typename cpp_regex_traits_implementation::string_type +typename cpp_regex_traits_implementation::string_type cpp_regex_traits_implementation::transform(const charT* p1, const charT* p2) const { // // PRECONDITIONS: // // A bug in gcc 3.2 (and maybe other versions as well) treats - // p1 as a null terminated string, for efficiency reasons + // p1 as a null terminated string, for efficiency reasons // we work around this elsewhere, but just assert here that // we adhere to gcc's (buggy) preconditions... // @@ -613,7 +613,7 @@ typename cpp_regex_traits_implementation::string_type template -typename cpp_regex_traits_implementation::string_type +typename cpp_regex_traits_implementation::string_type cpp_regex_traits_implementation::lookup_collatename(const charT* p1, const charT* p2) const { typedef typename std::map::const_iterator iter_type; @@ -669,7 +669,7 @@ void cpp_regex_traits_implementation::init() if(cat_name.size() && (this->m_pmessages != 0)) { cat = this->m_pmessages->open( - cat_name, + cat_name, this->m_locale); if((int)cat < 0) { @@ -686,8 +686,8 @@ void cpp_regex_traits_implementation::init() // // Error messages: // - for(boost::regex_constants::error_type i = static_cast(0); - i <= boost::regex_constants::error_unknown; + for(boost::regex_constants::error_type i = static_cast(0); + i <= boost::regex_constants::error_unknown; i = static_cast(i + 1)) { const char* p = get_default_error_string(i); @@ -709,7 +709,7 @@ void cpp_regex_traits_implementation::init() // Custom class names: // #ifndef BOOST_REGEX_BUGGY_CTYPE_FACET - static const char_class_type masks[16] = + static const char_class_type masks[16] = { std::ctype::alnum, std::ctype::alpha, @@ -729,7 +729,7 @@ void cpp_regex_traits_implementation::init() cpp_regex_traits_implementation::mask_unicode, }; #else - static const char_class_type masks[16] = + static const char_class_type masks[16] = { ::boost::re_detail::char_class_alnum, ::boost::re_detail::char_class_alpha, @@ -765,14 +765,14 @@ void cpp_regex_traits_implementation::init() } template -typename cpp_regex_traits_implementation::char_class_type +typename cpp_regex_traits_implementation::char_class_type cpp_regex_traits_implementation::lookup_classname_imp(const charT* p1, const charT* p2) const { #ifndef BOOST_REGEX_BUGGY_CTYPE_FACET - static const char_class_type masks[22] = + static const char_class_type masks[22] = { 0, - std::ctype::alnum, + std::ctype::alnum, std::ctype::alpha, cpp_regex_traits_implementation::mask_blank, std::ctype::cntrl, @@ -790,15 +790,15 @@ typename cpp_regex_traits_implementation::char_class_type cpp_regex_traits_implementation::mask_unicode, std::ctype::upper, cpp_regex_traits_implementation::mask_vertical, - std::ctype::alnum | cpp_regex_traits_implementation::mask_word, - std::ctype::alnum | cpp_regex_traits_implementation::mask_word, + std::ctype::alnum | cpp_regex_traits_implementation::mask_word, + std::ctype::alnum | cpp_regex_traits_implementation::mask_word, std::ctype::xdigit, }; #else - static const char_class_type masks[22] = + static const char_class_type masks[22] = { 0, - ::boost::re_detail::char_class_alnum, + ::boost::re_detail::char_class_alnum, ::boost::re_detail::char_class_alpha, ::boost::re_detail::char_class_blank, ::boost::re_detail::char_class_cntrl, @@ -816,8 +816,8 @@ typename cpp_regex_traits_implementation::char_class_type ::boost::re_detail::char_class_unicode, ::boost::re_detail::char_class_upper, ::boost::re_detail::char_class_vertical_space, - ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, - ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, + ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, + ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, ::boost::re_detail::char_class_xdigit, }; #endif @@ -857,7 +857,7 @@ bool cpp_regex_traits_implementation::isctype(const charT c, char_class_t template -inline boost::shared_ptr > create_cpp_regex_traits(const std::locale& l BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(charT)) +inline boost::std::shared_ptr > create_cpp_regex_traits(const std::locale& l BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(charT)) { cpp_regex_traits_base key(l); return ::boost::object_cache, cpp_regex_traits_implementation >::get(key, 5); @@ -935,9 +935,9 @@ public: #ifndef BOOST_REGEX_BUGGY_CTYPE_FACET typedef typename std::ctype::mask ctype_mask; - static const ctype_mask mask_base = + static const ctype_mask mask_base = static_cast( - std::ctype::alnum + std::ctype::alnum | std::ctype::alpha | std::ctype::cntrl | std::ctype::digit @@ -949,7 +949,7 @@ public: | std::ctype::upper | std::ctype::xdigit); - if((f & mask_base) + if((f & mask_base) && (m_pimpl->m_pctype->is( static_cast(f & mask_base), c))) return true; @@ -957,14 +957,14 @@ public: return true; else if((f & re_detail::cpp_regex_traits_implementation::mask_word) && (c == '_')) return true; - else if((f & re_detail::cpp_regex_traits_implementation::mask_blank) + else if((f & re_detail::cpp_regex_traits_implementation::mask_blank) && m_pimpl->m_pctype->is(std::ctype::space, c) && !re_detail::is_separator(c)) return true; - else if((f & re_detail::cpp_regex_traits_implementation::mask_vertical) + else if((f & re_detail::cpp_regex_traits_implementation::mask_vertical) && (::boost::re_detail::is_separator(c) || (c == '\v'))) return true; - else if((f & re_detail::cpp_regex_traits_implementation::mask_horizontal) + else if((f & re_detail::cpp_regex_traits_implementation::mask_horizontal) && this->isctype(c, std::ctype::space) && !this->isctype(c, re_detail::cpp_regex_traits_implementation::mask_vertical)) return true; return false; @@ -1001,7 +1001,7 @@ public: static std::string get_catalog_name(); private: - boost::shared_ptr > m_pimpl; + boost::std::shared_ptr > m_pimpl; // // catalog name handler: // diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/match_results.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/match_results.hpp index 63e51175..c5641a43 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/match_results.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/match_results.hpp @@ -3,8 +3,8 @@ * Copyright (c) 1998-2009 * John Maddock * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ @@ -47,14 +47,14 @@ class named_subexpressions; template class match_results -{ +{ private: #ifndef BOOST_NO_STD_ALLOCATOR typedef std::vector, Allocator> vector_type; #else typedef std::vector > vector_type; #endif -public: +public: typedef sub_match value_type; #if !defined(BOOST_NO_STD_ALLOCATOR) && !(defined(BOOST_MSVC) && defined(_STLPORT_VERSION)) typedef typename Allocator::const_reference const_reference; @@ -81,7 +81,7 @@ public: : m_subs(), m_base(), m_last_closed_paren(0), m_is_singular(true) { (void)a; } #endif match_results(const match_results& m) - : m_subs(m.m_subs), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular) + : m_subs(m.m_subs), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular) { if(!m_is_singular) { @@ -547,7 +547,7 @@ public: } void BOOST_REGEX_CALL maybe_assign(const match_results& m); - void BOOST_REGEX_CALL set_named_subs(boost::shared_ptr subs) + void BOOST_REGEX_CALL set_named_subs(boost::std::shared_ptr subs) { m_named_subs = subs; } @@ -566,7 +566,7 @@ private: vector_type m_subs; // subexpressions BidiIterator m_base; // where the search started from sub_match m_null; // a null match - boost::shared_ptr m_named_subs; // Shared copy of named subs in the regex object + boost::std::shared_ptr m_named_subs; // Shared copy of named subs in the regex object int m_last_closed_paren; // Last ) to be seen - used for formatting bool m_is_singular; // True if our stored iterators are singular }; @@ -586,7 +586,7 @@ void BOOST_REGEX_CALL match_results::maybe_assign(const // Distances are measured from the start of *this* match, unless this isn't // a valid match in which case we use the start of the whole sequence. Note that // no subsequent match-candidate can ever be to the left of the first match found. - // This ensures that when we are using bidirectional iterators, that distances + // This ensures that when we are using bidirectional iterators, that distances // measured are as short as possible, and therefore as efficient as possible // to compute. Finally note that we don't use the "matched" data member to test // whether a sub-expression is a valid match, because partial matches set this diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_iterator.hpp index 09e75c69..c7a946d8 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_iterator.hpp @@ -3,8 +3,8 @@ * Copyright (c) 2003 * John Maddock * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ @@ -19,7 +19,7 @@ #ifndef BOOST_REGEX_V4_REGEX_ITERATOR_HPP #define BOOST_REGEX_V4_REGEX_ITERATOR_HPP -#include +#include namespace boost{ @@ -34,10 +34,10 @@ namespace boost{ #pragma warning(pop) #endif -template -class regex_iterator_implementation +class regex_iterator_implementation { typedef basic_regex regex_type; @@ -81,34 +81,34 @@ private: regex_iterator_implementation& operator=(const regex_iterator_implementation&); }; -template ::value_type, class traits = regex_traits > -class regex_iterator +class regex_iterator #ifndef BOOST_NO_STD_ITERATOR : public std::iterator< - std::forward_iterator_tag, + std::forward_iterator_tag, match_results, typename re_detail::regex_iterator_traits::difference_type, const match_results*, - const match_results& > + const match_results& > #endif { private: typedef regex_iterator_implementation impl; - typedef shared_ptr pimpl; + typedef std::shared_ptr pimpl; public: typedef basic_regex regex_type; typedef match_results value_type; - typedef typename re_detail::regex_iterator_traits::difference_type + typedef typename re_detail::regex_iterator_traits::difference_type difference_type; typedef const value_type* pointer; - typedef const value_type& reference; + typedef const value_type& reference; typedef std::forward_iterator_tag iterator_category; - + regex_iterator(){} - regex_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type& re, + regex_iterator(BidirectionalIterator a, BidirectionalIterator b, + const regex_type& re, match_flag_type m = match_default) : pdata(new impl(&re, b, m)) { @@ -125,10 +125,10 @@ public: return *this; } bool operator==(const regex_iterator& that)const - { + { if((pdata.get() == 0) || (that.pdata.get() == 0)) return pdata.get() == that.pdata.get(); - return pdata->compare(*(that.pdata.get())); + return pdata->compare(*(that.pdata.get())); } bool operator!=(const regex_iterator& that)const { return !(*this == that); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_token_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_token_iterator.hpp index 4e8bc36f..d7b8da65 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_token_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_token_iterator.hpp @@ -3,8 +3,8 @@ * Copyright (c) 2003 * John Maddock * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ @@ -19,7 +19,7 @@ #ifndef BOOST_REGEX_V4_REGEX_TOKEN_ITERATOR_HPP #define BOOST_REGEX_V4_REGEX_TOKEN_ITERATOR_HPP -#include +#include #include #if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \ @@ -27,7 +27,7 @@ // // Borland C++ Builder 6, and Visual C++ 6, // can't cope with the array template constructor -// so we have a template member that will accept any type as +// so we have a template member that will accept any type as // argument, and then assert that is really is an array: // #include @@ -54,7 +54,7 @@ namespace boost{ template -class regex_token_iterator_implementation +class regex_token_iterator_implementation { typedef basic_regex regex_type; typedef sub_match value_type; @@ -125,11 +125,11 @@ public: bool compare(const regex_token_iterator_implementation& that) { if(this == &that) return true; - return (&re.get_data() == &that.re.get_data()) - && (end == that.end) - && (flags == that.flags) - && (N == that.N) - && (what[0].first == that.what[0].first) + return (&re.get_data() == &that.re.get_data()) + && (end == that.end) + && (flags == that.flags) + && (N == that.N) + && (what[0].first == that.what[0].first) && (what[0].second == that.what[0].second); } const value_type& get() @@ -167,40 +167,40 @@ private: regex_token_iterator_implementation& operator=(const regex_token_iterator_implementation&); }; -template ::value_type, class traits = regex_traits > -class regex_token_iterator +class regex_token_iterator #ifndef BOOST_NO_STD_ITERATOR : public std::iterator< - std::forward_iterator_tag, + std::forward_iterator_tag, sub_match, typename re_detail::regex_iterator_traits::difference_type, const sub_match*, - const sub_match& > + const sub_match& > #endif { private: typedef regex_token_iterator_implementation impl; - typedef shared_ptr pimpl; + typedef std::shared_ptr pimpl; public: typedef basic_regex regex_type; typedef sub_match value_type; - typedef typename re_detail::regex_iterator_traits::difference_type + typedef typename re_detail::regex_iterator_traits::difference_type difference_type; typedef const value_type* pointer; - typedef const value_type& reference; + typedef const value_type& reference; typedef std::forward_iterator_tag iterator_category; - + regex_token_iterator(){} - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, + regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, int submatch = 0, match_flag_type m = match_default) : pdata(new impl(&re, b, submatch, m)) { if(!pdata->init(a)) pdata.reset(); } - regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, + regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, const std::vector& submatches, match_flag_type m = match_default) : pdata(new impl(&re, b, submatches, m)) { @@ -239,10 +239,10 @@ public: return *this; } bool operator==(const regex_token_iterator& that)const - { + { if((pdata.get() == 0) || (that.pdata.get() == 0)) return pdata.get() == that.pdata.get(); - return pdata->compare(*(that.pdata.get())); + return pdata->compare(*(that.pdata.get())); } bool operator!=(const regex_token_iterator& that)const { return !(*this == that); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_workaround.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_workaround.hpp index 46a8a8d3..916a4787 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_workaround.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/regex_workaround.hpp @@ -3,8 +3,8 @@ * Copyright (c) 1998-2005 * John Maddock * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #ifndef BOOST_NO_STD_LOCALE # include @@ -128,13 +128,13 @@ namespace boost{ namespace re_detail{ // // MSVC 8 will either emit warnings or else refuse to compile // code that makes perfectly legitimate use of std::copy, when - // the OutputIterator type is a user-defined class (apparently all user + // the OutputIterator type is a user-defined class (apparently all user // defined iterators are "unsafe"). This code works around that: // template inline OutputIterator copy( - InputIterator first, - InputIterator last, + InputIterator first, + InputIterator last, OutputIterator dest ) { @@ -142,8 +142,8 @@ namespace boost{ namespace re_detail{ } template inline bool equal( - InputIterator1 first, - InputIterator1 last, + InputIterator1 first, + InputIterator1 last, InputIterator2 with ) { @@ -153,15 +153,15 @@ namespace boost{ namespace re_detail{ // // MSVC 10 will either emit warnings or else refuse to compile // code that makes perfectly legitimate use of std::copy, when - // the OutputIterator type is a user-defined class (apparently all user + // the OutputIterator type is a user-defined class (apparently all user // defined iterators are "unsafe"). What's more Microsoft have removed their // non-standard "unchecked" versions, even though their still in the MS - // documentation!! Work around this as best we can: + // documentation!! Work around this as best we can: // template inline OutputIterator copy( - InputIterator first, - InputIterator last, + InputIterator first, + InputIterator last, OutputIterator dest ) { @@ -171,8 +171,8 @@ namespace boost{ namespace re_detail{ } template inline bool equal( - InputIterator1 first, - InputIterator1 last, + InputIterator1 first, + InputIterator1 last, InputIterator2 with ) { @@ -180,11 +180,11 @@ namespace boost{ namespace re_detail{ if(*first++ != *with++) return false; return true; } -#else - using std::copy; - using std::equal; -#endif -#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(__STDC_WANT_SECURE_LIB__) && __STDC_WANT_SECURE_LIB__ +#else + using std::copy; + using std::equal; +#endif +#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(__STDC_WANT_SECURE_LIB__) && __STDC_WANT_SECURE_LIB__ // use safe versions of strcpy etc: using ::strcpy_s; @@ -193,7 +193,7 @@ namespace boost{ namespace re_detail{ inline std::size_t strcpy_s( char *strDestination, std::size_t sizeInBytes, - const char *strSource + const char *strSource ) { if(std::strlen(strSource)+1 > sizeInBytes) @@ -204,7 +204,7 @@ namespace boost{ namespace re_detail{ inline std::size_t strcat_s( char *strDestination, std::size_t sizeInBytes, - const char *strSource + const char *strSource ) { if(std::strlen(strSource) + std::strlen(strDestination) + 1 > sizeInBytes) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/u32regex_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/u32regex_iterator.hpp index 65ebd7f8..450069ce 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/u32regex_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/u32regex_iterator.hpp @@ -3,8 +3,8 @@ * Copyright (c) 2003 * John Maddock * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ @@ -26,7 +26,7 @@ namespace boost{ #endif template -class u32regex_iterator_implementation +class u32regex_iterator_implementation { typedef u32regex regex_type; @@ -71,31 +71,31 @@ private: }; template -class u32regex_iterator +class u32regex_iterator #ifndef BOOST_NO_STD_ITERATOR : public std::iterator< - std::forward_iterator_tag, + std::forward_iterator_tag, match_results, typename re_detail::regex_iterator_traits::difference_type, const match_results*, - const match_results& > + const match_results& > #endif { private: typedef u32regex_iterator_implementation impl; - typedef shared_ptr pimpl; + typedef std::shared_ptr pimpl; public: typedef u32regex regex_type; typedef match_results value_type; - typedef typename re_detail::regex_iterator_traits::difference_type + typedef typename re_detail::regex_iterator_traits::difference_type difference_type; typedef const value_type* pointer; - typedef const value_type& reference; + typedef const value_type& reference; typedef std::forward_iterator_tag iterator_category; - + u32regex_iterator(){} - u32regex_iterator(BidirectionalIterator a, BidirectionalIterator b, - const regex_type& re, + u32regex_iterator(BidirectionalIterator a, BidirectionalIterator b, + const regex_type& re, match_flag_type m = match_default) : pdata(new impl(&re, b, m)) { @@ -112,10 +112,10 @@ public: return *this; } bool operator==(const u32regex_iterator& that)const - { + { if((pdata.get() == 0) || (that.pdata.get() == 0)) return pdata.get() == that.pdata.get(); - return pdata->compare(*(that.pdata.get())); + return pdata->compare(*(that.pdata.get())); } bool operator!=(const u32regex_iterator& that)const { return !(*this == that); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/u32regex_token_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/u32regex_token_iterator.hpp index de167716..3b12fec9 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/u32regex_token_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/u32regex_token_iterator.hpp @@ -3,8 +3,8 @@ * Copyright (c) 2003 * John Maddock * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ @@ -25,7 +25,7 @@ // // Borland C++ Builder 6, and Visual C++ 6, // can't cope with the array template constructor -// so we have a template member that will accept any type as +// so we have a template member that will accept any type as // argument, and then assert that is really is an array: // #include @@ -43,7 +43,7 @@ namespace boost{ #endif template -class u32regex_token_iterator_implementation +class u32regex_token_iterator_implementation { typedef u32regex regex_type; typedef sub_match value_type; @@ -115,11 +115,11 @@ public: bool compare(const u32regex_token_iterator_implementation& that) { if(this == &that) return true; - return (&re.get_data() == &that.re.get_data()) - && (end == that.end) - && (flags == that.flags) - && (N == that.N) - && (what[0].first == that.what[0].first) + return (&re.get_data() == &that.re.get_data()) + && (end == that.end) + && (flags == that.flags) + && (N == that.N) + && (what[0].first == that.what[0].first) && (what[0].second == that.what[0].second); } const value_type& get() @@ -158,37 +158,37 @@ private: }; template -class u32regex_token_iterator +class u32regex_token_iterator #ifndef BOOST_NO_STD_ITERATOR : public std::iterator< - std::forward_iterator_tag, + std::forward_iterator_tag, sub_match, typename re_detail::regex_iterator_traits::difference_type, const sub_match*, - const sub_match& > + const sub_match& > #endif { private: typedef u32regex_token_iterator_implementation impl; - typedef shared_ptr pimpl; + typedef std::shared_ptr pimpl; public: typedef u32regex regex_type; typedef sub_match value_type; - typedef typename re_detail::regex_iterator_traits::difference_type + typedef typename re_detail::regex_iterator_traits::difference_type difference_type; typedef const value_type* pointer; - typedef const value_type& reference; + typedef const value_type& reference; typedef std::forward_iterator_tag iterator_category; - + u32regex_token_iterator(){} - u32regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, + u32regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, int submatch = 0, match_flag_type m = match_default) : pdata(new impl(&re, b, submatch, m)) { if(!pdata->init(a)) pdata.reset(); } - u32regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, + u32regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, const std::vector& submatches, match_flag_type m = match_default) : pdata(new impl(&re, b, submatches, m)) { @@ -227,10 +227,10 @@ public: return *this; } bool operator==(const u32regex_token_iterator& that)const - { + { if((pdata.get() == 0) || (that.pdata.get() == 0)) return pdata.get() == that.pdata.get(); - return pdata->compare(*(that.pdata.get())); + return pdata->compare(*(that.pdata.get())); } bool operator!=(const u32regex_token_iterator& that)const { return !(*this == that); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/w32_regex_traits.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/w32_regex_traits.hpp index d5562072..2d727bc6 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/w32_regex_traits.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/regex/v4/w32_regex_traits.hpp @@ -3,12 +3,12 @@ * Copyright (c) 2004 * John Maddock * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * */ - + /* * LOCATION: see http://www.boost.org for most recent version. * FILE w32_regex_traits.hpp @@ -52,21 +52,21 @@ #pragma warning(disable:4800) #endif -namespace boost{ +namespace boost{ // // forward declaration is needed by some compilers: // template class w32_regex_traits; - + namespace re_detail{ // // start by typedeffing the types we'll need: // typedef ::boost::uint32_t lcid_type; // placeholder for LCID. -typedef ::boost::shared_ptr cat_type; // placeholder for dll HANDLE. +typedef ::boost::std::shared_ptr cat_type; // placeholder for dll HANDLE. // // then add wrappers around the actual Win32 API's (ie implementation hiding): @@ -186,7 +186,7 @@ private: }; template -w32_regex_traits_char_layer::w32_regex_traits_char_layer(::boost::re_detail::lcid_type l) +w32_regex_traits_char_layer::w32_regex_traits_char_layer(::boost::re_detail::lcid_type l) : w32_regex_traits_base(l) { // we need to start by initialising our syntax map so we know which @@ -232,7 +232,7 @@ w32_regex_traits_char_layer::w32_regex_traits_char_layer(::boost::re_deta } template -typename w32_regex_traits_char_layer::string_type +typename w32_regex_traits_char_layer::string_type w32_regex_traits_char_layer::get_default_message(regex_constants::syntax_type i) { const char* ptr = get_default_syntax(i); @@ -342,7 +342,7 @@ private: }; template -typename w32_regex_traits_implementation::string_type +typename w32_regex_traits_implementation::string_type w32_regex_traits_implementation::transform_primary(const charT* p1, const charT* p2) const { string_type result; @@ -388,7 +388,7 @@ typename w32_regex_traits_implementation::string_type } template -typename w32_regex_traits_implementation::string_type +typename w32_regex_traits_implementation::string_type w32_regex_traits_implementation::lookup_collatename(const charT* p1, const charT* p2) const { typedef typename std::map::const_iterator iter_type; @@ -455,8 +455,8 @@ w32_regex_traits_implementation::w32_regex_traits_implementation(::boost: // // Error messages: // - for(boost::regex_constants::error_type i = static_cast(0); - i <= boost::regex_constants::error_unknown; + for(boost::regex_constants::error_type i = static_cast(0); + i <= boost::regex_constants::error_unknown; i = static_cast(i + 1)) { const char* p = get_default_error_string(i); @@ -477,7 +477,7 @@ w32_regex_traits_implementation::w32_regex_traits_implementation(::boost: // // Custom class names: // - static const char_class_type masks[14] = + static const char_class_type masks[14] = { 0x0104u, // C1_ALPHA | C1_DIGIT 0x0100u, // C1_ALPHA @@ -509,10 +509,10 @@ w32_regex_traits_implementation::w32_regex_traits_implementation(::boost: } template -typename w32_regex_traits_implementation::char_class_type +typename w32_regex_traits_implementation::char_class_type w32_regex_traits_implementation::lookup_classname_imp(const charT* p1, const charT* p2) const { - static const char_class_type masks[22] = + static const char_class_type masks[22] = { 0, 0x0104u, // C1_ALPHA | C1_DIGIT @@ -522,7 +522,7 @@ typename w32_regex_traits_implementation::char_class_type 0x0004u, // C1_DIGIT 0x0004u, // C1_DIGIT (~(0x0020u|0x0008u|0x0040) & 0x01ffu) | 0x0400u, // not C1_CNTRL or C1_SPACE or C1_BLANK - w32_regex_traits_implementation::mask_horizontal, + w32_regex_traits_implementation::mask_horizontal, 0x0002u, // C1_LOWER 0x0002u, // C1_LOWER (~0x0020u & 0x01ffu) | 0x0400, // not C1_CNTRL @@ -532,9 +532,9 @@ typename w32_regex_traits_implementation::char_class_type 0x0001u, // C1_UPPER w32_regex_traits_implementation::mask_unicode, 0x0001u, // C1_UPPER - w32_regex_traits_implementation::mask_vertical, - 0x0104u | w32_regex_traits_implementation::mask_word, - 0x0104u | w32_regex_traits_implementation::mask_word, + w32_regex_traits_implementation::mask_vertical, + 0x0104u | w32_regex_traits_implementation::mask_word, + 0x0104u | w32_regex_traits_implementation::mask_word, 0x0080u, // C1_XDIGIT }; if(m_custom_class_names.size()) @@ -552,7 +552,7 @@ typename w32_regex_traits_implementation::char_class_type template -boost::shared_ptr > create_w32_regex_traits(::boost::re_detail::lcid_type l BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(charT)) +boost::std::shared_ptr > create_w32_regex_traits(::boost::re_detail::lcid_type l BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(charT)) { // TODO: create a cache for previously constructed objects. return boost::object_cache< ::boost::re_detail::lcid_type, w32_regex_traits_implementation >::get(l, 5); @@ -625,7 +625,7 @@ public: } bool isctype(charT c, char_class_type f) const { - if((f & re_detail::w32_regex_traits_implementation::mask_base) + if((f & re_detail::w32_regex_traits_implementation::mask_base) && (this->m_pimpl->isctype(f & re_detail::w32_regex_traits_implementation::mask_base, c))) return true; else if((f & re_detail::w32_regex_traits_implementation::mask_unicode) && re_detail::is_extended(c)) @@ -635,7 +635,7 @@ public: else if((f & re_detail::w32_regex_traits_implementation::mask_vertical) && (::boost::re_detail::is_separator(c) || (c == '\v'))) return true; - else if((f & re_detail::w32_regex_traits_implementation::mask_horizontal) + else if((f & re_detail::w32_regex_traits_implementation::mask_horizontal) && this->isctype(c, 0x0008u) && !this->isctype(c, re_detail::w32_regex_traits_implementation::mask_vertical)) return true; return false; @@ -672,7 +672,7 @@ public: static std::string get_catalog_name(); private: - boost::shared_ptr > m_pimpl; + boost::std::shared_ptr > m_pimpl; // // catalog name handler: // diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/detail/shared_ptr_132.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/detail/shared_ptr_132.hpp index b5f2b215..897062f2 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/detail/shared_ptr_132.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/detail/shared_ptr_132.hpp @@ -2,7 +2,7 @@ #define BOOST_SHARED_PTR_132_HPP_INCLUDED // -// shared_ptr.hpp +// std::shared_ptr.hpp // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002, 2003 Peter Dimov @@ -11,7 +11,7 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. +// See http://www.boost.org/libs/smart_ptr/std::shared_ptr.htm for documentation. // #include // for broken compiler workarounds @@ -96,18 +96,18 @@ inline void sp_enable_shared_from_this( shared_count const & /*pn*/, ... ) // -// shared_ptr +// std::shared_ptr // // An enhanced relative of scoped_ptr with reference counted copy semantics. -// The object pointed to is deleted when the last shared_ptr pointing to it +// The object pointed to is deleted when the last std::shared_ptr pointing to it // is destroyed or reset. // -template class shared_ptr +template class std::shared_ptr { private: // Borland 5.5.1 specific workaround - typedef shared_ptr< T > this_type; + typedef std::shared_ptr< T > this_type; public: @@ -116,16 +116,16 @@ public: typedef T * pointer; typedef BOOST_DEDUCED_TYPENAME detail::shared_ptr_traits< T >::reference reference; - shared_ptr(): px(0), pn() // never throws in 1.30+ + std::shared_ptr(): px(0), pn() // never throws in 1.30+ { } #if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x564) ) template - explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter()) // Y must be complete + explicit std::shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter()) // Y must be complete #else template - explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter()) // Y must be complete + explicit std::shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter()) // Y must be complete #endif { detail::sp_enable_shared_from_this( pn, p, p ); @@ -134,10 +134,10 @@ public: // // Requirements: D's copy constructor must not throw // - // shared_ptr will release p by calling d(p) + // std::shared_ptr will release p by calling d(p) // - template shared_ptr(Y * p, D d): px(p), pn(p, d) + template std::shared_ptr(Y * p, D d): px(p), pn(p, d) { detail::sp_enable_shared_from_this( pn, p, p ); } @@ -147,7 +147,7 @@ public: // except that Borland C++ has a bug, and g++ with -Wsynth warns #if defined(__BORLANDC__) || defined(__GNUC__) - shared_ptr & operator=(shared_ptr const & r) // never throws + std::shared_ptr & operator=(std::shared_ptr const & r) // never throws { px = r.px; pn = r.pn; // shared_count::op= doesn't throw @@ -157,29 +157,29 @@ public: #endif template - explicit shared_ptr(weak_ptr const & r): pn(r.pn) // may throw + explicit std::shared_ptr(weak_ptr const & r): pn(r.pn) // may throw { // it is now safe to copy r.px, as pn(r.pn) did not throw px = r.px; } template - shared_ptr(shared_ptr const & r): px(r.px), pn(r.pn) // never throws + std::shared_ptr(std::shared_ptr const & r): px(r.px), pn(r.pn) // never throws { } template - shared_ptr(shared_ptr const & r, detail::static_cast_tag): px(static_cast(r.px)), pn(r.pn) + std::shared_ptr(std::shared_ptr const & r, detail::static_cast_tag): px(static_cast(r.px)), pn(r.pn) { } template - shared_ptr(shared_ptr const & r, detail::const_cast_tag): px(const_cast(r.px)), pn(r.pn) + std::shared_ptr(std::shared_ptr const & r, detail::const_cast_tag): px(const_cast(r.px)), pn(r.pn) { } template - shared_ptr(shared_ptr const & r, detail::dynamic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) + std::shared_ptr(std::shared_ptr const & r, detail::dynamic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) { if(px == 0) // need to allocate new counter -- the cast failed { @@ -188,7 +188,7 @@ public: } template - shared_ptr(shared_ptr const & r, detail::polymorphic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) + std::shared_ptr(std::shared_ptr const & r, detail::polymorphic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) { if(px == 0) { @@ -199,7 +199,7 @@ public: #ifndef BOOST_NO_AUTO_PTR template - explicit shared_ptr(std::auto_ptr & r): px(r.get()), pn() + explicit std::shared_ptr(std::auto_ptr & r): px(r.get()), pn() { Y * tmp = r.get(); pn = detail::shared_count(r); @@ -211,7 +211,7 @@ public: #if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200) template - shared_ptr & operator=(shared_ptr const & r) // never throws + std::shared_ptr & operator=(std::shared_ptr const & r) // never throws { px = r.px; pn = r.pn; // shared_count::op= doesn't throw @@ -223,7 +223,7 @@ public: #ifndef BOOST_NO_AUTO_PTR template - shared_ptr & operator=(std::auto_ptr & r) + std::shared_ptr & operator=(std::auto_ptr & r) { this_type(r).swap(*this); return *this; @@ -258,7 +258,7 @@ public: BOOST_ASSERT(px != 0); return px; } - + T * get() const // never throws { return px; @@ -275,13 +275,13 @@ public: #elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) typedef T * (this_type::*unspecified_bool_type)() const; - + operator unspecified_bool_type() const // never throws { return px == 0? 0: &this_type::get; } -#else +#else typedef T * this_type::*unspecified_bool_type; @@ -309,13 +309,13 @@ public: return pn.use_count(); } - void swap(shared_ptr< T > & other) // never throws + void swap(std::shared_ptr< T > & other) // never throws { std::swap(px, other.px); pn.swap(other.pn); } - template bool _internal_less(shared_ptr const & rhs) const + template bool _internal_less(std::shared_ptr const & rhs) const { return pn < rhs.pn; } @@ -332,7 +332,7 @@ public: private: - template friend class shared_ptr; + template friend class std::shared_ptr; template friend class weak_ptr; @@ -341,14 +341,14 @@ public: // for serialization T * px; // contained pointer detail::shared_count pn; // reference counter -}; // shared_ptr +}; // std::shared_ptr -template inline bool operator==(shared_ptr< T > const & a, shared_ptr const & b) +template inline bool operator==(std::shared_ptr< T > const & a, std::shared_ptr const & b) { return a.get() == b.get(); } -template inline bool operator!=(shared_ptr< T > const & a, shared_ptr const & b) +template inline bool operator!=(std::shared_ptr< T > const & a, std::shared_ptr const & b) { return a.get() != b.get(); } @@ -357,64 +357,64 @@ template inline bool operator!=(shared_ptr< T > const & a, sha // Resolve the ambiguity between our op!= and the one in rel_ops -template inline bool operator!=(shared_ptr< T > const & a, shared_ptr< T > const & b) +template inline bool operator!=(std::shared_ptr< T > const & a, std::shared_ptr< T > const & b) { return a.get() != b.get(); } #endif -template inline bool operator<(shared_ptr< T > const & a, shared_ptr const & b) +template inline bool operator<(std::shared_ptr< T > const & a, std::shared_ptr const & b) { return a._internal_less(b); } -template inline void swap(shared_ptr< T > & a, shared_ptr< T > & b) +template inline void swap(std::shared_ptr< T > & a, std::shared_ptr< T > & b) { a.swap(b); } -template shared_ptr< T > static_pointer_cast(shared_ptr const & r) +template std::shared_ptr< T > static_pointer_cast(std::shared_ptr const & r) { - return shared_ptr< T >(r, detail::static_cast_tag()); + return std::shared_ptr< T >(r, detail::static_cast_tag()); } -template shared_ptr< T > const_pointer_cast(shared_ptr const & r) +template std::shared_ptr< T > const_pointer_cast(std::shared_ptr const & r) { - return shared_ptr< T >(r, detail::const_cast_tag()); + return std::shared_ptr< T >(r, detail::const_cast_tag()); } -template shared_ptr< T > dynamic_pointer_cast(shared_ptr const & r) +template std::shared_ptr< T > dynamic_pointer_cast(std::shared_ptr const & r) { - return shared_ptr< T >(r, detail::dynamic_cast_tag()); + return std::shared_ptr< T >(r, detail::dynamic_cast_tag()); } // shared_*_cast names are deprecated. Use *_pointer_cast instead. -template shared_ptr< T > shared_static_cast(shared_ptr const & r) +template std::shared_ptr< T > shared_static_cast(std::shared_ptr const & r) { - return shared_ptr< T >(r, detail::static_cast_tag()); + return std::shared_ptr< T >(r, detail::static_cast_tag()); } -template shared_ptr< T > shared_dynamic_cast(shared_ptr const & r) +template std::shared_ptr< T > shared_dynamic_cast(std::shared_ptr const & r) { - return shared_ptr< T >(r, detail::dynamic_cast_tag()); + return std::shared_ptr< T >(r, detail::dynamic_cast_tag()); } -template shared_ptr< T > shared_polymorphic_cast(shared_ptr const & r) +template std::shared_ptr< T > shared_polymorphic_cast(std::shared_ptr const & r) { - return shared_ptr< T >(r, detail::polymorphic_cast_tag()); + return std::shared_ptr< T >(r, detail::polymorphic_cast_tag()); } -template shared_ptr< T > shared_polymorphic_downcast(shared_ptr const & r) +template std::shared_ptr< T > shared_polymorphic_downcast(std::shared_ptr const & r) { BOOST_ASSERT(dynamic_cast(r.get()) == r.get()); return shared_static_cast< T >(r); } -// get_pointer() enables boost::mem_fn to recognize shared_ptr +// get_pointer() enables boost::mem_fn to recognize std::shared_ptr -template inline T * get_pointer(shared_ptr< T > const & p) +template inline T * get_pointer(std::shared_ptr< T > const & p) { return p.get(); } @@ -423,7 +423,7 @@ template inline T * get_pointer(shared_ptr< T > const & p) #if defined(__GNUC__) && (__GNUC__ < 3) -template std::ostream & operator<< (std::ostream & os, shared_ptr const & p) +template std::ostream & operator<< (std::ostream & os, std::shared_ptr const & p) { os << p.get(); return os; @@ -434,10 +434,10 @@ template std::ostream & operator<< (std::ostream & os, shared_ptr co # if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT) // MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL using std::basic_ostream; -template basic_ostream & operator<< (basic_ostream & os, shared_ptr const & p) +template basic_ostream & operator<< (basic_ostream & os, std::shared_ptr const & p) # else -template std::basic_ostream & operator<< (std::basic_ostream & os, shared_ptr const & p) -# endif +template std::basic_ostream & operator<< (std::basic_ostream & os, std::shared_ptr const & p) +# endif { os << p.get(); return os; @@ -452,7 +452,7 @@ template std::basic_ostream & operator<< (std:: // g++ 2.9x doesn't allow static_cast(void *) // apparently EDG 2.38 also doesn't accept it -template D * get_deleter(shared_ptr< T > const & p) +template D * get_deleter(std::shared_ptr< T > const & p) { void const * q = p._internal_get_deleter(typeid(D)); return const_cast(static_cast(q)); @@ -460,7 +460,7 @@ template D * get_deleter(shared_ptr< T > const & p) #else -template D * get_deleter(shared_ptr< T > const & p) +template D * get_deleter(std::shared_ptr< T > const & p) { return static_cast(p._internal_get_deleter(typeid(D))); } @@ -471,7 +471,7 @@ template D * get_deleter(shared_ptr< T > const & p) #ifdef BOOST_MSVC # pragma warning(pop) -#endif +#endif #endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/detail/shared_ptr_nmt_132.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/detail/shared_ptr_nmt_132.hpp index 490e7ddd..0f9c8282 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/detail/shared_ptr_nmt_132.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/detail/shared_ptr_nmt_132.hpp @@ -2,7 +2,7 @@ #define BOOST_DETAIL_SHARED_PTR_NMT_132_HPP_INCLUDED // -// detail/shared_ptr_nmt.hpp - shared_ptr.hpp without member templates +// detail/shared_ptr_nmt.hpp - std::shared_ptr.hpp without member templates // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002 Peter Dimov @@ -11,7 +11,7 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. +// See http://www.boost.org/libs/smart_ptr/std::shared_ptr.htm for documentation. // #include @@ -30,7 +30,7 @@ namespace boost { -template class shared_ptr +template class std::shared_ptr { private: @@ -41,7 +41,7 @@ public: typedef T element_type; typedef T value_type; - explicit shared_ptr(T * p = 0): px(p) + explicit std::shared_ptr(T * p = 0): px(p) { #ifndef BOOST_NO_EXCEPTIONS @@ -68,7 +68,7 @@ public: #endif } - ~shared_ptr() + ~std::shared_ptr() { if(--*pn == 0) { @@ -77,29 +77,29 @@ public: } } - shared_ptr(shared_ptr const & r): px(r.px) // never throws + std::shared_ptr(std::shared_ptr const & r): px(r.px) // never throws { pn = r.pn; ++*pn; } - shared_ptr & operator=(shared_ptr const & r) + std::shared_ptr & operator=(std::shared_ptr const & r) { - shared_ptr(r).swap(*this); + std::shared_ptr(r).swap(*this); return *this; } #ifndef BOOST_NO_AUTO_PTR - explicit shared_ptr(std::auto_ptr< T > & r) - { + explicit std::shared_ptr(std::auto_ptr< T > & r) + { pn = new count_type(1); // may throw px = r.release(); // fix: moved here to stop leak if new throws - } + } - shared_ptr & operator=(std::auto_ptr< T > & r) + std::shared_ptr & operator=(std::auto_ptr< T > & r) { - shared_ptr(r).swap(*this); + std::shared_ptr(r).swap(*this); return *this; } @@ -108,7 +108,7 @@ public: void reset(T * p = 0) { BOOST_ASSERT(p == 0 || p != px); - shared_ptr(p).swap(*this); + std::shared_ptr(p).swap(*this); } T & operator*() const // never throws @@ -137,8 +137,8 @@ public: { return *pn == 1; } - - void swap(shared_ptr< T > & other) // never throws + + void swap(std::shared_ptr< T > & other) // never throws { std::swap(px, other.px); std::swap(pn, other.pn); @@ -150,29 +150,29 @@ private: count_type * pn; // ptr to reference counter }; -template inline bool operator==(shared_ptr< T > const & a, shared_ptr const & b) +template inline bool operator==(std::shared_ptr< T > const & a, std::shared_ptr const & b) { return a.get() == b.get(); } -template inline bool operator!=(shared_ptr< T > const & a, shared_ptr const & b) +template inline bool operator!=(std::shared_ptr< T > const & a, std::shared_ptr const & b) { return a.get() != b.get(); } -template inline bool operator<(shared_ptr< T > const & a, shared_ptr< T > const & b) +template inline bool operator<(std::shared_ptr< T > const & a, std::shared_ptr< T > const & b) { return std::less()(a.get(), b.get()); } -template void swap(shared_ptr< T > & a, shared_ptr< T > & b) +template void swap(std::shared_ptr< T > & a, std::shared_ptr< T > & b) { a.swap(b); } -// get_pointer() enables boost::mem_fn to recognize shared_ptr +// get_pointer() enables boost::mem_fn to recognize std::shared_ptr -template inline T * get_pointer(shared_ptr< T > const & p) +template inline T * get_pointer(std::shared_ptr< T > const & p) { return p.get(); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/shared_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/shared_ptr.hpp index 37f95e35..63eab8c5 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/shared_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/shared_ptr.hpp @@ -7,7 +7,7 @@ #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// shared_ptr.hpp: serialization for boost shared pointer +// std::shared_ptr.hpp: serialization for boost shared pointer // (C) Copyright 2004 Robert Ramey and Martin Ecker // Use, modification and distribution is subject to the Boost Software @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -31,7 +31,7 @@ #include /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// shared_ptr serialization traits +// std::shared_ptr serialization traits // version 1 to distinguish from boost 1.32 version. Note: we can only do this // for a template when the compiler supports partial template specialization @@ -39,7 +39,7 @@ namespace boost { namespace serialization{ template - struct version< ::boost::shared_ptr< T > > { + struct version< ::boost::std::shared_ptr< T > > { typedef mpl::integral_c_tag tag; #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) typedef BOOST_DEDUCED_TYPENAME mpl::int_<1> type; @@ -54,7 +54,7 @@ }; // don't track shared pointers template - struct tracking_level< ::boost::shared_ptr< T > > { + struct tracking_level< ::boost::std::shared_ptr< T > > { typedef mpl::integral_c_tag tag; #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) typedef BOOST_DEDUCED_TYPENAME mpl::int_< ::boost::serialization::track_never> type; @@ -73,11 +73,11 @@ // define macro to let users of these compilers do this #define BOOST_SERIALIZATION_SHARED_PTR(T) \ BOOST_CLASS_VERSION( \ - ::boost::shared_ptr< T >, \ + ::boost::std::shared_ptr< T >, \ 1 \ ) \ BOOST_CLASS_TRACKING( \ - ::boost::shared_ptr< T >, \ + ::boost::std::shared_ptr< T >, \ ::boost::serialization::track_never \ ) \ /**/ @@ -91,16 +91,16 @@ struct null_deleter { }; /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// serialization for shared_ptr +// serialization for std::shared_ptr template inline void save( Archive & ar, - const boost::shared_ptr< T > &t, + const boost::std::shared_ptr< T > &t, const unsigned int /* file_version */ ){ // The most common cause of trapping here would be serializing - // something like shared_ptr. This occurs because int + // something like std::shared_ptr. This occurs because int // is never tracked by default. Wrap int in a trackable type BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); const T * t_ptr = t.get(); @@ -111,11 +111,11 @@ inline void save( template inline void load( Archive & ar, - boost::shared_ptr< T > &t, + boost::std::shared_ptr< T > &t, const unsigned int file_version ){ // The most common cause of trapping here would be serializing - // something like shared_ptr. This occurs because int + // something like std::shared_ptr. This occurs because int // is never tracked by default. Wrap int in a trackable type BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); T* r; @@ -126,7 +126,7 @@ inline void load( ar.register_type(static_cast< boost_132::detail::sp_counted_base_impl * >(NULL)); - boost_132::shared_ptr< T > sp; + boost_132::std::shared_ptr< T > sp; ar >> boost::serialization::make_nvp("px", sp.px); ar >> boost::serialization::make_nvp("pn", sp.pn); // got to keep the sps around so the sp.pns don't disappear @@ -143,11 +143,11 @@ inline void load( template inline void load( Archive & ar, - boost::shared_ptr< T > &t, + boost::std::shared_ptr< T > &t, const unsigned int /*file_version*/ ){ // The most common cause of trapping here would be serializing - // something like shared_ptr. This occurs because int + // something like std::shared_ptr. This occurs because int // is never tracked by default. Wrap int in a trackable type BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); T* r; @@ -159,10 +159,10 @@ inline void load( template inline void serialize( Archive & ar, - boost::shared_ptr< T > &t, + boost::std::shared_ptr< T > &t, const unsigned int file_version ){ - // correct shared_ptr serialization depends upon object tracking + // correct std::shared_ptr serialization depends upon object tracking // being used. BOOST_STATIC_ASSERT( boost::serialization::tracking_level< T >::value diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/shared_ptr_132.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/shared_ptr_132.hpp index 9bcefe09..cdc888b8 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/shared_ptr_132.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/shared_ptr_132.hpp @@ -7,9 +7,9 @@ #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// shared_ptr.hpp: serialization for boost shared pointer +// std::shared_ptr.hpp: serialization for boost shared pointer -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -17,8 +17,8 @@ // See http://www.boost.org for updates, documentation, and revision history. // note: totally unadvised hack to gain access to private variables -// in shared_ptr and shared_count. Unfortunately its the only way to -// do this without changing shared_ptr and shared_count +// in std::shared_ptr and shared_count. Unfortunately its the only way to +// do this without changing std::shared_ptr and shared_count // the best we can do is to detect a conflict here #include @@ -38,7 +38,7 @@ // Maintain a couple of lists of loaded shared pointers of the old previous // version (1.32) -namespace boost_132 { +namespace boost_132 { namespace serialization { namespace detail { @@ -53,7 +53,7 @@ struct null_deleter { ///////////////////////////////////////////////////////////// // sp_counted_base_impl serialization -namespace boost { +namespace boost { namespace serialization { template @@ -66,7 +66,7 @@ inline void serialize( // its polymorphic base boost::serialization::void_cast_register< boost_132::detail::sp_counted_base_impl, - boost_132::detail::sp_counted_base + boost_132::detail::sp_counted_base >( static_cast *>(NULL), static_cast(NULL) @@ -76,8 +76,8 @@ inline void serialize( template inline void save_construct_data( Archive & ar, - const - boost_132::detail::sp_counted_base_impl *t, + const + boost_132::detail::sp_counted_base_impl *t, const BOOST_PFTO unsigned int /* file_version */ ){ // variables used for construction @@ -87,25 +87,25 @@ inline void save_construct_data( template inline void load_construct_data( Archive & ar, - boost_132::detail::sp_counted_base_impl * t, + boost_132::detail::sp_counted_base_impl * t, const unsigned int /* file_version */ ){ P ptr_; ar >> boost::serialization::make_nvp("ptr", ptr_); - // ::new(t)boost_132::detail::sp_counted_base_impl(ptr_, D()); + // ::new(t)boost_132::detail::sp_counted_base_impl(ptr_, D()); // placement // note: the original ::new... above is replaced by the one here. This one // creates all new objects with a null_deleter so that after the archive // is finished loading and the shared_ptrs are destroyed - the underlying - // raw pointers are NOT deleted. This is necessary as they are used by the + // raw pointers are NOT deleted. This is necessary as they are used by the // new system as well. ::new(t)boost_132::detail::sp_counted_base_impl< - P, + P, boost_132::serialization::detail::null_deleter >( ptr_, boost_132::serialization::detail::null_deleter() ); // placement new - // compensate for that fact that a new shared count always is + // compensate for that fact that a new shared count always is // initialized with one. the add_ref_copy below will increment it // every time its serialized so without this adjustment // the use and weak counts will be off by one. @@ -118,7 +118,7 @@ inline void load_construct_data( ///////////////////////////////////////////////////////////// // shared_count serialization -namespace boost { +namespace boost { namespace serialization { template @@ -147,15 +147,15 @@ inline void load( BOOST_SERIALIZATION_SPLIT_FREE(boost_132::detail::shared_count) ///////////////////////////////////////////////////////////// -// implement serialization for shared_ptr< T > +// implement serialization for std::shared_ptr< T > -namespace boost { +namespace boost { namespace serialization { template inline void save( Archive & ar, - const boost_132::shared_ptr< T > &t, + const boost_132::std::shared_ptr< T > &t, const unsigned int /* file_version */ ){ // only the raw pointer has to be saved @@ -170,7 +170,7 @@ inline void save( template inline void load( Archive & ar, - boost_132::shared_ptr< T > &t, + boost_132::std::shared_ptr< T > &t, const unsigned int /* file_version */ ){ // only the raw pointer has to be saved @@ -185,10 +185,10 @@ inline void load( template inline void serialize( Archive & ar, - boost_132::shared_ptr< T > &t, + boost_132::std::shared_ptr< T > &t, const unsigned int file_version ){ - // correct shared_ptr serialization depends upon object tracking + // correct std::shared_ptr serialization depends upon object tracking // being used. BOOST_STATIC_ASSERT( boost::serialization::tracking_level< T >::value @@ -200,7 +200,7 @@ inline void serialize( } // serialization } // namespace boost -// note: change below uses null_deleter +// note: change below uses null_deleter // This macro is used to export GUIDS for shared pointers to allow // the serialization system to export them properly. David Tonge #define BOOST_SHARED_POINTER_EXPORT_GUID(T, K) \ diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/weak_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/weak_ptr.hpp index 3fe8698d..a6add742 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/weak_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/serialization/weak_ptr.hpp @@ -7,7 +7,7 @@ #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// shared_ptr.hpp: serialization for boost shared pointer +// std::shared_ptr.hpp: serialization for boost shared pointer // (C) Copyright 2004 Robert Ramey and Martin Ecker // Use, modification and distribution is subject to the Boost Software @@ -17,7 +17,7 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include +#include namespace boost { namespace serialization{ @@ -28,7 +28,7 @@ inline void save( const boost::weak_ptr< T > &t, const unsigned int /* file_version */ ){ - const boost::shared_ptr< T > sp = t.lock(); + const boost::std::shared_ptr< T > sp = t.lock(); ar << boost::serialization::make_nvp("weak_ptr", sp); } @@ -38,7 +38,7 @@ inline void load( boost::weak_ptr< T > &t, const unsigned int /* file_version */ ){ - boost::shared_ptr< T > sp; + boost::std::shared_ptr< T > sp; ar >> boost::serialization::make_nvp("weak_ptr", sp); t = sp; } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/shared_container_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/shared_container_iterator.hpp index 7d8ecd3e..5a8f0af5 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/shared_container_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/shared_container_iterator.hpp @@ -9,7 +9,7 @@ #define SHARED_CONTAINER_ITERATOR_RG08102002_HPP #include "boost/iterator_adaptors.hpp" -#include "boost/shared_ptr.hpp" +#include "boost/std::shared_ptr.hpp" #include namespace boost { @@ -24,7 +24,7 @@ class shared_container_iterator : public iterator_adaptor< typename Container::iterator> super_t; typedef typename Container::iterator iterator_t; - typedef boost::shared_ptr container_ref_t; + typedef boost::std::shared_ptr container_ref_t; container_ref_t container_ref; public: @@ -39,7 +39,7 @@ public: template shared_container_iterator make_shared_container_iterator(typename Container::iterator iter, - boost::shared_ptr const& container) { + boost::std::shared_ptr const& container) { typedef shared_container_iterator iterator; return iterator(iter,container); } @@ -50,7 +50,7 @@ template std::pair< shared_container_iterator, shared_container_iterator > -make_shared_container_range(boost::shared_ptr const& container) { +make_shared_container_range(boost::std::shared_ptr const& container) { return std::make_pair( make_shared_container_iterator(container->begin(),container), diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/shared_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/shared_ptr.hpp index d31978c9..bcc40bff 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/shared_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/shared_ptr.hpp @@ -2,7 +2,7 @@ #define BOOST_SHARED_PTR_HPP_INCLUDED // -// shared_ptr.hpp +// std::shared_ptr.hpp // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001-2008 Peter Dimov @@ -11,9 +11,9 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. +// See http://www.boost.org/libs/smart_ptr/std::shared_ptr.htm for documentation. // -#include +#include #endif // #ifndef BOOST_SHARED_PTR_HPP_INCLUDED diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/connection.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/connection.hpp index 1ede6be7..8ef685b1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/connection.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/connection.hpp @@ -97,7 +97,7 @@ namespace boost { void set_controlling(bool control = true) { controlling_connection = control; } - shared_ptr + std::shared_ptr get_connection() const { return con; } @@ -115,7 +115,7 @@ namespace boost { friend class BOOST_SIGNALS_NAMESPACE::detail::bound_objects_visitor; // Pointer to the actual contents of the connection - shared_ptr con; + std::shared_ptr con; // True if the destruction of this connection object should disconnect bool controlling_connection; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/detail/named_slot_map.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/detail/named_slot_map.hpp index 88625fae..84a1e04c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/detail/named_slot_map.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/detail/named_slot_map.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -45,7 +45,7 @@ class stored_group private: storage_kind kind; - shared_ptr group; + std::shared_ptr group; }; typedef function2 compare_type; @@ -60,7 +60,7 @@ public: typedef const stored_group& first_argument_type; typedef const stored_group& second_argument_type; - group_bridge_compare(const Compare& c) : comp(c) + group_bridge_compare(const Compare& c) : comp(c) { } bool operator()(const stored_group& k1, const stored_group& k2) const @@ -93,15 +93,15 @@ class BOOST_SIGNALS_DECL named_slot_map_iterator : connection_slot_pair, forward_traversal_tag> inherited; public: - named_slot_map_iterator() : slot_assigned(false) + named_slot_map_iterator() : slot_assigned(false) { } - named_slot_map_iterator(const named_slot_map_iterator& other) + named_slot_map_iterator(const named_slot_map_iterator& other) : group(other.group), last_group(other.last_group), slot_assigned(other.slot_assigned) { if (slot_assigned) slot_ = other.slot_; } - named_slot_map_iterator& operator=(const named_slot_map_iterator& other) + named_slot_map_iterator& operator=(const named_slot_map_iterator& other) { slot_assigned = other.slot_assigned; group = other.group; @@ -109,11 +109,11 @@ public: if (slot_assigned) slot_ = other.slot_; return *this; } - connection_slot_pair& dereference() const + connection_slot_pair& dereference() const { return *slot_; } - void increment() + void increment() { ++slot_; if (slot_ == group->second.end()) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/detail/signal_base.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/detail/signal_base.hpp index 0438cf7b..d82100ce 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/detail/signal_base.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/detail/signal_base.hpp @@ -33,10 +33,10 @@ namespace boost { // manages call depth class BOOST_SIGNALS_DECL call_notification { public: - call_notification(const shared_ptr&); + call_notification(const std::shared_ptr&); ~call_notification(); - shared_ptr impl; + std::shared_ptr impl; }; // Implementation of base class for all signals. It handles the @@ -87,7 +87,7 @@ namespace boost { connection connect_slot(const any& slot, const stored_group& name, - shared_ptr data, + std::shared_ptr data, connect_position at); private: @@ -138,7 +138,7 @@ namespace boost { protected: connection connect_slot(const any& slot, const stored_group& name, - shared_ptr data, + std::shared_ptr data, connect_position at) { return impl->connect_slot(slot, name, data, at); @@ -146,7 +146,7 @@ namespace boost { typedef named_slot_map::iterator iterator; - shared_ptr impl; + std::shared_ptr impl; }; } // end namespace detail } // end namespace BOOST_SIGNALS_NAMESPACE diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/slot.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/slot.hpp index bbf18480..6d1533d2 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/slot.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals/slot.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #ifdef BOOST_HAS_ABI_HEADERS @@ -33,7 +33,7 @@ namespace boost { std::vector bound_objects; connection watch_bound_objects; }; - shared_ptr get_data() const { return data; } + std::shared_ptr get_data() const { return data; } // Get the set of bound objects std::vector& get_bound_objects() const @@ -41,14 +41,14 @@ namespace boost { // Determine if this slot is still "active", i.e., all of the bound // objects still exist - bool is_active() const + bool is_active() const { return data->watch_bound_objects.connected(); } protected: // Create a connection for this slot void create_connection(); - shared_ptr data; + std::shared_ptr data; private: static void bound_object_destructed(void*, void*) {} @@ -116,9 +116,9 @@ namespace boost { // An exception thrown here will allow the basic_connection to be // destroyed when this goes out of scope, and no other connections // have been made. - BOOST_SIGNALS_NAMESPACE::detail::bound_objects_visitor + BOOST_SIGNALS_NAMESPACE::detail::bound_objects_visitor do_bind(this->data->bound_objects); - visit_each(do_bind, + visit_each(do_bind, BOOST_SIGNALS_NAMESPACE::get_inspectable_slot (f, BOOST_SIGNALS_NAMESPACE::tag_type(f))); create_connection(); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/connection.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/connection.hpp index 0271a3c1..13136cc6 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/connection.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/connection.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -48,11 +48,11 @@ namespace boost _connected = false; } virtual bool connected() const = 0; - shared_ptr get_blocker() + std::shared_ptr get_blocker() { unique_lock local_lock(*this); - shared_ptr blocker = _weak_blocker.lock(); - if(blocker == shared_ptr()) + std::shared_ptr blocker = _weak_blocker.lock(); + if(blocker == std::shared_ptr()) { blocker.reset(this, &null_deleter); _weak_blocker = blocker; @@ -161,26 +161,26 @@ namespace boost ~connection() {} void disconnect() const { - boost::shared_ptr connectionBody(_weak_connection_body.lock()); + boost::std::shared_ptr connectionBody(_weak_connection_body.lock()); if(connectionBody == 0) return; connectionBody->disconnect(); } bool connected() const { - boost::shared_ptr connectionBody(_weak_connection_body.lock()); + boost::std::shared_ptr connectionBody(_weak_connection_body.lock()); if(connectionBody == 0) return false; return connectionBody->connected(); } bool blocked() const { - boost::shared_ptr connectionBody(_weak_connection_body.lock()); + boost::std::shared_ptr connectionBody(_weak_connection_body.lock()); if(connectionBody == 0) return true; return connectionBody->blocked(); } bool operator==(const connection& other) const { - boost::shared_ptr connectionBody(_weak_connection_body.lock()); - boost::shared_ptr otherConnectionBody(other._weak_connection_body.lock()); + boost::std::shared_ptr connectionBody(_weak_connection_body.lock()); + boost::std::shared_ptr otherConnectionBody(other._weak_connection_body.lock()); return connectionBody == otherConnectionBody; } bool operator!=(const connection& other) const @@ -189,8 +189,8 @@ namespace boost } bool operator<(const connection& other) const { - boost::shared_ptr connectionBody(_weak_connection_body.lock()); - boost::shared_ptr otherConnectionBody(other._weak_connection_body.lock()); + boost::std::shared_ptr connectionBody(_weak_connection_body.lock()); + boost::std::shared_ptr otherConnectionBody(other._weak_connection_body.lock()); return connectionBody < otherConnectionBody; } void swap(connection &other) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/deconstruct.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/deconstruct.hpp index d3eca33c..d651fa31 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/deconstruct.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/deconstruct.hpp @@ -3,8 +3,8 @@ // deconstruct.hpp // -// A factory function for creating a shared_ptr which creates -// an object and its owning shared_ptr with one allocation, similar +// A factory function for creating a std::shared_ptr which creates +// an object and its owning std::shared_ptr with one allocation, similar // to make_shared(). It also supports postconstructors // and predestructors through unqualified calls of adl_postconstruct() and // adl_predestruct, relying on argument-dependent @@ -25,7 +25,7 @@ // for more information #include -#include +#include #include #include #include @@ -50,11 +50,11 @@ template class postconstructor_invoker { public: - operator const shared_ptr & () const + operator const std::shared_ptr & () const { return postconstruct(); } - const shared_ptr& postconstruct() const + const std::shared_ptr& postconstruct() const { if(!_postconstructed) { @@ -65,7 +65,7 @@ public: } #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - const shared_ptr& postconstruct(Args && ... args) + const std::shared_ptr& postconstruct(Args && ... args) { if(!_postconstructed) { @@ -77,7 +77,7 @@ public: } #else // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - const shared_ptr& postconstruct(const A1 &a1) const + const std::shared_ptr& postconstruct(const A1 &a1) const { if(!_postconstructed) { @@ -88,7 +88,7 @@ public: return _sp; } template - const shared_ptr& postconstruct(const A1 &a1, const A2 &a2) const + const std::shared_ptr& postconstruct(const A1 &a1, const A2 &a2) const { if(!_postconstructed) { @@ -99,7 +99,7 @@ public: return _sp; } template - const shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3) const + const std::shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3) const { if(!_postconstructed) { @@ -110,7 +110,7 @@ public: return _sp; } template - const shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) const + const std::shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) const { if(!_postconstructed) { @@ -121,7 +121,7 @@ public: return _sp; } template - const shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) const + const std::shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) const { if(!_postconstructed) { @@ -133,7 +133,7 @@ public: } template - const shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, + const std::shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) const { if(!_postconstructed) @@ -146,7 +146,7 @@ public: } template - const shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, + const std::shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) const { if(!_postconstructed) @@ -159,7 +159,7 @@ public: } template - const shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, + const std::shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) const { if(!_postconstructed) @@ -172,7 +172,7 @@ public: } template - const shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, + const std::shared_ptr& postconstruct(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9) const { if(!_postconstructed) @@ -186,10 +186,10 @@ public: #endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) private: friend class boost::signals2::deconstruct_access; - postconstructor_invoker(const shared_ptr & sp): + postconstructor_invoker(const std::shared_ptr & sp): _sp(sp), _postconstructed(false) {} - shared_ptr _sp; + std::shared_ptr _sp; mutable bool _postconstructed; }; @@ -269,7 +269,7 @@ public: template< class T > static postconstructor_invoker deconstruct() { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -278,7 +278,7 @@ public: new( pv ) T(); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; @@ -291,7 +291,7 @@ public: template< class T, class... Args > static postconstructor_invoker deconstruct( Args && ... args ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -300,7 +300,7 @@ public: new( pv ) T( std::forward( args )... ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } @@ -310,7 +310,7 @@ public: template< class T, class A1 > static postconstructor_invoker deconstruct( A1 const & a1 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -319,7 +319,7 @@ public: new( pv ) T( a1 ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } @@ -327,7 +327,7 @@ public: template< class T, class A1, class A2 > static postconstructor_invoker deconstruct( A1 const & a1, A2 const & a2 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -336,7 +336,7 @@ public: new( pv ) T( a1, a2 ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } @@ -344,7 +344,7 @@ public: template< class T, class A1, class A2, class A3 > static postconstructor_invoker deconstruct( A1 const & a1, A2 const & a2, A3 const & a3 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -353,7 +353,7 @@ public: new( pv ) T( a1, a2, a3 ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } @@ -361,7 +361,7 @@ public: template< class T, class A1, class A2, class A3, class A4 > static postconstructor_invoker deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -370,7 +370,7 @@ public: new( pv ) T( a1, a2, a3, a4 ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } @@ -378,7 +378,7 @@ public: template< class T, class A1, class A2, class A3, class A4, class A5 > static postconstructor_invoker deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -387,7 +387,7 @@ public: new( pv ) T( a1, a2, a3, a4, a5 ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } @@ -395,7 +395,7 @@ public: template< class T, class A1, class A2, class A3, class A4, class A5, class A6 > static postconstructor_invoker deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -404,7 +404,7 @@ public: new( pv ) T( a1, a2, a3, a4, a5, a6 ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } @@ -412,7 +412,7 @@ public: template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > static postconstructor_invoker deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -421,7 +421,7 @@ public: new( pv ) T( a1, a2, a3, a4, a5, a6, a7 ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } @@ -429,7 +429,7 @@ public: template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > static postconstructor_invoker deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -438,7 +438,7 @@ public: new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8 ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } @@ -446,7 +446,7 @@ public: template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > static postconstructor_invoker deconstruct( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::deconstruct_deleter< T >() ); detail::deconstruct_deleter< T > * pd = boost::get_deleter< detail::deconstruct_deleter< T > >( pt ); @@ -455,7 +455,7 @@ public: new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8, a9 ); pd->set_initialized(); - boost::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); + boost::std::shared_ptr< T > retval( pt, static_cast< T* >( pv ) ); boost::detail::sp_enable_shared_from_this(&retval, retval.get(), retval.get()); return retval; } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/deconstruct_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/deconstruct_ptr.hpp index 841b19b2..a376c197 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/deconstruct_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/deconstruct_ptr.hpp @@ -1,7 +1,7 @@ // DEPRECATED in favor of adl_postconstruct and adl_predestruct with // deconstruct(). -// A factory function for creating a shared_ptr that enhances the plain -// shared_ptr constructors by adding support for postconstructors +// A factory function for creating a std::shared_ptr that enhances the plain +// std::shared_ptr constructors by adding support for postconstructors // and predestructors through the boost::signals2::postconstructible and // boost::signals2::predestructible base classes. // @@ -19,7 +19,7 @@ #include #include #include -#include +#include namespace boost { @@ -63,17 +63,17 @@ namespace boost }; template - shared_ptr deconstruct_ptr(T *ptr) + std::shared_ptr deconstruct_ptr(T *ptr) { - if(ptr == 0) return shared_ptr(ptr); - shared_ptr shared(ptr, boost::signals2::predestructing_deleter()); + if(ptr == 0) return std::shared_ptr(ptr); + std::shared_ptr shared(ptr, boost::signals2::predestructing_deleter()); detail::do_postconstruct(ptr); return shared; } template - shared_ptr deconstruct_ptr(T *ptr, D deleter) + std::shared_ptr deconstruct_ptr(T *ptr, D deleter) { - shared_ptr shared(ptr, deleter); + std::shared_ptr shared(ptr, deleter); if(ptr == 0) return shared; detail::do_postconstruct(ptr); return shared; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/foreign_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/foreign_ptr.hpp index 47c59962..a53bb6d4 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/foreign_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/foreign_ptr.hpp @@ -1,5 +1,5 @@ -// helper code for dealing with tracking non-boost shared_ptr/weak_ptr +// helper code for dealing with tracking non-boost std::shared_ptr/weak_ptr // Copyright Frank Mori Hess 2009. // Distributed under the Boost Software License, Version @@ -31,7 +31,7 @@ namespace boost { - template class shared_ptr; + template class std::shared_ptr; template class weak_ptr; namespace signals2 @@ -40,7 +40,7 @@ namespace boost {}; template struct weak_ptr_traits > { - typedef boost::shared_ptr shared_type; + typedef boost::std::shared_ptr shared_type; }; #ifndef BOOST_SIGNALS2_NO_CXX11_SMART_PTR template struct weak_ptr_traits > @@ -52,7 +52,7 @@ namespace boost template struct shared_ptr_traits {}; - template struct shared_ptr_traits > + template struct shared_ptr_traits > { typedef boost::weak_ptr weak_type; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/signal_template.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/signal_template.hpp index 45e70316..8fef5f83 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/signal_template.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/signal_template.hpp @@ -112,7 +112,7 @@ namespace boost {} ExtendedSlotFunction _fun; - boost::shared_ptr _connection; + boost::std::shared_ptr _connection; }; template @@ -139,7 +139,7 @@ namespace boost #endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES typedef slot_call_iterator_cache slot_call_iterator_cache_type; typedef typename group_key::type group_key_type; - typedef shared_ptr > connection_body_type; + typedef std::shared_ptr > connection_body_type; typedef grouped_list connection_list_type; typedef BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(BOOST_SIGNALS2_NUM_ARGS) bound_extended_slot_function_type; @@ -191,7 +191,7 @@ namespace boost // disconnect slot(s) void disconnect_all_slots() { - shared_ptr local_state = + std::shared_ptr local_state = get_readable_state(); typename connection_list_type::iterator it; for(it = local_state->connection_bodies().begin(); @@ -202,7 +202,7 @@ namespace boost } void disconnect(const group_type &group) { - shared_ptr local_state = + std::shared_ptr local_state = get_readable_state(); group_key_type group_key(grouped_slots, group); typename connection_list_type::iterator it; @@ -223,7 +223,7 @@ namespace boost // emit signal result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) { - shared_ptr local_state; + std::shared_ptr local_state; typename connection_list_type::iterator it; { unique_lock list_lock(_mutex); @@ -247,7 +247,7 @@ namespace boost } result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const { - shared_ptr local_state; + std::shared_ptr local_state; typename connection_list_type::iterator it; { unique_lock list_lock(_mutex); @@ -271,7 +271,7 @@ namespace boost } std::size_t num_slots() const { - shared_ptr local_state = + std::shared_ptr local_state = get_readable_state(); typename connection_list_type::iterator it; std::size_t count = 0; @@ -284,7 +284,7 @@ namespace boost } bool empty() const { - shared_ptr local_state = + std::shared_ptr local_state = get_readable_state(); typename connection_list_type::iterator it; for(it = local_state->connection_bodies().begin(); @@ -396,8 +396,8 @@ namespace boost private: invocation_state(const invocation_state &); - shared_ptr _connection_bodies; - shared_ptr _combiner; + std::shared_ptr _connection_bodies; + std::shared_ptr _combiner; }; // Destructor of invocation_janitor does some cleanup when a signal invocation completes. // Code can't be put directly in signal's operator() due to complications from void return types. @@ -500,7 +500,7 @@ namespace boost } nolock_cleanup_connections_from(false, _shared_state->connection_bodies().begin()); } - shared_ptr get_readable_state() const + std::shared_ptr get_readable_state() const { unique_lock list_lock(_mutex); return _shared_state; @@ -517,7 +517,7 @@ namespace boost template void do_disconnect(const T &slot, mpl::bool_ /* is_group */) { - shared_ptr local_state = + std::shared_ptr local_state = get_readable_state(); typename connection_list_type::iterator it; for(it = local_state->connection_bodies().begin(); @@ -576,7 +576,7 @@ namespace boost } // _shared_state is mutable so we can do force_cleanup_connections during a const invocation - mutable shared_ptr _shared_state; + mutable std::shared_ptr _shared_state; mutable typename connection_list_type::iterator _garbage_collector_it; // connection list mutex must never be locked when attempting a blocking lock on a slot, // or you could deadlock. @@ -715,12 +715,12 @@ namespace boost return (*_pimpl).set_combiner(combiner_arg); } protected: - virtual shared_ptr lock_pimpl() const + virtual std::shared_ptr lock_pimpl() const { return _pimpl; } private: - shared_ptr + std::shared_ptr _pimpl; }; @@ -747,7 +747,7 @@ namespace boost {} result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) { - shared_ptr > shared_pimpl(_weak_pimpl.lock()); if(shared_pimpl == 0) boost::throw_exception(expired_slot()); @@ -755,7 +755,7 @@ namespace boost } result_type operator ()(BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(BOOST_SIGNALS2_NUM_ARGS)) const { - shared_ptr > shared_pimpl(_weak_pimpl.lock()); if(shared_pimpl == 0) boost::throw_exception(expired_slot()); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/postconstructible.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/postconstructible.hpp index faa14444..5ee1d82c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/postconstructible.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/postconstructible.hpp @@ -2,7 +2,7 @@ // A simple framework for creating objects with postconstructors. // The objects must inherit from boost::signals2::postconstructible, and // have their lifetimes managed by -// boost::shared_ptr created with the boost::signals2::deconstruct_ptr() +// boost::std::shared_ptr created with the boost::signals2::deconstruct_ptr() // function. // // Copyright Frank Mori Hess 2007-2008. @@ -17,7 +17,7 @@ namespace boost { - template class shared_ptr; + template class std::shared_ptr; namespace signals2 { @@ -37,7 +37,7 @@ namespace boost public: friend void detail::do_postconstruct(const postconstructible *ptr); template - friend void adl_postconstruct(const shared_ptr &sp, postconstructible *p) + friend void adl_postconstruct(const std::shared_ptr &sp, postconstructible *p) { p->postconstruct(); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/predestructible.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/predestructible.hpp index 0f6806dc..bc7f574c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/predestructible.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/predestructible.hpp @@ -2,7 +2,7 @@ // A simple framework for creating objects with predestructors. // The objects must inherit from boost::signals2::predestructible, and // have their lifetimes managed by -// boost::shared_ptr created with the boost::signals2::deconstruct_ptr() +// boost::std::shared_ptr created with the boost::signals2::deconstruct_ptr() // function. // // Copyright Frank Mori Hess 2007-2008. @@ -29,7 +29,7 @@ namespace boost predestructible() {} public: template - friend void adl_postconstruct(const shared_ptr &, ...) + friend void adl_postconstruct(const std::shared_ptr &, ...) {} friend void adl_predestruct(predestructible *p) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/shared_connection_block.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/shared_connection_block.hpp index c16bf9b9..aa11a90a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/shared_connection_block.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/shared_connection_block.hpp @@ -11,7 +11,7 @@ #ifndef BOOST_SIGNALS2_SHARED_CONNECTION_BLOCK_HPP #define BOOST_SIGNALS2_SHARED_CONNECTION_BLOCK_HPP -#include +#include #include #include @@ -31,7 +31,7 @@ namespace boost void block() { if(blocking()) return; - boost::shared_ptr connection_body(_weak_connection_body.lock()); + boost::std::shared_ptr connection_body(_weak_connection_body.lock()); if(connection_body == 0) { // Make _blocker non-empty so the blocking() method still returns the correct value @@ -47,7 +47,7 @@ namespace boost } bool blocking() const { - shared_ptr empty; + std::shared_ptr empty; return _blocker < empty || empty < _blocker; } signals2::connection connection() const @@ -56,7 +56,7 @@ namespace boost } private: boost::weak_ptr _weak_connection_body; - shared_ptr _blocker; + std::shared_ptr _blocker; }; } } // end namespace boost diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/signal.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/signal.hpp index 4300eeea..f82d541b 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/signal.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/signal.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/signal_base.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/signal_base.hpp index 05b6b5fd..31edf33d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/signal_base.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/signal_base.hpp @@ -12,7 +12,7 @@ #define BOOST_SIGNALS2_SIGNAL_BASE_HPP #include -#include +#include namespace boost { namespace signals2 { @@ -25,7 +25,7 @@ namespace boost { virtual ~signal_base() {} protected: - virtual shared_ptr lock_pimpl() const = 0; + virtual std::shared_ptr lock_pimpl() const = 0; }; } // end namespace signals2 } // end namespace boost diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/slot_base.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/slot_base.hpp index f7f6d39f..fabc1403 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/slot_base.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/slot_base.hpp @@ -13,7 +13,7 @@ #define BOOST_SIGNALS2_SLOT_BASE_HPP #include -#include +#include #include #include #include @@ -32,7 +32,7 @@ namespace boost class tracked_objects_visitor; typedef boost::variant, detail::foreign_void_weak_ptr > void_weak_ptr_variant; - typedef boost::variant, detail::foreign_void_shared_ptr > void_shared_ptr_variant; + typedef boost::variant, detail::foreign_void_shared_ptr > void_shared_ptr_variant; class lock_weak_ptr_visitor { public: diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/trackable.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/trackable.hpp index d6a60149..1438a0c1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/trackable.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/trackable.hpp @@ -17,7 +17,7 @@ #define BOOST_SIGNALS2_TRACKABLE_HPP #include -#include +#include namespace boost { namespace signals2 { @@ -36,12 +36,12 @@ namespace boost { ~trackable() {} private: friend class detail::tracked_objects_visitor; - const shared_ptr& get_shared_ptr() const + const std::shared_ptr& get_shared_ptr() const { return _tracked_ptr; } - shared_ptr _tracked_ptr; + std::shared_ptr _tracked_ptr; }; } // end namespace signals2 } // end namespace boost diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr.hpp index b5e569d8..ec6d2813 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/allocate_shared_array.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/allocate_shared_array.hpp index 3ee16552..d5be0454 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/allocate_shared_array.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/allocate_shared_array.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP #define BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP -#include +#include #include #include #include @@ -29,12 +29,12 @@ namespace boost { std::size_t n1 = size * boost::detail::array_total::size; boost::detail::allocate_array_helper a1(allocator, n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template @@ -47,12 +47,12 @@ namespace boost { std::size_t n1 = size * boost::detail::array_total::size; boost::detail::allocate_array_helper a1(allocator, n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2, boost::detail::sp_forward(args)...); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_size_array::type @@ -66,12 +66,12 @@ namespace boost { T2* p2 = 0; boost::detail::allocate_array_helper a1(allocator, &p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2, boost::detail::sp_forward(args)...); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #endif #if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) @@ -89,13 +89,13 @@ namespace boost { T3* p3 = 0; boost::detail::allocate_array_helper a1(allocator, &p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p3 = reinterpret_cast(list); p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init_list(p2, p3); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_array::type @@ -113,13 +113,13 @@ namespace boost { std::size_t n1 = M * size; boost::detail::allocate_array_helper a1(allocator, n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p3 = reinterpret_cast(list); p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->template init_list(p2, p3); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_size_array::type @@ -137,13 +137,13 @@ namespace boost { T3* p3 = 0; boost::detail::allocate_array_helper a1(allocator, &p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p3 = reinterpret_cast(list); p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->template init_list(p2, p3); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) template @@ -159,13 +159,13 @@ namespace boost { std::size_t n1 = list.size() * boost::detail::array_total::size; boost::detail::allocate_array_helper a1(allocator, n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p3 = reinterpret_cast(list.begin()); p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init_list(p2, p3); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #endif #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) @@ -180,12 +180,12 @@ namespace boost { std::size_t n1 = size * boost::detail::array_total::size; boost::detail::allocate_array_helper a1(allocator, n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2, boost::detail::sp_forward(value)); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_size_array::type @@ -200,12 +200,12 @@ namespace boost { T2* p2 = 0; boost::detail::allocate_array_helper a1(allocator, &p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2, boost::detail::sp_forward(value)); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #endif #endif @@ -219,12 +219,12 @@ namespace boost { std::size_t n1 = size * boost::detail::array_total::size; boost::detail::allocate_array_helper a1(allocator, n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->noinit(p2); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_size_array::type @@ -238,12 +238,12 @@ namespace boost { T2* p2 = 0; boost::detail::allocate_array_helper a1(allocator, &p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->noinit(p2); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/shared_ptr_nmt.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/shared_ptr_nmt.hpp index afc1ec03..bb3d739c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/shared_ptr_nmt.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/shared_ptr_nmt.hpp @@ -2,7 +2,7 @@ #define BOOST_SMART_PTR_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED // -// detail/shared_ptr_nmt.hpp - shared_ptr.hpp without member templates +// detail/shared_ptr_nmt.hpp - std::shared_ptr.hpp without member templates // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002 Peter Dimov @@ -11,7 +11,7 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. +// See http://www.boost.org/libs/smart_ptr/std::shared_ptr.htm for documentation. // #include @@ -30,7 +30,7 @@ namespace boost { -template class shared_ptr +template class std::shared_ptr { private: @@ -41,7 +41,7 @@ public: typedef T element_type; typedef T value_type; - explicit shared_ptr(T * p = 0): px(p) + explicit std::shared_ptr(T * p = 0): px(p) { #ifndef BOOST_NO_EXCEPTIONS @@ -68,7 +68,7 @@ public: #endif } - ~shared_ptr() + ~std::shared_ptr() { if(--*pn == 0) { @@ -77,29 +77,29 @@ public: } } - shared_ptr(shared_ptr const & r): px(r.px) // never throws + std::shared_ptr(std::shared_ptr const & r): px(r.px) // never throws { pn = r.pn; ++*pn; } - shared_ptr & operator=(shared_ptr const & r) + std::shared_ptr & operator=(std::shared_ptr const & r) { - shared_ptr(r).swap(*this); + std::shared_ptr(r).swap(*this); return *this; } #ifndef BOOST_NO_AUTO_PTR - explicit shared_ptr(std::auto_ptr & r) - { + explicit std::shared_ptr(std::auto_ptr & r) + { pn = new count_type(1); // may throw px = r.release(); // fix: moved here to stop leak if new throws - } + } - shared_ptr & operator=(std::auto_ptr & r) + std::shared_ptr & operator=(std::auto_ptr & r) { - shared_ptr(r).swap(*this); + std::shared_ptr(r).swap(*this); return *this; } @@ -108,7 +108,7 @@ public: void reset(T * p = 0) { BOOST_ASSERT(p == 0 || p != px); - shared_ptr(p).swap(*this); + std::shared_ptr(p).swap(*this); } T & operator*() const // never throws @@ -137,8 +137,8 @@ public: { return *pn == 1; } - - void swap(shared_ptr & other) // never throws + + void swap(std::shared_ptr & other) // never throws { std::swap(px, other.px); std::swap(pn, other.pn); @@ -150,29 +150,29 @@ private: count_type * pn; // ptr to reference counter }; -template inline bool operator==(shared_ptr const & a, shared_ptr const & b) +template inline bool operator==(std::shared_ptr const & a, std::shared_ptr const & b) { return a.get() == b.get(); } -template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) +template inline bool operator!=(std::shared_ptr const & a, std::shared_ptr const & b) { return a.get() != b.get(); } -template inline bool operator<(shared_ptr const & a, shared_ptr const & b) +template inline bool operator<(std::shared_ptr const & a, std::shared_ptr const & b) { return std::less()(a.get(), b.get()); } -template void swap(shared_ptr & a, shared_ptr & b) +template void swap(std::shared_ptr & a, std::shared_ptr & b) { a.swap(b); } -// get_pointer() enables boost::mem_fn to recognize shared_ptr +// get_pointer() enables boost::mem_fn to recognize std::shared_ptr -template inline T * get_pointer(shared_ptr const & p) +template inline T * get_pointer(std::shared_ptr const & p) { return p.get(); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/sp_if_array.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/sp_if_array.hpp index 661e1785..a364cb55 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/sp_if_array.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/sp_if_array.hpp @@ -1,29 +1,29 @@ /* - * Copyright (c) 2012 Glen Joseph Fernandes + * Copyright (c) 2012 Glen Joseph Fernandes * glenfe at live dot com * - * Distributed under the Boost Software License, - * Version 1.0. (See accompanying file LICENSE_1_0.txt + * Distributed under the Boost Software License, + * Version 1.0. (See accompanying file LICENSE_1_0.txt * or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_SMART_PTR_DETAIL_SP_IF_ARRAY_HPP #define BOOST_SMART_PTR_DETAIL_SP_IF_ARRAY_HPP -#include +#include namespace boost { namespace detail { - template + template struct sp_if_array; template struct sp_if_array { - typedef boost::shared_ptr type; + typedef boost::std::shared_ptr type; }; template struct sp_if_size_array; template struct sp_if_size_array { - typedef boost::shared_ptr type; + typedef boost::std::shared_ptr type; }; } } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/spinlock_pool.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/spinlock_pool.hpp index f09d5c64..5d3e9e6a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/spinlock_pool.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/spinlock_pool.hpp @@ -17,8 +17,8 @@ // http://www.boost.org/LICENSE_1_0.txt) // // spinlock_pool<0> is reserved for atomic<>, when/if it arrives -// spinlock_pool<1> is reserved for shared_ptr reference counts -// spinlock_pool<2> is reserved for shared_ptr atomic access +// spinlock_pool<1> is reserved for std::shared_ptr reference counts +// spinlock_pool<2> is reserved for std::shared_ptr atomic access // #include @@ -41,11 +41,11 @@ public: static spinlock & spinlock_for( void const * pv ) { -#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 +#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 std::size_t i = reinterpret_cast< unsigned long long >( pv ) % 41; -#else +#else std::size_t i = reinterpret_cast< std::size_t >( pv ) % 41; -#endif +#endif return pool_[ i ]; } @@ -74,14 +74,14 @@ public: template< int I > spinlock spinlock_pool< I >::pool_[ 41 ] = { - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/enable_shared_from_raw.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/enable_shared_from_raw.hpp index f659c046..2ebd0466 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/enable_shared_from_raw.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/enable_shared_from_raw.hpp @@ -13,19 +13,19 @@ // #include -#include +#include #include #include #include namespace boost { -template boost::shared_ptr shared_from_raw(T *); +template boost::std::shared_ptr shared_from_raw(T *); template boost::weak_ptr weak_from_raw(T *); namespace detail { -template< class X, class Y > inline void sp_enable_shared_from_this( boost::shared_ptr * ppx, Y const * py, boost::enable_shared_from_raw const * pe ); +template< class X, class Y > inline void sp_enable_shared_from_this( boost::std::shared_ptr * ppx, Y const * py, boost::enable_shared_from_raw const * pe ); } // namespace detail @@ -48,7 +48,7 @@ protected: ~enable_shared_from_raw() { - BOOST_ASSERT( shared_this_.use_count() <= 1 ); // make sure no dangling shared_ptr objects exist + BOOST_ASSERT( shared_this_.use_count() <= 1 ); // make sure no dangling std::shared_ptr objects exist } private: @@ -66,26 +66,26 @@ private: public: #else private: - template friend class shared_ptr; - template friend boost::shared_ptr shared_from_raw(T *); + template friend class std::shared_ptr; + template friend boost::std::shared_ptr shared_from_raw(T *); template friend boost::weak_ptr weak_from_raw(T *); - template< class X, class Y > friend inline void detail::sp_enable_shared_from_this( boost::shared_ptr * ppx, Y const * py, boost::enable_shared_from_raw const * pe ); + template< class X, class Y > friend inline void detail::sp_enable_shared_from_this( boost::std::shared_ptr * ppx, Y const * py, boost::enable_shared_from_raw const * pe ); #endif - shared_ptr shared_from_this() + std::shared_ptr shared_from_this() { init_weak_once(); - return shared_ptr( weak_this_ ); + return std::shared_ptr( weak_this_ ); } - shared_ptr shared_from_this() const + std::shared_ptr shared_from_this() const { init_weak_once(); - return shared_ptr( weak_this_ ); + return std::shared_ptr( weak_this_ ); } - // Note: invoked automatically by shared_ptr; do not call - template void _internal_accept_owner( shared_ptr * ppx, Y * py ) const + // Note: invoked automatically by std::shared_ptr; do not call + template void _internal_accept_owner( std::shared_ptr * ppx, Y * py ) const { BOOST_ASSERT( ppx != 0 ); @@ -109,14 +109,14 @@ private: mutable weak_ptr weak_this_; private: - mutable shared_ptr shared_this_; + mutable std::shared_ptr shared_this_; }; template -boost::shared_ptr shared_from_raw(T *p) +boost::std::shared_ptr shared_from_raw(T *p) { BOOST_ASSERT(p != 0); - return boost::shared_ptr(p->enable_shared_from_raw::shared_from_this(), p); + return boost::std::shared_ptr(p->enable_shared_from_raw::shared_from_this(), p); } template @@ -130,7 +130,7 @@ boost::weak_ptr weak_from_raw(T *p) namespace detail { - template< class X, class Y > inline void sp_enable_shared_from_this( boost::shared_ptr * ppx, Y const * py, boost::enable_shared_from_raw const * pe ) + template< class X, class Y > inline void sp_enable_shared_from_this( boost::std::shared_ptr * ppx, Y const * py, boost::enable_shared_from_raw const * pe ) { if( pe != 0 ) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/enable_shared_from_this.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/enable_shared_from_this.hpp index 3230f025..e0eddd0d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/enable_shared_from_this.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/enable_shared_from_this.hpp @@ -14,7 +14,7 @@ // #include -#include +#include #include #include @@ -44,28 +44,28 @@ protected: public: - shared_ptr shared_from_this() + std::shared_ptr shared_from_this() { - shared_ptr p( weak_this_ ); + std::shared_ptr p( weak_this_ ); BOOST_ASSERT( p.get() == this ); return p; } - shared_ptr shared_from_this() const + std::shared_ptr shared_from_this() const { - shared_ptr p( weak_this_ ); + std::shared_ptr p( weak_this_ ); BOOST_ASSERT( p.get() == this ); return p; } public: // actually private, but avoids compiler template friendship issues - // Note: invoked automatically by shared_ptr; do not call - template void _internal_accept_owner( shared_ptr const * ppx, Y * py ) const + // Note: invoked automatically by std::shared_ptr; do not call + template void _internal_accept_owner( std::shared_ptr const * ppx, Y * py ) const { if( weak_this_.expired() ) { - weak_this_ = shared_ptr( *ppx, py ); + weak_this_ = std::shared_ptr( *ppx, py ); } } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/make_shared_array.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/make_shared_array.hpp index eb0578d9..b8abaf55 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/make_shared_array.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/make_shared_array.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP #define BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP -#include +#include #include #include #include @@ -29,12 +29,12 @@ namespace boost { std::size_t n1 = size * boost::detail::array_total::size; boost::detail::make_array_helper a1(n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template @@ -47,12 +47,12 @@ namespace boost { std::size_t n1 = size * boost::detail::array_total::size; boost::detail::make_array_helper a1(n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2, boost::detail::sp_forward(args)...); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_size_array::type @@ -66,12 +66,12 @@ namespace boost { T2* p2 = 0; boost::detail::make_array_helper a1(&p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2, boost::detail::sp_forward(args)...); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #endif #if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) @@ -89,13 +89,13 @@ namespace boost { T3* p3 = 0; boost::detail::make_array_helper a1(&p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p3 = reinterpret_cast(list); p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init_list(p2, p3); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_array::type @@ -113,13 +113,13 @@ namespace boost { std::size_t n1 = M * size; boost::detail::make_array_helper a1(n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p3 = reinterpret_cast(list); p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->template init_list(p2, p3); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_size_array::type @@ -136,13 +136,13 @@ namespace boost { T3* p3 = 0; boost::detail::make_array_helper a1(&p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p3 = reinterpret_cast(list); p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->template init_list(p2, p3); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) template @@ -157,13 +157,13 @@ namespace boost { std::size_t n1 = list.size() * boost::detail::array_total::size; boost::detail::make_array_helper a1(n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p3 = reinterpret_cast(list.begin()); p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init_list(p2, p3); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #endif #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) @@ -178,12 +178,12 @@ namespace boost { std::size_t n1 = size * boost::detail::array_total::size; boost::detail::make_array_helper a1(n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2, boost::detail::sp_forward(value)); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_size_array::type @@ -197,12 +197,12 @@ namespace boost { T2* p2 = 0; boost::detail::make_array_helper a1(&p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->init(p2, boost::detail::sp_forward(value)); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } #endif #endif @@ -216,12 +216,12 @@ namespace boost { std::size_t n1 = size * boost::detail::array_total::size; boost::detail::make_array_helper a1(n1, &p2); boost::detail::array_deleter d1(n1); - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->noinit(p2); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } template inline typename boost::detail::sp_if_size_array::type @@ -235,12 +235,12 @@ namespace boost { T2* p2 = 0; boost::detail::make_array_helper a1(&p2); boost::detail::array_deleter d1; - boost::shared_ptr s1(p1, d1, a1); + boost::std::shared_ptr s1(p1, d1, a1); typedef boost::detail::array_deleter* D2; p1 = reinterpret_cast(p2); D2 d2 = static_cast(s1._internal_get_untyped_deleter()); d2->noinit(p2); - return boost::shared_ptr(s1, p1); + return boost::std::shared_ptr(s1, p1); } } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/make_shared_object.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/make_shared_object.hpp index 89a71168..3b4bb108 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/make_shared_object.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/make_shared_object.hpp @@ -13,7 +13,7 @@ // for documentation. #include -#include +#include #include #include #include @@ -100,7 +100,7 @@ public: template< class T > struct sp_if_not_array { - typedef boost::shared_ptr< T > type; + typedef boost::std::shared_ptr< T > type; }; #if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) @@ -133,7 +133,7 @@ template< class T, std::size_t N > struct sp_if_not_array< T[N] > template< class T > typename boost::detail::sp_if_not_array< T >::type make_shared() { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -145,12 +145,12 @@ template< class T > typename boost::detail::sp_if_not_array< T >::type make_shar T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T > typename boost::detail::sp_if_not_array< T >::type make_shared_noinit() { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -162,12 +162,12 @@ template< class T > typename boost::detail::sp_if_not_array< T >::type make_shar T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -179,12 +179,12 @@ template< class T, class A > typename boost::detail::sp_if_not_array< T >::type T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A > typename boost::detail::sp_if_not_array< T >::type allocate_shared_noinit( A const & a ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -196,7 +196,7 @@ template< class T, class A > typename boost::detail::sp_if_not_array< T >::type T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } #if !defined( BOOST_NO_CXX11_VARIADIC_TEMPLATES ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) @@ -205,7 +205,7 @@ template< class T, class A > typename boost::detail::sp_if_not_array< T >::type template< class T, class Arg1, class... Args > typename boost::detail::sp_if_not_array< T >::type make_shared( Arg1 && arg1, Args && ... args ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -217,12 +217,12 @@ template< class T, class Arg1, class... Args > typename boost::detail::sp_if_not T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class Arg1, class... Args > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, Arg1 && arg1, Args && ... args ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -234,7 +234,7 @@ template< class T, class A, class Arg1, class... Args > typename boost::detail:: T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } #elif !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) @@ -244,7 +244,7 @@ template< class T, class A, class Arg1, class... Args > typename boost::detail:: template< class T, class A1 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -259,19 +259,19 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1 ) T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); - ::new( pv ) T( + ::new( pv ) T( boost::detail::sp_forward( a1 ) ); @@ -280,20 +280,20 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); ::new( pv ) T( - boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a1 ), boost::detail::sp_forward( a2 ) ); @@ -302,20 +302,20 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); - ::new( pv ) T( - boost::detail::sp_forward( a1 ), + ::new( pv ) T( + boost::detail::sp_forward( a1 ), boost::detail::sp_forward( a2 ) ); @@ -324,21 +324,21 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), boost::detail::sp_forward( a3 ) ); @@ -347,21 +347,21 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); - ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), + ::new( pv ) T( + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), boost::detail::sp_forward( a3 ) ); @@ -370,22 +370,22 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), boost::detail::sp_forward( a4 ) ); @@ -394,22 +394,22 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); - ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), + ::new( pv ) T( + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), boost::detail::sp_forward( a4 ) ); @@ -418,23 +418,23 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), boost::detail::sp_forward( a5 ) ); @@ -443,23 +443,23 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); - ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), + ::new( pv ) T( + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), boost::detail::sp_forward( a5 ) ); @@ -468,24 +468,24 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5, class A6 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), - boost::detail::sp_forward( a5 ), + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), + boost::detail::sp_forward( a5 ), boost::detail::sp_forward( a6 ) ); @@ -494,24 +494,24 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); - ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), - boost::detail::sp_forward( a5 ), + ::new( pv ) T( + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), + boost::detail::sp_forward( a5 ), boost::detail::sp_forward( a6 ) ); @@ -520,25 +520,25 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), - boost::detail::sp_forward( a5 ), - boost::detail::sp_forward( a6 ), + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), + boost::detail::sp_forward( a5 ), + boost::detail::sp_forward( a6 ), boost::detail::sp_forward( a7 ) ); @@ -547,25 +547,25 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); - ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), - boost::detail::sp_forward( a5 ), - boost::detail::sp_forward( a6 ), + ::new( pv ) T( + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), + boost::detail::sp_forward( a5 ), + boost::detail::sp_forward( a6 ), boost::detail::sp_forward( a7 ) ); @@ -574,26 +574,26 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), - boost::detail::sp_forward( a5 ), - boost::detail::sp_forward( a6 ), - boost::detail::sp_forward( a7 ), + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), + boost::detail::sp_forward( a5 ), + boost::detail::sp_forward( a6 ), + boost::detail::sp_forward( a7 ), boost::detail::sp_forward( a8 ) ); @@ -602,26 +602,26 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); - ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), - boost::detail::sp_forward( a5 ), - boost::detail::sp_forward( a6 ), - boost::detail::sp_forward( a7 ), + ::new( pv ) T( + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), + boost::detail::sp_forward( a5 ), + boost::detail::sp_forward( a6 ), + boost::detail::sp_forward( a7 ), boost::detail::sp_forward( a8 ) ); @@ -630,27 +630,27 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), - boost::detail::sp_forward( a5 ), - boost::detail::sp_forward( a6 ), - boost::detail::sp_forward( a7 ), - boost::detail::sp_forward( a8 ), + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), + boost::detail::sp_forward( a5 ), + boost::detail::sp_forward( a6 ), + boost::detail::sp_forward( a7 ), + boost::detail::sp_forward( a8 ), boost::detail::sp_forward( a9 ) ); @@ -659,27 +659,27 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 && a1, A2 && T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); void * pv = pd->address(); - ::new( pv ) T( - boost::detail::sp_forward( a1 ), - boost::detail::sp_forward( a2 ), - boost::detail::sp_forward( a3 ), - boost::detail::sp_forward( a4 ), - boost::detail::sp_forward( a5 ), - boost::detail::sp_forward( a6 ), - boost::detail::sp_forward( a7 ), - boost::detail::sp_forward( a8 ), + ::new( pv ) T( + boost::detail::sp_forward( a1 ), + boost::detail::sp_forward( a2 ), + boost::detail::sp_forward( a3 ), + boost::detail::sp_forward( a4 ), + boost::detail::sp_forward( a5 ), + boost::detail::sp_forward( a6 ), + boost::detail::sp_forward( a7 ), + boost::detail::sp_forward( a8 ), boost::detail::sp_forward( a9 ) ); @@ -688,7 +688,7 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } #else @@ -698,7 +698,7 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, template< class T, class A1 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -710,13 +710,13 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1 ) T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -728,13 +728,13 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -746,13 +746,13 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -764,13 +764,13 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -782,13 +782,13 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -800,13 +800,13 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -818,13 +818,13 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -836,13 +836,13 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -854,13 +854,13 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -872,13 +872,13 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5, class A6 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -890,13 +890,13 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -908,13 +908,13 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -926,13 +926,13 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -944,13 +944,13 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -962,13 +962,13 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -980,13 +980,13 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -998,13 +998,13 @@ typename boost::detail::sp_if_not_array< T >::type make_shared( A1 const & a1, A T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 ) { - boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); + boost::std::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a ); boost::detail::sp_ms_deleter< T > * pd = static_cast *>( pt._internal_get_untyped_deleter() ); @@ -1016,7 +1016,7 @@ typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a, T * pt2 = static_cast< T* >( pv ); boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 ); - return boost::shared_ptr< T >( pt, pt2 ); + return boost::std::shared_ptr< T >( pt, pt2 ); } #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/owner_less.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/owner_less.hpp index 6899325b..f621533d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/owner_less.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/owner_less.hpp @@ -17,7 +17,7 @@ namespace boost { - template class shared_ptr; + template class std::shared_ptr; template class weak_ptr; namespace detail @@ -43,13 +43,13 @@ namespace boost template struct owner_less; template - struct owner_less >: - public detail::generic_owner_less, weak_ptr > + struct owner_less >: + public detail::generic_owner_less, weak_ptr > {}; template struct owner_less >: - public detail::generic_owner_less, shared_ptr > + public detail::generic_owner_less, std::shared_ptr > {}; } // namespace boost diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/scoped_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/scoped_ptr.hpp index be6722d5..162395db 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/scoped_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/scoped_ptr.hpp @@ -36,7 +36,7 @@ void sp_scalar_destructor_hook(void * p); // scoped_ptr mimics a built-in pointer except that it guarantees deletion // of the object pointed to, either on destruction of the scoped_ptr or via // an explicit reset(). scoped_ptr is a simple solution for simple needs; -// use shared_ptr or std::auto_ptr if your needs are more complex. +// use std::shared_ptr or std::auto_ptr if your needs are more complex. template class scoped_ptr // noncopyable { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/shared_array.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/shared_array.hpp index 73a07ae1..bf55aa65 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/shared_array.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/shared_array.hpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -40,7 +40,7 @@ namespace boost // // shared_array // -// shared_array extends shared_ptr to arrays. +// shared_array extends std::shared_ptr to arrays. // The array pointed to is deleted when the last shared_array pointing to it // is destroyed or reset. // @@ -195,7 +195,7 @@ public: BOOST_ASSERT(i >= 0); return px[i]; } - + T * get() const BOOST_NOEXCEPT { return px; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/shared_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/shared_ptr.hpp index 2f0ce7bc..ea010b16 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/shared_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/shared_ptr.hpp @@ -2,7 +2,7 @@ #define BOOST_SMART_PTR_SHARED_PTR_HPP_INCLUDED // -// shared_ptr.hpp +// std::shared_ptr.hpp // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001-2008 Peter Dimov @@ -11,7 +11,7 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. +// See http://www.boost.org/libs/smart_ptr/std::shared_ptr.htm for documentation. // #include // for broken compiler workarounds @@ -22,7 +22,7 @@ // In order to avoid circular dependencies with Boost.TR1 // we make sure that our include of doesn't try to -// pull in the TR1 headers: that's why we use this header +// pull in the TR1 headers: that's why we use this header // rather than including directly: #include // std::auto_ptr @@ -55,7 +55,7 @@ namespace boost { -template class shared_ptr; +template class std::shared_ptr; template class weak_ptr; template class enable_shared_from_this; class enable_shared_from_raw; @@ -205,7 +205,7 @@ template< class T, std::size_t N > struct sp_extent< T[N] > // enable_shared_from_this support -template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::shared_ptr const * ppx, Y const * py, boost::enable_shared_from_this< T > const * pe ) +template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::std::shared_ptr const * ppx, Y const * py, boost::enable_shared_from_this< T > const * pe ) { if( pe != 0 ) { @@ -213,7 +213,7 @@ template< class X, class Y, class T > inline void sp_enable_shared_from_this( bo } } -template< class X, class Y > inline void sp_enable_shared_from_this( boost::shared_ptr * ppx, Y const * py, boost::enable_shared_from_raw const * pe ); +template< class X, class Y > inline void sp_enable_shared_from_this( boost::std::shared_ptr * ppx, Y const * py, boost::enable_shared_from_raw const * pe ); #ifdef _MANAGED @@ -247,7 +247,7 @@ template< class T, class R > struct sp_enable_if_auto_ptr template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R > { typedef R type; -}; +}; #endif @@ -271,7 +271,7 @@ template< class Y, class T > inline void sp_assert_convertible() // pointer constructor helper -template< class T, class Y > inline void sp_pointer_construct( boost::shared_ptr< T > * ppx, Y * p, boost::detail::shared_count & pn ) +template< class T, class Y > inline void sp_pointer_construct( boost::std::shared_ptr< T > * ppx, Y * p, boost::detail::shared_count & pn ) { boost::detail::shared_count( p ).swap( pn ); boost::detail::sp_enable_shared_from_this( ppx, p, p ); @@ -279,13 +279,13 @@ template< class T, class Y > inline void sp_pointer_construct( boost::shared_ptr #if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) -template< class T, class Y > inline void sp_pointer_construct( boost::shared_ptr< T[] > * /*ppx*/, Y * p, boost::detail::shared_count & pn ) +template< class T, class Y > inline void sp_pointer_construct( boost::std::shared_ptr< T[] > * /*ppx*/, Y * p, boost::detail::shared_count & pn ) { sp_assert_convertible< Y[], T[] >(); boost::detail::shared_count( p, boost::checked_array_deleter< T >() ).swap( pn ); } -template< class T, std::size_t N, class Y > inline void sp_pointer_construct( boost::shared_ptr< T[N] > * /*ppx*/, Y * p, boost::detail::shared_count & pn ) +template< class T, std::size_t N, class Y > inline void sp_pointer_construct( boost::std::shared_ptr< T[N] > * /*ppx*/, Y * p, boost::detail::shared_count & pn ) { sp_assert_convertible< Y[N], T[N] >(); boost::detail::shared_count( p, boost::checked_array_deleter< T >() ).swap( pn ); @@ -295,19 +295,19 @@ template< class T, std::size_t N, class Y > inline void sp_pointer_construct( bo // deleter constructor helper -template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr< T > * ppx, Y * p ) +template< class T, class Y > inline void sp_deleter_construct( boost::std::shared_ptr< T > * ppx, Y * p ) { boost::detail::sp_enable_shared_from_this( ppx, p, p ); } #if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) -template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr< T[] > * /*ppx*/, Y * /*p*/ ) +template< class T, class Y > inline void sp_deleter_construct( boost::std::shared_ptr< T[] > * /*ppx*/, Y * /*p*/ ) { sp_assert_convertible< Y[], T[] >(); } -template< class T, std::size_t N, class Y > inline void sp_deleter_construct( boost::shared_ptr< T[N] > * /*ppx*/, Y * /*p*/ ) +template< class T, std::size_t N, class Y > inline void sp_deleter_construct( boost::std::shared_ptr< T[N] > * /*ppx*/, Y * /*p*/ ) { sp_assert_convertible< Y[N], T[N] >(); } @@ -318,38 +318,38 @@ template< class T, std::size_t N, class Y > inline void sp_deleter_construct( bo // -// shared_ptr +// std::shared_ptr // // An enhanced relative of scoped_ptr with reference counted copy semantics. -// The object pointed to is deleted when the last shared_ptr pointing to it +// The object pointed to is deleted when the last std::shared_ptr pointing to it // is destroyed or reset. // -template class shared_ptr +template class std::shared_ptr { private: // Borland 5.5.1 specific workaround - typedef shared_ptr this_type; + typedef std::shared_ptr this_type; public: typedef typename boost::detail::sp_element< T >::type element_type; - shared_ptr() BOOST_NOEXCEPT : px( 0 ), pn() // never throws in 1.30+ + std::shared_ptr() BOOST_NOEXCEPT : px( 0 ), pn() // never throws in 1.30+ { } #if !defined( BOOST_NO_CXX11_NULLPTR ) - shared_ptr( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT : px( 0 ), pn() // never throws + std::shared_ptr( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT : px( 0 ), pn() // never throws { } #endif template - explicit shared_ptr( Y * p ): px( p ), pn() // Y must be complete + explicit std::shared_ptr( Y * p ): px( p ), pn() // Y must be complete { boost::detail::sp_pointer_construct( this, p, pn ); } @@ -357,17 +357,17 @@ public: // // Requirements: D's copy constructor must not throw // - // shared_ptr will release p by calling d(p) + // std::shared_ptr will release p by calling d(p) // - template shared_ptr( Y * p, D d ): px( p ), pn( p, d ) + template std::shared_ptr( Y * p, D d ): px( p ), pn( p, d ) { boost::detail::sp_deleter_construct( this, p ); } #if !defined( BOOST_NO_CXX11_NULLPTR ) - template shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( p, d ) + template std::shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( p, d ) { } @@ -375,14 +375,14 @@ public: // As above, but with allocator. A's copy constructor shall not throw. - template shared_ptr( Y * p, D d, A a ): px( p ), pn( p, d, a ) + template std::shared_ptr( Y * p, D d, A a ): px( p ), pn( p, d, a ) { boost::detail::sp_deleter_construct( this, p ); } #if !defined( BOOST_NO_CXX11_NULLPTR ) - template shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, d, a ) + template std::shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, d, a ) { } @@ -394,14 +394,14 @@ public: // ... except in C++0x, move disables the implicit copy - shared_ptr( shared_ptr const & r ) BOOST_NOEXCEPT : px( r.px ), pn( r.pn ) + std::shared_ptr( std::shared_ptr const & r ) BOOST_NOEXCEPT : px( r.px ), pn( r.pn ) { } #endif template - explicit shared_ptr( weak_ptr const & r ): pn( r.pn ) // may throw + explicit std::shared_ptr( weak_ptr const & r ): pn( r.pn ) // may throw { boost::detail::sp_assert_convertible< Y, T >(); @@ -410,7 +410,7 @@ public: } template - shared_ptr( weak_ptr const & r, boost::detail::sp_nothrow_tag ) + std::shared_ptr( weak_ptr const & r, boost::detail::sp_nothrow_tag ) BOOST_NOEXCEPT : px( 0 ), pn( r.pn, boost::detail::sp_nothrow_tag() ) { if( !pn.empty() ) @@ -422,11 +422,11 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) + std::shared_ptr( std::shared_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else - shared_ptr( shared_ptr const & r ) + std::shared_ptr( std::shared_ptr const & r ) #endif BOOST_NOEXCEPT : px( r.px ), pn( r.pn ) @@ -436,14 +436,14 @@ public: // aliasing template< class Y > - shared_ptr( shared_ptr const & r, element_type * p ) BOOST_NOEXCEPT : px( p ), pn( r.pn ) + std::shared_ptr( std::shared_ptr const & r, element_type * p ) BOOST_NOEXCEPT : px( p ), pn( r.pn ) { } #ifndef BOOST_NO_AUTO_PTR template - explicit shared_ptr( std::auto_ptr & r ): px(r.get()), pn() + explicit std::shared_ptr( std::auto_ptr & r ): px(r.get()), pn() { boost::detail::sp_assert_convertible< Y, T >(); @@ -456,7 +456,7 @@ public: #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) template - shared_ptr( std::auto_ptr && r ): px(r.get()), pn() + std::shared_ptr( std::auto_ptr && r ): px(r.get()), pn() { boost::detail::sp_assert_convertible< Y, T >(); @@ -469,7 +469,7 @@ public: #elif !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template - explicit shared_ptr( Ap r, typename boost::detail::sp_enable_if_auto_ptr::type = 0 ): px( r.get() ), pn() + explicit std::shared_ptr( Ap r, typename boost::detail::sp_enable_if_auto_ptr::type = 0 ): px( r.get() ), pn() { typedef typename Ap::element_type Y; @@ -488,7 +488,7 @@ public: #if !defined( BOOST_NO_CXX11_SMART_PTR ) template< class Y, class D > - shared_ptr( std::unique_ptr< Y, D > && r ): px( r.get() ), pn() + std::shared_ptr( std::unique_ptr< Y, D > && r ): px( r.get() ), pn() { boost::detail::sp_assert_convertible< Y, T >(); @@ -502,7 +502,7 @@ public: // assignment - shared_ptr & operator=( shared_ptr const & r ) BOOST_NOEXCEPT + std::shared_ptr & operator=( std::shared_ptr const & r ) BOOST_NOEXCEPT { this_type(r).swap(*this); return *this; @@ -511,7 +511,7 @@ public: #if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1400) template - shared_ptr & operator=(shared_ptr const & r) BOOST_NOEXCEPT + std::shared_ptr & operator=(std::shared_ptr const & r) BOOST_NOEXCEPT { this_type(r).swap(*this); return *this; @@ -522,7 +522,7 @@ public: #ifndef BOOST_NO_AUTO_PTR template - shared_ptr & operator=( std::auto_ptr & r ) + std::shared_ptr & operator=( std::auto_ptr & r ) { this_type( r ).swap( *this ); return *this; @@ -531,7 +531,7 @@ public: #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) template - shared_ptr & operator=( std::auto_ptr && r ) + std::shared_ptr & operator=( std::auto_ptr && r ) { this_type( static_cast< std::auto_ptr && >( r ) ).swap( *this ); return *this; @@ -540,7 +540,7 @@ public: #elif !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template - typename boost::detail::sp_enable_if_auto_ptr< Ap, shared_ptr & >::type operator=( Ap r ) + typename boost::detail::sp_enable_if_auto_ptr< Ap, std::shared_ptr & >::type operator=( Ap r ) { this_type( r ).swap( *this ); return *this; @@ -553,7 +553,7 @@ public: #if !defined( BOOST_NO_CXX11_SMART_PTR ) template - shared_ptr & operator=( std::unique_ptr && r ) + std::shared_ptr & operator=( std::unique_ptr && r ) { this_type( static_cast< std::unique_ptr && >( r ) ).swap(*this); return *this; @@ -565,7 +565,7 @@ public: #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - shared_ptr( shared_ptr && r ) BOOST_NOEXCEPT : px( r.px ), pn() + std::shared_ptr( std::shared_ptr && r ) BOOST_NOEXCEPT : px( r.px ), pn() { pn.swap( r.pn ); r.px = 0; @@ -574,11 +574,11 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr && r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) + std::shared_ptr( std::shared_ptr && r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else - shared_ptr( shared_ptr && r ) + std::shared_ptr( std::shared_ptr && r ) #endif BOOST_NOEXCEPT : px( r.px ), pn() @@ -589,16 +589,16 @@ public: r.px = 0; } - shared_ptr & operator=( shared_ptr && r ) BOOST_NOEXCEPT + std::shared_ptr & operator=( std::shared_ptr && r ) BOOST_NOEXCEPT { - this_type( static_cast< shared_ptr && >( r ) ).swap( *this ); + this_type( static_cast< std::shared_ptr && >( r ) ).swap( *this ); return *this; } template - shared_ptr & operator=( shared_ptr && r ) BOOST_NOEXCEPT + std::shared_ptr & operator=( std::shared_ptr && r ) BOOST_NOEXCEPT { - this_type( static_cast< shared_ptr && >( r ) ).swap( *this ); + this_type( static_cast< std::shared_ptr && >( r ) ).swap( *this ); return *this; } @@ -606,7 +606,7 @@ public: #if !defined( BOOST_NO_CXX11_NULLPTR ) - shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT // never throws + std::shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT // never throws { this_type().swap(*this); return *this; @@ -635,25 +635,25 @@ public: this_type( p, d, a ).swap( *this ); } - template void reset( shared_ptr const & r, element_type * p ) + template void reset( std::shared_ptr const & r, element_type * p ) { this_type( r, p ).swap( *this ); } - + // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) typename boost::detail::sp_dereference< T >::type operator* () const { BOOST_ASSERT( px != 0 ); return *px; } - + // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) - typename boost::detail::sp_member_access< T >::type operator-> () const + typename boost::detail::sp_member_access< T >::type operator-> () const { BOOST_ASSERT( px != 0 ); return px; } - + // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) typename boost::detail::sp_array_access< T >::type operator[] ( std::ptrdiff_t i ) const { @@ -681,13 +681,13 @@ public: return pn.use_count(); } - void swap( shared_ptr & other ) BOOST_NOEXCEPT + void swap( std::shared_ptr & other ) BOOST_NOEXCEPT { std::swap(px, other.px); pn.swap(other.pn); } - template bool owner_before( shared_ptr const & rhs ) const BOOST_NOEXCEPT + template bool owner_before( std::shared_ptr const & rhs ) const BOOST_NOEXCEPT { return pn < rhs.pn; } @@ -707,7 +707,7 @@ public: return pn.get_untyped_deleter(); } - bool _internal_equiv( shared_ptr const & r ) const BOOST_NOEXCEPT + bool _internal_equiv( std::shared_ptr const & r ) const BOOST_NOEXCEPT { return px == r.px && pn == r.pn; } @@ -719,7 +719,7 @@ public: private: - template friend class shared_ptr; + template friend class std::shared_ptr; template friend class weak_ptr; @@ -728,14 +728,14 @@ private: element_type * px; // contained pointer boost::detail::shared_count pn; // reference counter -}; // shared_ptr +}; // std::shared_ptr -template inline bool operator==(shared_ptr const & a, shared_ptr const & b) BOOST_NOEXCEPT +template inline bool operator==(std::shared_ptr const & a, std::shared_ptr const & b) BOOST_NOEXCEPT { return a.get() == b.get(); } -template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) BOOST_NOEXCEPT +template inline bool operator!=(std::shared_ptr const & a, std::shared_ptr const & b) BOOST_NOEXCEPT { return a.get() != b.get(); } @@ -744,7 +744,7 @@ template inline bool operator!=(shared_ptr const & a, share // Resolve the ambiguity between our op!= and the one in rel_ops -template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) BOOST_NOEXCEPT +template inline bool operator!=(std::shared_ptr const & a, std::shared_ptr const & b) BOOST_NOEXCEPT { return a.get() != b.get(); } @@ -753,81 +753,81 @@ template inline bool operator!=(shared_ptr const & a, shared_ptr #if !defined( BOOST_NO_CXX11_NULLPTR ) -template inline bool operator==( shared_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT +template inline bool operator==( std::shared_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT { return p.get() == 0; } -template inline bool operator==( boost::detail::sp_nullptr_t, shared_ptr const & p ) BOOST_NOEXCEPT +template inline bool operator==( boost::detail::sp_nullptr_t, std::shared_ptr const & p ) BOOST_NOEXCEPT { return p.get() == 0; } -template inline bool operator!=( shared_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT +template inline bool operator!=( std::shared_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT { return p.get() != 0; } -template inline bool operator!=( boost::detail::sp_nullptr_t, shared_ptr const & p ) BOOST_NOEXCEPT +template inline bool operator!=( boost::detail::sp_nullptr_t, std::shared_ptr const & p ) BOOST_NOEXCEPT { return p.get() != 0; } #endif -template inline bool operator<(shared_ptr const & a, shared_ptr const & b) BOOST_NOEXCEPT +template inline bool operator<(std::shared_ptr const & a, std::shared_ptr const & b) BOOST_NOEXCEPT { return a.owner_before( b ); } -template inline void swap(shared_ptr & a, shared_ptr & b) BOOST_NOEXCEPT +template inline void swap(std::shared_ptr & a, std::shared_ptr & b) BOOST_NOEXCEPT { a.swap(b); } -template shared_ptr static_pointer_cast( shared_ptr const & r ) BOOST_NOEXCEPT +template std::shared_ptr static_pointer_cast( std::shared_ptr const & r ) BOOST_NOEXCEPT { (void) static_cast< T* >( static_cast< U* >( 0 ) ); - typedef typename shared_ptr::element_type E; + typedef typename std::shared_ptr::element_type E; E * p = static_cast< E* >( r.get() ); - return shared_ptr( r, p ); + return std::shared_ptr( r, p ); } -template shared_ptr const_pointer_cast( shared_ptr const & r ) BOOST_NOEXCEPT +template std::shared_ptr const_pointer_cast( std::shared_ptr const & r ) BOOST_NOEXCEPT { (void) const_cast< T* >( static_cast< U* >( 0 ) ); - typedef typename shared_ptr::element_type E; + typedef typename std::shared_ptr::element_type E; E * p = const_cast< E* >( r.get() ); - return shared_ptr( r, p ); + return std::shared_ptr( r, p ); } -template shared_ptr dynamic_pointer_cast( shared_ptr const & r ) BOOST_NOEXCEPT +template std::shared_ptr dynamic_pointer_cast( std::shared_ptr const & r ) BOOST_NOEXCEPT { //(void) dynamic_cast< T* >( static_cast< U* >( 0 ) ); // // MGH - TODO - FIX - removed this check, as it was breaking the PS3 compile, and I've no idea why :-s - typedef typename shared_ptr::element_type E; + typedef typename std::shared_ptr::element_type E; E * p = dynamic_cast< E* >( r.get() ); - return p? shared_ptr( r, p ): shared_ptr(); + return p? std::shared_ptr( r, p ): std::shared_ptr(); } -template shared_ptr reinterpret_pointer_cast( shared_ptr const & r ) BOOST_NOEXCEPT +template std::shared_ptr reinterpret_pointer_cast( std::shared_ptr const & r ) BOOST_NOEXCEPT { (void) reinterpret_cast< T* >( static_cast< U* >( 0 ) ); - typedef typename shared_ptr::element_type E; + typedef typename std::shared_ptr::element_type E; E * p = reinterpret_cast< E* >( r.get() ); - return shared_ptr( r, p ); + return std::shared_ptr( r, p ); } -// get_pointer() enables boost::mem_fn to recognize shared_ptr +// get_pointer() enables boost::mem_fn to recognize std::shared_ptr -template inline typename shared_ptr::element_type * get_pointer(shared_ptr const & p) BOOST_NOEXCEPT +template inline typename std::shared_ptr::element_type * get_pointer(std::shared_ptr const & p) BOOST_NOEXCEPT { return p.get(); } @@ -838,7 +838,7 @@ template inline typename shared_ptr::element_type * get_pointer(shar #if defined(BOOST_NO_TEMPLATED_IOSTREAMS) || ( defined(__GNUC__) && (__GNUC__ < 3) ) -template std::ostream & operator<< (std::ostream & os, shared_ptr const & p) +template std::ostream & operator<< (std::ostream & os, std::shared_ptr const & p) { os << p.get(); return os; @@ -852,9 +852,9 @@ template std::ostream & operator<< (std::ostream & os, shared_ptr co # if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT) // MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL using std::basic_ostream; -template basic_ostream & operator<< (basic_ostream & os, shared_ptr const & p) +template basic_ostream & operator<< (basic_ostream & os, std::shared_ptr const & p) # else -template std::basic_ostream & operator<< (std::basic_ostream & os, shared_ptr const & p) +template std::basic_ostream & operator<< (std::basic_ostream & os, std::shared_ptr const & p) # endif { os << p.get(); @@ -879,7 +879,7 @@ namespace detail // g++ 2.9x doesn't allow static_cast(void *) // apparently EDG 2.38 and HP aCC A.03.35 also don't accept it -template D * basic_get_deleter(shared_ptr const & p) +template D * basic_get_deleter(std::shared_ptr const & p) { void const * q = p._internal_get_deleter(BOOST_SP_TYPEID(D)); return const_cast(static_cast(q)); @@ -887,7 +887,7 @@ template D * basic_get_deleter(shared_ptr const & p) #else -template D * basic_get_deleter( shared_ptr const & p ) BOOST_NOEXCEPT +template D * basic_get_deleter( std::shared_ptr const & p ) BOOST_NOEXCEPT { return static_cast( p._internal_get_deleter(BOOST_SP_TYPEID(D)) ); } @@ -898,7 +898,7 @@ class esft2_deleter_wrapper { private: - shared_ptr deleter_; + std::shared_ptr deleter_; public: @@ -906,7 +906,7 @@ public: { } - template< class T > void set_deleter( shared_ptr const & deleter ) + template< class T > void set_deleter( std::shared_ptr const & deleter ) { deleter_ = deleter; } @@ -925,7 +925,7 @@ public: } // namespace detail -template D * get_deleter( shared_ptr const & p ) BOOST_NOEXCEPT +template D * get_deleter( std::shared_ptr const & p ) BOOST_NOEXCEPT { D *del = boost::detail::basic_get_deleter(p); @@ -944,34 +944,34 @@ template D * get_deleter( shared_ptr const & p ) BOOST_NOEX #if !defined(BOOST_SP_NO_ATOMIC_ACCESS) -template inline bool atomic_is_lock_free( shared_ptr const * /*p*/ ) BOOST_NOEXCEPT +template inline bool atomic_is_lock_free( std::shared_ptr const * /*p*/ ) BOOST_NOEXCEPT { return false; } -template shared_ptr atomic_load( shared_ptr const * p ) +template std::shared_ptr atomic_load( std::shared_ptr const * p ) { boost::detail::spinlock_pool<2>::scoped_lock lock( p ); return *p; } -template inline shared_ptr atomic_load_explicit( shared_ptr const * p, memory_order /*mo*/ ) +template inline std::shared_ptr atomic_load_explicit( std::shared_ptr const * p, memory_order /*mo*/ ) { return atomic_load( p ); } -template void atomic_store( shared_ptr * p, shared_ptr r ) +template void atomic_store( std::shared_ptr * p, std::shared_ptr r ) { boost::detail::spinlock_pool<2>::scoped_lock lock( p ); p->swap( r ); } -template inline void atomic_store_explicit( shared_ptr * p, shared_ptr r, memory_order /*mo*/ ) +template inline void atomic_store_explicit( std::shared_ptr * p, std::shared_ptr r, memory_order /*mo*/ ) { atomic_store( p, r ); // std::move( r ) } -template shared_ptr atomic_exchange( shared_ptr * p, shared_ptr r ) +template std::shared_ptr atomic_exchange( std::shared_ptr * p, std::shared_ptr r ) { boost::detail::spinlock & sp = boost::detail::spinlock_pool<2>::spinlock_for( p ); @@ -982,12 +982,12 @@ template shared_ptr atomic_exchange( shared_ptr * p, shared_ptr shared_ptr atomic_exchange_explicit( shared_ptr * p, shared_ptr r, memory_order /*mo*/ ) +template std::shared_ptr atomic_exchange_explicit( std::shared_ptr * p, std::shared_ptr r, memory_order /*mo*/ ) { return atomic_exchange( p, r ); // std::move( r ) } -template bool atomic_compare_exchange( shared_ptr * p, shared_ptr * v, shared_ptr w ) +template bool atomic_compare_exchange( std::shared_ptr * p, std::shared_ptr * v, std::shared_ptr w ) { boost::detail::spinlock & sp = boost::detail::spinlock_pool<2>::spinlock_for( p ); @@ -1003,7 +1003,7 @@ template bool atomic_compare_exchange( shared_ptr * p, shared_ptr } else { - shared_ptr tmp( *p ); + std::shared_ptr tmp( *p ); sp.unlock(); @@ -1012,7 +1012,7 @@ template bool atomic_compare_exchange( shared_ptr * p, shared_ptr } } -template inline bool atomic_compare_exchange_explicit( shared_ptr * p, shared_ptr * v, shared_ptr w, memory_order /*success*/, memory_order /*failure*/ ) +template inline bool atomic_compare_exchange_explicit( std::shared_ptr * p, std::shared_ptr * v, std::shared_ptr w, memory_order /*success*/, memory_order /*failure*/ ) { return atomic_compare_exchange( p, v, w ); // std::move( w ) } @@ -1023,7 +1023,7 @@ template inline bool atomic_compare_exchange_explicit( shared_ptr * template< class T > struct hash; -template< class T > std::size_t hash_value( boost::shared_ptr const & p ) BOOST_NOEXCEPT +template< class T > std::size_t hash_value( boost::std::shared_ptr const & p ) BOOST_NOEXCEPT { return boost::hash< T* >()( p.get() ); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/weak_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/weak_ptr.hpp index e3e9ad9b..e30124ad 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/weak_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/weak_ptr.hpp @@ -15,7 +15,7 @@ #include // boost.TR1 include order fix #include -#include +#include namespace boost { @@ -124,11 +124,11 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( shared_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) + weak_ptr( std::shared_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else - weak_ptr( shared_ptr const & r ) + weak_ptr( std::shared_ptr const & r ) #endif BOOST_NOEXCEPT : px( r.px ), pn( r.pn ) @@ -161,7 +161,7 @@ public: #endif template - weak_ptr & operator=( shared_ptr const & r ) BOOST_NOEXCEPT + weak_ptr & operator=( std::shared_ptr const & r ) BOOST_NOEXCEPT { boost::detail::sp_assert_convertible< Y, T >(); @@ -173,9 +173,9 @@ public: #endif - shared_ptr lock() const BOOST_NOEXCEPT + std::shared_ptr lock() const BOOST_NOEXCEPT { - return shared_ptr( *this, boost::detail::sp_nothrow_tag() ); + return std::shared_ptr( *this, boost::detail::sp_nothrow_tag() ); } long use_count() const BOOST_NOEXCEPT @@ -216,7 +216,7 @@ public: return pn < rhs.pn; } - template bool owner_before( shared_ptr const & rhs ) const BOOST_NOEXCEPT + template bool owner_before( std::shared_ptr const & rhs ) const BOOST_NOEXCEPT { return pn < rhs.pn; } @@ -229,7 +229,7 @@ public: private: template friend class weak_ptr; - template friend class shared_ptr; + template friend class std::shared_ptr; #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp index 3b25b3d2..b3e7b91f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp @@ -147,7 +147,7 @@ struct grammar_definition typedef typename grammar_definition::type definition_t; typedef grammar_helper helper_t; - typedef boost::shared_ptr helper_ptr_t; + typedef boost::std::shared_ptr helper_ptr_t; typedef boost::weak_ptr helper_weak_ptr_t; grammar_helper* diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp index 822180a9..b5e832b0 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp @@ -11,7 +11,7 @@ #define BOOST_SPIRIT_OBJECT_WITH_ID_IPP #include -#include +#include #ifdef BOOST_SPIRIT_THREADSAFE #include @@ -64,7 +64,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN static void mutex_init(); #endif - boost::shared_ptr > id_supply; + boost::std::shared_ptr > id_supply; }; ////////////////////////////////// @@ -141,7 +141,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN boost::mutex &mutex = mutex_instance(); boost::mutex::scoped_lock lock(mutex); #endif - static boost::shared_ptr > + static boost::std::shared_ptr > static_supply; if (!static_supply.get()) @@ -174,7 +174,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN ////////////////////////////////// #ifdef BOOST_SPIRIT_THREADSAFE template - inline void + inline void object_with_id_base::mutex_init() { mutex_instance(); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/dynamic/stored_rule.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/dynamic/stored_rule.hpp index 5661ef88..81bafd17 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/dynamic/stored_rule.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/dynamic/stored_rule.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include @@ -27,7 +27,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN // /////////////////////////////////////////////////////////////////////////// template < - typename T0 + typename T0 , typename T1 , typename T2 , bool EmbedByValue @@ -113,10 +113,10 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN private: #endif - stored_rule(shared_ptr const& ptr) + stored_rule(std::shared_ptr const& ptr) : ptr(ptr) {} - shared_ptr ptr; + std::shared_ptr ptr; }; /////////////////////////////////////////////////////////////////////////////// diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/iterator/file_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/iterator/file_iterator.hpp index 5c20f15f..9ee354b8 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/iterator/file_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/iterator/file_iterator.hpp @@ -177,7 +177,7 @@ public: inline file_iterator& operator=(const base_t& iter); file_iterator make_end(void); - // operator bool. This borrows a trick from boost::shared_ptr to avoid + // operator bool. This borrows a trick from boost::std::shared_ptr to avoid // to interfere with arithmetic operations. bool operator_bool(void) const { return this->base(); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/iterator/impl/file_iterator.ipp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/iterator/impl/file_iterator.ipp index 4227b696..c9f41aa1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/iterator/impl/file_iterator.ipp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/iterator/impl/file_iterator.ipp @@ -17,7 +17,7 @@ #endif #include -#include +#include #ifdef BOOST_SPIRIT_FILEITERATOR_WINDOWS # include @@ -48,7 +48,7 @@ namespace fileiter_impl { // the base components on which the iterator is built (through the // iterator adaptor library). // -// The opened file stream (FILE) is held with a shared_ptr<>, whose +// The opened file stream (FILE) is held with a std::shared_ptr<>, whose // custom deleter invokes fcose(). This makes the syntax of the class // very easy, especially everything related to copying. // @@ -93,7 +93,7 @@ public: } // Nasty bug in Comeau up to 4.3.0.1, we need explicit boolean context - // for shared_ptr to evaluate correctly + // for std::shared_ptr to evaluate correctly operator bool() const { return m_file ? true : false; } @@ -140,7 +140,7 @@ public: } private: - boost::shared_ptr m_file; + boost::std::shared_ptr m_file; std::size_t m_pos; CharT m_curChar; bool m_eof; @@ -236,7 +236,7 @@ public: // a reference is hold by the filemap object). ::CloseHandle(hFile); - // Store the handles inside the shared_ptr (with the custom destructors) + // Store the handles inside the std::shared_ptr (with the custom destructors) m_mem.reset(static_cast(pMem), ::UnmapViewOfFile); // Start of the file @@ -256,7 +256,7 @@ public: } // Nasty bug in Comeau up to 4.3.0.1, we need explicit boolean context - // for shared_ptr to evaluate correctly + // for std::shared_ptr to evaluate correctly operator bool() const { return m_mem ? true : false; } @@ -291,7 +291,7 @@ private: typedef void handle_t; #endif - boost::shared_ptr m_mem; + boost::std::shared_ptr m_mem; std::size_t m_filesize; CharT* m_curChar; }; @@ -403,7 +403,7 @@ public: } // Nasty bug in Comeau up to 4.3.0.1, we need explicit boolean context - // for shared_ptr to evaluate correctly + // for std::shared_ptr to evaluate correctly operator bool() const { return m_mem ? true : false; } @@ -432,7 +432,7 @@ public: private: - boost::shared_ptr m_mem; + boost::std::shared_ptr m_mem; CharT const* m_curChar; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/utility/chset.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/utility/chset.hpp index 36354564..62b174cb 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/utility/chset.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/utility/chset.hpp @@ -10,7 +10,7 @@ #define BOOST_SPIRIT_CHSET_HPP /////////////////////////////////////////////////////////////////////////////// -#include +#include #include #include #include @@ -26,7 +26,7 @@ namespace utility { namespace impl { // template functions. And we don't want to put the whole algorithm // in the chset constructor in the class definition. template - void construct_chset(boost::shared_ptr >& ptr, + void construct_chset(boost::std::shared_ptr >& ptr, CharT2 const* definition); }} // namespace utility::impl @@ -84,7 +84,7 @@ public: private: - boost::shared_ptr > ptr; + boost::std::shared_ptr > ptr; }; /////////////////////////////////////////////////////////////////////////////// diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/utility/impl/chset.ipp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/utility/impl/chset.ipp index 30170351..a8514a3b 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/utility/impl/chset.ipp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/classic/utility/impl/chset.ipp @@ -27,16 +27,16 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN namespace utility { namespace impl { template inline void - detach(boost::shared_ptr >& ptr) + detach(boost::std::shared_ptr >& ptr) { if (!ptr.unique()) - ptr = boost::shared_ptr > + ptr = boost::std::shared_ptr > (new basic_chset(*ptr)); } template inline void - detach_clear(boost::shared_ptr >& ptr) + detach_clear(boost::std::shared_ptr >& ptr) { if (ptr.unique()) ptr->clear(); @@ -45,7 +45,7 @@ namespace utility { namespace impl { } template - void construct_chset(boost::shared_ptr >& ptr, + void construct_chset(boost::std::shared_ptr >& ptr, CharT2 const* definition) { CharT2 ch = *definition++; @@ -76,7 +76,7 @@ namespace utility { namespace impl { #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) template - void chset_negated_set(boost::shared_ptr > &ptr, chlit const &ch, + void chset_negated_set(boost::std::shared_ptr > &ptr, chlit const &ch, FakeT) { if(ch.ch != (std::numeric_limits::min)()) { @@ -86,9 +86,9 @@ namespace utility { namespace impl { ptr->set(ch.ch + 1, (std::numeric_limits::max)()); } } - + template - void chset_negated_set(boost::shared_ptr > &ptr, + void chset_negated_set(boost::std::shared_ptr > &ptr, spirit::range const &rng, FakeT) { if(rng.first != (std::numeric_limits::min)()) { @@ -255,7 +255,7 @@ inline void chset::set(negated_char_parser > const& arg_) { utility::impl::detach(ptr); - + if(arg_.positive.ch != (std::numeric_limits::min)()) { ptr->set((std::numeric_limits::min)(), arg_.positive.ch - 1); } @@ -269,7 +269,7 @@ inline void chset::set(negated_char_parser > const& arg_) { utility::impl::detach(ptr); - + if(arg_.positive.first != (std::numeric_limits::min)()) { ptr->set((std::numeric_limits::min)(), arg_.positive.first - 1); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/karma/string/symbols.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/karma/string/symbols.hpp index 185a280a..550154e1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/karma/string/symbols.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/karma/string/symbols.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -451,7 +451,7 @@ namespace boost { namespace spirit { namespace karma adder add; remover remove; - shared_ptr lookup; + std::shared_ptr lookup; std::string name_; }; @@ -710,7 +710,7 @@ namespace boost { namespace spirit { namespace karma adder add; remover remove; - shared_ptr lookup; + std::shared_ptr lookup; std::string name_; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/phoenix/operator/member.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/phoenix/operator/member.hpp index 27f3e8d1..df5d106c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/phoenix/operator/member.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/phoenix/operator/member.hpp @@ -2,7 +2,7 @@ Copyright (c) 2005-2007 Dan Marsden Copyright (c) 2005-2007 Joel de Guzman - Distributed under the Boost Software License, Version 1.0. (See accompanying + Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ @@ -33,8 +33,8 @@ #include -namespace boost { - template class shared_ptr; +namespace boost { + template class std::shared_ptr; template class scoped_ptr; namespace phoenix { @@ -42,7 +42,7 @@ namespace phoenix { { template struct member_type; - + template struct member_type { @@ -52,7 +52,7 @@ namespace phoenix { namespace meta { - template + template struct pointed_type; template @@ -62,11 +62,11 @@ namespace phoenix { }; template - struct pointed_type > + struct pointed_type > { typedef T type; }; - + template struct pointed_type > { @@ -116,7 +116,7 @@ namespace phoenix { member_object_eval, actor, typename as_actor::type>::type> >::type operator->*( - const actor& ptrActor, + const actor& ptrActor, MemObjPtr memObjPtr) { return compose( diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/qi/string/symbols.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/qi/string/symbols.hpp index a9656f18..b4f9bb1b 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/qi/string/symbols.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/qi/string/symbols.hpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #if defined(BOOST_MSVC) # pragma warning(push) @@ -373,7 +373,7 @@ public: adder add; remover remove; - shared_ptr lookup; + std::shared_ptr lookup; std::string name_; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/repository/home/qi/operator/detail/keywords.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/repository/home/qi/operator/detail/keywords.hpp index 06836f77..0beb3871 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/repository/home/qi/operator/detail/keywords.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/spirit/repository/home/qi/operator/detail/keywords.hpp @@ -15,10 +15,10 @@ #include namespace boost { namespace spirit { namespace repository { namespace qi { namespace detail { // Variant visitor class which handles dispatching the parsing to the selected parser - // This also handles passing the correct attributes and flags/counters to the subject parsers + // This also handles passing the correct attributes and flags/counters to the subject parsers template struct is_distinct : T::distinct { }; - + template struct is_distinct< spirit::qi::action > : T::distinct { }; @@ -38,22 +38,22 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names typedef Skipper skipper_type; typedef Elements elements_type; - typedef typename add_reference::type attr_reference; + typedef typename add_reference::type attr_reference; public: parse_dispatcher(const Elements &elements,Iterator& first, Iterator const& last , Context& context, Skipper const& skipper - , Flags &flags, Counters &counters, attr_reference attr) : + , Flags &flags, Counters &counters, attr_reference attr) : elements(elements), first(first), last(last) , context(context), skipper(skipper) , flags(flags),counters(counters), attr(attr) {} - + template bool operator()(T& idx) const - { + { return call(idx,typename traits::not_is_unused::type()); } - - template + + template bool call_subject_unused( Subject const &subject, Iterator &first, Iterator const &last , Context& context, Skipper const& skipper @@ -62,25 +62,25 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names Iterator save = first; skipper_keyword_marker marked_skipper(skipper,flags[Index::value],counters[Index::value]); - + if(subject.parse(first,last,context,marked_skipper,unused)) { return true; } save = save; return false; - } - - - template + } + + + template bool call_subject( Subject const &subject, Iterator &first, Iterator const &last , Context& context, Skipper const& skipper , Index& idx ) const { - + Iterator save = first; - skipper_keyword_marker + skipper_keyword_marker marked_skipper(skipper,flags[Index::value],counters[Index::value]); if(subject.parse(first,last,context,marked_skipper,fusion::at_c(attr))) { @@ -91,8 +91,8 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names } // Handle unused attributes - template bool call(T &idx, mpl::false_) const{ - + template bool call(T &idx, mpl::false_) const{ + typedef typename mpl::at::type ElementType; if( (!is_distinct::value) @@ -114,7 +114,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names } return false; } - + const Elements &elements; Iterator &first; const Iterator &last; @@ -132,7 +132,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names typedef typename spirit::detail::as_variant< IndexList >::type parser_index_type; - + /////////////////////////////////////////////////////////////////////////// // build_char_type_sequence // @@ -351,7 +351,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names { typedef int result_type; - keyword_entry_adder(shared_ptr lookup,FlagsType &flags, Elements &elements) : + keyword_entry_adder(std::shared_ptr lookup,FlagsType &flags, Elements &elements) : lookup(lookup) ,flags(flags) ,elements(elements) @@ -421,7 +421,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names - shared_ptr lookup; + std::shared_ptr lookup; FlagsType & flags; Elements &elements; }; @@ -443,7 +443,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names { if(parser_index_type* val_ptr = lookup->find(first,last,first_pass_filter_type())) - { + { if(!apply_visitor(parse_visitor,*val_ptr)){ return false; } @@ -481,7 +481,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names } return false; } - shared_ptr lookup; + std::shared_ptr lookup; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/statechart/processor_container.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/statechart/processor_container.hpp index 797e2f8f..2b914958 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/statechart/processor_container.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/statechart/processor_container.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include // BOOST_INTEL @@ -65,7 +65,7 @@ class processor_container : noncopyable { typedef event_processor< Scheduler > processor_base_type; typedef std::auto_ptr< processor_base_type > processor_holder_type; - typedef shared_ptr< processor_holder_type > processor_holder_ptr_type; + typedef std::shared_ptr< processor_holder_type > processor_holder_ptr_type; public: ////////////////////////////////////////////////////////////////////////// @@ -426,8 +426,8 @@ class processor_container : noncopyable } } - typedef std::set< - processor_holder_ptr_type, + typedef std::set< + processor_holder_ptr_type, std::less< processor_holder_ptr_type >, typename boost::detail::allocator::rebind_to< Allocator, processor_holder_ptr_type >::type diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/parameterized_test.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/parameterized_test.hpp index 930dc81a..22b7452d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/parameterized_test.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/parameterized_test.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2001-2008. // Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -73,7 +73,7 @@ template class param_test_case_generator : public test_unit_generator { public: param_test_case_generator( callback1 const& test_func, - const_string tc_name, + const_string tc_name, ParamIter par_begin, ParamIter par_end ) : m_test_func( test_func ) @@ -110,13 +110,13 @@ struct user_param_tc_method_invoker { typedef void (UserTestCase::*test_method)( ParamType ); // Constructor - user_param_tc_method_invoker( shared_ptr inst, test_method test_method ) + user_param_tc_method_invoker( std::shared_ptr inst, test_method test_method ) : m_inst( inst ), m_test_method( test_method ) {} void operator()( ParamType p ) { ((*m_inst).*m_test_method)( p ); } // Data members - shared_ptr m_inst; + std::shared_ptr m_inst; test_method m_test_method; }; @@ -127,7 +127,7 @@ struct user_param_tc_method_invoker { template inline ut_detail::param_test_case_generator make_test_case( callback1 const& test_func, - const_string tc_name, + const_string tc_name, ParamIter par_begin, ParamIter par_end ) { @@ -140,7 +140,7 @@ template inline ut_detail::param_test_case_generator< BOOST_DEDUCED_TYPENAME remove_const::type>::type,ParamIter> make_test_case( void (*test_func)( ParamType ), - const_string tc_name, + const_string tc_name, ParamIter par_begin, ParamIter par_end ) { @@ -155,13 +155,13 @@ inline ut_detail::param_test_case_generator< BOOST_DEDUCED_TYPENAME remove_const::type>::type,ParamIter> make_test_case( void (UserTestCase::*test_method )( ParamType ), const_string tc_name, - boost::shared_ptr const& user_test_case, + boost::std::shared_ptr const& user_test_case, ParamIter par_begin, ParamIter par_end ) { typedef BOOST_DEDUCED_TYPENAME remove_const::type>::type param_value_type; - return ut_detail::param_test_case_generator( - ut_detail::user_param_tc_method_invoker( user_test_case, test_method ), + return ut_detail::param_test_case_generator( + ut_detail::user_param_tc_method_invoker( user_test_case, test_method ), tc_name, par_begin, par_end ); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/predicate_result.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/predicate_result.hpp index 16ae4882..773024e8 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/predicate_result.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/predicate_result.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2001-2008. // Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -21,7 +21,7 @@ #include // Boost -#include +#include #include // STL @@ -46,7 +46,7 @@ class BOOST_TEST_DECL predicate_result { public: // Constructor - predicate_result( bool pv_ ) + predicate_result( bool pv_ ) : p_predicate_value( pv_ ) {} @@ -74,7 +74,7 @@ public: private: // Data members - shared_ptr m_message; + std::shared_ptr m_message; }; } // namespace test_tools diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/unit_test_suite_impl.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/unit_test_suite_impl.hpp index 993e0560..478524a5 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/unit_test_suite_impl.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/unit_test_suite_impl.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2001-2008. // Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -25,7 +25,7 @@ #include // Boost -#include +#include #include #include #include @@ -70,7 +70,7 @@ public: // Public r/w properties readwrite_property p_name; // name for this test unit - readwrite_property p_timeout; // timeout for the test unit execution + readwrite_property p_timeout; // timeout for the test unit execution readwrite_property p_expected_failures; // number of expected failures in this test unit mutable readwrite_property p_enabled; // enabled status for this unit @@ -140,7 +140,7 @@ public: std::size_t size() const { return m_members.size(); } protected: - friend BOOST_TEST_DECL + friend BOOST_TEST_DECL void traverse_test_tree( test_suite const&, test_tree_visitor& ); friend class framework_impl; virtual ~test_suite() {} @@ -159,8 +159,8 @@ public: , argc( 0 ) , argv( 0 ) {} - - // Data members + + // Data members int argc; char** argv; }; @@ -236,12 +236,12 @@ template struct user_tc_method_invoker { typedef void (UserTestCase::*TestMethod )(); - user_tc_method_invoker( shared_ptr inst, TestMethod test_method ) + user_tc_method_invoker( std::shared_ptr inst, TestMethod test_method ) : m_inst( inst ), m_test_method( test_method ) {} void operator()() { ((*m_inst).*m_test_method)(); } - shared_ptr m_inst; + std::shared_ptr m_inst; TestMethod m_test_method; }; @@ -261,9 +261,9 @@ template inline test_case* make_test_case( void (UserTestCase::* test_method )(), const_string tc_name, - boost::shared_ptr user_test_case ) + boost::std::shared_ptr user_test_case ) { - return new test_case( ut_detail::normalize_test_case_name( tc_name ), + return new test_case( ut_detail::normalize_test_case_name( tc_name ), ut_detail::user_tc_method_invoker( user_test_case, test_method ) ); } @@ -299,10 +299,10 @@ struct auto_tc_exp_fail { instance() = this; } - static auto_tc_exp_fail*& instance() + static auto_tc_exp_fail*& instance() { - static auto_tc_exp_fail inst; - static auto_tc_exp_fail* inst_ptr = &inst; + static auto_tc_exp_fail inst; + static auto_tc_exp_fail* inst_ptr = &inst; return inst_ptr; } @@ -322,30 +322,30 @@ private: // ************** global_fixture ************** // // ************************************************************************** // -class BOOST_TEST_DECL global_fixture : public test_observer { -public: +class BOOST_TEST_DECL global_fixture : public test_observer { +public: // Constructor global_fixture(); -}; +}; //____________________________________________________________________________// namespace ut_detail { -template +template struct global_fixture_impl : public global_fixture { // Constructor global_fixture_impl(): m_fixure( 0 ) {} // test observer interface virtual void test_start( counter_t ) { m_fixure = new F; } - virtual void test_finish() { delete m_fixure; m_fixure = 0; } - virtual void test_aborted() { delete m_fixure; m_fixure = 0; } + virtual void test_finish() { delete m_fixure; m_fixure = 0; } + virtual void test_aborted() { delete m_fixure; m_fixure = 0; } private: // Data members F* m_fixure; -}; +}; // ************************************************************************** // // ************** test_case_template_invoker ************** // @@ -379,7 +379,7 @@ struct generate_test_case_4_type { full_name += " const"; full_name += '>'; - m_holder.m_test_cases.push_back( + m_holder.m_test_cases.push_back( new test_case( full_name, test_case_template_invoker() ) ); } @@ -409,7 +409,7 @@ public: { if( m_test_cases.empty() ) return 0; - + test_unit* res = m_test_cases.front(); m_test_cases.pop_front(); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/callback.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/callback.hpp index bd7d3e12..f4241225 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/callback.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/callback.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// Use, modification, and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -9,7 +9,7 @@ // // Version : $Revision: 49312 $ // -// Description : +// Description : // *************************************************************************** #ifndef BOOST_TEST_CALLBACK_020505GER @@ -18,7 +18,7 @@ // Boost #include #include -#include +#include #include @@ -109,7 +109,7 @@ public: template callback0( Functor f ) : m_impl( new ut_detail::callback0_impl_t( f ) ) {} - + void operator=( callback0 const& rhs ) { m_impl = rhs.m_impl; } template @@ -121,7 +121,7 @@ public: private: // Data members - boost::shared_ptr > m_impl; + boost::std::shared_ptr > m_impl; }; // ************************************************************************** // @@ -179,7 +179,7 @@ public: private: // Data members - boost::shared_ptr > m_impl; + boost::std::shared_ptr > m_impl; }; // ************************************************************************** // @@ -236,7 +236,7 @@ public: private: // Data members - boost::shared_ptr > m_impl; + boost::std::shared_ptr > m_impl; }; // ************************************************************************** // @@ -294,7 +294,7 @@ public: private: // Data members - boost::shared_ptr > m_impl; + boost::std::shared_ptr > m_impl; }; } // namespace unit_test diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/basic_parameter.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/basic_parameter.hpp index e7e084cd..c98027cd 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/basic_parameter.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/basic_parameter.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// Use, modification, and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -40,7 +40,7 @@ template class basic_parameter : private base_from_member, public typed_parameter { public: // Constructors - explicit basic_parameter( cstring n ) + explicit basic_parameter( cstring n ) : base_from_member() , typed_parameter( base_from_member::member ) { @@ -61,16 +61,16 @@ public: #define BOOST_RT_CLA_NAMED_PARAM_GENERATORS( param_type ) \ template \ -inline shared_ptr > \ +inline std::shared_ptr > \ param_type( cstring name = cstring() ) \ { \ - return shared_ptr >( new param_type ## _t( name ) ); \ + return std::shared_ptr >( new param_type ## _t( name ) ); \ } \ \ -inline shared_ptr > \ +inline std::shared_ptr > \ param_type( cstring name = cstring() ) \ { \ - return shared_ptr >( new param_type ## _t( name ) ); \ + return std::shared_ptr >( new param_type ## _t( name ) ); \ } \ /**/ diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/char_parameter.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/char_parameter.hpp index 3e9b2d84..ac686e06 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/char_parameter.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/char_parameter.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// Use, modification, and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -66,18 +66,18 @@ public: //____________________________________________________________________________// template -inline shared_ptr > +inline std::shared_ptr > char_parameter( char_type name ) { - return shared_ptr >( new char_parameter_t( name ) ); + return std::shared_ptr >( new char_parameter_t( name ) ); } //____________________________________________________________________________// -inline shared_ptr > +inline std::shared_ptr > char_parameter( char_type name ) { - return shared_ptr >( new char_parameter_t( name ) ); + return std::shared_ptr >( new char_parameter_t( name ) ); } //____________________________________________________________________________// diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/fwd.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/fwd.hpp index 66d6efc1..9a351bd0 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/fwd.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/fwd.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// Use, modification, and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -19,7 +19,7 @@ #include // Boost -#include +#include namespace boost { @@ -29,9 +29,9 @@ namespace cla { class parser; class parameter; -typedef shared_ptr parameter_ptr; +typedef std::shared_ptr parameter_ptr; class naming_policy; -typedef shared_ptr naming_policy_ptr; +typedef std::shared_ptr naming_policy_ptr; class argv_traverser; namespace rt_cla_detail { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/parameter.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/parameter.hpp index 753268a9..46a6aebf 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/parameter.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/parameter.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// Use, modification, and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -88,12 +88,12 @@ public: bool conflict_with( parameter const& p ) const { return (id_2_report() == p.id_2_report() && !id_2_report().is_empty()) || - m_id_policy.conflict_with( p.m_id_policy ) || + m_id_policy.conflict_with( p.m_id_policy ) || ((m_id_policy.p_type_id != p.m_id_policy.p_type_id) && p.m_id_policy.conflict_with( m_id_policy )); } cstring id_2_report() const { return m_id_policy.id_2_report(); } void usage_info( format_stream& fs ) const - { + { m_id_policy.usage_info( fs ); if( p_optional_value ) fs << BOOST_RT_PARAM_LITERAL( '[' ); @@ -131,8 +131,8 @@ private: //____________________________________________________________________________// template -inline shared_ptr -operator-( shared_ptr p, Modifier const& m ) +inline std::shared_ptr +operator-( std::shared_ptr p, Modifier const& m ) { p->accept_modifier( m ); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/parser.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/parser.hpp index 5c3c341d..a37e7877 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/parser.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/cla/parser.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// Use, modification, and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -52,7 +52,7 @@ public: template global_mod_parser const& - operator<<( shared_ptr param ) const + operator<<( std::shared_ptr param ) const { param->accept_modifier( m_modifiers ); @@ -103,7 +103,7 @@ public: // arguments access const_argument_ptr operator[]( cstring string_id ) const; - cstring get( cstring string_id ) const; + cstring get( cstring string_id ) const; template T const& get( cstring string_id ) const diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/file/config_file_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/file/config_file_iterator.hpp index 85467f66..8cfe4880 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/file/config_file_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/file/config_file_iterator.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// Use, modification, and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -26,7 +26,7 @@ #include // Boost -#include +#include namespace boost { @@ -34,7 +34,7 @@ namespace BOOST_RT_PARAM_NAMESPACE { namespace file { -// Public typedef +// Public typedef typedef std::pair location; // ************************************************************************** // @@ -154,7 +154,7 @@ private: // Data members struct Impl; - shared_ptr m_pimpl; + std::shared_ptr m_pimpl; }; } // namespace file diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/fwd.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/fwd.hpp index 8d298d72..a4f1a77a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/fwd.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/fwd.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2005-2008. // Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -19,7 +19,7 @@ #include // Boost -#include +#include namespace boost { @@ -28,8 +28,8 @@ namespace BOOST_RT_PARAM_NAMESPACE { class parameter; class argument; -typedef shared_ptr argument_ptr; -typedef shared_ptr const_argument_ptr; +typedef std::shared_ptr argument_ptr; +typedef std::shared_ptr const_argument_ptr; template class value_interpreter; template class typed_argument; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/validation.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/validation.hpp index ff8e4691..2a3f1d02 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/validation.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/test/utils/runtime/validation.hpp @@ -1,6 +1,6 @@ // (C) Copyright Gennadiy Rozental 2005-2008. // Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. @@ -22,7 +22,7 @@ #include // Boost -#include +#include // STL #ifdef BOOST_RT_PARAM_EXCEPTION_INHERIT_STD @@ -37,14 +37,14 @@ namespace BOOST_RT_PARAM_NAMESPACE { // ************** runtime::logic_error ************** // // ************************************************************************** // -class logic_error +class logic_error #ifdef BOOST_RT_PARAM_EXCEPTION_INHERIT_STD : public std::exception #endif { - typedef shared_ptr dstring_ptr; + typedef std::shared_ptr dstring_ptr; public: - // Constructor // !! could we eliminate shared_ptr + // Constructor // !! could we eliminate std::shared_ptr explicit logic_error( cstring msg ) : m_msg( new dstring( msg.begin(), msg.size() ) ) {} ~logic_error() throw() {} diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/future.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/future.hpp index de23fda4..c818c945 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/future.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/future.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -236,9 +236,9 @@ namespace boost bool thread_was_interrupted; //#endif #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION - shared_ptr continuation_ptr; + std::shared_ptr continuation_ptr; #else - shared_ptr continuation_ptr; + std::shared_ptr continuation_ptr; #endif future_object_base(): done(false), @@ -998,11 +998,11 @@ namespace boost struct registered_waiter { - boost::shared_ptr future_; + boost::std::shared_ptr future_; detail::future_object_base::waiter_list::iterator wait_iterator; count_type index; - registered_waiter(boost::shared_ptr const& a_future, + registered_waiter(boost::std::shared_ptr const& a_future, detail::future_object_base::waiter_list::iterator wait_iterator_, count_type index_): future_(a_future),wait_iterator(wait_iterator_),index(index_) @@ -1236,7 +1236,7 @@ namespace boost { protected: - typedef boost::shared_ptr > future_ptr; + typedef boost::std::shared_ptr > future_ptr; future_ptr future_; @@ -1566,7 +1566,7 @@ namespace boost template class promise { - typedef boost::shared_ptr > future_ptr; + typedef boost::std::shared_ptr > future_ptr; future_ptr future_; bool future_obtained; @@ -1729,7 +1729,7 @@ namespace boost template class promise { - typedef boost::shared_ptr > future_ptr; + typedef boost::std::shared_ptr > future_ptr; future_ptr future_; bool future_obtained; @@ -1871,7 +1871,7 @@ namespace boost template <> class promise { - typedef boost::shared_ptr > future_ptr; + typedef boost::std::shared_ptr > future_ptr; future_ptr future_; bool future_obtained; @@ -1927,7 +1927,7 @@ namespace boost promise(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT : future_(BOOST_THREAD_RV(rhs).future_),future_obtained(BOOST_THREAD_RV(rhs).future_obtained) { - // we need to release the future as shared_ptr doesn't implements move semantics + // we need to release the future as std::shared_ptr doesn't implements move semantics BOOST_THREAD_RV(rhs).future_.reset(); BOOST_THREAD_RV(rhs).future_obtained=false; } @@ -2461,21 +2461,21 @@ namespace boost template class packaged_task { - typedef boost::shared_ptr > task_ptr; - boost::shared_ptr > task; + typedef boost::std::shared_ptr > task_ptr; + boost::std::shared_ptr > task; #else template class packaged_task { - typedef boost::shared_ptr > task_ptr; - boost::shared_ptr > task; + typedef boost::std::shared_ptr > task_ptr; + boost::std::shared_ptr > task; #endif #else template class packaged_task { - typedef boost::shared_ptr > task_ptr; - boost::shared_ptr > task; + typedef boost::std::shared_ptr > task_ptr; + boost::std::shared_ptr > task; #endif bool future_obtained; struct dummy; @@ -2806,7 +2806,7 @@ namespace boost BOOST_THREAD_FUTURE make_future_deferred_object(BOOST_THREAD_FWD_REF(Fp) f) { - shared_ptr > + std::shared_ptr > h(new future_deferred_object(boost::forward(f))); return BOOST_THREAD_FUTURE(h); } @@ -2818,7 +2818,7 @@ namespace boost BOOST_THREAD_FUTURE make_future_async_object(BOOST_THREAD_FWD_REF(Fp) f) { - shared_ptr > + std::shared_ptr > h(new future_async_object(boost::forward(f))); return BOOST_THREAD_FUTURE(h); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/pthread/thread_data.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/pthread/thread_data.hpp index 5c3b4f02..18dacc0f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/pthread/thread_data.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/pthread/thread_data.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include @@ -87,17 +87,17 @@ namespace boost struct thread_exit_callback_node; struct tss_data_node { - boost::shared_ptr func; + boost::std::shared_ptr func; void* value; - tss_data_node(boost::shared_ptr func_, + tss_data_node(boost::std::shared_ptr func_, void* value_): func(func_),value(value_) {} }; struct thread_data_base; - typedef boost::shared_ptr thread_data_ptr; + typedef boost::std::shared_ptr thread_data_ptr; struct BOOST_THREAD_DECL thread_data_base: enable_shared_from_this @@ -121,7 +121,7 @@ namespace boost > notify_list_t; notify_list_t notify; - typedef std::vector > async_states_t; + typedef std::vector > async_states_t; async_states_t async_states_; //#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS @@ -152,7 +152,7 @@ namespace boost notify.push_back(std::pair(cv, m)); } - void make_ready_at_thread_exit(shared_ptr as) + void make_ready_at_thread_exit(std::shared_ptr as) { async_states_.push_back(as); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/tss.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/tss.hpp index c920024b..e5d518fd 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/tss.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/thread/tss.hpp @@ -6,7 +6,7 @@ // (C) Copyright 2007-8 Anthony Williams #include -#include +#include #include #include @@ -19,11 +19,11 @@ namespace boost { virtual ~tss_cleanup_function() {} - + virtual void operator()(void* data)=0; }; - - BOOST_THREAD_DECL void set_tss_data(void const* key,boost::shared_ptr func,void* tss_data,bool cleanup_existing); + + BOOST_THREAD_DECL void set_tss_data(void const* key,boost::std::shared_ptr func,void* tss_data,bool cleanup_existing); BOOST_THREAD_DECL void* get_tss_data(void const* key); } @@ -42,16 +42,16 @@ namespace boost delete static_cast(data); } }; - + struct run_custom_cleanup_function: detail::tss_cleanup_function { void (*cleanup_function)(T*); - + explicit run_custom_cleanup_function(void (*cleanup_function_)(T*)): cleanup_function(cleanup_function_) {} - + void operator()(void* data) { cleanup_function(static_cast(data)); @@ -59,11 +59,11 @@ namespace boost }; - boost::shared_ptr cleanup; - + boost::std::shared_ptr cleanup; + public: typedef T element_type; - + thread_specific_ptr(): cleanup(detail::heap_new(),detail::do_heap_delete()) {} @@ -76,7 +76,7 @@ namespace boost } ~thread_specific_ptr() { - detail::set_tss_data(this,boost::shared_ptr(),0,true); + detail::set_tss_data(this,boost::std::shared_ptr(),0,true); } T* get() const @@ -94,7 +94,7 @@ namespace boost T* release() { T* const temp=get(); - detail::set_tss_data(this,boost::shared_ptr(),0,false); + detail::set_tss_data(this,boost::std::shared_ptr(),0,false); return temp; } void reset(T* new_value=0) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/tr1/memory.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/tr1/memory.hpp index 16908774..8b50bba3 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/tr1/memory.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/tr1/memory.hpp @@ -12,23 +12,23 @@ #ifndef BOOST_HAS_TR1_SHARED_PTR // -// This header can get included by boost/shared_ptr.hpp which leads +// This header can get included by boost/std::shared_ptr.hpp which leads // to cyclic dependencies, the workaround is to forward declare all // the boost components, and then include the actual headers afterwards. // This is fragile, but seems to work, and doesn't require modification -// of boost/shared_ptr.hpp. +// of boost/std::shared_ptr.hpp. // namespace boost{ class bad_weak_ptr; template class weak_ptr; -template class shared_ptr; +template class std::shared_ptr; template void swap(weak_ptr & a, weak_ptr & b) BOOST_NOEXCEPT; -template void swap(shared_ptr & a, shared_ptr & b) BOOST_NOEXCEPT; -template shared_ptr static_pointer_cast(shared_ptr const & r) BOOST_NOEXCEPT; -template shared_ptr dynamic_pointer_cast(shared_ptr const & r) BOOST_NOEXCEPT; -template shared_ptr const_pointer_cast(shared_ptr const & r) BOOST_NOEXCEPT; -template D * get_deleter(shared_ptr const & p) BOOST_NOEXCEPT; +template void swap(std::shared_ptr & a, std::shared_ptr & b) BOOST_NOEXCEPT; +template std::shared_ptr static_pointer_cast(std::shared_ptr const & r) BOOST_NOEXCEPT; +template std::shared_ptr dynamic_pointer_cast(std::shared_ptr const & r) BOOST_NOEXCEPT; +template std::shared_ptr const_pointer_cast(std::shared_ptr const & r) BOOST_NOEXCEPT; +template D * get_deleter(std::shared_ptr const & p) BOOST_NOEXCEPT; template class enable_shared_from_this; namespace detail{ @@ -41,7 +41,7 @@ class weak_count; namespace std{ namespace tr1{ using ::boost::bad_weak_ptr; - using ::boost::shared_ptr; + using ::boost::std::shared_ptr; #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582) using ::boost::swap; #endif @@ -53,7 +53,7 @@ namespace std{ namespace tr1{ using ::boost::enable_shared_from_this; } } -#include +#include #include #include diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/uuid/random_generator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/uuid/random_generator.hpp index 0f4a0ab6..82fa2e23 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/uuid/random_generator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/uuid/random_generator.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include namespace boost { @@ -34,7 +34,7 @@ private: public: typedef uuid result_type; - + // default constructor creates the random number generator basic_random_generator() : pURNG(new UniformRandomNumberGenerator) @@ -49,7 +49,7 @@ public: // seed the random number generator detail::seed(*pURNG); } - + // keep a reference to a random number generator // don't seed a given random number generator explicit basic_random_generator(UniformRandomNumberGenerator& gen) @@ -62,7 +62,7 @@ public: ) ) {} - + // keep a pointer to a random number generator // don't seed a given random number generator explicit basic_random_generator(UniformRandomNumberGenerator* pGen) @@ -77,11 +77,11 @@ public: { BOOST_ASSERT(pURNG); } - + uuid operator()() { uuid u; - + int i=0; unsigned long random_value = generator(); for (uuid::iterator it=u.begin(); it!=u.end(); ++it, ++i) { @@ -108,7 +108,7 @@ public: } private: - shared_ptr pURNG; + std::shared_ptr pURNG; generator_type generator; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/cpp_context.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/cpp_context.hpp index 50c1d1ce..9d67f4f5 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/cpp_context.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/cpp_context.hpp @@ -1,7 +1,7 @@ /*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library Definition of the preprocessor context - + http://www.boost.org/ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost @@ -52,10 +52,10 @@ namespace boost { namespace wave { /////////////////////////////////////////////////////////////////////////////// -// +// // The C/C++ preprocessor context template class // -// The boost::wave::context template is the main interface class to +// The boost::wave::context template is the main interface class to // control the behavior of the preprocessing engine. // // The following template parameters has to be supplied: @@ -63,18 +63,18 @@ namespace wave { // IteratorT The iterator type of the underlying input stream // LexIteratorT The lexer iterator type to use as the token factory // InputPolicyT The input policy type to use for loading the files -// to be included. This template parameter is optional and -// defaults to the +// to be included. This template parameter is optional and +// defaults to the // iteration_context_policies::load_file_to_string // type. -// HooksT The hooks policy to use for different notification +// HooksT The hooks policy to use for different notification // callbacks. This template parameter is optional and // defaults to the // context_policies::default_preprocessing_hooks // type. // DerivedT The type of the type being derived from the context // type (if any). This template parameter is optional and -// defaults to 'this_type', which means that the context +// defaults to 'this_type', which means that the context // type will be used assuming no derived type exists. // /////////////////////////////////////////////////////////////////////////////// @@ -83,7 +83,7 @@ struct this_type {}; template < typename IteratorT, - typename LexIteratorT, + typename LexIteratorT, typename InputPolicyT = iteration_context_policies::load_file_to_string, typename HooksT = context_policies::eat_whitespace, typename DerivedT = this_type @@ -113,35 +113,35 @@ public: typedef typename token_type::position_type position_type; // type of a token sequence - typedef std::list > + typedef std::list > token_sequence_type; // type of the policies typedef HooksT hook_policy_type; private: -// stack of shared_ptr's to the pending iteration contexts - typedef boost::shared_ptr > +// stack of std::shared_ptr's to the pending iteration contexts + typedef boost::std::shared_ptr > iteration_ptr_type; - typedef boost::wave::util::iteration_context_stack + typedef boost::wave::util::iteration_context_stack iteration_context_stack_type; typedef typename iteration_context_stack_type::size_type iter_size_type; context *this_() { return this; } // avoid warning in constructor public: - context(target_iterator_type const &first_, target_iterator_type const &last_, + context(target_iterator_type const &first_, target_iterator_type const &last_, char const *fname = "", HooksT const &hooks_ = HooksT()) : first(first_), last(last_), filename(fname) , has_been_initialized(false) #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 , current_filename(fname) -#endif +#endif , current_relative_filename(fname) , macros(*this_()) , language(language_support( - support_cpp - | support_option_convert_trigraphs - | support_option_emit_line_directives + support_cpp + | support_option_convert_trigraphs + | support_option_emit_line_directives #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 | support_option_include_guard_detection #endif @@ -160,29 +160,29 @@ public: // default destructor // iterator interface - iterator_type begin() - { + iterator_type begin() + { std::string fname(filename); if (filename != "" && filename != "") { using namespace boost::filesystem; path fpath(util::complete_path(path(filename))); fname = fpath.string(); } - return iterator_type(*this, first, last, position_type(fname.c_str())); + return iterator_type(*this, first, last, position_type(fname.c_str())); } iterator_type begin( - target_iterator_type const &first_, - target_iterator_type const &last_) - { + target_iterator_type const &first_, + target_iterator_type const &last_) + { std::string fname(filename); if (filename != "" && filename != "") { using namespace boost::filesystem; path fpath(util::complete_path(path(filename))); fname = fpath.string(); } - return iterator_type(*this, first_, last_, position_type(fname.c_str())); + return iterator_type(*this, first_, last_, position_type(fname.c_str())); } - iterator_type end() const + iterator_type end() const { return iterator_type(); } // maintain include paths @@ -191,46 +191,46 @@ public: bool add_sysinclude_path(char const *path_) { return includes.add_include_path(path_, true);} void set_sysinclude_delimiter() { includes.set_sys_include_delimiter(); } - typename iteration_context_stack_type::size_type get_iteration_depth() const + typename iteration_context_stack_type::size_type get_iteration_depth() const { return iter_ctxs.size(); } // maintain defined macros #if BOOST_WAVE_ENABLE_COMMANDLINE_MACROS != 0 template bool add_macro_definition(StringT macrostring, bool is_predefined = false) - { - return boost::wave::util::add_macro_definition(*this, - util::to_string(macrostring), is_predefined, - get_language()); + { + return boost::wave::util::add_macro_definition(*this, + util::to_string(macrostring), is_predefined, + get_language()); } -#endif +#endif // Define and undefine macros, macro introspection template - bool add_macro_definition(StringT const &name, position_type const& pos, - bool has_params, std::vector ¶meters, + bool add_macro_definition(StringT const &name, position_type const& pos, + bool has_params, std::vector ¶meters, token_sequence_type &definition, bool is_predefined = false) - { + { return macros.add_macro( - token_type(T_IDENTIFIER, util::to_string(name), pos), - has_params, parameters, definition, is_predefined); + token_type(T_IDENTIFIER, util::to_string(name), pos), + has_params, parameters, definition, is_predefined); } template bool is_defined_macro(StringT const &str) const - { - return macros.is_defined(util::to_string(str)); + { + return macros.is_defined(util::to_string(str)); } template - bool get_macro_definition(StringT const &name, + bool get_macro_definition(StringT const &name, bool &has_params, bool &is_predefined, position_type &pos, - std::vector ¶meters, + std::vector ¶meters, token_sequence_type &definition) const - { - return macros.get_macro(util::to_string(name), - has_params, is_predefined, pos, parameters, definition); + { + return macros.get_macro(util::to_string(name), + has_params, is_predefined, pos, parameters, definition); } template bool remove_macro_definition(StringT const& undefname, bool even_predefined = false) - { + { // strip leading and trailing whitespace string_type name = util::to_string(undefname); typename string_type::size_type pos = name.find_first_not_of(" \t"); @@ -244,9 +244,9 @@ public: includes.remove_pragma_once_header( util::to_string(name)); #endif - return macros.remove_macro(name, macros.get_main_pos(), even_predefined); + return macros.remove_macro(name, macros.get_main_pos(), even_predefined); } - void reset_macro_definitions() + void reset_macro_definitions() { macros.reset_macromap(); macros.init_predefined_macros(); } // Iterate over names of defined macros @@ -264,28 +264,28 @@ public: bool add_macro_definition(token_type const &name, bool has_params, std::vector ¶meters, token_sequence_type &definition, bool is_predefined = false) - { - return macros.add_macro(name, has_params, parameters, definition, - is_predefined); + { + return macros.add_macro(name, has_params, parameters, definition, + is_predefined); } -// get the Wave version information - static std::string get_version() - { - boost::wave::util::predefined_macros p; - return util::to_string(p.get_fullversion()); - } - static std::string get_version_string() +// get the Wave version information + static std::string get_version() { boost::wave::util::predefined_macros p; - return util::to_string(p.get_versionstr()); + return util::to_string(p.get_fullversion()); + } + static std::string get_version_string() + { + boost::wave::util::predefined_macros p; + return util::to_string(p.get_versionstr()); } // access current language options void set_language(boost::wave::language_support language_, - bool reset_macros = true) - { - language = language_; + bool reset_macros = true) + { + language = language_; if (reset_macros) reset_macro_definitions(); } @@ -305,10 +305,10 @@ public: hook_policy_type const &get_hooks() const { return hooks; } // return type of actually used context type (might be the derived type) - actual_context_type& derived() - { return *static_cast(this); } + actual_context_type& derived() + { return *static_cast(this); } actual_context_type const& derived() const - { return *static_cast(this); } + { return *static_cast(this); } // return the directory of the currently preprocessed file boost::filesystem::path get_current_directory() const @@ -320,7 +320,7 @@ protected: friend class boost::wave::impl::pp_iterator_functor; #endif -// make sure the context has been initialized +// make sure the context has been initialized void init_context() { if (!has_been_initialized) { @@ -340,22 +340,22 @@ protected: { return macros.is_defined(begin, end); } // maintain include paths (helper functions) - void set_current_directory(char const *path_) + void set_current_directory(char const *path_) { includes.set_current_directory(path_); } // conditional compilation contexts bool get_if_block_status() const { return ifblocks.get_status(); } - bool get_if_block_some_part_status() const - { return ifblocks.get_some_part_status(); } + bool get_if_block_some_part_status() const + { return ifblocks.get_some_part_status(); } bool get_enclosing_if_block_status() const { return ifblocks.get_enclosing_status(); } - void enter_if_block(bool new_status) + void enter_if_block(bool new_status) { ifblocks.enter_if_block(new_status); } - bool enter_elif_block(bool new_status) + bool enter_elif_block(bool new_status) { return ifblocks.enter_elif_block(new_status); } bool enter_else_block() { return ifblocks.enter_else_block(); } bool exit_if_block() { return ifblocks.exit_if_block(); } - typename boost::wave::util::if_block_stack::size_type get_if_block_depth() const + typename boost::wave::util::if_block_stack::size_type get_if_block_depth() const { return ifblocks.get_if_block_depth(); } // stack of iteration contexts @@ -366,29 +366,29 @@ protected: /////////////////////////////////////////////////////////////////////////////// // -// expand_tokensequence(): -// expands all macros contained in a given token sequence, handles '##' -// and '#' pp operators and re-scans the resulting sequence +// expand_tokensequence(): +// expands all macros contained in a given token sequence, handles '##' +// and '#' pp operators and re-scans the resulting sequence // (essentially pre-processes the token sequence). // // The expand_undefined parameter is true during macro expansion inside -// a C++ expression given for a #if or #elif statement. +// a C++ expression given for a #if or #elif statement. // /////////////////////////////////////////////////////////////////////////////// template - token_type expand_tokensequence(IteratorT2 &first_, IteratorT2 const &last_, - token_sequence_type &pending, token_sequence_type &expanded, + token_type expand_tokensequence(IteratorT2 &first_, IteratorT2 const &last_, + token_sequence_type &pending, token_sequence_type &expanded, bool& seen_newline, bool expand_undefined = false) { - return macros.expand_tokensequence(first_, last_, pending, expanded, + return macros.expand_tokensequence(first_, last_, pending, expanded, seen_newline, expand_undefined); } template - void expand_whole_tokensequence(IteratorT2 &first_, IteratorT2 const &last_, + void expand_whole_tokensequence(IteratorT2 &first_, IteratorT2 const &last_, token_sequence_type &expanded, bool expand_undefined = true) { - macros.expand_whole_tokensequence(expanded, first_, last_, + macros.expand_whole_tokensequence(expanded, first_, last_, expand_undefined); // remove any contained placeholder @@ -401,33 +401,33 @@ public: // maintain the real name of the current preprocessed file void set_current_filename(char const *real_name) { current_filename = real_name; } - std::string const &get_current_filename() const + std::string const &get_current_filename() const { return current_filename; } -// maintain the list of known headers containing #pragma once +// maintain the list of known headers containing #pragma once bool has_pragma_once(std::string const &filename_) { return includes.has_pragma_once(filename_); } bool add_pragma_once_header(std::string const &filename_, std::string const& guard_name) - { + { get_hooks().detected_include_guard(derived(), filename_, guard_name); - return includes.add_pragma_once_header(filename_, guard_name); + return includes.add_pragma_once_header(filename_, guard_name); } - bool add_pragma_once_header(token_type const &pragma_, + bool add_pragma_once_header(token_type const &pragma_, std::string const &filename_) - { + { get_hooks().detected_pragma_once(derived(), pragma_, filename_); - return includes.add_pragma_once_header(filename_, - "__BOOST_WAVE_PRAGMA_ONCE__"); + return includes.add_pragma_once_header(filename_, + "__BOOST_WAVE_PRAGMA_ONCE__"); } -#endif +#endif void set_current_relative_filename(char const *real_name) { current_relative_filename = real_name; } - std::string const &get_current_relative_filename() const + std::string const &get_current_relative_filename() const { return current_relative_filename; } - bool find_include_file (std::string &s, std::string &d, bool is_system, + bool find_include_file (std::string &s, std::string &d, bool is_system, char const *current_file) const { return includes.find_include_file(s, d, is_system, current_file); } @@ -459,8 +459,8 @@ private: { using namespace boost::serialization; if (version != (loaded_version & ~version_mask)) { - BOOST_WAVE_THROW_CTX((*this), preprocess_exception, - incompatible_config, "cpp_context state version", + BOOST_WAVE_THROW_CTX((*this), preprocess_exception, + incompatible_config, "cpp_context state version", get_main_pos()); return; } @@ -471,7 +471,7 @@ private: // BOOST_PP_STRINGIZE(BOOST_WAVE_CONFIG) ar & make_nvp("config", config); if (config != BOOST_PP_STRINGIZE(BOOST_WAVE_CONFIG)) { - BOOST_WAVE_THROW_CTX((*this), preprocess_exception, + BOOST_WAVE_THROW_CTX((*this), preprocess_exception, incompatible_config, "BOOST_WAVE_CONFIG", get_main_pos()); return; } @@ -479,8 +479,8 @@ private: // BOOST_WAVE_PRAGMA_KEYWORD ar & make_nvp("pragma_keyword", pragma_keyword); if (pragma_keyword != BOOST_WAVE_PRAGMA_KEYWORD) { - BOOST_WAVE_THROW_CTX((*this), preprocess_exception, - incompatible_config, "BOOST_WAVE_PRAGMA_KEYWORD", + BOOST_WAVE_THROW_CTX((*this), preprocess_exception, + incompatible_config, "BOOST_WAVE_PRAGMA_KEYWORD", get_main_pos()); return; } @@ -488,7 +488,7 @@ private: // BOOST_PP_STRINGIZE((BOOST_WAVE_STRINGTYPE)) ar & make_nvp("string_type", string_type_str); if (string_type_str != BOOST_PP_STRINGIZE((BOOST_WAVE_STRINGTYPE))) { - BOOST_WAVE_THROW_CTX((*this), preprocess_exception, + BOOST_WAVE_THROW_CTX((*this), preprocess_exception, incompatible_config, "BOOST_WAVE_STRINGTYPE", get_main_pos()); return; } @@ -501,7 +501,7 @@ private: } catch (boost::wave::preprocess_exception const& e) { // catch version mismatch exceptions and call error handler - get_hooks().throw_exception(derived(), e); + get_hooks().throw_exception(derived(), e); } } BOOST_SERIALIZATION_SPLIT_MEMBER() @@ -515,7 +515,7 @@ private: bool has_been_initialized; // set cwd once #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 std::string current_filename; // real name of current preprocessed file -#endif +#endif std::string current_relative_filename; // real relative name of current preprocessed file boost::wave::util::if_block_stack ifblocks; // conditional compilation contexts @@ -534,7 +534,7 @@ private: namespace boost { namespace serialization { template< - typename Iterator, typename LexIterator, + typename Iterator, typename LexIterator, typename InputPolicy, typename Hooks > struct tracking_level > @@ -548,7 +548,7 @@ struct tracking_level struct version > diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/cpp_iterator.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/cpp_iterator.hpp index dc2d9342..b1bd8ee6 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/cpp_iterator.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/cpp_iterator.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -359,7 +359,7 @@ protected: private: ContextT &ctx; // context, this iterator is associated with - boost::shared_ptr iter_ctx; + boost::std::shared_ptr iter_ctx; bool seen_newline; // needed for recognizing begin of line bool skipped_newline; // a newline has been skipped since last one @@ -1608,7 +1608,7 @@ char const *current_name = 0; // never try to match current file name ctx.set_current_directory(native_path_str.c_str()); // preprocess the opened file - boost::shared_ptr new_iter_ctx ( + boost::std::shared_ptr new_iter_ctx ( new iteration_context_type(ctx, native_path_str.c_str(), act_pos, boost::wave::enable_prefer_pp_numbers(ctx.get_language()), is_system ? base_iteration_context_type::system_header : diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/cpp_macromap.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/cpp_macromap.hpp index fb251ea1..9ccefca1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/cpp_macromap.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/cpp_macromap.hpp @@ -28,7 +28,7 @@ #include #if BOOST_WAVE_SERIALIZATION != 0 #include -#include +#include #endif #include @@ -259,7 +259,7 @@ private: private: defined_macros_type *current_macros; // current symbol table - boost::shared_ptr defined_macros; // global symbol table + boost::std::shared_ptr defined_macros; // global symbol table token_type act_token; // current token position_type main_pos; // last token position in the pp_iterator diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/symbol_table.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/symbol_table.hpp index 312b0a2f..f622d45c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/symbol_table.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/util/symbol_table.hpp @@ -14,14 +14,14 @@ #include #include -#include +#include #if BOOST_WAVE_SERIALIZATION != 0 #include #include -#include +#include #else -#include +#include #endif #include @@ -38,27 +38,27 @@ namespace util { /////////////////////////////////////////////////////////////////////////////// // -// The symbol_table class is used for the storage of defined macros. +// The symbol_table class is used for the storage of defined macros. // /////////////////////////////////////////////////////////////////////////////// template -struct symbol_table +struct symbol_table #if BOOST_WAVE_SERIALIZATION != 0 -: public std::map > +: public std::map > #else -: public std::map > +: public std::map > #endif { #if BOOST_WAVE_SERIALIZATION != 0 - typedef std::map > base_type; + typedef std::map > base_type; #else typedef std::map > base_type; #endif typedef typename base_type::iterator iterator_type; typedef typename base_type::const_iterator const_iterator_type; - symbol_table(long uid_ = 0) + symbol_table(long uid_ = 0) {} #if BOOST_WAVE_SERIALIZATION != 0 @@ -68,7 +68,7 @@ private: void serialize(Archive &ar, const unsigned int version) { using namespace boost::serialization; - ar & make_nvp("symbol_table", + ar & make_nvp("symbol_table", boost::serialization::base_object(*this)); } #endif @@ -76,7 +76,7 @@ private: private: /////////////////////////////////////////////////////////////////////////// // - // This is a special iterator allowing to iterate the names of all defined + // This is a special iterator allowing to iterate the names of all defined // macros. // /////////////////////////////////////////////////////////////////////////// @@ -94,13 +94,13 @@ private: typedef get_first unary_functor; public: - typedef transform_iterator + typedef transform_iterator name_iterator; - typedef transform_iterator + typedef transform_iterator const_name_iterator; template - static + static transform_iterator make_iterator(Iterator it) { return boost::make_transform_iterator(it); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/access.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/access.hpp index d984a432..a1fe00f2 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/access.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/access.hpp @@ -14,7 +14,7 @@ #endif #include -#include +#include #include #include #include @@ -41,7 +41,7 @@ struct core_access return rex.match_(state); } - static shared_ptr > const & + static std::shared_ptr > const & get_regex_impl(basic_regex const &rex) { return proto::value(rex).get(); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/linker.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/linker.hpp index e87e26d1..15c2d951 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/linker.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/linker.hpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/matcher/regex_byref_matcher.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/matcher/regex_byref_matcher.hpp index f9282042..bb036635 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/matcher/regex_byref_matcher.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/matcher/regex_byref_matcher.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -41,7 +41,7 @@ namespace boost { namespace xpressive { namespace detail // we don't have to worry about it going away. regex_impl const *pimpl_; - regex_byref_matcher(shared_ptr > const &impl) + regex_byref_matcher(std::shared_ptr > const &impl) : wimpl_(impl) , pimpl_(impl.get()) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/matcher/regex_matcher.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/matcher/regex_matcher.hpp index e7eee7d3..100317df 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/matcher/regex_matcher.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/core/matcher/regex_matcher.hpp @@ -34,7 +34,7 @@ namespace boost { namespace xpressive { namespace detail { regex_impl impl_; - regex_matcher(shared_ptr > const &impl) + regex_matcher(std::shared_ptr > const &impl) : impl_() { this->impl_.xpr_ = impl->xpr_; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/detail_fwd.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/detail_fwd.hpp index 52deaae9..7fd3088b 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/detail_fwd.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/detail_fwd.hpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include namespace boost { namespace xpressive { namespace detail @@ -353,7 +353,7 @@ namespace boost { namespace xpressive { namespace detail int get_mark_number(basic_mark_tag const &); template - void static_compile(Xpr const &xpr, shared_ptr > const &impl); + void static_compile(Xpr const &xpr, std::shared_ptr > const &impl); struct quant_spec; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/compile.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/compile.hpp index bc8af05b..023a238a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/compile.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/compile.hpp @@ -32,7 +32,7 @@ namespace boost { namespace xpressive { namespace detail /////////////////////////////////////////////////////////////////////////////// // static_compile_impl2 template - void static_compile_impl2(Xpr const &xpr, shared_ptr > const &impl, Traits const &tr) + void static_compile_impl2(Xpr const &xpr, std::shared_ptr > const &impl, Traits const &tr) { typedef typename iterator_value::type char_type; impl->tracking_clear(); @@ -70,7 +70,7 @@ namespace boost { namespace xpressive { namespace detail // static_compile_impl1 template typename disable_if >::type - static_compile_impl1(Xpr const &xpr, shared_ptr > const &impl) + static_compile_impl1(Xpr const &xpr, std::shared_ptr > const &impl) { // use default traits typedef typename iterator_value::type char_type; @@ -83,7 +83,7 @@ namespace boost { namespace xpressive { namespace detail // static_compile_impl1 template typename enable_if >::type - static_compile_impl1(Xpr const &xpr, shared_ptr > const &impl) + static_compile_impl1(Xpr const &xpr, std::shared_ptr > const &impl) { // use specified traits typedef typename proto::result_of::value::type>::type::locale_type locale_type; @@ -94,7 +94,7 @@ namespace boost { namespace xpressive { namespace detail /////////////////////////////////////////////////////////////////////////////// // static_compile template - void static_compile(Xpr const &xpr, shared_ptr > const &impl) + void static_compile(Xpr const &xpr, std::shared_ptr > const &impl) { static_compile_impl1(xpr, impl); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/placeholders.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/placeholders.hpp index 5c955384..75c09b4a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/placeholders.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/placeholders.hpp @@ -17,7 +17,7 @@ #endif #include -#include +#include #include #include diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/visitor.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/visitor.hpp index 5a0213f6..68ac32f1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/visitor.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/static/visitor.hpp @@ -14,7 +14,7 @@ #endif #include -#include +#include #include #include #include @@ -27,7 +27,7 @@ namespace boost { namespace xpressive { namespace detail template struct xpression_visitor_base { - explicit xpression_visitor_base(shared_ptr > const &self) + explicit xpression_visitor_base(std::shared_ptr > const &self) : self_(self) { } @@ -51,7 +51,7 @@ namespace boost { namespace xpressive { namespace detail } } - shared_ptr > &self() + std::shared_ptr > &self() { return this->self_; } @@ -94,7 +94,7 @@ namespace boost { namespace xpressive { namespace detail } private: - shared_ptr > self_; + std::shared_ptr > self_; }; /////////////////////////////////////////////////////////////////////////////// @@ -108,7 +108,7 @@ namespace boost { namespace xpressive { namespace detail typedef Traits traits_type; typedef typename boost::iterator_value::type char_type; - explicit xpression_visitor(Traits const &tr, shared_ptr > const &self) + explicit xpression_visitor(Traits const &tr, std::shared_ptr > const &self) : xpression_visitor_base(self) , traits_(tr) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/utility/symbols.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/utility/symbols.hpp index 5efa4aba..ffb9b552 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/utility/symbols.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/utility/symbols.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include namespace boost { namespace xpressive { namespace detail { @@ -75,9 +75,9 @@ namespace boost { namespace xpressive { namespace detail private: /////////////////////////////////////////////////////////////////////////////// - // struct node : a node in the TST. + // struct node : a node in the TST. // The "eq" field stores the result pointer when ch is zero. - // + // struct node : boost::noncopyable { @@ -125,7 +125,7 @@ namespace boost { namespace xpressive { namespace detail /////////////////////////////////////////////////////////////////////////////// // insert : insert a string into the TST - // + // template node* insert(node* p, key_iterator &begin, key_iterator end, result_type r, Trans trans) const { @@ -168,7 +168,7 @@ namespace boost { namespace xpressive { namespace detail /////////////////////////////////////////////////////////////////////////////// // conditional rotation : the goal is to minimize the overall // weighted path length of each binary search tree - // + // bool cond_rotation(bool left, node* const i, node* const j) const { // don't rotate top node in binary search tree @@ -201,7 +201,7 @@ namespace boost { namespace xpressive { namespace detail /////////////////////////////////////////////////////////////////////////////// // search : find a string in the TST - // + // template result_type search(BidiIter &begin, BidiIter end, Trans trans, node* p) const { @@ -276,7 +276,7 @@ namespace boost { namespace xpressive { namespace detail } } - boost::shared_ptr root; + boost::std::shared_ptr root; }; }}} // namespace boost::xpressive::detail diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/utility/tracking_ptr.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/utility/tracking_ptr.hpp index c6a0353e..0c211c3c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/utility/tracking_ptr.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/detail/utility/tracking_ptr.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -48,7 +48,7 @@ struct weak_iterator : iterator_facade < weak_iterator - , shared_ptr const + , std::shared_ptr const , std::forward_iterator_tag > { @@ -73,7 +73,7 @@ struct weak_iterator private: friend class boost::iterator_core_access; - shared_ptr const &dereference() const + std::shared_ptr const &dereference() const { return this->cur_; } @@ -102,7 +102,7 @@ private: this->cur_.reset(); } - shared_ptr cur_; + std::shared_ptr cur_; base_iterator iter_; set_type *set_; }; @@ -112,14 +112,14 @@ private: // for use with a filter_iterator to filter a node out of a list of dependencies template struct filter_self - : std::unary_function, bool> + : std::unary_function, bool> { filter_self(enable_reference_tracking *self) : self_(self) { } - bool operator ()(shared_ptr const &that) const + bool operator ()(std::shared_ptr const &that) const { return this->self_ != that.get(); } @@ -144,7 +144,7 @@ void adl_swap(T &t1, T &t2) template struct enable_reference_tracking { - typedef std::set > references_type; + typedef std::set > references_type; typedef std::set > dependents_type; void tracking_copy(Derived const &that) @@ -321,7 +321,7 @@ private: references_type refs_; dependents_type deps_; - shared_ptr self_; + std::shared_ptr self_; boost::detail::atomic_count cnt_; }; @@ -345,7 +345,7 @@ inline void intrusive_ptr_release(enable_reference_tracking *p) template inline void enable_reference_tracking::dump_(std::ostream &sout) const { - shared_ptr this_ = this->self_; + std::shared_ptr this_ = this->self_; sout << "0x" << (void*)this << " cnt=" << this_.use_count()-1 << " refs={"; typename references_type::const_iterator cur1 = this->refs_.begin(); typename references_type::const_iterator end1 = this->refs_.end(); @@ -358,8 +358,8 @@ inline void enable_reference_tracking::dump_(std::ostream &sout) const typename dependents_type::const_iterator end2 = this->deps_.end(); for(; cur2 != end2; ++cur2) { - // ericne, 27/nov/05: CW9_4 doesn't like if(shared_ptr x = y) - shared_ptr dep = cur2->lock(); + // ericne, 27/nov/05: CW9_4 doesn't like if(std::shared_ptr x = y) + std::shared_ptr dep = cur2->lock(); if(dep.get()) { sout << "0x" << (void*)&*dep << ','; @@ -425,7 +425,7 @@ struct tracking_ptr } // calling this forces this->impl_ to fork. - shared_ptr const &get() const + std::shared_ptr const &get() const { if(intrusive_ptr impl = this->fork_()) { @@ -480,7 +480,7 @@ private: { impl = this->impl_; BOOST_ASSERT(!this->has_deps_()); - shared_ptr simpl(new element_type); + std::shared_ptr simpl(new element_type); this->impl_ = get_pointer(simpl->self_ = simpl); } return impl; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/regex_compiler.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/regex_compiler.hpp index 4a2a9d74..ca47501e 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/regex_compiler.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/xpressive/regex_compiler.hpp @@ -375,7 +375,7 @@ private: , "mismatched parenthesis" ); basic_regex &rex = this->rules_[name]; - shared_ptr > impl = access::get_regex_impl(rex); + std::shared_ptr > impl = access::get_regex_impl(rex); this->self_->track_reference(*impl); return detail::make_dynamic(detail::regex_byref_matcher(impl)); } @@ -735,7 +735,7 @@ private: std::size_t hidden_mark_count_; CompilerTraits traits_; typename RegexTraits::char_class_type upper_; - shared_ptr > self_; + std::shared_ptr > self_; std::map > rules_; }; diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp index 1cb5e2ee..a5e97a2f 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp @@ -3,7 +3,7 @@ #ifndef SN_TARGET_PS3_SPU // #include "..\..\..\stdafx.h" #endif -#endif +#endif #include "ChunkRebuildData.h" #include "Tesselator_SPU.h" @@ -13,7 +13,7 @@ #include "..\..\..\..\Minecraft.World\Tile.h" #include "..\..\..\..\Minecraft.World\Level.h" #include "..\..\..\..\Minecraft.World\Dimension.h" -// +// // #include "..\..\..\Chunk.h" // #include "..\..\..\TileRenderer.h" // #include "..\..\..\TileEntityRenderDispatcher.h" @@ -26,13 +26,13 @@ #include "..\..\..\..\Minecraft.World\BiomeSource.h" #else - + #include "..\Common\spu_assert.h" #endif //SN_TARGET_PS3_SPU static const int Level_maxBuildHeight = 256; -static const int Level_MAX_LEVEL_SIZE = 30000000; +static const int Level_MAX_LEVEL_SIZE = 30000000; static const int Level_MAX_BRIGHTNESS = 15; @@ -53,7 +53,7 @@ int ChunkRebuildData::getGrassColor( int x, int z ) { return m_grassColor[get int ChunkRebuildData::getFoliageColor( int x, int z ) { return m_foliageColor[getTileIdx(x,z)]; } int ChunkRebuildData::getFlags(int x, int y, int z) { return m_data_flags[getTileIdx(x,y,z)] >> 4; } void ChunkRebuildData::setFlag(int x, int y, int z, int flag) { m_data_flags[getTileIdx(x,y,z)] |= (flag<<4);} -#endif +#endif @@ -77,7 +77,7 @@ void ChunkRebuildData::disableUnseenTiles() int tileID = getTile(iX,iY,iZ); if( tileID == 0 ) continue; m_flags &= ~e_flag_EmptyChunk; - + // Don't bother trying to work out neighbours for this tile if we are at the edge of the chunk - apart from the very // bottom of the world where we shouldn't ever be able to see @@ -120,7 +120,7 @@ void ChunkRebuildData::disableUnseenTiles() } } } - + #ifndef SN_TARGET_PS3_SPU void setIconSPUFromIcon(Icon_SPU* iconSpu, Icon* icon) @@ -145,78 +145,78 @@ void ChunkRebuildData::buildMaterial(int matSPUIndex, Material* mat) void ChunkRebuildData::buildMaterials() { - buildMaterial(Material_SPU::air_Id, Material::air); - buildMaterial(Material_SPU::grass_Id, Material::grass); - buildMaterial(Material_SPU::dirt_Id, Material::dirt); - buildMaterial(Material_SPU::wood_Id, Material::wood); - buildMaterial(Material_SPU::stone_Id, Material::stone); - buildMaterial(Material_SPU::metal_Id, Material::metal); - buildMaterial(Material_SPU::water_Id, Material::water); - buildMaterial(Material_SPU::lava_Id, Material::lava); - buildMaterial(Material_SPU::leaves_Id, Material::leaves); - buildMaterial(Material_SPU::plant_Id, Material::plant); - buildMaterial(Material_SPU::replaceable_plant_Id, Material::replaceable_plant); - buildMaterial(Material_SPU::sponge_Id, Material::sponge); - buildMaterial(Material_SPU::cloth_Id, Material::cloth); - buildMaterial(Material_SPU::fire_Id, Material::fire); - buildMaterial(Material_SPU::sand_Id, Material::sand); - buildMaterial(Material_SPU::decoration_Id, Material::decoration); - buildMaterial(Material_SPU::clothDecoration_Id, Material::clothDecoration); - buildMaterial(Material_SPU::glass_Id, Material::glass); - buildMaterial(Material_SPU::explosive_Id, Material::explosive); - buildMaterial(Material_SPU::coral_Id, Material::coral); - buildMaterial(Material_SPU::ice_Id, Material::ice); - buildMaterial(Material_SPU::topSnow_Id, Material::topSnow); - buildMaterial(Material_SPU::snow_Id, Material::snow); - buildMaterial(Material_SPU::cactus_Id, Material::cactus); - buildMaterial(Material_SPU::clay_Id, Material::clay); - buildMaterial(Material_SPU::vegetable_Id, Material::vegetable); - buildMaterial(Material_SPU::egg_Id, Material::egg); - buildMaterial(Material_SPU::portal_Id, Material::portal); - buildMaterial(Material_SPU::cake_Id, Material::cake); - buildMaterial(Material_SPU::web_Id, Material::web); - buildMaterial(Material_SPU::piston_Id, Material::piston); - buildMaterial(Material_SPU::buildable_glass_Id, Material::buildable_glass); - buildMaterial(Material_SPU::heavyMetal_Id, Material::heavyMetal); + buildMaterial(Material_SPU::air_Id, Material::air); + buildMaterial(Material_SPU::grass_Id, Material::grass); + buildMaterial(Material_SPU::dirt_Id, Material::dirt); + buildMaterial(Material_SPU::wood_Id, Material::wood); + buildMaterial(Material_SPU::stone_Id, Material::stone); + buildMaterial(Material_SPU::metal_Id, Material::metal); + buildMaterial(Material_SPU::water_Id, Material::water); + buildMaterial(Material_SPU::lava_Id, Material::lava); + buildMaterial(Material_SPU::leaves_Id, Material::leaves); + buildMaterial(Material_SPU::plant_Id, Material::plant); + buildMaterial(Material_SPU::replaceable_plant_Id, Material::replaceable_plant); + buildMaterial(Material_SPU::sponge_Id, Material::sponge); + buildMaterial(Material_SPU::cloth_Id, Material::cloth); + buildMaterial(Material_SPU::fire_Id, Material::fire); + buildMaterial(Material_SPU::sand_Id, Material::sand); + buildMaterial(Material_SPU::decoration_Id, Material::decoration); + buildMaterial(Material_SPU::clothDecoration_Id, Material::clothDecoration); + buildMaterial(Material_SPU::glass_Id, Material::glass); + buildMaterial(Material_SPU::explosive_Id, Material::explosive); + buildMaterial(Material_SPU::coral_Id, Material::coral); + buildMaterial(Material_SPU::ice_Id, Material::ice); + buildMaterial(Material_SPU::topSnow_Id, Material::topSnow); + buildMaterial(Material_SPU::snow_Id, Material::snow); + buildMaterial(Material_SPU::cactus_Id, Material::cactus); + buildMaterial(Material_SPU::clay_Id, Material::clay); + buildMaterial(Material_SPU::vegetable_Id, Material::vegetable); + buildMaterial(Material_SPU::egg_Id, Material::egg); + buildMaterial(Material_SPU::portal_Id, Material::portal); + buildMaterial(Material_SPU::cake_Id, Material::cake); + buildMaterial(Material_SPU::web_Id, Material::web); + buildMaterial(Material_SPU::piston_Id, Material::piston); + buildMaterial(Material_SPU::buildable_glass_Id, Material::buildable_glass); + buildMaterial(Material_SPU::heavyMetal_Id, Material::heavyMetal); } int ChunkRebuildData::getMaterialID(Tile* pTile) { Material* m = pTile->material; - if(m == Material::air) return Material_SPU::air_Id; - if(m == Material::grass) return Material_SPU::grass_Id; - if(m == Material::dirt) return Material_SPU::dirt_Id; - if(m == Material::wood) return Material_SPU::wood_Id; - if(m == Material::stone) return Material_SPU::stone_Id; - if(m == Material::metal) return Material_SPU::metal_Id; - if(m == Material::water) return Material_SPU::water_Id; - if(m == Material::lava) return Material_SPU::lava_Id; - if(m == Material::leaves) return Material_SPU::leaves_Id; - if(m == Material::plant) return Material_SPU::plant_Id; - if(m == Material::replaceable_plant)return Material_SPU::replaceable_plant_Id; - if(m == Material::sponge) return Material_SPU::sponge_Id; - if(m == Material::cloth) return Material_SPU::cloth_Id; - if(m == Material::fire) return Material_SPU::fire_Id; - if(m == Material::sand) return Material_SPU::sand_Id; - if(m == Material::decoration) return Material_SPU::decoration_Id; - if(m == Material::clothDecoration) return Material_SPU::clothDecoration_Id; + if(m == Material::air) return Material_SPU::air_Id; + if(m == Material::grass) return Material_SPU::grass_Id; + if(m == Material::dirt) return Material_SPU::dirt_Id; + if(m == Material::wood) return Material_SPU::wood_Id; + if(m == Material::stone) return Material_SPU::stone_Id; + if(m == Material::metal) return Material_SPU::metal_Id; + if(m == Material::water) return Material_SPU::water_Id; + if(m == Material::lava) return Material_SPU::lava_Id; + if(m == Material::leaves) return Material_SPU::leaves_Id; + if(m == Material::plant) return Material_SPU::plant_Id; + if(m == Material::replaceable_plant)return Material_SPU::replaceable_plant_Id; + if(m == Material::sponge) return Material_SPU::sponge_Id; + if(m == Material::cloth) return Material_SPU::cloth_Id; + if(m == Material::fire) return Material_SPU::fire_Id; + if(m == Material::sand) return Material_SPU::sand_Id; + if(m == Material::decoration) return Material_SPU::decoration_Id; + if(m == Material::clothDecoration) return Material_SPU::clothDecoration_Id; if(m == Material::glass) return Material_SPU::glass_Id; - if(m == Material::explosive) return Material_SPU::explosive_Id; - if(m == Material::coral) return Material_SPU::coral_Id; - if(m == Material::ice) return Material_SPU::ice_Id; - if(m == Material::topSnow) return Material_SPU::topSnow_Id; - if(m == Material::snow) return Material_SPU::snow_Id; - if(m == Material::cactus) return Material_SPU::cactus_Id; - if(m == Material::clay) return Material_SPU::clay_Id; - if(m == Material::vegetable) return Material_SPU::vegetable_Id; - if(m == Material::egg) return Material_SPU::egg_Id; - if(m == Material::portal) return Material_SPU::portal_Id; - if(m == Material::cake) return Material_SPU::cake_Id; - if(m == Material::web) return Material_SPU::web_Id; - if(m == Material::piston) return Material_SPU::piston_Id; + if(m == Material::explosive) return Material_SPU::explosive_Id; + if(m == Material::coral) return Material_SPU::coral_Id; + if(m == Material::ice) return Material_SPU::ice_Id; + if(m == Material::topSnow) return Material_SPU::topSnow_Id; + if(m == Material::snow) return Material_SPU::snow_Id; + if(m == Material::cactus) return Material_SPU::cactus_Id; + if(m == Material::clay) return Material_SPU::clay_Id; + if(m == Material::vegetable) return Material_SPU::vegetable_Id; + if(m == Material::egg) return Material_SPU::egg_Id; + if(m == Material::portal) return Material_SPU::portal_Id; + if(m == Material::cake) return Material_SPU::cake_Id; + if(m == Material::web) return Material_SPU::web_Id; + if(m == Material::piston) return Material_SPU::piston_Id; if(m == Material::buildable_glass) return Material_SPU::buildable_glass_Id; if(m == Material::heavyMetal) return Material_SPU::heavyMetal_Id; - assert(0); + assert(0); return Material_SPU::air_Id; } @@ -364,12 +364,12 @@ void ChunkRebuildData::createTileData() // recordPlayer setIconSPUFromIcon(&m_tileData.recordPlayer_iconTop, ((RecordPlayerTile*)Tile::recordPlayer)->iconTop); - // pumpkin + // pumpkin setIconSPUFromIcon(&m_tileData.pumpkinTile_iconTop, ((PumpkinTile*)Tile::pumpkin)->iconTop); setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFace, ((PumpkinTile*)Tile::pumpkin)->iconFace); setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFaceLit, ((PumpkinTile*)Tile::litPumpkin)->iconFace); - // cakeTile + // cakeTile setIconSPUFromIcon(&m_tileData.cakeTile_iconTop, ((CakeTile*)Tile::cake)->iconTop); setIconSPUFromIcon(&m_tileData.cakeTile_iconBottom, ((CakeTile*)Tile::cake)->iconBottom); setIconSPUFromIcon(&m_tileData.cakeTile_iconInner, ((CakeTile*)Tile::cake)->iconInner); @@ -509,7 +509,7 @@ void ChunkRebuildData::buildForChunk( Region* region, Level* level, int x0, int // assert(index < 400); int cacheBlockIndex = (cacheMap[iZ-m_z0]*3) + cacheMap[iX-m_x0]; BiomeCache::Block* pCacheBlock = cacheBlocks[cacheBlockIndex]; -// assert(region->getBiomeSource()->getBlockAt(iX, iZ) == pCacheBlock); +// assert(region->getBiomeSource()->getBlockAt(iX, iZ) == pCacheBlock); Biome* pBiome = pCacheBlock->getBiome(iX, iZ); m_grassColor[index] = pColourTable->getColor(pBiome->m_grassColor); m_foliageColor[index] = pColourTable->getColor(pBiome->m_foliageColor); @@ -537,7 +537,7 @@ void ChunkRebuildData::copyFromTesselator() m_tesselator.m_PPUOffset = 0; // copy tesselator vars over - m_tesselator.vertices = t->vertices; + m_tesselator.vertices = t->vertices; m_tesselator.u = t->u; m_tesselator.v = t->v; m_tesselator._tex2 = t->_tex2; @@ -588,7 +588,7 @@ void ChunkRebuildData::storeInTesselator() Tesselator* t = Tesselator::getInstance(); // 4J - added - static initialiser being set at the wrong time // copy tesselator vars over - t->vertices = m_tesselator.vertices; + t->vertices = m_tesselator.vertices; t->u = m_tesselator.u; t->v = m_tesselator.v; t->_tex2 = m_tesselator._tex2; @@ -647,7 +647,7 @@ void ChunkRebuildData::tesselateAllTiles(TileRenderer_SPU* pTileRenderer) { // if (m_currentLayer == 0 && m_tileData.isEntityTile[tileId]) // { -// shared_ptr et = region->getTileEntity(x, y, z); +// std::shared_ptr et = region->getTileEntity(x, y, z); // if (TileEntityRenderDispatcher::instance->hasRenderer(et)) // { // renderableTileEntities.push_back(et); @@ -801,7 +801,7 @@ int ChunkRebuildData::getBrightnessPropagate(LightLayer::variety layer, int x, i if(layer == LightLayer::Sky) return getBrightnessSky(x, y, z); return getBrightnessBlock(x, y, z); - + } int ChunkRebuildData::getLightColor(int x, int y, int z, int emitt) // 4J - change brought forward from 1.8.2 { @@ -865,7 +865,7 @@ int ChunkRebuildData::getRawBrightness(int x, int y, int z, bool propagate) int ChunkRebuildData::LevelChunk_getRawBrightness(int x, int y, int z, int skyDampen) { int light = (m_flags & e_flag_HasCeiling) ? 0 : getBrightnessSky(x, y, z); - if (light > 0) + if (light > 0) m_flags |= e_flag_TouchedSky; light -= skyDampen; int block = getBrightnessBlock(x, y, z); diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LeverTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LeverTile_SPU.h index 06dda5bb..53c9f3ec 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LeverTile_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LeverTile_SPU.h @@ -8,5 +8,5 @@ public: virtual bool blocksLight() { return false; } virtual bool isSolidRender(bool isServerLevel = false) { return false; } virtual int getRenderShape() { return Tile_SPU::SHAPE_LEVER; } -// virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param +// virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param }; diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h index e8411c88..a8c6851c 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h @@ -12,7 +12,7 @@ public: virtual int getRenderShape() { return SHAPE_PISTON_BASE; } virtual bool isSolidRender(bool isServerLevel = false) { return false; } - // virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + // virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param // virtual void updateDefaultShape(); }; \ No newline at end of file diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h index d5460492..3323cfd0 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h @@ -9,5 +9,5 @@ public: virtual Icon_SPU *getTexture(int face, int data) { return NULL; } virtual int getRenderShape() { return SHAPE_PISTON_EXTENSION; } virtual bool isSolidRender(bool isServerLevel = false) { return false; } -// virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param +// virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param }; \ No newline at end of file diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortal_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortal_SPU.h index f6e3b3e7..b8bed9a8 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortal_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortal_SPU.h @@ -6,7 +6,7 @@ class TheEndPortal_SPU : public EntityTile_SPU public: TheEndPortal_SPU(int id) : EntityTile_SPU(id) {} -// virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param +// virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual bool shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face) { if (face != 0) return false; diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp index f2dfeaac..552345fd 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp @@ -118,14 +118,14 @@ float Tile_SPU::getBrightness(ChunkRebuildData *level, int x, int y, int z) { return level->getBrightness(x, y, z, ms_pTileData->lightEmission[id]); } -// +// // // 4J - brought forward from 1.8.2 int Tile_SPU::getLightColor(ChunkRebuildData *level, int x, int y, int z) { int tileID = level->getTile(x, y, z); return level->getLightColor(x, y, z, ms_pTileData->lightEmission[tileID]); } -// +// // bool Tile_SPU::isFaceVisible(Level *level, int x, int y, int z, int f) // { // if (f == 0) y--; @@ -136,7 +136,7 @@ int Tile_SPU::getLightColor(ChunkRebuildData *level, int x, int y, int z) // if (f == 5) x++; // return !level->isSolidRenderTile(x, y, z); // } -// +// bool Tile_SPU::shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face) { if (face == 0 && getShapeY0() > 0) return true; @@ -147,7 +147,7 @@ bool Tile_SPU::shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, in if (face == 5 && getShapeX1() < 1) return true; return (!level->isSolidRenderTile(x, y, z)); } -// +// bool Tile_SPU::isSolidFace(ChunkRebuildData *level, int x, int y, int z, int face) { return (level->getMaterial(x, y, z)->isSolid()); @@ -196,39 +196,39 @@ Icon_SPU *Tile_SPU::getTexture(ChunkRebuildData *level, int x, int y, int z, int } return getTexture(face, tileData); } -// +// Icon_SPU *Tile_SPU::getTexture(int face, int data) { return &ms_pTileData->iconData[id]; } -// +// Icon_SPU *Tile_SPU::getTexture(int face) { return getTexture(face, 0); } -// +// // AABB *Tile_SPU::getTileAABB(Level *level, int x, int y, int z) // { // return AABB::newTemp(x + xx0, y + yy0, z + zz0, x + xx1, y + yy1, z + zz1); // } -// -// void Tile_SPU::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, Entity *source) +// +// void Tile_SPU::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, Entity *source) // { // AABB *aabb = getAABB(level, x, y, z); // if (aabb != NULL && box->intersects(aabb)) boxes->push_back(aabb); // } -// +// // void Tile_SPU::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes) // { // AABB *aabb = getAABB(level, x, y, z); // if (aabb != NULL && box->intersects(aabb)) boxes->push_back(aabb); // } -// +// // AABB *Tile_SPU::getAABB(Level *level, int x, int y, int z) // { // return AABB::newTemp(x + xx0, y + yy0, z + zz0, x + xx1, y + yy1, z + zz1); // } -// +// bool Tile_SPU::isSolidRender(bool isServerLevel) { return true; @@ -239,67 +239,67 @@ Icon_SPU *Tile_SPU::getTexture(int face) // { // return mayPick(); // } -// +// // bool Tile_SPU::mayPick() // { // return true; // } -// +// // void Tile_SPU::tick(Level *level, int x, int y, int z, Random *random) // { // } -// +// // void Tile_SPU::animateTick(Level *level, int x, int y, int z, Random *random) // { // } -// +// // void Tile_SPU::destroy(Level *level, int x, int y, int z, int data) // { // } -// +// // void Tile_SPU::neighborChanged(Level *level, int x, int y, int z, int type) // { // } -// +// // void Tile_SPU::addLights(Level *level, int x, int y, int z) // { // } -// +// // int Tile_SPU::getTickDelay() // { // return 10; // } -// +// // void Tile_SPU::onPlace(Level *level, int x, int y, int z) // { // } -// +// // void Tile_SPU::onRemove(Level *level, int x, int y, int z) // { // } -// +// // int Tile_SPU::getResourceCount(Random *random) // { // return 1; // } -// +// // int Tile_SPU::getResource(int data, Random *random, int playerBonusLevel) // { // return id; // } -// -// float Tile_SPU::getDestroyProgress(shared_ptr player) +// +// float Tile_SPU::getDestroyProgress(std::shared_ptr player) // { // if (destroySpeed < 0) return 0; // if (!player->canDestroy(this)) return 1 / destroySpeed / 100.0f; // return (player->getDestroySpeed(this) / destroySpeed) / 30; // } -// +// // void Tile_SPU::spawnResources(Level *level, int x, int y, int z, int data, int playerBonusLevel) // { // spawnResources(level, x, y, z, data, 1, playerBonusLevel); // } -// +// // void Tile_SPU::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel) // { // if (level->isClientSide) return; @@ -309,24 +309,24 @@ Icon_SPU *Tile_SPU::getTexture(int face) // if (level->random->nextFloat() > odds) continue; // int type = getResource(data, level->random, playerBonusLevel); // if (type <= 0) continue; -// -// popResource(level, x, y, z, shared_ptr( new ItemInstance(type, 1, getSpawnResourcesAuxValue(data) ) ) ); +// +// popResource(level, x, y, z, std::shared_ptr( new ItemInstance(type, 1, getSpawnResourcesAuxValue(data) ) ) ); // } // } -// -// void Tile_SPU::popResource(Level *level, int x, int y, int z, shared_ptr itemInstance) +// +// void Tile_SPU::popResource(Level *level, int x, int y, int z, std::shared_ptr itemInstance) // { // if( level->isClientSide ) return; -// +// // float s = 0.7f; // double xo = level->random->nextFloat() * s + (1 - s) * 0.5; // double yo = level->random->nextFloat() * s + (1 - s) * 0.5; // double zo = level->random->nextFloat() * s + (1 - s) * 0.5; -// shared_ptr item = shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, itemInstance ) ); +// std::shared_ptr item = std::shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, itemInstance ) ); // item->throwTime = 10; // level->addEntity(item); // } -// +// // // Brought forward for TU7 // void Tile_SPU::popExperience(Level *level, int x, int y, int z, int amount) // { @@ -336,182 +336,182 @@ Icon_SPU *Tile_SPU::getTexture(int face) // { // int newCount = ExperienceOrb::getExperienceValue(amount); // amount -= newCount; -// level->addEntity(shared_ptr( new ExperienceOrb(level, x + .5, y + .5, z + .5, newCount))); +// level->addEntity(std::shared_ptr( new ExperienceOrb(level, x + .5, y + .5, z + .5, newCount))); // } // } // } -// +// // int Tile_SPU::getSpawnResourcesAuxValue(int data) // { // return 0; // } -// -// float Tile_SPU::getExplosionResistance(shared_ptr source) +// +// float Tile_SPU::getExplosionResistance(std::shared_ptr source) // { // return explosionResistance / 5.0f; // } -// +// // HitResult *Tile_SPU::clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b) // { // EnterCriticalSection(&m_csShape); // updateShape(level, xt, yt, zt); -// +// // a = a->add(-xt, -yt, -zt); // b = b->add(-xt, -yt, -zt); -// +// // Vec3 *xh0 = a->clipX(b, xx0); // Vec3 *xh1 = a->clipX(b, xx1); -// +// // Vec3 *yh0 = a->clipY(b, yy0); // Vec3 *yh1 = a->clipY(b, yy1); -// +// // Vec3 *zh0 = a->clipZ(b, zz0); // Vec3 *zh1 = a->clipZ(b, zz1); -// +// // Vec3 *closest = NULL; -// +// // if (containsX(xh0) && (closest == NULL || a->distanceTo(xh0) < a->distanceTo(closest))) closest = xh0; // if (containsX(xh1) && (closest == NULL || a->distanceTo(xh1) < a->distanceTo(closest))) closest = xh1; // if (containsY(yh0) && (closest == NULL || a->distanceTo(yh0) < a->distanceTo(closest))) closest = yh0; // if (containsY(yh1) && (closest == NULL || a->distanceTo(yh1) < a->distanceTo(closest))) closest = yh1; // if (containsZ(zh0) && (closest == NULL || a->distanceTo(zh0) < a->distanceTo(closest))) closest = zh0; // if (containsZ(zh1) && (closest == NULL || a->distanceTo(zh1) < a->distanceTo(closest))) closest = zh1; -// +// // LeaveCriticalSection(&m_csShape); -// +// // if (closest == NULL) return NULL; -// +// // int face = -1; -// +// // if (closest == xh0) face = 4; // if (closest == xh1) face = 5; // if (closest == yh0) face = 0; // if (closest == yh1) face = 1; // if (closest == zh0) face = 2; // if (closest == zh1) face = 3; -// +// // return new HitResult(xt, yt, zt, face, closest->add(xt, yt, zt)); // } -// +// // bool Tile_SPU::containsX(Vec3 *v) // { // if( v == NULL) return false; // return v->y >= yy0 && v->y <= yy1 && v->z >= zz0 && v->z <= zz1; // } -// +// // bool Tile_SPU::containsY(Vec3 *v) // { // if( v == NULL) return false; // return v->x >= xx0 && v->x <= xx1 && v->z >= zz0 && v->z <= zz1; // } -// +// // bool Tile_SPU::containsZ(Vec3 *v) // { // if( v == NULL) return false; // return v->x >= xx0 && v->x <= xx1 && v->y >= yy0 && v->y <= yy1; // } -// +// // void Tile_SPU::wasExploded(Level *level, int x, int y, int z) // { // } -// +// int Tile_SPU::getRenderLayer() { return 0; } -// +// // bool Tile_SPU::mayPlace(Level *level, int x, int y, int z, int face) // { // return mayPlace(level, x, y, z); // } -// +// // bool Tile_SPU::mayPlace(Level *level, int x, int y, int z) // { // int t = level->getTile(x, y, z); // return t == 0 || Tile_SPU::tiles[t]->material->isReplaceable(); // } -// +// // // 4J-PB - Adding a TestUse for tooltip display // bool Tile_SPU::TestUse() // { // return false; // } -// -// bool Tile_SPU::TestUse(Level *level, int x, int y, int z, shared_ptr player) +// +// bool Tile_SPU::TestUse(Level *level, int x, int y, int z, std::shared_ptr player) // { // return false; // } -// -// bool Tile_SPU::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +// +// bool Tile_SPU::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param // { // return false; // } -// -// void Tile_SPU::stepOn(Level *level, int x, int y, int z, shared_ptr entity) +// +// void Tile_SPU::stepOn(Level *level, int x, int y, int z, std::shared_ptr entity) // { // } -// +// // void Tile_SPU::setPlacedOnFace(Level *level, int x, int y, int z, int face) // { // } -// +// // void Tile_SPU::prepareRender(Level *level, int x, int y, int z) // { // } -// -// void Tile_SPU::attack(Level *level, int x, int y, int z, shared_ptr player) +// +// void Tile_SPU::attack(Level *level, int x, int y, int z, std::shared_ptr player) // { // } -// -// void Tile_SPU::handleEntityInside(Level *level, int x, int y, int z, shared_ptr e, Vec3 *current) +// +// void Tile_SPU::handleEntityInside(Level *level, int x, int y, int z, std::shared_ptr e, Vec3 *current) // { // } -// +// void Tile_SPU::updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData, TileEntity* forceEntity) // 4J added forceData, forceEntity param { } -// +// int Tile_SPU::getColor(ChunkRebuildData *level, int x, int y, int z) { return 0xffffff; } -// +// // int Tile_SPU::getColor(LevelSource *level, int x, int y, int z, int data) // { // return 0xffffff; // } -// +// // bool Tile_SPU::getSignal(LevelSource *level, int x, int y, int z) // { // return false; // } -// +// // bool Tile_SPU::getSignal(LevelSource *level, int x, int y, int z, int dir) // { // return false; // } -// +// // bool Tile_SPU::isSignalSource() // { // return false; // } -// -// void Tile_SPU::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +// +// void Tile_SPU::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) // { // } -// +// // bool Tile_SPU::getDirectSignal(Level *level, int x, int y, int z, int dir) // { // return false; // } -// +// void Tile_SPU::updateDefaultShape() { } -// -// void Tile_SPU::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +// +// void Tile_SPU::playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data) // { // // 4J Stu - Special case - only record a crop destroy if is fully grown // if(id==Tile_SPU::crops_Id) @@ -525,14 +525,14 @@ void Tile_SPU::updateDefaultShape() // } // player->awardStat(Stats::totalBlocksMined, 1); // 4J : WESTY : Added for other award. // player->causeFoodExhaustion(FoodConstants::EXHAUSTION_MINE); -// +// // if( id == Tile_SPU::treeTrunk_Id ) // player->awardStat(Achievements::mineWood); -// -// +// +// // if (isCubeShaped() && !isEntityTile[id] && EnchantmentHelper::hasSilkTouch(player->inventory)) // { -// shared_ptr item = getSilkTouchItemInstance(data); +// std::shared_ptr item = getSilkTouchItemInstance(data); // if (item != NULL) // { // popResource(level, x, y, z, item); @@ -544,78 +544,78 @@ void Tile_SPU::updateDefaultShape() // spawnResources(level, x, y, z, data, playerBonusLevel); // } // } -// -// shared_ptr Tile_SPU::getSilkTouchItemInstance(int data) +// +// std::shared_ptr Tile_SPU::getSilkTouchItemInstance(int data) // { // int popData = 0; // if (id >= 0 && id < Item::items.length && Item::items[id]->isStackedByData()) // { // popData = data; // } -// return shared_ptr(new ItemInstance(id, 1, popData)); +// return std::shared_ptr(new ItemInstance(id, 1, popData)); // } -// +// // int Tile_SPU::getResourceCountForLootBonus(int bonusLevel, Random *random) // { // return getResourceCount(random); // } -// +// // bool Tile_SPU::canSurvive(Level *level, int x, int y, int z) // { // return true; // } -// -// void Tile_SPU::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +// +// void Tile_SPU::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) // { // } -// +// // Tile *Tile_SPU::setDescriptionId(unsigned int id) // { // this->descriptionId = id; // return this; // } -// +// // wstring Tile_SPU::getName() // { // return I18n::get(getDescriptionId() + L".name"); // } -// +// // unsigned int Tile_SPU::getDescriptionId(int iData /*= -1*/) // { // return descriptionId; // } -// +// // Tile *Tile_SPU::setUseDescriptionId(unsigned int id) // { // this->useDescriptionId = id; // return this; // } -// +// // unsigned int Tile_SPU::getUseDescriptionId() // { // return useDescriptionId; // } -// +// // void Tile_SPU::triggerEvent(Level *level, int x, int y, int z, int b0, int b1) // { // } -// +// // bool Tile_SPU::isCollectStatistics() // { // return collectStatistics; // } -// +// // Tile *Tile_SPU::setNotCollectStatistics() // { // collectStatistics = false; // return this; // } -// +// // int Tile_SPU::getPistonPushReaction() // { // return material->getPushReaction(); // } -// +// // // 4J - brought forward from 1.8.2 float Tile_SPU::getShadeBrightness(ChunkRebuildData *level, int x, int y, int z) { @@ -629,37 +629,37 @@ Tile_SPU* Tile_SPU::createFromID( int tileID ) if(m_tiles[tileID].id != -1) return &m_tiles[tileID]; - + #ifndef SN_TARGET_PS3_SPU app.DebugPrintf("missing tile ID %d\n", tileID); #else spu_print("missing tile ID %d\n", tileID); -#endif +#endif return &m_tiles[1]; } Material_SPU* Tile_SPU::getMaterial() { - int matID = ms_pTileData->materialIDs[id]; + int matID = ms_pTileData->materialIDs[id]; return &ms_pTileData->materials[matID]; } -// -// void Tile_SPU::fallOn(Level *level, int x, int y, int z, shared_ptr entity, float fallDistance) +// +// void Tile_SPU::fallOn(Level *level, int x, int y, int z, std::shared_ptr entity, float fallDistance) // { // } -// +// // void Tile_SPU::registerIcons(IconRegister *iconRegister) // { // icon = iconRegister->registerIcon(m_textureName); // } -// +// // wstring Tile_SPU::getTileItemIconName() // { // return L""; // } -// +// // Tile *Tile_SPU::setTextureName(const wstring &name) // { // m_textureName = name; @@ -690,7 +690,7 @@ void Tile_SPU::initTilePointers() CREATE_TILE_TYPE(stairs_wood_Id, StairTile_SPU); CREATE_TILE_TYPE(stairs_stone_Id, StairTile_SPU); - CREATE_TILE_TYPE(stairs_bricks_Id, StairTile_SPU); + CREATE_TILE_TYPE(stairs_bricks_Id, StairTile_SPU); CREATE_TILE_TYPE(stairs_stoneBrickSmooth_Id, StairTile_SPU); CREATE_TILE_TYPE(stairs_netherBricks_Id, StairTile_SPU); CREATE_TILE_TYPE(stairs_sandstone_Id, StairTile_SPU); @@ -863,7 +863,7 @@ void Tile_SPU::initTilePointers() CREATE_TILE_TYPE(goldOre_Id, Tile_SPU); // OreTile CREATE_TILE_TYPE(ironOre_Id, Tile_SPU); // OreTile CREATE_TILE_TYPE(coalOre_Id, Tile_SPU); // OreTile - CREATE_TILE_TYPE(lapisOre_Id, Tile_SPU); // OreTile + CREATE_TILE_TYPE(lapisOre_Id, Tile_SPU); // OreTile CREATE_TILE_TYPE(diamondOre_Id, Tile_SPU); // OreTile CREATE_TILE_TYPE(clay_Id, Tile_SPU); // ClayTile CREATE_TILE_TYPE(redStoneOre_Id, Tile_SPU); // RedStoneOreTile @@ -884,7 +884,7 @@ void Tile_SPU::initTilePointers() CREATE_TILE_TYPE(enderChest_Id, EnderChestTile_SPU); CREATE_TILE_TYPE(tripWireSource_Id, TripWireSourceTile_SPU); CREATE_TILE_TYPE(tripWire_Id, TripWireTile_SPU); -// +// CREATE_TILE_TYPE(emeraldBlock_Id, Tile_SPU); // MetalTile CREATE_TILE_TYPE(cobbleWall_Id, WallTile_SPU); CREATE_TILE_TYPE(flowerPot_Id, FlowerPotTile_SPU); diff --git a/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp b/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp index 0912e33a..3de39461 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp +++ b/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.cpp @@ -21,7 +21,7 @@ PlayStation(R)3 Programmer Tool Runtime Library 430.001 // #define SPU_HEAPSIZE (128*1024) // #define SPU_STACKSIZE (16*1024) -// +// // CELL_SPU_LS_PARAM(128*1024, 16*1024); // can't use #defines here as it seems to create an asm instruction @@ -132,7 +132,7 @@ bool LevelRenderer_FindNearestChunk_DataIn::MultiplayerChunkCache::getChunkEmpty } -bool LevelRenderer_FindNearestChunk_DataIn::CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 byte range) +bool LevelRenderer_FindNearestChunk_DataIn::CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 byte range) { int blockIdx; unsigned short *blockIndices = (unsigned short *)indicesAndData; @@ -162,30 +162,30 @@ void LevelRenderer_FindNearestChunk_DataIn::findNearestChunk() unsigned char* globalChunkFlags = (unsigned char*)alloca(numGlobalChunks); // 164K !!! DmaData_SPU::getAndWait(globalChunkFlags, (uintptr_t)pGlobalChunkFlags, sizeof(unsigned char)*numGlobalChunks); - + nearChunk = NULL; // Nearest chunk that is dirty veryNearCount = 0; int minDistSq = 0x7fffffff; // Distances to this chunk - + // Find nearest chunk that is dirty for( int p = 0; p < 4; p++ ) { // It's possible that the localplayers member can be set to NULL on the main thread when a player chooses to exit the game - // So take a reference to the player object now. As it is a shared_ptr it should live as long as we need it - PlayerData* player = &playerData[p]; + // So take a reference to the player object now. As it is a std::shared_ptr it should live as long as we need it + PlayerData* player = &playerData[p]; if( player->bValid == NULL ) continue; if( chunks[p] == NULL ) continue; if( level[p] == NULL ) continue; if( chunkLengths[p] != xChunks * zChunks * CHUNK_Y_COUNT ) continue; int px = (int)player->x; int py = (int)player->y; - int pz = (int)player->z; + int pz = (int)player->z; ClipChunk clipChunk[512]; for( int z = 0; z < zChunks; z++ ) - { + { uintptr_t ClipChunkX_PPU = (uintptr_t)&chunks[p][(z * yChunks + 0) * xChunks + 0]; DmaData_SPU::getAndWait(&clipChunk[0], ClipChunkX_PPU, sizeof(ClipChunk) * xChunks*CHUNK_Y_COUNT); for( int y = 0; y < CHUNK_Y_COUNT; y++ ) @@ -196,7 +196,7 @@ void LevelRenderer_FindNearestChunk_DataIn::findNearestChunk() // Get distance to this chunk - deliberately not calling the chunk's method of doing this to avoid overheads (passing entitie, type conversion etc.) that this involves int xd = pClipChunk->xm - px; - int yd = pClipChunk->ym - py; + int yd = pClipChunk->ym - py; int zd = pClipChunk->zm - pz; int distSq = xd * xd + yd * yd + zd * zd; int distSqWeighted = xd * xd + yd * yd * 4 + zd * zd; // Weighting against y to prioritise things in same x/z plane as player first @@ -257,12 +257,12 @@ void cellSpursJobQueueMain(CellSpursJobContext2 *pContext, CellSpursJob256 *pJob spu_print("LevelRenderer_cull [SPU#%u] start\n", idSpu); g_pSpursJobContext = pContext; - uint32_t eaDataIn = pJob->workArea.userData[0]; + uint32_t eaDataIn = pJob->workArea.userData[0]; // uint32_t eaDataOut =pJob->workArea.userData[1]; LevelRenderer_FindNearestChunk_DataIn dataIn; DmaData_SPU::getAndWait(&dataIn, eaDataIn, sizeof(LevelRenderer_FindNearestChunk_DataIn)); - + dataIn.findNearestChunk(); DmaData_SPU::putAndWait(&dataIn, eaDataIn, sizeof(LevelRenderer_FindNearestChunk_DataIn)); diff --git a/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.h b/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.h index 55ffcabd..a6c3ef2a 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.h +++ b/Minecraft.Client/PS3/SPU_Tasks/LevelRenderer_FindNearestChunk/LevelRenderer_FindNearestChunk.h @@ -23,7 +23,7 @@ public: int xm, ym, zm; }; - class AABB + class AABB { double x0, y0, z0; double x1, y1, z1; @@ -64,7 +64,7 @@ public: int id; int padding[1]; //public: - // vector > renderableTileEntities; // 4J - removed + // vector > renderableTileEntities; // 4J - removed private: void *globalRenderableTileEntities; @@ -86,7 +86,7 @@ public: MultiplayerChunkCache multiplayerChunkCache[4]; int lowerOffset; // offsets into the level class, we don't want to compile the entire class - int upperOffset; + int upperOffset; int xChunks, yChunks, zChunks; diff --git a/Minecraft.Client/PaintingRenderer.cpp b/Minecraft.Client/PaintingRenderer.cpp index 4238f759..b3a8acd2 100644 --- a/Minecraft.Client/PaintingRenderer.cpp +++ b/Minecraft.Client/PaintingRenderer.cpp @@ -11,11 +11,11 @@ PaintingRenderer::PaintingRenderer() random = new Random(); } -void PaintingRenderer::render(shared_ptr _painting, double x, double y, double z, float rot, float a) +void PaintingRenderer::render(std::shared_ptr _painting, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr painting = dynamic_pointer_cast(_painting); - + std::shared_ptr painting = dynamic_pointer_cast(_painting); + random->setSeed(187); glPushMatrix(); @@ -33,7 +33,7 @@ void PaintingRenderer::render(shared_ptr _painting, double x, double y, glPopMatrix(); } -void PaintingRenderer::renderPainting(shared_ptr painting, int w, int h, int uo, int vo) +void PaintingRenderer::renderPainting(std::shared_ptr painting, int w, int h, int uo, int vo) { float xx0 = -w / 2.0f; float yy0 = -h / 2.0f; @@ -113,7 +113,7 @@ void PaintingRenderer::renderPainting(shared_ptr painting, int w, int } -void PaintingRenderer::setBrightness(shared_ptr painting, float ss, float ya) +void PaintingRenderer::setBrightness(std::shared_ptr painting, float ss, float ya) { int x = Mth::floor(painting->x); int y = Mth::floor(painting->y + ya/16.0f); diff --git a/Minecraft.Client/PaintingRenderer.h b/Minecraft.Client/PaintingRenderer.h index a750e128..f940c169 100644 --- a/Minecraft.Client/PaintingRenderer.h +++ b/Minecraft.Client/PaintingRenderer.h @@ -11,9 +11,9 @@ private: public: PaintingRenderer(); // 4J -added - virtual void render(shared_ptr _painting, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _painting, double x, double y, double z, float rot, float a); private: - void renderPainting(shared_ptr painting, int w, int h, int uo, int vo); - void setBrightness(shared_ptr painting, float ss, float ya); + void renderPainting(std::shared_ptr painting, int w, int h, int uo, int vo); + void setBrightness(std::shared_ptr painting, float ss, float ya); }; diff --git a/Minecraft.Client/Particle.cpp b/Minecraft.Client/Particle.cpp index 90ef93bc..30f14878 100644 --- a/Minecraft.Client/Particle.cpp +++ b/Minecraft.Client/Particle.cpp @@ -61,7 +61,7 @@ Particle::Particle(Level *level, double x, double y, double z, double xa, double yd = yd / dd * speed * 0.4f + 0.1f; zd = zd / dd * speed * 0.4f;} -shared_ptr Particle::setPower(float power) +std::shared_ptr Particle::setPower(float power) { xd *= power; yd = (yd - 0.1f) * power + 0.1f; @@ -69,7 +69,7 @@ shared_ptr Particle::setPower(float power) return dynamic_pointer_cast( shared_from_this() ); } -shared_ptr Particle::scale(float scale) +std::shared_ptr Particle::scale(float scale) { setSize(0.2f * scale, 0.2f * scale); size *= scale; @@ -168,9 +168,9 @@ void Particle::render(Tesselator *t, float a, float xa, float ya, float za, floa #ifdef __PSVITA__ // AP - this will set up the 4 vertices in half the time. t->tileParticleQuad((float)(x - xa * r - xa2 * r), (float)( y - ya * r), (float)( z - za * r - za2 * r), (float)( u1), (float)( v1), - (float)(x - xa * r + xa2 * r), (float)( y + ya * r), (float)( z - za * r + za2 * r), (float)( u1), (float)( v0), - (float)(x + xa * r + xa2 * r), (float)( y + ya * r), (float)( z + za * r + za2 * r), (float)( u0), (float)( v0), - (float)(x + xa * r - xa2 * r), (float)( y - ya * r), (float)( z + za * r - za2 * r), (float)( u0), (float)( v1), + (float)(x - xa * r + xa2 * r), (float)( y + ya * r), (float)( z - za * r + za2 * r), (float)( u1), (float)( v0), + (float)(x + xa * r + xa2 * r), (float)( y + ya * r), (float)( z + za * r + za2 * r), (float)( u0), (float)( v0), + (float)(x + xa * r - xa2 * r), (float)( y - ya * r), (float)( z + za * r - za2 * r), (float)( u0), (float)( v1), rCol * br, gCol * br, bCol * br, alpha); #else t->color(rCol * br, gCol * br, bCol * br, alpha); diff --git a/Minecraft.Client/Particle.h b/Minecraft.Client/Particle.h index d9b0ba3a..a56c2e4d 100644 --- a/Minecraft.Client/Particle.h +++ b/Minecraft.Client/Particle.h @@ -28,8 +28,8 @@ protected: Particle(Level *level, double x, double y, double z); public: Particle(Level *level, double x, double y, double z, double xa, double ya, double za); - virtual shared_ptr setPower(float power); - virtual shared_ptr scale(float scale); + virtual std::shared_ptr setPower(float power); + virtual std::shared_ptr scale(float scale); void setColor(float r, float g, float b); void setAlpha(float alpha); float getRedCol(); diff --git a/Minecraft.Client/ParticleEngine.cpp b/Minecraft.Client/ParticleEngine.cpp index 3a34253a..12ef4a87 100644 --- a/Minecraft.Client/ParticleEngine.cpp +++ b/Minecraft.Client/ParticleEngine.cpp @@ -18,7 +18,7 @@ ParticleEngine::ParticleEngine(Level *level, Textures *textures) this->level = level; } this->textures = textures; - + this->random = new Random(); } @@ -27,7 +27,7 @@ ParticleEngine::~ParticleEngine() delete random; } -void ParticleEngine::add(shared_ptr p) +void ParticleEngine::add(std::shared_ptr p) { int t = p->getParticleTexture(); int l = p->level->dimension->id == 0 ? 0 : ( p->level->dimension->id == -1 ? 1 : 2); @@ -43,7 +43,7 @@ void ParticleEngine::tick() { for (unsigned int i = 0; i < particles[l][tt].size(); i++) { - shared_ptr p = particles[l][tt][i]; + std::shared_ptr p = particles[l][tt][i]; p->tick(); if (p->removed) { @@ -56,7 +56,7 @@ void ParticleEngine::tick() } } -void ParticleEngine::render(shared_ptr player, float a) +void ParticleEngine::render(std::shared_ptr player, float a) { // 4J - change brought forward from 1.2.3 float xa = Camera::xa; @@ -99,7 +99,7 @@ void ParticleEngine::render(shared_ptr player, float a) t->end(); t->begin(); } - shared_ptr p = particles[l][tt][i]; + std::shared_ptr p = particles[l][tt][i]; if (SharedConstants::TEXTURE_LIGHTING) // 4J - change brought forward from 1.8.2 { @@ -118,7 +118,7 @@ void ParticleEngine::render(shared_ptr player, float a) } -void ParticleEngine::renderLit(shared_ptr player, float a) +void ParticleEngine::renderLit(std::shared_ptr player, float a) { // 4J - added. We call this before ParticleEngine::render in the general render per player, so if we // don't set this here then the offsets will be from the previous player - a single frame lag for the @@ -142,7 +142,7 @@ void ParticleEngine::renderLit(shared_ptr player, float a) Tesselator *t = Tesselator::getInstance(); for (unsigned int i = 0; i < particles[l][tt].size(); i++) { - shared_ptr p = particles[l][tt][i]; + std::shared_ptr p = particles[l][tt][i]; if (SharedConstants::TEXTURE_LIGHTING) // 4J - change brought forward from 1.8.2 { @@ -182,7 +182,7 @@ void ParticleEngine::destroy(int x, int y, int z, int tid, int data) double yp = y + (yy + 0.5) / SD; double zp = z + (zz + 0.5) / SD; int face = random->nextInt(6); - add(( shared_ptr(new TerrainParticle(level, xp, yp, zp, xp - x - 0.5f, yp - y - 0.5f, zp - z - 0.5f, tile, face, data, textures) ) )->init(x, y, z, data)); + add(( std::shared_ptr(new TerrainParticle(level, xp, yp, zp, xp - x - 0.5f, yp - y - 0.5f, zp - z - 0.5f, tile, face, data, textures) ) )->init(x, y, z, data)); } } @@ -201,7 +201,7 @@ void ParticleEngine::crack(int x, int y, int z, int face) if (face == 3) zp = z + tile->getShapeZ1() + r; if (face == 4) xp = x + tile->getShapeX0() - r; if (face == 5) xp = x + tile->getShapeX1() + r; - add(( shared_ptr(new TerrainParticle(level, xp, yp, zp, 0, 0, 0, tile, face, level->getData(x, y, z), textures) ) )->init(x, y, z, level->getData(x, y, z))->setPower(0.2f)->scale(0.6f)); + add(( std::shared_ptr(new TerrainParticle(level, xp, yp, zp, 0, 0, 0, tile, face, level->getData(x, y, z), textures) ) )->init(x, y, z, level->getData(x, y, z))->setPower(0.2f)->scale(0.6f)); } diff --git a/Minecraft.Client/ParticleEngine.h b/Minecraft.Client/ParticleEngine.h index 09e3685b..0fee7a16 100644 --- a/Minecraft.Client/ParticleEngine.h +++ b/Minecraft.Client/ParticleEngine.h @@ -26,17 +26,17 @@ public: protected: Level *level; private: - deque > particles[3][TEXTURE_COUNT]; // 4J made two arrays to cope with simultaneous two dimensions + deque > particles[3][TEXTURE_COUNT]; // 4J made two arrays to cope with simultaneous two dimensions Textures *textures; Random *random; public: ParticleEngine(Level *level, Textures *textures); ~ParticleEngine(); - void add(shared_ptr p); + void add(std::shared_ptr p); void tick(); - void render(shared_ptr player, float a); - void renderLit(shared_ptr player, float a); + void render(std::shared_ptr player, float a); + void renderLit(std::shared_ptr player, float a); void setLevel(Level *level); void destroy(int x, int y, int z, int tid, int data); void crack(int x, int y, int z, int face); diff --git a/Minecraft.Client/PendingConnection.cpp b/Minecraft.Client/PendingConnection.cpp index 841863b6..f8f61bdb 100644 --- a/Minecraft.Client/PendingConnection.cpp +++ b/Minecraft.Client/PendingConnection.cpp @@ -61,7 +61,7 @@ void PendingConnection::disconnect(DisconnectPacket::eDisconnectReason reason) // try { // 4J - removed try/catch // logger.info("Disconnecting " + getName() + ": " + reason); app.DebugPrintf("Pending connection disconnect: %d\n", reason ); - connection->send( shared_ptr( new DisconnectPacket(reason) ) ); + connection->send( std::shared_ptr( new DisconnectPacket(reason) ) ); connection->sendAndQuit(); done = true; // } catch (Exception e) { @@ -69,7 +69,7 @@ void PendingConnection::disconnect(DisconnectPacket::eDisconnectReason reason) // } } -void PendingConnection::handlePreLogin(shared_ptr packet) +void PendingConnection::handlePreLogin(std::shared_ptr packet) { if (packet->m_netcodeVersion != MINECRAFT_NET_VERSION) { @@ -103,10 +103,10 @@ void PendingConnection::sendPreLoginResponse() PlayerList *playerList = MinecraftServer::getInstance()->getPlayers(); for(AUTO_VAR(it, playerList->players.begin()); it != playerList->players.end(); ++it) { - shared_ptr player = *it; + std::shared_ptr player = *it; // If the offline Xuid is invalid but the online one is not then that's guest which we should ignore // If the online Xuid is invalid but the offline one is not then we are definitely an offline game so dont care about UGC - + // PADDY - this is failing when a local player with chat restrictions joins an online game if( player != NULL && player->connection->m_offlineXUID != INVALID_XUID && player->connection->m_onlineXUID != INVALID_XUID ) @@ -128,16 +128,16 @@ void PendingConnection::sendPreLoginResponse() if (false)// server->onlineMode) // 4J - removed { loginKey = L"TOIMPLEMENT"; // 4J - todo Long.toHexString(random.nextLong()); - connection->send( shared_ptr( new PreLoginPacket(loginKey, ugcXuids, ugcXuidCount, ugcFriendsOnlyBits, server->m_ugcPlayersVersion, szUniqueMapName,app.GetGameHostOption(eGameHostOption_All),hostIndex) ) ); + connection->send( std::shared_ptr( new PreLoginPacket(loginKey, ugcXuids, ugcXuidCount, ugcFriendsOnlyBits, server->m_ugcPlayersVersion, szUniqueMapName,app.GetGameHostOption(eGameHostOption_All),hostIndex) ) ); } else #endif { - connection->send( shared_ptr( new PreLoginPacket(L"-", ugcXuids, ugcXuidCount, ugcFriendsOnlyBits, server->m_ugcPlayersVersion,szUniqueMapName,app.GetGameHostOption(eGameHostOption_All),hostIndex, server->m_texturePackId) ) ); + connection->send( std::shared_ptr( new PreLoginPacket(L"-", ugcXuids, ugcXuidCount, ugcFriendsOnlyBits, server->m_ugcPlayersVersion,szUniqueMapName,app.GetGameHostOption(eGameHostOption_All),hostIndex, server->m_texturePackId) ) ); } } -void PendingConnection::handleLogin(shared_ptr packet) +void PendingConnection::handleLogin(std::shared_ptr packet) { // printf("Server: handleLogin\n"); //name = packet->userName; @@ -173,7 +173,7 @@ void PendingConnection::handleLogin(shared_ptr packet) //else { //4J - removed -#if 0 +#if 0 new Thread() { public void run() { try { @@ -198,7 +198,7 @@ void PendingConnection::handleLogin(shared_ptr packet) } -void PendingConnection::handleAcceptedLogin(shared_ptr packet) +void PendingConnection::handleAcceptedLogin(std::shared_ptr packet) { if(packet->m_ugcPlayersVersion != server->m_ugcPlayersVersion) { @@ -211,7 +211,7 @@ void PendingConnection::handleAcceptedLogin(shared_ptr packet) PlayerUID playerXuid = packet->m_offlineXuid; if(playerXuid == INVALID_XUID) playerXuid = packet->m_onlineXuid; - shared_ptr playerEntity = server->getPlayers()->getPlayerForLogin(this, name, playerXuid,packet->m_onlineXuid); + std::shared_ptr playerEntity = server->getPlayers()->getPlayerForLogin(this, name, playerXuid,packet->m_onlineXuid); if (playerEntity != NULL) { server->getPlayers()->placeNewPlayer(connection, playerEntity, packet); @@ -227,12 +227,12 @@ void PendingConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason, done = true; } -void PendingConnection::handleGetInfo(shared_ptr packet) +void PendingConnection::handleGetInfo(std::shared_ptr packet) { //try { - //String message = server->motd + "§" + server->players->getPlayerCount() + "§" + server->players->getMaxPlayers(); + //String message = server->motd + "�" + server->players->getPlayerCount() + "�" + server->players->getMaxPlayers(); //connection->send(new DisconnectPacket(message)); - connection->send(shared_ptr(new DisconnectPacket(DisconnectPacket::eDisconnect_ServerFull) ) ); + connection->send(std::shared_ptr(new DisconnectPacket(DisconnectPacket::eDisconnect_ServerFull) ) ); connection->sendAndQuit(); server->connection->removeSpamProtection(connection->getSocket()); done = true; @@ -241,17 +241,17 @@ void PendingConnection::handleGetInfo(shared_ptr packet) //} } -void PendingConnection::handleKeepAlive(shared_ptr packet) +void PendingConnection::handleKeepAlive(std::shared_ptr packet) { // Ignore } -void PendingConnection::onUnhandledPacket(shared_ptr packet) +void PendingConnection::onUnhandledPacket(std::shared_ptr packet) { disconnect(DisconnectPacket::eDisconnect_UnexpectedPacket); } -void PendingConnection::send(shared_ptr packet) +void PendingConnection::send(std::shared_ptr packet) { connection->send(packet); } diff --git a/Minecraft.Client/PendingConnection.h b/Minecraft.Client/PendingConnection.h index 02d706f9..45d8163d 100644 --- a/Minecraft.Client/PendingConnection.h +++ b/Minecraft.Client/PendingConnection.h @@ -24,7 +24,7 @@ private: MinecraftServer *server; int _tick; wstring name; - shared_ptr acceptedLogin; + std::shared_ptr acceptedLogin; wstring loginKey; public: @@ -32,14 +32,14 @@ public: ~PendingConnection(); void tick(); void disconnect(DisconnectPacket::eDisconnectReason reason); - virtual void handlePreLogin(shared_ptr packet); - virtual void handleLogin(shared_ptr packet); - virtual void handleAcceptedLogin(shared_ptr packet); + virtual void handlePreLogin(std::shared_ptr packet); + virtual void handleLogin(std::shared_ptr packet); + virtual void handleAcceptedLogin(std::shared_ptr packet); virtual void onDisconnect(DisconnectPacket::eDisconnectReason reason, void *reasonObjects); - virtual void handleGetInfo(shared_ptr packet); - virtual void handleKeepAlive(shared_ptr packet); - virtual void onUnhandledPacket(shared_ptr packet); - void send(shared_ptr packet); + virtual void handleGetInfo(std::shared_ptr packet); + virtual void handleKeepAlive(std::shared_ptr packet); + virtual void onUnhandledPacket(std::shared_ptr packet); + void send(std::shared_ptr packet); wstring getName(); virtual bool isServerPacketListener(); diff --git a/Minecraft.Client/PigRenderer.cpp b/Minecraft.Client/PigRenderer.cpp index eb78cd20..7e50fe35 100644 --- a/Minecraft.Client/PigRenderer.cpp +++ b/Minecraft.Client/PigRenderer.cpp @@ -7,10 +7,10 @@ PigRenderer::PigRenderer(Model *model, Model *armor, float shadow) : MobRenderer setArmor(armor); } -int PigRenderer::prepareArmor(shared_ptr _pig, int layer, float a) +int PigRenderer::prepareArmor(std::shared_ptr _pig, int layer, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr pig = dynamic_pointer_cast(_pig); + std::shared_ptr pig = dynamic_pointer_cast(_pig); MemSect(31); bindTexture(TN_MOB_SADDLE); // 4J was L"/mob/saddle.png" @@ -18,7 +18,7 @@ int PigRenderer::prepareArmor(shared_ptr _pig, int layer, float a) return (layer == 0 && pig->hasSaddle()) ? 1 : -1; } -void PigRenderer::render(shared_ptr mob, double x, double y, double z, float rot, float a) +void PigRenderer::render(std::shared_ptr mob, double x, double y, double z, float rot, float a) { MobRenderer::render(mob, x, y, z, rot, a); -} \ No newline at end of file +} \ No newline at end of file diff --git a/Minecraft.Client/PigRenderer.h b/Minecraft.Client/PigRenderer.h index e674b508..9dc3edfa 100644 --- a/Minecraft.Client/PigRenderer.h +++ b/Minecraft.Client/PigRenderer.h @@ -6,8 +6,8 @@ class PigRenderer : public MobRenderer public: PigRenderer(Model *model, Model *armor, float shadow); protected: - virtual int prepareArmor(shared_ptr _pig, int layer, float a); + virtual int prepareArmor(std::shared_ptr _pig, int layer, float a); public: - virtual void render(shared_ptr mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr mob, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/PistonPieceRenderer.cpp b/Minecraft.Client/PistonPieceRenderer.cpp index 1ce084cf..b33df7b2 100644 --- a/Minecraft.Client/PistonPieceRenderer.cpp +++ b/Minecraft.Client/PistonPieceRenderer.cpp @@ -12,10 +12,10 @@ PistonPieceRenderer::PistonPieceRenderer() tileRenderer = NULL; } -void PistonPieceRenderer::render(shared_ptr _entity, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +void PistonPieceRenderer::render(std::shared_ptr _entity, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr entity = dynamic_pointer_cast(_entity); + std::shared_ptr entity = dynamic_pointer_cast(_entity); Tile *tile = Tile::tiles[entity->getId()]; if (tile != NULL && entity->getProgress(a) <= 1) // 4J - changed condition from < to <= as our chunk update is async to main thread and so we can have to render these with progress of 1 @@ -60,7 +60,7 @@ void PistonPieceRenderer::render(shared_ptr _entity, double x, doubl } } - + void PistonPieceRenderer::onNewLevel(Level *level) { delete tileRenderer; diff --git a/Minecraft.Client/PistonPieceRenderer.h b/Minecraft.Client/PistonPieceRenderer.h index 830ddd43..7a2a3b7d 100644 --- a/Minecraft.Client/PistonPieceRenderer.h +++ b/Minecraft.Client/PistonPieceRenderer.h @@ -2,13 +2,13 @@ class PistonPieceEntity; class TileRenderer; -class PistonPieceRenderer : public TileEntityRenderer +class PistonPieceRenderer : public TileEntityRenderer { private: TileRenderer *tileRenderer; public: PistonPieceRenderer(); - virtual void render(shared_ptr _entity, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param + virtual void render(std::shared_ptr _entity, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param virtual void onNewLevel(Level *level); }; diff --git a/Minecraft.Client/PlayerChunkMap.cpp b/Minecraft.Client/PlayerChunkMap.cpp index 1c7516cf..06bdcf73 100644 --- a/Minecraft.Client/PlayerChunkMap.cpp +++ b/Minecraft.Client/PlayerChunkMap.cpp @@ -44,12 +44,12 @@ void PlayerChunkMap::flagEntitiesToBeRemoved(unsigned int *flags, bool *flagToBe { for(AUTO_VAR(it,players.begin()); it != players.end(); it++) { - shared_ptr serverPlayer = *it; + std::shared_ptr serverPlayer = *it; serverPlayer->flagEntitiesToBeRemoved(flags, flagToBeRemoved); } } -void PlayerChunkMap::PlayerChunk::add(shared_ptr player, bool sendPacket /*= true*/) +void PlayerChunkMap::PlayerChunk::add(std::shared_ptr player, bool sendPacket /*= true*/) { //app.DebugPrintf("--- Adding player to chunk x=%d\tz=%d\n",x, z); if (find(players.begin(),players.end(),player) != players.end()) @@ -66,7 +66,7 @@ void PlayerChunkMap::PlayerChunk::add(shared_ptr player, bool send player->seenChunks.insert(pos); // 4J Added the sendPacket check. See PlayerChunkMap::add for the usage - if( sendPacket ) player->connection->send( shared_ptr( new ChunkVisibilityPacket(pos.x, pos.z, true) ) ); + if( sendPacket ) player->connection->send( std::shared_ptr( new ChunkVisibilityPacket(pos.x, pos.z, true) ) ); players.push_back(player); @@ -77,7 +77,7 @@ void PlayerChunkMap::PlayerChunk::add(shared_ptr player, bool send #endif } -void PlayerChunkMap::PlayerChunk::remove(shared_ptr player) +void PlayerChunkMap::PlayerChunk::remove(std::shared_ptr player) { PlayerChunkMap::PlayerChunk *toDelete = NULL; @@ -121,7 +121,7 @@ void PlayerChunkMap::PlayerChunk::remove(shared_ptr player) { for( AUTO_VAR(it, players.begin()); it < players.end(); ++it ) { - shared_ptr currPlayer = *it; + std::shared_ptr currPlayer = *it; INetworkPlayer *currNetPlayer = currPlayer->connection->getNetworkPlayer(); if( currNetPlayer != NULL && currNetPlayer->IsSameSystem( thisNetPlayer ) && currPlayer->seenChunks.find(pos) != currPlayer->seenChunks.end() ) { @@ -132,7 +132,7 @@ void PlayerChunkMap::PlayerChunk::remove(shared_ptr player) if(noOtherPlayersFound) { //wprintf(L"Sending ChunkVisiblity packet false for chunk (%d,%d) to player %ls\n", x, z, player->name.c_str() ); - player->connection->send( shared_ptr( new ChunkVisibilityPacket(pos.x, pos.z, false) ) ); + player->connection->send( std::shared_ptr( new ChunkVisibilityPacket(pos.x, pos.z, false) ) ); } } else @@ -181,12 +181,12 @@ void PlayerChunkMap::PlayerChunk::prioritiseTileChanges() prioritised = true; } -void PlayerChunkMap::PlayerChunk::broadcast(shared_ptr packet) +void PlayerChunkMap::PlayerChunk::broadcast(std::shared_ptr packet) { - vector< shared_ptr > sentTo; + vector< std::shared_ptr > sentTo; for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr player = players[i]; + std::shared_ptr player = players[i]; // 4J - don't send to a player we've already sent this data to that shares the same machine. TileUpdatePacket, // ChunkTilesUpdatePacket and SignUpdatePacket all used to limit themselves to sending once to each machine @@ -205,7 +205,7 @@ void PlayerChunkMap::PlayerChunk::broadcast(shared_ptr packet) { for(unsigned int j = 0; j < sentTo.size(); j++ ) { - shared_ptr player2 = sentTo[j]; + std::shared_ptr player2 = sentTo[j]; INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); if( otherPlayer != NULL && thisPlayer->IsSameSystem(otherPlayer) ) { @@ -244,7 +244,7 @@ void PlayerChunkMap::PlayerChunk::broadcast(shared_ptr packet) for( int i = 0; i < parent->level->getServer()->getPlayers()->players.size(); i++ ) { - shared_ptr player = parent->level->getServer()->getPlayers()->players[i]; + std::shared_ptr player = parent->level->getServer()->getPlayers()->players[i]; // Don't worry about local players, they get all their updates through sharing level with the server anyway if ( player->connection == NULL ) continue; if( player->connection->isLocal() ) continue; @@ -267,7 +267,7 @@ void PlayerChunkMap::PlayerChunk::broadcast(shared_ptr packet) { for(unsigned int j = 0; j < sentTo.size(); j++ ) { - shared_ptr player2 = sentTo[j]; + std::shared_ptr player2 = sentTo[j]; INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); if( otherPlayer != NULL && thisPlayer->IsSameSystem(otherPlayer) ) { @@ -299,7 +299,7 @@ bool PlayerChunkMap::PlayerChunk::broadcastChanges(bool allowRegionUpdate) int x = pos.x * 16 + xChangeMin; int y = yChangeMin; int z = pos.z * 16 + zChangeMin; - broadcast( shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); + broadcast( std::shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); if (level->isEntityTile(x, y, z)) { broadcast(level->getTileEntity(x, y, z)); @@ -329,8 +329,8 @@ bool PlayerChunkMap::PlayerChunk::broadcastChanges(bool allowRegionUpdate) // Block region update packets can only encode ys in a range of 1 - 256 if( ys > 256 ) ys = 256; - broadcast( shared_ptr( new BlockRegionUpdatePacket(xp, yp, zp, xs, ys, zs, level) ) ); - vector > *tes = level->getTileEntitiesInRegion(xp, yp, zp, xp + xs, yp + ys, zp + zs); + broadcast( std::shared_ptr( new BlockRegionUpdatePacket(xp, yp, zp, xs, ys, zs, level) ) ); + vector > *tes = level->getTileEntitiesInRegion(xp, yp, zp, xp + xs, yp + ys, zp + zs); for (unsigned int i = 0; i < tes->size(); i++) { broadcast(tes->at(i)); @@ -342,7 +342,7 @@ bool PlayerChunkMap::PlayerChunk::broadcastChanges(bool allowRegionUpdate) else { // 4J As we only get here if changes is less than MAX_CHANGES_BEFORE_RESEND (10) we only need to send a byte value in the packet - broadcast( shared_ptr( new ChunkTilesUpdatePacket(pos.x, pos.z, changedTiles, (byte)changes, level) ) ); + broadcast( std::shared_ptr( new ChunkTilesUpdatePacket(pos.x, pos.z, changedTiles, (byte)changes, level) ) ); for (int i = 0; i < changes; i++) { int x = pos.x * 16 + ((changedTiles[i] >> 12) & 15); @@ -361,11 +361,11 @@ bool PlayerChunkMap::PlayerChunk::broadcastChanges(bool allowRegionUpdate) return didRegionUpdate; } -void PlayerChunkMap::PlayerChunk::broadcast(shared_ptr te) +void PlayerChunkMap::PlayerChunk::broadcast(std::shared_ptr te) { if (te != NULL) { - shared_ptr p = te->getUpdatePacket(); + std::shared_ptr p = te->getUpdatePacket(); if (p != NULL) { broadcast(p); @@ -458,7 +458,7 @@ PlayerChunkMap::PlayerChunk *PlayerChunkMap::getChunk(int x, int z, bool create) // 4J - added. If a chunk exists, add a player to it straight away. If it doesn't exist, // queue a request for it to be created. -void PlayerChunkMap::getChunkAndAddPlayer(int x, int z, shared_ptr player) +void PlayerChunkMap::getChunkAndAddPlayer(int x, int z, std::shared_ptr player) { int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); AUTO_VAR(it, chunks.find(id)); @@ -475,7 +475,7 @@ void PlayerChunkMap::getChunkAndAddPlayer(int x, int z, shared_ptr // 4J - added. If the chunk and player are in the queue to be added, remove from there. Otherwise // attempt to remove from main chunk map. -void PlayerChunkMap::getChunkAndRemovePlayer(int x, int z, shared_ptr player) +void PlayerChunkMap::getChunkAndRemovePlayer(int x, int z, std::shared_ptr player) { for( AUTO_VAR(it, addRequests.begin()); it != addRequests.end(); it++ ) { @@ -497,7 +497,7 @@ void PlayerChunkMap::getChunkAndRemovePlayer(int x, int z, shared_ptr player) +void PlayerChunkMap::tickAddRequests(std::shared_ptr player) { if( addRequests.size() ) { @@ -533,7 +533,7 @@ void PlayerChunkMap::tickAddRequests(shared_ptr player) } } -void PlayerChunkMap::broadcastTileUpdate(shared_ptr packet, int x, int y, int z) +void PlayerChunkMap::broadcastTileUpdate(std::shared_ptr packet, int x, int y, int z) { int xc = x >> 4; int zc = z >> 4; @@ -576,7 +576,7 @@ void PlayerChunkMap::prioritiseTileChanges(int x, int y, int z) } } -void PlayerChunkMap::add(shared_ptr player) +void PlayerChunkMap::add(std::shared_ptr player) { static int direction[4][2] = { { 1, 0 }, { 0, 1 }, { -1, 0 }, {0, -1} }; @@ -649,7 +649,7 @@ void PlayerChunkMap::add(shared_ptr player) } // CraftBukkit end - player->connection->send( shared_ptr( new ChunkVisibilityAreaPacket(minX, maxX, minZ, maxZ) ) ); + player->connection->send( std::shared_ptr( new ChunkVisibilityAreaPacket(minX, maxX, minZ, maxZ) ) ); #ifdef _LARGE_WORLDS getLevel()->cache->dontDrop(xc,zc); @@ -659,7 +659,7 @@ void PlayerChunkMap::add(shared_ptr player) } -void PlayerChunkMap::remove(shared_ptr player) +void PlayerChunkMap::remove(std::shared_ptr player) { int xc = ((int) player->lastMoveX) >> 4; int zc = ((int) player->lastMoveZ) >> 4; @@ -702,7 +702,7 @@ bool PlayerChunkMap::chunkInRange(int x, int z, int xc, int zc) // 4J - have changed this so that we queue requests to add the player to chunks if they // need to be created, so that we aren't creating potentially 20 chunks per player per tick -void PlayerChunkMap::move(shared_ptr player) +void PlayerChunkMap::move(std::shared_ptr player) { int xc = ((int) player->x) >> 4; int zc = ((int) player->z) >> 4; @@ -744,7 +744,7 @@ int PlayerChunkMap::getMaxRange() return radius * 16 - 16; } -bool PlayerChunkMap::isPlayerIn(shared_ptr player, int xChunk, int zChunk) +bool PlayerChunkMap::isPlayerIn(std::shared_ptr player, int xChunk, int zChunk) { PlayerChunk *chunk = getChunk(xChunk, zChunk, false); @@ -775,7 +775,7 @@ void PlayerChunkMap::setRadius(int newRadius) PlayerList* players = level->getServer()->getPlayerList(); for( int i = 0;i < players->players.size();i += 1 ) { - shared_ptr player = players->players[i]; + std::shared_ptr player = players->players[i]; if( player->level == level ) { int xc = ((int) player->x) >> 4; diff --git a/Minecraft.Client/PlayerChunkMap.h b/Minecraft.Client/PlayerChunkMap.h index 08cda2a7..5e87934b 100644 --- a/Minecraft.Client/PlayerChunkMap.h +++ b/Minecraft.Client/PlayerChunkMap.h @@ -25,8 +25,8 @@ public: { public: int x,z; - shared_ptr player; - PlayerChunkAddRequest(int x, int z, shared_ptr player ) : x(x), z(z), player(player) {} + std::shared_ptr player; + PlayerChunkAddRequest(int x, int z, std::shared_ptr player ) : x(x), z(z), player(player) {} }; class PlayerChunk @@ -34,7 +34,7 @@ public: friend class PlayerChunkMap; private: PlayerChunkMap *parent; // 4J added - vector > players; + vector > players; //int x, z; ChunkPos pos; @@ -51,25 +51,25 @@ public: ~PlayerChunk(); // 4J Added sendPacket param so we can aggregate the initial send into one much smaller packet - void add(shared_ptr player, bool sendPacket = true); - void remove(shared_ptr player); + void add(std::shared_ptr player, bool sendPacket = true); + void remove(std::shared_ptr player); void tileChanged(int x, int y, int z); void prioritiseTileChanges(); // 4J added - void broadcast(shared_ptr packet); + void broadcast(std::shared_ptr packet); bool broadcastChanges(bool allowRegionUpdate); // 4J - added parm private: - void broadcast(shared_ptr te); + void broadcast(std::shared_ptr te); }; public: - vector > players; + vector > players; void flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFound); // 4J added private: unordered_map chunks; // 4J - was LongHashMap vector changedChunks; vector addRequests; // 4J added - void tickAddRequests(shared_ptr player); // 4J added + void tickAddRequests(std::shared_ptr player); // 4J added ServerLevel *level; int radius; @@ -83,21 +83,21 @@ public: bool hasChunk(int x, int z); private: PlayerChunk *getChunk(int x, int z, bool create); - void getChunkAndAddPlayer(int x, int z, shared_ptr player); // 4J added - void getChunkAndRemovePlayer(int x, int z, shared_ptr player); // 4J added + void getChunkAndAddPlayer(int x, int z, std::shared_ptr player); // 4J added + void getChunkAndRemovePlayer(int x, int z, std::shared_ptr player); // 4J added public: - void broadcastTileUpdate(shared_ptr packet, int x, int y, int z); + void broadcastTileUpdate(std::shared_ptr packet, int x, int y, int z); void tileChanged(int x, int y, int z); bool isTrackingTile(int x, int y, int z); // 4J added void prioritiseTileChanges(int x, int y, int z); // 4J added - void add(shared_ptr player); - void remove(shared_ptr player); + void add(std::shared_ptr player); + void remove(std::shared_ptr player); private: bool chunkInRange(int x, int z, int xc, int zc); public: - void move(shared_ptr player); + void move(std::shared_ptr player); int getMaxRange(); - bool isPlayerIn(shared_ptr player, int xChunk, int zChunk); + bool isPlayerIn(std::shared_ptr player, int xChunk, int zChunk); static int convertChunkRangeToBlock(int radius); // AP added for Vita diff --git a/Minecraft.Client/PlayerCloudParticle.cpp b/Minecraft.Client/PlayerCloudParticle.cpp index 6976fbab..ca7e9d90 100644 --- a/Minecraft.Client/PlayerCloudParticle.cpp +++ b/Minecraft.Client/PlayerCloudParticle.cpp @@ -49,7 +49,7 @@ void PlayerCloudParticle::tick() xd *= 0.96f; yd *= 0.96f; zd *= 0.96f; - shared_ptr p = level->getNearestPlayer(shared_from_this(), 2); + std::shared_ptr p = level->getNearestPlayer(shared_from_this(), 2); if (p != NULL) { if (y > p->bb->y0) diff --git a/Minecraft.Client/PlayerConnection.cpp b/Minecraft.Client/PlayerConnection.cpp index f0e538a8..393ae105 100644 --- a/Minecraft.Client/PlayerConnection.cpp +++ b/Minecraft.Client/PlayerConnection.cpp @@ -34,7 +34,7 @@ Random PlayerConnection::random; -PlayerConnection::PlayerConnection(MinecraftServer *server, Connection *connection, shared_ptr player) +PlayerConnection::PlayerConnection(MinecraftServer *server, Connection *connection, std::shared_ptr player) { // 4J - added initialisers done = false; @@ -93,12 +93,12 @@ void PlayerConnection::tick() lastKeepAliveTick = tickCount; lastKeepAliveTime = System::nanoTime() / 1000000; lastKeepAliveId = random.nextInt(); - send( shared_ptr( new KeepAlivePacket(lastKeepAliveId) ) ); + send( std::shared_ptr( new KeepAlivePacket(lastKeepAliveId) ) ); } // if (!didTick) { // player->doTick(false); // } - + if (chatSpamTickCount > 0) { chatSpamTickCount--; @@ -123,30 +123,30 @@ void PlayerConnection::disconnect(DisconnectPacket::eDisconnectReason reason) // 4J Stu - Need to remove the player from the receiving list before their socket is NULLed so that we can find another player on their system server->getPlayers()->removePlayerFromReceiving( player ); - send( shared_ptr( new DisconnectPacket(reason) )); + send( std::shared_ptr( new DisconnectPacket(reason) )); connection->sendAndQuit(); // 4J-PB - removed, since it needs to be localised in the language the client is in - //server->players->broadcastAll( shared_ptr( new ChatPacket(L"§e" + player->name + L" left the game.") ) ); + //server->players->broadcastAll( std::shared_ptr( new ChatPacket(L"�e" + player->name + L" left the game.") ) ); if(getWasKicked()) { - server->getPlayers()->broadcastAll( shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) ); + server->getPlayers()->broadcastAll( std::shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) ); } else { - server->getPlayers()->broadcastAll( shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerLeftGame) ) ); + server->getPlayers()->broadcastAll( std::shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerLeftGame) ) ); } - + server->getPlayers()->remove(player); done = true; LeaveCriticalSection(&done_cs); } -void PlayerConnection::handlePlayerInput(shared_ptr packet) +void PlayerConnection::handlePlayerInput(std::shared_ptr packet) { player->setPlayerInput(packet->getXa(), packet->getYa(), packet->isJumping(), packet->isSneaking(), packet->getXRot(), packet->getYRot()); } -void PlayerConnection::handleMovePlayer(shared_ptr packet) +void PlayerConnection::handleMovePlayer(std::shared_ptr packet) { ServerLevel *level = server->getLevel(player->dimension); @@ -391,10 +391,10 @@ void PlayerConnection::teleport(double x, double y, double z, float yRot, float player->absMoveTo(x, y, z, yRot, xRot); // 4J - note that 1.62 is added to the height here as the client connection that receives this will presume it represents y + heightOffset at that end // This is different to the way that height is sent back to the server, where it represents the bottom of the player bounding volume - if(sendPacket) player->connection->send( shared_ptr( new MovePlayerPacket::PosRot(x, y + 1.62f, y, z, yRot, xRot, false, false) ) ); + if(sendPacket) player->connection->send( std::shared_ptr( new MovePlayerPacket::PosRot(x, y + 1.62f, y, z, yRot, xRot, false, false) ) ); } -void PlayerConnection::handlePlayerAction(shared_ptr packet) +void PlayerConnection::handlePlayerAction(std::shared_ptr packet) { ServerLevel *level = server->getLevel(player->dimension); @@ -442,19 +442,19 @@ void PlayerConnection::handlePlayerAction(shared_ptr packet) if (packet->action == PlayerActionPacket::START_DESTROY_BLOCK) { if (zd > 16 || canEditSpawn) player->gameMode->startDestroyBlock(x, y, z, packet->face); - else player->connection->send( shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); + else player->connection->send( std::shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); } else if (packet->action == PlayerActionPacket::STOP_DESTROY_BLOCK) { player->gameMode->stopDestroyBlock(x, y, z); server->getPlayers()->prioritiseTileChanges(x, y, z, level->dimension->id); // 4J added - make sure that the update packets for this get prioritised over other general world updates - if (level->getTile(x, y, z) != 0) player->connection->send( shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); + if (level->getTile(x, y, z) != 0) player->connection->send( std::shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); } else if (packet->action == PlayerActionPacket::ABORT_DESTROY_BLOCK) { player->gameMode->abortDestroyBlock(x, y, z); - if (level->getTile(x, y, z) != 0) player->connection->send(shared_ptr( new TileUpdatePacket(x, y, z, level))); + if (level->getTile(x, y, z) != 0) player->connection->send(std::shared_ptr( new TileUpdatePacket(x, y, z, level))); } else if (packet->action == PlayerActionPacket::GET_UPDATED_BLOCK) { @@ -464,7 +464,7 @@ void PlayerConnection::handlePlayerAction(shared_ptr packet) double dist = xDist * xDist + yDist * yDist + zDist * zDist; if (dist < 16 * 16) { - player->connection->send( shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); + player->connection->send( std::shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); } } @@ -473,16 +473,16 @@ void PlayerConnection::handlePlayerAction(shared_ptr packet) } -void PlayerConnection::handleUseItem(shared_ptr packet) +void PlayerConnection::handleUseItem(std::shared_ptr packet) { ServerLevel *level = server->getLevel(player->dimension); - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); bool informClient = false; int x = packet->getX(); int y = packet->getY(); int z = packet->getZ(); int face = packet->getFace(); - + // 4J Stu - We don't have ops, so just use the levels setting bool canEditSpawn = level->canEditSpawn; // = level->dimension->id != 0 || server->players->isOp(player->name); if (packet->getFace() == 255) @@ -509,14 +509,14 @@ void PlayerConnection::handleUseItem(shared_ptr packet) } else { - //player->connection->send(shared_ptr(new ChatPacket("\u00A77Height limit for building is " + server->maxBuildHeight))); + //player->connection->send(std::shared_ptr(new ChatPacket("\u00A77Height limit for building is " + server->maxBuildHeight))); informClient = true; } if (informClient) { - player->connection->send( shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); + player->connection->send( std::shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); if (face == 0) y--; if (face == 1) y++; @@ -524,7 +524,7 @@ void PlayerConnection::handleUseItem(shared_ptr packet) if (face == 3) z++; if (face == 4) x--; if (face == 5) x++; - + // 4J - Fixes an issue where pistons briefly disappear when retracting. The pistons themselves shouldn't have their change from being pistonBase_Id to pistonMovingPiece_Id // directly sent to the client, as this will happen on the client as a result of it actioning (via a tile event) the retraction of the piston locally. However, by putting a switch // beside a piston and then performing an action on the side of it facing a piston, the following line of code will send a TileUpdatePacket containing the change to pistonMovingPiece_Id @@ -532,7 +532,7 @@ void PlayerConnection::handleUseItem(shared_ptr packet) // isn't what it is expecting. if( level->getTile(x,y,z) != Tile::pistonMovingPiece_Id ) { - player->connection->send( shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); + player->connection->send( std::shared_ptr( new TileUpdatePacket(x, y, z, level) ) ); } } @@ -554,7 +554,7 @@ void PlayerConnection::handleUseItem(shared_ptr packet) if (!ItemInstance::matches(player->inventory->getSelected(), packet->getItem())) { - send( shared_ptr( new ContainerSetSlotPacket(player->containerMenu->containerId, s->index, player->inventory->getSelected()) ) ); + send( std::shared_ptr( new ContainerSetSlotPacket(player->containerMenu->containerId, s->index, player->inventory->getSelected()) ) ); } } @@ -569,27 +569,27 @@ void PlayerConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason, if( done ) return; // logger.info(player.name + " lost connection: " + reason); // 4J-PB - removed, since it needs to be localised in the language the client is in - //server->players->broadcastAll( shared_ptr( new ChatPacket(L"§e" + player->name + L" left the game.") ) ); + //server->players->broadcastAll( std::shared_ptr( new ChatPacket(L"�e" + player->name + L" left the game.") ) ); if(getWasKicked()) { - server->getPlayers()->broadcastAll( shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) ); + server->getPlayers()->broadcastAll( std::shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) ); } else { - server->getPlayers()->broadcastAll( shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerLeftGame) ) ); + server->getPlayers()->broadcastAll( std::shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerLeftGame) ) ); } server->getPlayers()->remove(player); done = true; LeaveCriticalSection(&done_cs); } -void PlayerConnection::onUnhandledPacket(shared_ptr packet) +void PlayerConnection::onUnhandledPacket(std::shared_ptr packet) { // logger.warning(getClass() + " wasn't prepared to deal with a " + packet.getClass()); disconnect(DisconnectPacket::eDisconnect_UnexpectedPacket); } -void PlayerConnection::send(shared_ptr packet) +void PlayerConnection::send(std::shared_ptr packet) { if( connection->getSocket() != NULL ) { @@ -607,7 +607,7 @@ void PlayerConnection::send(shared_ptr packet) } // 4J Added -void PlayerConnection::queueSend(shared_ptr packet) +void PlayerConnection::queueSend(std::shared_ptr packet) { if( connection->getSocket() != NULL ) { @@ -624,7 +624,7 @@ void PlayerConnection::queueSend(shared_ptr packet) } } -void PlayerConnection::handleSetCarriedItem(shared_ptr packet) +void PlayerConnection::handleSetCarriedItem(std::shared_ptr packet) { if (packet->slot < 0 || packet->slot >= Inventory::getSelectionSize()) { @@ -634,7 +634,7 @@ void PlayerConnection::handleSetCarriedItem(shared_ptr pac player->inventory->selected = packet->slot; } -void PlayerConnection::handleChat(shared_ptr packet) +void PlayerConnection::handleChat(std::shared_ptr packet) { // 4J - TODO #if 0 @@ -678,7 +678,7 @@ void PlayerConnection::handleCommand(const wstring& message) #endif } -void PlayerConnection::handleAnimate(shared_ptr packet) +void PlayerConnection::handleAnimate(std::shared_ptr packet) { if (packet->action == AnimatePacket::SWING) { @@ -686,7 +686,7 @@ void PlayerConnection::handleAnimate(shared_ptr packet) } } -void PlayerConnection::handlePlayerCommand(shared_ptr packet) +void PlayerConnection::handlePlayerCommand(std::shared_ptr packet) { if (packet->action == PlayerCommandPacket::START_SNEAKING) { @@ -725,7 +725,7 @@ void PlayerConnection::setShowOnMaps(bool bVal) player->setShowOnMaps(bVal); } -void PlayerConnection::handleDisconnect(shared_ptr packet) +void PlayerConnection::handleDisconnect(std::shared_ptr packet) { // 4J Stu - Need to remove the player from the receiving list before their socket is NULLed so that we can find another player on their system server->getPlayers()->removePlayerFromReceiving( player ); @@ -740,13 +740,13 @@ int PlayerConnection::countDelayedPackets() void PlayerConnection::info(const wstring& string) { // 4J-PB - removed, since it needs to be localised in the language the client is in - //send( shared_ptr( new ChatPacket(L"§7" + string) ) ); + //send( std::shared_ptr( new ChatPacket(L"�7" + string) ) ); } void PlayerConnection::warn(const wstring& string) { // 4J-PB - removed, since it needs to be localised in the language the client is in - //send( shared_ptr( new ChatPacket(L"§9" + string) ) ); + //send( std::shared_ptr( new ChatPacket(L"�9" + string) ) ); } wstring PlayerConnection::getConsoleName() @@ -754,10 +754,10 @@ wstring PlayerConnection::getConsoleName() return player->name; } -void PlayerConnection::handleInteract(shared_ptr packet) +void PlayerConnection::handleInteract(std::shared_ptr packet) { ServerLevel *level = server->getLevel(player->dimension); - shared_ptr target = level->getEntity(packet->target); + std::shared_ptr target = level->getEntity(packet->target); // Fix for #8218 - Gameplay: Attacking zombies from a different level often results in no hits being registered // 4J Stu - If the client says that we hit something, then agree with it. The canSee can fail here as it checks @@ -792,7 +792,7 @@ bool PlayerConnection::canHandleAsyncPackets() return true; } -void PlayerConnection::handleTexture(shared_ptr packet) +void PlayerConnection::handleTexture(std::shared_ptr packet) { // Both PlayerConnection and ClientConnection should handle this mostly the same way @@ -803,12 +803,12 @@ void PlayerConnection::handleTexture(shared_ptr packet) wprintf(L"Server received request for custom texture %ls\n",packet->textureName.c_str()); #endif PBYTE pbData=NULL; - DWORD dwBytes=0; + DWORD dwBytes=0; app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes); if(dwBytes!=0) { - send( shared_ptr( new TexturePacket(packet->textureName,pbData,dwBytes) ) ); + send( std::shared_ptr( new TexturePacket(packet->textureName,pbData,dwBytes) ) ); } else { @@ -826,7 +826,7 @@ void PlayerConnection::handleTexture(shared_ptr packet) } } -void PlayerConnection::handleTextureAndGeometry(shared_ptr packet) +void PlayerConnection::handleTextureAndGeometry(std::shared_ptr packet) { // Both PlayerConnection and ClientConnection should handle this mostly the same way @@ -837,7 +837,7 @@ void PlayerConnection::handleTextureAndGeometry(shared_ptrtextureName.c_str()); #endif PBYTE pbData=NULL; - DWORD dwTextureBytes=0; + DWORD dwTextureBytes=0; app.GetMemFileDetails(packet->textureName,&pbData,&dwTextureBytes); DLCSkinFile *pDLCSkinFile = app.m_dlcManager.getSkinFile(packet->textureName); @@ -848,11 +848,11 @@ void PlayerConnection::handleTextureAndGeometry(shared_ptrgetAdditionalBoxesCount()!=0) { - send( shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwTextureBytes,pDLCSkinFile) ) ); + send( std::shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwTextureBytes,pDLCSkinFile) ) ); } else { - send( shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwTextureBytes) ) ); + send( std::shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwTextureBytes) ) ); } } else @@ -861,7 +861,7 @@ void PlayerConnection::handleTextureAndGeometry(shared_ptr *pvSkinBoxes = app.GetAdditionalSkinBoxes(packet->dwSkinID); unsigned int uiAnimOverrideBitmask= app.GetAnimOverrideBitmask(packet->dwSkinID); - send( shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwTextureBytes,pvSkinBoxes,uiAnimOverrideBitmask) ) ); + send( std::shared_ptr( new TextureAndGeometryPacket(packet->textureName,pbData,dwTextureBytes,pvSkinBoxes,uiAnimOverrideBitmask) ) ); } } else @@ -901,12 +901,12 @@ void PlayerConnection::handleTextureReceived(const wstring &textureName) if( it != m_texturesRequested.end() ) { PBYTE pbData=NULL; - DWORD dwBytes=0; + DWORD dwBytes=0; app.GetMemFileDetails(textureName,&pbData,&dwBytes); if(dwBytes!=0) { - send( shared_ptr( new TexturePacket(textureName,pbData,dwBytes) ) ); + send( std::shared_ptr( new TexturePacket(textureName,pbData,dwBytes) ) ); m_texturesRequested.erase(it); } } @@ -919,7 +919,7 @@ void PlayerConnection::handleTextureAndGeometryReceived(const wstring &textureNa if( it != m_texturesRequested.end() ) { PBYTE pbData=NULL; - DWORD dwTextureBytes=0; + DWORD dwTextureBytes=0; app.GetMemFileDetails(textureName,&pbData,&dwTextureBytes); DLCSkinFile *pDLCSkinFile=app.m_dlcManager.getSkinFile(textureName); @@ -927,7 +927,7 @@ void PlayerConnection::handleTextureAndGeometryReceived(const wstring &textureNa { if(pDLCSkinFile && (pDLCSkinFile->getAdditionalBoxesCount()!=0)) { - send( shared_ptr( new TextureAndGeometryPacket(textureName,pbData,dwTextureBytes,pDLCSkinFile) ) ); + send( std::shared_ptr( new TextureAndGeometryPacket(textureName,pbData,dwTextureBytes,pDLCSkinFile) ) ); } else { @@ -936,14 +936,14 @@ void PlayerConnection::handleTextureAndGeometryReceived(const wstring &textureNa vector *pvSkinBoxes = app.GetAdditionalSkinBoxes(dwSkinID); unsigned int uiAnimOverrideBitmask= app.GetAnimOverrideBitmask(dwSkinID); - send( shared_ptr( new TextureAndGeometryPacket(textureName,pbData,dwTextureBytes, pvSkinBoxes, uiAnimOverrideBitmask) ) ); + send( std::shared_ptr( new TextureAndGeometryPacket(textureName,pbData,dwTextureBytes, pvSkinBoxes, uiAnimOverrideBitmask) ) ); } - m_texturesRequested.erase(it); + m_texturesRequested.erase(it); } } } -void PlayerConnection::handleTextureChange(shared_ptr packet) +void PlayerConnection::handleTextureChange(std::shared_ptr packet) { switch(packet->action) { @@ -968,26 +968,26 @@ void PlayerConnection::handleTextureChange(shared_ptr packe #ifndef _CONTENT_PACKAGE wprintf(L"Sending texture packet to get custom skin %ls from player %ls\n",packet->path.c_str(), player->name.c_str()); #endif - send(shared_ptr( new TexturePacket(packet->path,NULL,0) ) ); + send(std::shared_ptr( new TexturePacket(packet->path,NULL,0) ) ); } } else if(!packet->path.empty() && app.IsFileInMemoryTextures(packet->path)) - { + { // Update the ref count on the memory texture data app.AddMemoryTextureFile(packet->path,NULL,0); } - server->getPlayers()->broadcastAll( shared_ptr( new TextureChangePacket(player,packet->action,packet->path) ), player->dimension ); + server->getPlayers()->broadcastAll( std::shared_ptr( new TextureChangePacket(player,packet->action,packet->path) ), player->dimension ); } -void PlayerConnection::handleTextureAndGeometryChange(shared_ptr packet) +void PlayerConnection::handleTextureAndGeometryChange(std::shared_ptr packet) { player->setCustomSkin( app.getSkinIdFromPath( packet->path ) ); #ifndef _CONTENT_PACKAGE wprintf(L"PlayerConnection::handleTextureAndGeometryChange - Skin for server player %ls has changed to %ls (%d)\n", player->name.c_str(), player->customTextureUrl.c_str(), player->getPlayerDefaultSkin() ); #endif - - + + if(!packet->path.empty() && packet->path.substr(0,3).compare(L"def") != 0 && !app.IsFileInMemoryTextures(packet->path)) { if( server->connection->addPendingTextureRequest(packet->path)) @@ -995,11 +995,11 @@ void PlayerConnection::handleTextureAndGeometryChange(shared_ptrpath.c_str(), player->name.c_str()); #endif - send(shared_ptr( new TextureAndGeometryPacket(packet->path,NULL,0) ) ); + send(std::shared_ptr( new TextureAndGeometryPacket(packet->path,NULL,0) ) ); } } else if(!packet->path.empty() && app.IsFileInMemoryTextures(packet->path)) - { + { // Update the ref count on the memory texture data app.AddMemoryTextureFile(packet->path,NULL,0); @@ -1009,10 +1009,10 @@ void PlayerConnection::handleTextureAndGeometryChange(shared_ptrdwSkinID,) //DebugBreak(); } - server->getPlayers()->broadcastAll( shared_ptr( new TextureAndGeometryChangePacket(player,packet->path) ), player->dimension ); + server->getPlayers()->broadcastAll( std::shared_ptr( new TextureAndGeometryChangePacket(player,packet->path) ), player->dimension ); } -void PlayerConnection::handleServerSettingsChanged(shared_ptr packet) +void PlayerConnection::handleServerSettingsChanged(std::shared_ptr packet) { if(packet->action==ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS) { @@ -1024,7 +1024,7 @@ void PlayerConnection::handleServerSettingsChanged(shared_ptrdata,eGameHostOption_FireSpreads)); app.SetGameHostOption(eGameHostOption_TNT, app.GetGameHostOption(packet->data,eGameHostOption_TNT)); - server->getPlayers()->broadcastAll( shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS,app.GetGameHostOption(eGameHostOption_All) ) ) ); + server->getPlayers()->broadcastAll( std::shared_ptr( new ServerSettingsChangedPacket( ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS,app.GetGameHostOption(eGameHostOption_All) ) ) ); // Update the QoS data g_NetworkManager.UpdateAndSetGameSessionData(); @@ -1032,21 +1032,21 @@ void PlayerConnection::handleServerSettingsChanged(shared_ptr packet) +void PlayerConnection::handleKickPlayer(std::shared_ptr packet) { INetworkPlayer *networkPlayer = getNetworkPlayer(); if( (networkPlayer != NULL && networkPlayer->IsHost()) || player->isModerator()) - { + { server->getPlayers()->kickPlayerByShortId(packet->m_networkSmallId); } } -void PlayerConnection::handleGameCommand(shared_ptr packet) +void PlayerConnection::handleGameCommand(std::shared_ptr packet) { MinecraftServer::getInstance()->getCommandDispatcher()->performCommand(player, packet->command, packet->data); } -void PlayerConnection::handleClientCommand(shared_ptr packet) +void PlayerConnection::handleClientCommand(std::shared_ptr packet) { if (packet->action == ClientCommandPacket::PERFORM_RESPAWN) { @@ -1078,17 +1078,17 @@ void PlayerConnection::handleClientCommand(shared_ptr packe } } -void PlayerConnection::handleRespawn(shared_ptr packet) +void PlayerConnection::handleRespawn(std::shared_ptr packet) { } -void PlayerConnection::handleContainerClose(shared_ptr packet) +void PlayerConnection::handleContainerClose(std::shared_ptr packet) { player->doCloseContainer(); } -#ifndef _CONTENT_PACKAGE -void PlayerConnection::handleContainerSetSlot(shared_ptr packet) +#ifndef _CONTENT_PACKAGE +void PlayerConnection::handleContainerSetSlot(std::shared_ptr packet) { if (packet->containerId == AbstractContainerMenu::CONTAINER_ID_CARRIED ) { @@ -1098,7 +1098,7 @@ void PlayerConnection::handleContainerSetSlot(shared_ptr { if (packet->containerId == AbstractContainerMenu::CONTAINER_ID_INVENTORY && packet->slot >= 36 && packet->slot < 36 + 9) { - shared_ptr lastItem = player->inventoryMenu->getSlot(packet->slot)->getItem(); + std::shared_ptr lastItem = player->inventoryMenu->getSlot(packet->slot)->getItem(); if (packet->item != NULL) { if (lastItem == NULL || lastItem->count < packet->item->count) @@ -1124,16 +1124,16 @@ void PlayerConnection::handleContainerSetSlot(shared_ptr } #endif -void PlayerConnection::handleContainerClick(shared_ptr packet) +void PlayerConnection::handleContainerClick(std::shared_ptr packet) { if (player->containerMenu->containerId == packet->containerId && player->containerMenu->isSynched(player)) { - shared_ptr clicked = player->containerMenu->clicked(packet->slotNum, packet->buttonNum, packet->quickKey?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, player); + std::shared_ptr clicked = player->containerMenu->clicked(packet->slotNum, packet->buttonNum, packet->quickKey?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, player); if (ItemInstance::matches(packet->item, clicked)) { // Yep, you sure did click what you claimed to click! - player->connection->send( shared_ptr( new ContainerAckPacket(packet->containerId, packet->uid, true) ) ); + player->connection->send( std::shared_ptr( new ContainerAckPacket(packet->containerId, packet->uid, true) ) ); player->ignoreSlotUpdateHack = true; player->containerMenu->broadcastChanges(); player->broadcastCarriedItem(); @@ -1143,10 +1143,10 @@ void PlayerConnection::handleContainerClick(shared_ptr pac { // No, you clicked the wrong thing! expectedAcks[player->containerMenu->containerId] = packet->uid; - player->connection->send( shared_ptr( new ContainerAckPacket(packet->containerId, packet->uid, false) ) ); + player->connection->send( std::shared_ptr( new ContainerAckPacket(packet->containerId, packet->uid, false) ) ); player->containerMenu->setSynched(player, false); - vector > items; + vector > items; for (unsigned int i = 0; i < player->containerMenu->slots->size(); i++) { items.push_back(player->containerMenu->slots->at(i)->getItem()); @@ -1159,7 +1159,7 @@ void PlayerConnection::handleContainerClick(shared_ptr pac } -void PlayerConnection::handleContainerButtonClick(shared_ptr packet) +void PlayerConnection::handleContainerButtonClick(std::shared_ptr packet) { if (player->containerMenu->containerId == packet->containerId && player->containerMenu->isSynched(player)) { @@ -1168,12 +1168,12 @@ void PlayerConnection::handleContainerButtonClick(shared_ptr packet) +void PlayerConnection::handleSetCreativeModeSlot(std::shared_ptr packet) { if (player->gameMode->isCreative()) { bool drop = packet->slotNum < 0; - shared_ptr item = packet->item; + std::shared_ptr item = packet->item; if(item != NULL && item->id == Item::map_Id) { @@ -1187,9 +1187,9 @@ void PlayerConnection::handleSetCreativeModeSlot(shared_ptrsetAuxValue( player->level->getAuxValueForMap(player->getXuid(), player->dimension, centreXC, centreZC, mapScale) ); + item->setAuxValue( player->level->getAuxValueForMap(player->getXuid(), player->dimension, centreXC, centreZC, mapScale) ); - shared_ptr data = MapItem::getSavedData(item->getAuxValue(), player->level); + std::shared_ptr data = MapItem::getSavedData(item->getAuxValue(), player->level); // 4J Stu - We only have one map per player per dimension, so don't reset the one that they have // when a new one is created wchar_t buf[64]; @@ -1197,9 +1197,9 @@ void PlayerConnection::handleSetCreativeModeSlot(shared_ptr( new MapItemSavedData(id) ); + data = std::shared_ptr( new MapItemSavedData(id) ); } - player->level->setSavedData(id, (shared_ptr ) data); + player->level->setSavedData(id, (std::shared_ptr ) data); data->scale = mapScale; // 4J-PB - for Xbox maps, we'll centre them on the origin of the world, since we can fit the whole world in our map @@ -1232,7 +1232,7 @@ void PlayerConnection::handleSetCreativeModeSlot(shared_ptr dropped = player->drop(item); + std::shared_ptr dropped = player->drop(item); if (dropped != NULL) { dropped->setShortLifeTime(); @@ -1244,7 +1244,7 @@ void PlayerConnection::handleSetCreativeModeSlot(shared_ptr > items; + vector > items; for (unsigned int i = 0; i < player->inventoryMenu->slots->size(); i++) { items.push_back(player->inventoryMenu->slots->at(i)->getItem()); @@ -1254,7 +1254,7 @@ void PlayerConnection::handleSetCreativeModeSlot(shared_ptr packet) +void PlayerConnection::handleContainerAck(std::shared_ptr packet) { AUTO_VAR(it, expectedAcks.find(player->containerMenu->containerId)); @@ -1264,18 +1264,18 @@ void PlayerConnection::handleContainerAck(shared_ptr packet) } } -void PlayerConnection::handleSignUpdate(shared_ptr packet) +void PlayerConnection::handleSignUpdate(std::shared_ptr packet) { app.DebugPrintf("PlayerConnection::handleSignUpdate\n"); ServerLevel *level = server->getLevel(player->dimension); if (level->hasChunkAt(packet->x, packet->y, packet->z)) { - shared_ptr te = level->getTileEntity(packet->x, packet->y, packet->z); + std::shared_ptr te = level->getTileEntity(packet->x, packet->y, packet->z); if (dynamic_pointer_cast(te) != NULL) { - shared_ptr ste = dynamic_pointer_cast(te); + std::shared_ptr ste = dynamic_pointer_cast(te); if (!ste->isEditable()) { server->warn(L"Player " + player->name + L" just tried to change non-editable sign"); @@ -1289,7 +1289,7 @@ void PlayerConnection::handleSignUpdate(shared_ptr packet) int x = packet->x; int y = packet->y; int z = packet->z; - shared_ptr ste = dynamic_pointer_cast(te); + std::shared_ptr ste = dynamic_pointer_cast(te); for (int i = 0; i < 4; i++) { wstring lineText = packet->lines[i].substr(0,15); @@ -1303,7 +1303,7 @@ void PlayerConnection::handleSignUpdate(shared_ptr packet) } -void PlayerConnection::handleKeepAlive(shared_ptr packet) +void PlayerConnection::handleKeepAlive(std::shared_ptr packet) { if (packet->id == lastKeepAliveId) { @@ -1312,18 +1312,18 @@ void PlayerConnection::handleKeepAlive(shared_ptr packet) } } -void PlayerConnection::handlePlayerInfo(shared_ptr packet) -{ +void PlayerConnection::handlePlayerInfo(std::shared_ptr packet) +{ // Need to check that this player has permission to change each individual setting? INetworkPlayer *networkPlayer = getNetworkPlayer(); if( (networkPlayer != NULL && networkPlayer->IsHost()) || player->isModerator() ) { - shared_ptr serverPlayer; + std::shared_ptr serverPlayer; // Find the player being edited for(AUTO_VAR(it, server->getPlayers()->players.begin()); it != server->getPlayers()->players.end(); ++it) { - shared_ptr checkingPlayer = *it; + std::shared_ptr checkingPlayer = *it; if(checkingPlayer->connection->getNetworkPlayer() != NULL && checkingPlayer->connection->getNetworkPlayer()->GetSmallId() == packet->m_networkSmallId) { serverPlayer = checkingPlayer; @@ -1348,7 +1348,7 @@ void PlayerConnection::handlePlayerInfo(shared_ptr packet) #endif serverPlayer->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_CreativeMode,Player::getPlayerGamePrivilege(packet->m_playerPrivileges,Player::ePlayerGamePrivilege_CreativeMode) ); serverPlayer->gameMode->setGameModeForPlayer(gameType); - serverPlayer->connection->send( shared_ptr( new GameEventPacket(GameEventPacket::CHANGE_GAME_MODE, gameType->getId()) )); + serverPlayer->connection->send( std::shared_ptr( new GameEventPacket(GameEventPacket::CHANGE_GAME_MODE, gameType->getId()) )); } else { @@ -1376,7 +1376,7 @@ void PlayerConnection::handlePlayerInfo(shared_ptr packet) } else { - // Editing someone else + // Editing someone else if(!trustPlayers && !serverPlayer->connection->getNetworkPlayer()->IsHost()) { serverPlayer->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_CannotMine,Player::getPlayerGamePrivilege(packet->m_playerPrivileges,Player::ePlayerGamePrivilege_CannotMine) ); @@ -1400,7 +1400,7 @@ void PlayerConnection::handlePlayerInfo(shared_ptr packet) } } - server->getPlayers()->broadcastAll( shared_ptr( new PlayerInfoPacket( serverPlayer ) ) ); + server->getPlayers()->broadcastAll( std::shared_ptr( new PlayerInfoPacket( serverPlayer ) ) ); } } } @@ -1410,7 +1410,7 @@ bool PlayerConnection::isServerPacketListener() return true; } -void PlayerConnection::handlePlayerAbilities(shared_ptr playerAbilitiesPacket) +void PlayerConnection::handlePlayerAbilities(std::shared_ptr playerAbilitiesPacket) { player->abilities.flying = playerAbilitiesPacket->isFlying() && player->abilities.mayfly; } @@ -1427,19 +1427,19 @@ void PlayerConnection::handlePlayerAbilities(shared_ptr p // player.connection.send(new ChatAutoCompletePacket(result.toString())); //} -//void handleClientInformation(shared_ptr packet) +//void handleClientInformation(std::shared_ptr packet) //{ // player->updateOptions(packet); //} -void PlayerConnection::handleCustomPayload(shared_ptr customPayloadPacket) +void PlayerConnection::handleCustomPayload(std::shared_ptr customPayloadPacket) { #if 0 if (CustomPayloadPacket.CUSTOM_BOOK_PACKET.equals(customPayloadPacket.identifier)) { ByteArrayInputStream bais(customPayloadPacket->data); DataInputStream input(&bais); - shared_ptr sentItem = Packet::readItem(input); + std::shared_ptr sentItem = Packet::readItem(input); if (!WritingBookItem.makeSureTagIsValid(sentItem.getTag())) { @@ -1510,13 +1510,13 @@ void PlayerConnection::handleCustomPayload(shared_ptr custo // 4J Added -void PlayerConnection::handleDebugOptions(shared_ptr packet) +void PlayerConnection::handleDebugOptions(std::shared_ptr packet) { //Player player = dynamic_pointer_cast( player->shared_from_this() ); player->SetDebugOptions(packet->m_uiVal); } -void PlayerConnection::handleCraftItem(shared_ptr packet) +void PlayerConnection::handleCraftItem(std::shared_ptr packet) { int iRecipe = packet->recipe; @@ -1524,7 +1524,7 @@ void PlayerConnection::handleCraftItem(shared_ptr packet) return; Recipy::INGREDIENTS_REQUIRED *pRecipeIngredientsRequired=Recipes::getInstance()->getRecipeIngredientsArray(); - shared_ptr pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); + std::shared_ptr pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr); if(app.DebugSettingsOn() && (player->GetDebugOptions()&(1L< packet) else { - + // TODO 4J Stu - Assume at the moment that the client can work this out for us... - //if(pRecipeIngredientsRequired[iRecipe].bCanMake) + //if(pRecipeIngredientsRequired[iRecipe].bCanMake) //{ pTempItemInst->onCraftedBy(player->level, dynamic_pointer_cast( player->shared_from_this() ), pTempItemInst->count ); @@ -1549,7 +1549,7 @@ void PlayerConnection::handleCraftItem(shared_ptr packet) { for(int j=0;j ingItemInst = nullptr; + std::shared_ptr ingItemInst = nullptr; // do we need to remove a specific aux value? if(pRecipeIngredientsRequired[iRecipe].iIngAuxValA[i]!=Recipes::ANY_AUX_VALUE) { @@ -1568,13 +1568,13 @@ void PlayerConnection::handleCraftItem(shared_ptr packet) if (ingItemInst->getItem()->hasCraftingRemainingItem()) { // replace item with remaining result - player->inventory->add( shared_ptr( new ItemInstance(ingItemInst->getItem()->getCraftingRemainingItem()) ) ); + player->inventory->add( std::shared_ptr( new ItemInstance(ingItemInst->getItem()->getCraftingRemainingItem()) ) ); } } } } - + // 4J Stu - Fix for #13119 - We should add the item after we remove the ingredients if(player->inventory->add(pTempItemInst)==false ) { @@ -1586,7 +1586,7 @@ void PlayerConnection::handleCraftItem(shared_ptr packet) { // 4J Stu - Maps need to have their aux value update, so the client should always be assumed to be wrong // This is how the Java works, as the client also incorrectly predicts the auxvalue of the mapItem - vector > items; + vector > items; for (unsigned int i = 0; i < player->containerMenu->slots->size(); i++) { items.push_back(player->containerMenu->slots->at(i)->getItem()); @@ -1625,7 +1625,7 @@ void PlayerConnection::handleCraftItem(shared_ptr packet) } -void PlayerConnection::handleTradeItem(shared_ptr packet) +void PlayerConnection::handleTradeItem(std::shared_ptr packet) { if (player->containerMenu->containerId == packet->containerId) { @@ -1642,8 +1642,8 @@ void PlayerConnection::handleTradeItem(shared_ptr packet) if(!activeRecipe->isDeprecated()) { // Do we have the ingredients? - shared_ptr buyAItem = activeRecipe->getBuyAItem(); - shared_ptr buyBItem = activeRecipe->getBuyBItem(); + std::shared_ptr buyAItem = activeRecipe->getBuyAItem(); + std::shared_ptr buyBItem = activeRecipe->getBuyBItem(); int buyAMatches = player->inventory->countMatches(buyAItem); int buyBMatches = player->inventory->countMatches(buyBItem); @@ -1656,8 +1656,8 @@ void PlayerConnection::handleTradeItem(shared_ptr packet) player->inventory->removeResources(buyBItem); // Add the item we have purchased - shared_ptr result = activeRecipe->getSellItem()->copy(); - + std::shared_ptr result = activeRecipe->getSellItem()->copy(); + // 4J JEV - Award itemsBought stat. player->awardStat( GenericStats::itemsBought(result->getItem()->id), @@ -1667,7 +1667,7 @@ void PlayerConnection::handleTradeItem(shared_ptr packet) result->GetCount() ) ); - + if (!player->inventory->add(result)) { player->drop(result); @@ -1687,7 +1687,7 @@ INetworkPlayer *PlayerConnection::getNetworkPlayer() bool PlayerConnection::isLocal() { - if( connection->getSocket() == NULL ) + if( connection->getSocket() == NULL ) { return false; } @@ -1700,7 +1700,7 @@ bool PlayerConnection::isLocal() bool PlayerConnection::isGuest() { - if( connection->getSocket() == NULL ) + if( connection->getSocket() == NULL ) { return false; } diff --git a/Minecraft.Client/PlayerConnection.h b/Minecraft.Client/PlayerConnection.h index d7b56a83..c00ee1c1 100644 --- a/Minecraft.Client/PlayerConnection.h +++ b/Minecraft.Client/PlayerConnection.h @@ -24,7 +24,7 @@ public: private: MinecraftServer *server; - shared_ptr player; + std::shared_ptr player; int tickCount; int aboveGroundTickCount; @@ -39,7 +39,7 @@ private: bool m_bHasClientTickedOnce; public: - PlayerConnection(MinecraftServer *server, Connection *connection, shared_ptr player); + PlayerConnection(MinecraftServer *server, Connection *connection, std::shared_ptr player); ~PlayerConnection(); void tick(); void disconnect(DisconnectPacket::eDisconnectReason reason); @@ -49,32 +49,32 @@ private: bool synched; public: - virtual void handlePlayerInput(shared_ptr packet); - virtual void handleMovePlayer(shared_ptr packet); + virtual void handlePlayerInput(std::shared_ptr packet); + virtual void handleMovePlayer(std::shared_ptr packet); void teleport(double x, double y, double z, float yRot, float xRot, bool sendPacket = true); // 4J Added sendPacket param - virtual void handlePlayerAction(shared_ptr packet); - virtual void handleUseItem(shared_ptr packet); + virtual void handlePlayerAction(std::shared_ptr packet); + virtual void handleUseItem(std::shared_ptr packet); virtual void onDisconnect(DisconnectPacket::eDisconnectReason reason, void *reasonObjects); - virtual void onUnhandledPacket(shared_ptr packet); - void send(shared_ptr packet); - void queueSend(shared_ptr packet); // 4J Added - virtual void handleSetCarriedItem(shared_ptr packet); - virtual void handleChat(shared_ptr packet); + virtual void onUnhandledPacket(std::shared_ptr packet); + void send(std::shared_ptr packet); + void queueSend(std::shared_ptr packet); // 4J Added + virtual void handleSetCarriedItem(std::shared_ptr packet); + virtual void handleChat(std::shared_ptr packet); private: void handleCommand(const wstring& message); public: - virtual void handleAnimate(shared_ptr packet); - virtual void handlePlayerCommand(shared_ptr packet); - virtual void handleDisconnect(shared_ptr packet); + virtual void handleAnimate(std::shared_ptr packet); + virtual void handlePlayerCommand(std::shared_ptr packet); + virtual void handleDisconnect(std::shared_ptr packet); int countDelayedPackets(); virtual void info(const wstring& string); virtual void warn(const wstring& string); virtual wstring getConsoleName(); - virtual void handleInteract(shared_ptr packet); + virtual void handleInteract(std::shared_ptr packet); bool canHandleAsyncPackets(); - virtual void handleClientCommand(shared_ptr packet); - virtual void handleRespawn(shared_ptr packet); - virtual void handleContainerClose(shared_ptr packet); + virtual void handleClientCommand(std::shared_ptr packet); + virtual void handleRespawn(std::shared_ptr packet); + virtual void handleContainerClose(std::shared_ptr packet); private: unordered_map expectedAcks; @@ -82,38 +82,38 @@ private: public: // 4J Stu - Handlers only valid in debug mode #ifndef _CONTENT_PACKAGE - virtual void handleContainerSetSlot(shared_ptr packet); + virtual void handleContainerSetSlot(std::shared_ptr packet); #endif - virtual void handleContainerClick(shared_ptr packet); - virtual void handleContainerButtonClick(shared_ptr packet); - virtual void handleSetCreativeModeSlot(shared_ptr packet); - virtual void handleContainerAck(shared_ptr packet); - virtual void handleSignUpdate(shared_ptr packet); - virtual void handleKeepAlive(shared_ptr packet); - virtual void handlePlayerInfo(shared_ptr packet); // 4J Added + virtual void handleContainerClick(std::shared_ptr packet); + virtual void handleContainerButtonClick(std::shared_ptr packet); + virtual void handleSetCreativeModeSlot(std::shared_ptr packet); + virtual void handleContainerAck(std::shared_ptr packet); + virtual void handleSignUpdate(std::shared_ptr packet); + virtual void handleKeepAlive(std::shared_ptr packet); + virtual void handlePlayerInfo(std::shared_ptr packet); // 4J Added virtual bool isServerPacketListener(); - virtual void handlePlayerAbilities(shared_ptr playerAbilitiesPacket); - virtual void handleCustomPayload(shared_ptr customPayloadPacket); + virtual void handlePlayerAbilities(std::shared_ptr playerAbilitiesPacket); + virtual void handleCustomPayload(std::shared_ptr customPayloadPacket); // 4J Added - virtual void handleCraftItem(shared_ptr packet); - virtual void handleTradeItem(shared_ptr packet); - virtual void handleDebugOptions(shared_ptr packet); - virtual void handleTexture(shared_ptr packet); - virtual void handleTextureAndGeometry(shared_ptr packet); - virtual void handleTextureChange(shared_ptr packet); - virtual void handleTextureAndGeometryChange(shared_ptr packet); - virtual void handleServerSettingsChanged(shared_ptr packet); - virtual void handleKickPlayer(shared_ptr packet); - virtual void handleGameCommand(shared_ptr packet); + virtual void handleCraftItem(std::shared_ptr packet); + virtual void handleTradeItem(std::shared_ptr packet); + virtual void handleDebugOptions(std::shared_ptr packet); + virtual void handleTexture(std::shared_ptr packet); + virtual void handleTextureAndGeometry(std::shared_ptr packet); + virtual void handleTextureChange(std::shared_ptr packet); + virtual void handleTextureAndGeometryChange(std::shared_ptr packet); + virtual void handleServerSettingsChanged(std::shared_ptr packet); + virtual void handleKickPlayer(std::shared_ptr packet); + virtual void handleGameCommand(std::shared_ptr packet); INetworkPlayer *getNetworkPlayer(); bool isLocal(); bool isGuest(); // 4J Added as we need to set this from outside sometimes - void setPlayer(shared_ptr player) { this->player = player; } - shared_ptr getPlayer() { return player; } + void setPlayer(std::shared_ptr player) { this->player = player; } + std::shared_ptr getPlayer() { return player; } // 4J Added to signal a disconnect from another thread void closeOnTick() { m_bCloseOnTick = true; } diff --git a/Minecraft.Client/PlayerList.cpp b/Minecraft.Client/PlayerList.cpp index 7921cbf8..9beea76b 100644 --- a/Minecraft.Client/PlayerList.cpp +++ b/Minecraft.Client/PlayerList.cpp @@ -54,7 +54,7 @@ PlayerList::PlayerList(MinecraftServer *server) maxPlayers = server->settings->getInt(L"max-players", 20); doWhiteList = false; - + InitializeCriticalSection(&m_kickPlayersCS); InitializeCriticalSection(&m_closePlayersCS); } @@ -72,7 +72,7 @@ PlayerList::~PlayerList() DeleteCriticalSection(&m_closePlayersCS); } -void PlayerList::placeNewPlayer(Connection *connection, shared_ptr player, shared_ptr packet) +void PlayerList::placeNewPlayer(Connection *connection, std::shared_ptr player, std::shared_ptr packet) { bool newPlayer = load(player); player->setLevel(server->getLevel(player->dimension)); @@ -82,7 +82,7 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr INetworkPlayer *networkPlayer = connection->getSocket()->getPlayer(); if(networkPlayer != NULL && networkPlayer->IsHost()) { - player->enableAllPlayerPrivileges(true); + player->enableAllPlayerPrivileges(true); player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_HOST,1); } @@ -127,8 +127,8 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr player->setCustomCape( packet->m_playerCapeId ); // 4J-JEV: Moved this here so we can send player-model texture and geometry data. - shared_ptr playerConnection = shared_ptr(new PlayerConnection(server, connection, player)); - //player->connection = playerConnection; // Used to be assigned in PlayerConnection ctor but moved out so we can use shared_ptr + std::shared_ptr playerConnection = std::shared_ptr(new PlayerConnection(server, connection, player)); + //player->connection = playerConnection; // Used to be assigned in PlayerConnection ctor but moved out so we can use std::shared_ptr if(newPlayer) { @@ -143,7 +143,7 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr int centreZC = 0; #endif // 4J Added - Give every player a map the first time they join a server - player->inventory->setItem( 9, shared_ptr( new ItemInstance(Item::map_Id, 1, level->getAuxValueForMap(player->getXuid(),0,centreXC, centreZC, mapScale ) ) ) ); + player->inventory->setItem( 9, std::shared_ptr( new ItemInstance(Item::map_Id, 1, level->getAuxValueForMap(player->getXuid(),0,centreXC, centreZC, mapScale ) ) ) ); if(app.getGameRuleDefinitions() != NULL) { app.getGameRuleDefinitions()->postProcessPlayer(player); @@ -157,11 +157,11 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr #ifndef _CONTENT_PACKAGE wprintf(L"Sending texture packet to get custom skin %ls from player %ls\n",player->customTextureUrl.c_str(), player->name.c_str()); #endif - playerConnection->send(shared_ptr( new TextureAndGeometryPacket(player->customTextureUrl,NULL,0) ) ); + playerConnection->send(std::shared_ptr( new TextureAndGeometryPacket(player->customTextureUrl,NULL,0) ) ); } } else if(!player->customTextureUrl.empty() && app.IsFileInMemoryTextures(player->customTextureUrl)) - { + { // Update the ref count on the memory texture data app.AddMemoryTextureFile(player->customTextureUrl,NULL,0); } @@ -173,11 +173,11 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr #ifndef _CONTENT_PACKAGE wprintf(L"Sending texture packet to get custom skin %ls from player %ls\n",player->customTextureUrl2.c_str(), player->name.c_str()); #endif - playerConnection->send(shared_ptr( new TexturePacket(player->customTextureUrl2,NULL,0) ) ); + playerConnection->send(std::shared_ptr( new TexturePacket(player->customTextureUrl2,NULL,0) ) ); } } else if(!player->customTextureUrl2.empty() && app.IsFileInMemoryTextures(player->customTextureUrl2)) - { + { // Update the ref count on the memory texture data app.AddMemoryTextureFile(player->customTextureUrl2,NULL,0); } @@ -196,8 +196,8 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_CreativeMode,player->gameMode->getGameModeForPlayer()->getId() ); } - //shared_ptr playerConnection = shared_ptr(new PlayerConnection(server, connection, player)); - player->connection = playerConnection; // Used to be assigned in PlayerConnection ctor but moved out so we can use shared_ptr + //std::shared_ptr playerConnection = std::shared_ptr(new PlayerConnection(server, connection, player)); + player->connection = playerConnection; // Used to be assigned in PlayerConnection ctor but moved out so we can use std::shared_ptr // 4J Added to store UGC settings playerConnection->m_friendsOnlyUGC = packet->m_friendsOnlyUGC; @@ -209,19 +209,19 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr addPlayerToReceiving( player ); - playerConnection->send( shared_ptr( new LoginPacket(L"", player->entityId, level->getLevelData()->getGenerator(), level->getSeed(), player->gameMode->getGameModeForPlayer()->getId(), + playerConnection->send( std::shared_ptr( new LoginPacket(L"", player->entityId, level->getLevelData()->getGenerator(), level->getSeed(), player->gameMode->getGameModeForPlayer()->getId(), (byte) level->dimension->id, (byte) level->getMaxBuildHeight(), (byte) getMaxPlayers(), level->difficulty, TelemetryManager->GetMultiplayerInstanceID(), (BYTE)playerIndex, level->useNewSeaLevel(), player->getAllPlayerGamePrivileges(), level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale() ) ) ); - playerConnection->send( shared_ptr( new SetSpawnPositionPacket(spawnPos->x, spawnPos->y, spawnPos->z) ) ); - playerConnection->send( shared_ptr( new PlayerAbilitiesPacket(&player->abilities)) ); + playerConnection->send( std::shared_ptr( new SetSpawnPositionPacket(spawnPos->x, spawnPos->y, spawnPos->z) ) ); + playerConnection->send( std::shared_ptr( new PlayerAbilitiesPacket(&player->abilities)) ); delete spawnPos; sendLevelInfo(player, level); // 4J-PB - removed, since it needs to be localised in the language the client is in - //server->players->broadcastAll( shared_ptr( new ChatPacket(L"§e" + playerEntity->name + L" joined the game.") ) ); - broadcastAll( shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerJoinedGame) ) ); + //server->players->broadcastAll( std::shared_ptr( new ChatPacket(L"�e" + playerEntity->name + L" joined the game.") ) ); + broadcastAll( std::shared_ptr( new ChatPacket(player->name, ChatPacket::e_ChatPlayerJoinedGame) ) ); MemSect(14); add(player); @@ -231,13 +231,13 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr playerConnection->teleport(player->x, player->y, player->z, player->yRot, player->xRot); server->getConnection()->addPlayerConnection(playerConnection); - playerConnection->send( shared_ptr( new SetTimePacket(level->getTime()) ) ); + playerConnection->send( std::shared_ptr( new SetTimePacket(level->getTime()) ) ); AUTO_VAR(activeEffects, player->getActiveEffects()); for(AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); ++it) { MobEffectInstance *effect = *it; - playerConnection->send(shared_ptr( new UpdateMobEffectPacket(player->entityId, effect) ) ); + playerConnection->send(std::shared_ptr( new UpdateMobEffectPacket(player->entityId, effect) ) ); } player->initMenu(); @@ -249,7 +249,7 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr { for(AUTO_VAR(it, players.begin()); it != players.end(); ++it) { - shared_ptr servPlayer = *it; + std::shared_ptr servPlayer = *it; INetworkPlayer *checkPlayer = servPlayer->connection->getNetworkPlayer(); if(thisPlayer != checkPlayer && checkPlayer != NULL && thisPlayer->IsSameSystem( checkPlayer ) && servPlayer->wonGame ) { @@ -265,7 +265,7 @@ void PlayerList::setLevel(ServerLevelArray levels) playerIo = levels[0]->getLevelStorage()->getPlayerIO(); } -void PlayerList::changeDimension(shared_ptr player, ServerLevel *from) +void PlayerList::changeDimension(std::shared_ptr player, ServerLevel *from) { ServerLevel *to = player->getLevel(); @@ -281,12 +281,12 @@ int PlayerList::getMaxRange() } // 4J Changed return val to bool to check if new player or loaded player -bool PlayerList::load(shared_ptr player) +bool PlayerList::load(std::shared_ptr player) { return playerIo->load(player); } -void PlayerList::save(shared_ptr player) +void PlayerList::save(std::shared_ptr player) { playerIo->save(player); } @@ -295,7 +295,7 @@ void PlayerList::save(shared_ptr player) // Add this function to take some of the code from the PlayerList::add function with the fixes // for checking spawn area, especially in the nether. These needed to be done in a different order from before // Fix for #13150 - When a player loads/joins a game after saving/leaving in the nether, sometimes they are spawned on top of the nether and cannot mine down -void PlayerList::validatePlayerSpawnPosition(shared_ptr player) +void PlayerList::validatePlayerSpawnPosition(std::shared_ptr player) { // 4J Stu - Some adjustments to make sure the current players position is correct // Make sure that the player is on the ground, and in the centre x/z of the current column @@ -354,17 +354,17 @@ void PlayerList::validatePlayerSpawnPosition(shared_ptr player) { player->setPos(player->x, player->y + 1, player->z); } - + app.DebugPrintf("Updated pos is %f, %f, %f in dimension %d\n", player->x, player->y, player->z, player->dimension); } } -void PlayerList::add(shared_ptr player) +void PlayerList::add(std::shared_ptr player) { - //broadcastAll(shared_ptr( new PlayerInfoPacket(player->name, true, 1000) ) ); + //broadcastAll(std::shared_ptr( new PlayerInfoPacket(player->name, true, 1000) ) ); if( player->connection->getNetworkPlayer() ) { - broadcastAll(shared_ptr( new PlayerInfoPacket( player ) ) ); + broadcastAll(std::shared_ptr( new PlayerInfoPacket( player ) ) ); } players.push_back(player); @@ -380,42 +380,42 @@ void PlayerList::add(shared_ptr player) // Some code from here has been moved to the above validatePlayerSpawnPosition function // 4J Stu - Swapped these lines about so that we get the chunk visiblity packet way ahead of all the add tracked entity packets - // Fix for #9169 - ART : Sign text is replaced with the words “Awaiting approval”. + // Fix for #9169 - ART : Sign text is replaced with the words �Awaiting approval�. changeDimension(player, NULL); level->addEntity(player); for (int i = 0; i < players.size(); i++) { - shared_ptr op = players.at(i); - //player->connection->send(shared_ptr( new PlayerInfoPacket(op->name, true, op->latency) ) ); + std::shared_ptr op = players.at(i); + //player->connection->send(std::shared_ptr( new PlayerInfoPacket(op->name, true, op->latency) ) ); if( op->connection->getNetworkPlayer() ) { - player->connection->send(shared_ptr( new PlayerInfoPacket( op ) ) ); + player->connection->send(std::shared_ptr( new PlayerInfoPacket( op ) ) ); } } if(level->isAtLeastOnePlayerSleeping()) { - shared_ptr firstSleepingPlayer = nullptr; + std::shared_ptr firstSleepingPlayer = nullptr; for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr thisPlayer = players[i]; + std::shared_ptr thisPlayer = players[i]; if(thisPlayer->isSleeping()) { - if(firstSleepingPlayer == NULL) firstSleepingPlayer = thisPlayer; - thisPlayer->connection->send(shared_ptr( new ChatPacket(thisPlayer->name, ChatPacket::e_ChatBedMeSleep))); + if(firstSleepingPlayer == NULL) firstSleepingPlayer = thisPlayer; + thisPlayer->connection->send(std::shared_ptr( new ChatPacket(thisPlayer->name, ChatPacket::e_ChatBedMeSleep))); } } - player->connection->send(shared_ptr( new ChatPacket(firstSleepingPlayer->name, ChatPacket::e_ChatBedPlayerSleep))); + player->connection->send(std::shared_ptr( new ChatPacket(firstSleepingPlayer->name, ChatPacket::e_ChatBedPlayerSleep))); } } -void PlayerList::move(shared_ptr player) +void PlayerList::move(std::shared_ptr player) { player->getLevel()->getChunkMap()->move(player); } -void PlayerList::remove(shared_ptr player) +void PlayerList::remove(std::shared_ptr player) { save(player); //4J Stu - We don't want to save the map data for guests, so when we are sure that the player is gone delete the map @@ -428,7 +428,7 @@ void PlayerList::remove(shared_ptr player) { players.erase(it); } - //broadcastAll(shared_ptr( new PlayerInfoPacket(player->name, false, 9999) ) ); + //broadcastAll(std::shared_ptr( new PlayerInfoPacket(player->name, false, 9999) ) ); removePlayerFromReceiving(player); player->connection = nullptr; // Must remove reference to connection, or else there is a circular dependency @@ -439,15 +439,15 @@ void PlayerList::remove(shared_ptr player) saveAll(NULL,false); } -shared_ptr PlayerList::getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID onlineXuid) +std::shared_ptr PlayerList::getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID onlineXuid) { if (players.size() >= maxPlayers) { pendingConnection->disconnect(DisconnectPacket::eDisconnect_ServerFull); - return shared_ptr(); + return std::shared_ptr(); } - - shared_ptr player = shared_ptr(new ServerPlayer(server, server->getLevel(0), userName, new ServerPlayerGameMode(server->getLevel(0)) )); + + std::shared_ptr player = std::shared_ptr(new ServerPlayer(server, server->getLevel(0), userName, new ServerPlayerGameMode(server->getLevel(0)) )); player->gameMode->player = player; // 4J added as had to remove this assignment from ServerPlayer ctor player->setXuid( xuid ); // 4J Added player->setOnlineXuid( onlineXuid ); // 4J Added @@ -469,9 +469,9 @@ shared_ptr PlayerList::getPlayerForLogin(PendingConnection *pendin return player; } -shared_ptr PlayerList::respawn(shared_ptr serverPlayer, int targetDimension, bool keepAllPlayerData) +std::shared_ptr PlayerList::respawn(std::shared_ptr serverPlayer, int targetDimension, bool keepAllPlayerData) { - // How we handle the entity tracker depends on whether we are the primary player currently, and whether there will be any player in the same system in the same dimension once we finish respawning. + // How we handle the entity tracker depends on whether we are the primary player currently, and whether there will be any player in the same system in the same dimension once we finish respawning. bool isPrimary = canReceiveAllPackets(serverPlayer); // Is this the primary player in its current dimension? int oldDimension = serverPlayer->dimension; bool isEmptying = ( targetDimension != oldDimension); // We're not emptying this dimension on this machine if this player is going back into the same dimension @@ -483,7 +483,7 @@ shared_ptr PlayerList::respawn(shared_ptr serverPlay for( unsigned int i = 0; i < players.size(); i++ ) { - shared_ptr ep = players[i]; + std::shared_ptr ep = players[i]; if( ep == serverPlayer ) continue; if( ep->dimension != oldDimension ) continue; @@ -539,8 +539,8 @@ shared_ptr PlayerList::respawn(shared_ptr serverPlay PlayerUID playerXuid = serverPlayer->getXuid(); PlayerUID playerOnlineXuid = serverPlayer->getOnlineXuid(); - - shared_ptr player = shared_ptr(new ServerPlayer(server, server->getLevel(serverPlayer->dimension), serverPlayer->name, new ServerPlayerGameMode(server->getLevel(serverPlayer->dimension)))); + + std::shared_ptr player = std::shared_ptr(new ServerPlayer(server, server->getLevel(serverPlayer->dimension), serverPlayer->name, new ServerPlayerGameMode(server->getLevel(serverPlayer->dimension)))); player->restoreFrom(serverPlayer, keepAllPlayerData); if (keepAllPlayerData) { @@ -598,7 +598,7 @@ shared_ptr PlayerList::respawn(shared_ptr serverPlay } else { - player->connection->send( shared_ptr( new GameEventPacket(GameEventPacket::NO_RESPAWN_BED_AVAILABLE, 0) ) ); + player->connection->send( std::shared_ptr( new GameEventPacket(GameEventPacket::NO_RESPAWN_BED_AVAILABLE, 0) ) ); } delete bedPosition; } @@ -611,7 +611,7 @@ shared_ptr PlayerList::respawn(shared_ptr serverPlay player->setPos(player->x, player->y + 1, player->z); } - player->connection->send( shared_ptr( new RespawnPacket((char) player->dimension, player->level->getSeed(), player->level->getMaxBuildHeight(), + player->connection->send( std::shared_ptr( new RespawnPacket((char) player->dimension, player->level->getSeed(), player->level->getMaxBuildHeight(), player->gameMode->getGameModeForPlayer(), level->difficulty, level->getLevelData()->getGenerator(), player->level->useNewSeaLevel(), player->entityId, level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale()) ) ); player->connection->teleport(player->x, player->y, player->z, player->yRot, player->xRot); @@ -623,7 +623,7 @@ shared_ptr PlayerList::respawn(shared_ptr serverPlay { MobEffectInstance *effect = *it; - player->connection->send(shared_ptr( new UpdateMobEffectPacket(player->entityId, effect) ) ); + player->connection->send(std::shared_ptr( new UpdateMobEffectPacket(player->entityId, effect) ) ); } delete activeEffects; player->getEntityData()->markDirty(Mob::DATA_EFFECT_COLOR_ID); @@ -639,7 +639,7 @@ shared_ptr PlayerList::respawn(shared_ptr serverPlay // 4J-JEV - Dying before this point in the tutorial is pretty annoying, // making sure to remove health/hunger and give you back your meat. - if( Minecraft::GetInstance()->isTutorial() + if( Minecraft::GetInstance()->isTutorial() && (!Minecraft::GetInstance()->gameMode->getTutorial()->isStateCompleted(e_Tutorial_State_Food_Bar)) ) { app.getGameRuleDefinitions()->postProcessPlayer(player); @@ -654,10 +654,10 @@ shared_ptr PlayerList::respawn(shared_ptr serverPlay } -void PlayerList::toggleDimension(shared_ptr player, int targetDimension) +void PlayerList::toggleDimension(std::shared_ptr player, int targetDimension) { int lastDimension = player->dimension; - // How we handle the entity tracker depends on whether we are the primary player currently, and whether there will be any player in the same system in the same dimension once we finish respawning. + // How we handle the entity tracker depends on whether we are the primary player currently, and whether there will be any player in the same system in the same dimension once we finish respawning. bool isPrimary = canReceiveAllPackets(player); // Is this the primary player in its current dimension? bool isEmptying = true; @@ -666,7 +666,7 @@ void PlayerList::toggleDimension(shared_ptr player, int targetDime for( unsigned int i = 0; i < players.size(); i++ ) { - shared_ptr ep = players[i]; + std::shared_ptr ep = players[i]; if( ep == player ) continue; if( ep->dimension != lastDimension ) continue; @@ -728,7 +728,7 @@ void PlayerList::toggleDimension(shared_ptr player, int targetDime // 4J Stu Added so that we remove entities from the correct level, after the respawn packet we will be in the wrong level player->flushEntitiesToRemove(); - player->connection->send( shared_ptr( new RespawnPacket((char) player->dimension, newLevel->getSeed(), newLevel->getMaxBuildHeight(), + player->connection->send( std::shared_ptr( new RespawnPacket((char) player->dimension, newLevel->getSeed(), newLevel->getMaxBuildHeight(), player->gameMode->getGameModeForPlayer(), newLevel->difficulty, newLevel->getLevelData()->getGenerator(), newLevel->useNewSeaLevel(), player->entityId, newLevel->getLevelData()->getXZSize(), newLevel->getLevelData()->getHellScale()) ) ); @@ -772,7 +772,7 @@ void PlayerList::toggleDimension(shared_ptr player, int targetDime oldLevel->tick(player, false); } } - + removePlayerFromReceiving(player, false, lastDimension); addPlayerToReceiving(player); @@ -807,7 +807,7 @@ void PlayerList::toggleDimension(shared_ptr player, int targetDime // Force sending of the current chunk player->doTick(true, true, true); } - + player->connection->teleport(player->x, player->y, player->z, player->yRot, player->xRot); // 4J Stu - Fix for #64683 - Customer Encountered: TU7: Content: Gameplay: Potion effects are removed after using the Nether Portal @@ -816,7 +816,7 @@ void PlayerList::toggleDimension(shared_ptr player, int targetDime { MobEffectInstance *effect = *it; - player->connection->send(shared_ptr( new UpdateMobEffectPacket(player->entityId, effect) ) ); + player->connection->send(std::shared_ptr( new UpdateMobEffectPacket(player->entityId, effect) ) ); } delete activeEffects; player->getEntityData()->markDirty(Mob::DATA_EFFECT_COLOR_ID); @@ -833,13 +833,13 @@ void PlayerList::tick() sendAllPlayerInfoIn = 0; } - if (sendAllPlayerInfoIn < players.size()) + if (sendAllPlayerInfoIn < players.size()) { - shared_ptr op = players[sendAllPlayerInfoIn]; - //broadcastAll(shared_ptr( new PlayerInfoPacket(op->name, true, op->latency) ) ); + std::shared_ptr op = players[sendAllPlayerInfoIn]; + //broadcastAll(std::shared_ptr( new PlayerInfoPacket(op->name, true, op->latency) ) ); if( op->connection->getNetworkPlayer() ) { - broadcastAll(shared_ptr( new PlayerInfoPacket( op ) ) ); + broadcastAll(std::shared_ptr( new PlayerInfoPacket( op ) ) ); } } @@ -849,11 +849,11 @@ void PlayerList::tick() BYTE smallId = m_smallIdsToClose.front(); m_smallIdsToClose.pop_front(); - shared_ptr player = nullptr; + std::shared_ptr player = nullptr; for(unsigned int i = 0; i < players.size(); i++) { - shared_ptr p = players.at(i); + std::shared_ptr p = players.at(i); // 4J Stu - May be being a bit overprotective with all the NULL checks, but adding late in TU7 so want to be safe if (p != NULL && p->connection != NULL && p->connection->connection != NULL && p->connection->connection->getSocket() != NULL && p->connection->connection->getSocket()->getSmallId() == smallId ) { @@ -882,11 +882,11 @@ void PlayerList::tick() //#ifdef _XBOX PlayerUID xuid = selectedPlayer->GetUID(); // Kick this player from the game - shared_ptr player = nullptr; + std::shared_ptr player = nullptr; for(unsigned int i = 0; i < players.size(); i++) { - shared_ptr p = players.at(i); + std::shared_ptr p = players.at(i); PlayerUID playersXuid = p->getOnlineXuid(); if (p != NULL && ProfileManager.AreXUIDSEqual(playersXuid, xuid ) ) { @@ -901,7 +901,7 @@ void PlayerList::tick() // 4J Stu - If we have kicked a player, make sure that they have no privileges if they later try to join the world when trust players is off player->enableAllPlayerPrivileges( false ); player->connection->setWasKicked(); - player->connection->send( shared_ptr( new DisconnectPacket(DisconnectPacket::eDisconnect_Kicked) )); + player->connection->send( std::shared_ptr( new DisconnectPacket(DisconnectPacket::eDisconnect_Kicked) )); } //#endif } @@ -914,10 +914,10 @@ void PlayerList::tick() { for(unsigned int i = 0; i < receiveAllPlayers[dim].size(); ++i) { - shared_ptr currentPlayer = receiveAllPlayers[dim][i]; + std::shared_ptr currentPlayer = receiveAllPlayers[dim][i]; if(currentPlayer->removed) { - shared_ptr newPlayer = findAlivePlayerOnSystem(currentPlayer); + std::shared_ptr newPlayer = findAlivePlayerOnSystem(currentPlayer); if(newPlayer != NULL) { receiveAllPlayers[dim][i] = newPlayer; @@ -939,20 +939,20 @@ void PlayerList::prioritiseTileChanges(int x, int y, int z, int dimension) server->getLevel(dimension)->getChunkMap()->prioritiseTileChanges(x, y, z); } -void PlayerList::broadcastAll(shared_ptr packet) +void PlayerList::broadcastAll(std::shared_ptr packet) { for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr player = players[i]; + std::shared_ptr player = players[i]; player->connection->send(packet); } } -void PlayerList::broadcastAll(shared_ptr packet, int dimension) +void PlayerList::broadcastAll(std::shared_ptr packet, int dimension) { for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr player = players[i]; + std::shared_ptr player = players[i]; if (player->dimension == dimension) player->connection->send(packet); } } @@ -978,7 +978,7 @@ bool PlayerList::isOp(const wstring& name) return false; } -bool PlayerList::isOp(shared_ptr player) +bool PlayerList::isOp(std::shared_ptr player) { bool cheatsEnabled = app.GetGameHostOption(eGameHostOption_CheatsEnabled); #ifdef _DEBUG_MENUS_ENABLED @@ -989,11 +989,11 @@ bool PlayerList::isOp(shared_ptr player) return isOp; } -shared_ptr PlayerList::getPlayer(const wstring& name) +std::shared_ptr PlayerList::getPlayer(const wstring& name) { - for (unsigned int i = 0; i < players.size(); i++) + for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr p = players[i]; + std::shared_ptr p = players[i]; if (p->name == name) // 4J - used to be case insensitive (using equalsIgnoreCase) - imagine we'll be shifting to XUIDs anyway { return p; @@ -1003,11 +1003,11 @@ shared_ptr PlayerList::getPlayer(const wstring& name) } // 4J Added -shared_ptr PlayerList::getPlayer(PlayerUID uid) +std::shared_ptr PlayerList::getPlayer(PlayerUID uid) { - for (unsigned int i = 0; i < players.size(); i++) + for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr p = players[i]; + std::shared_ptr p = players[i]; if (p->getXuid() == uid || p->getOnlineXuid() == uid) // 4J - used to be case insensitive (using equalsIgnoreCase) - imagine we'll be shifting to XUIDs anyway { return p; @@ -1018,23 +1018,23 @@ shared_ptr PlayerList::getPlayer(PlayerUID uid) void PlayerList::sendMessage(const wstring& name, const wstring& message) { - shared_ptr player = getPlayer(name); + std::shared_ptr player = getPlayer(name); if (player != NULL) { - player->connection->send( shared_ptr( new ChatPacket(message) ) ); + player->connection->send( std::shared_ptr( new ChatPacket(message) ) ); } } -void PlayerList::broadcast(double x, double y, double z, double range, int dimension, shared_ptr packet) +void PlayerList::broadcast(double x, double y, double z, double range, int dimension, std::shared_ptr packet) { broadcast(nullptr, x, y, z, range, dimension, packet); } -void PlayerList::broadcast(shared_ptr except, double x, double y, double z, double range, int dimension, shared_ptr packet) +void PlayerList::broadcast(std::shared_ptr except, double x, double y, double z, double range, int dimension, std::shared_ptr packet) { // 4J - altered so that we don't send to the same machine more than once. Add the source player to the machines we have "sent" to as it doesn't need to go to that // machine either - vector< shared_ptr > sentTo; + vector< std::shared_ptr > sentTo; if( except != NULL ) { sentTo.push_back(dynamic_pointer_cast(except)); @@ -1042,7 +1042,7 @@ void PlayerList::broadcast(shared_ptr except, double x, double y, double for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr p = players[i]; + std::shared_ptr p = players[i]; if (p == except) continue; if (p->dimension != dimension) continue; @@ -1057,9 +1057,9 @@ void PlayerList::broadcast(shared_ptr except, double x, double y, double } else { - for(unsigned int j = 0; j < sentTo.size(); j++ ) + for(unsigned int j = 0; j < sentTo.size(); j++ ) { - shared_ptr player2 = sentTo[j]; + std::shared_ptr player2 = sentTo[j]; INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); if( otherPlayer != NULL && thisPlayer->IsSameSystem(otherPlayer) ) { @@ -1080,7 +1080,7 @@ void PlayerList::broadcast(shared_ptr except, double x, double y, double if (xd * xd + yd * yd + zd * zd < range * range) { #if 0 // _DEBUG - shared_ptr SoundPacket= dynamic_pointer_cast(packet); + std::shared_ptr SoundPacket= dynamic_pointer_cast(packet); if(SoundPacket) { @@ -1099,10 +1099,10 @@ void PlayerList::broadcast(shared_ptr except, double x, double y, double void PlayerList::broadcastToAllOps(const wstring& message) { - shared_ptr chatPacket = shared_ptr( new ChatPacket(message) ); + std::shared_ptr chatPacket = std::shared_ptr( new ChatPacket(message) ); for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr p = players[i]; + std::shared_ptr p = players[i]; if (isOp(p->name)) { p->connection->send(chatPacket); @@ -1110,9 +1110,9 @@ void PlayerList::broadcastToAllOps(const wstring& message) } } -bool PlayerList::sendTo(const wstring& name, shared_ptr packet) +bool PlayerList::sendTo(const wstring& name, std::shared_ptr packet) { - shared_ptr player = getPlayer(name); + std::shared_ptr player = getPlayer(name); if (player != NULL) { player->connection->send(packet); @@ -1131,7 +1131,7 @@ void PlayerList::saveAll(ProgressListener *progressListener, bool bDeleteGuestMa for (unsigned int i = 0; i < players.size(); i++) { playerIo->save(players[i]); - + //4J Stu - We don't want to save the map data for guests, so when we are sure that the player is gone delete the map if(bDeleteGuestMaps && players[i]->isGuest()) playerIo->deleteMapFilesForPlayer(players[i]); @@ -1154,28 +1154,28 @@ void PlayerList::reloadWhitelist() { } -void PlayerList::sendLevelInfo(shared_ptr player, ServerLevel *level) +void PlayerList::sendLevelInfo(std::shared_ptr player, ServerLevel *level) { - player->connection->send( shared_ptr( new SetTimePacket(level->getTime()) ) ); + player->connection->send( std::shared_ptr( new SetTimePacket(level->getTime()) ) ); if (level->isRaining()) { - player->connection->send( shared_ptr( new GameEventPacket(GameEventPacket::START_RAINING, 0) ) ); + player->connection->send( std::shared_ptr( new GameEventPacket(GameEventPacket::START_RAINING, 0) ) ); } else { // 4J Stu - Fix for #44836 - Customer Encountered: Out of Sync Weather [A-10] // If it was raining when the player left the level, and is now not raining we need to make sure that state is updated - player->connection->send( shared_ptr( new GameEventPacket(GameEventPacket::STOP_RAINING, 0) ) ); + player->connection->send( std::shared_ptr( new GameEventPacket(GameEventPacket::STOP_RAINING, 0) ) ); } - // send the stronghold position if there is one + // send the stronghold position if there is one if((level->dimension->id==0) && level->getLevelData()->getHasStronghold()) { - player->connection->send( shared_ptr( new XZPacket(XZPacket::STRONGHOLD,level->getLevelData()->getXStronghold(),level->getLevelData()->getZStronghold()) ) ); + player->connection->send( std::shared_ptr( new XZPacket(XZPacket::STRONGHOLD,level->getLevelData()->getXStronghold(),level->getLevelData()->getZStronghold()) ) ); } } -void PlayerList::sendAllPlayerInfo(shared_ptr player) +void PlayerList::sendAllPlayerInfo(std::shared_ptr player) { player->refreshContainer(player->inventoryMenu); player->resetSentInfo(); @@ -1218,7 +1218,7 @@ void PlayerList::setOverrideGameMode(GameType *gameMode) this->overrideGameMode = gameMode; } -void PlayerList::updatePlayerGameMode(shared_ptr newPlayer, shared_ptr oldPlayer, Level *level) +void PlayerList::updatePlayerGameMode(std::shared_ptr newPlayer, std::shared_ptr oldPlayer, Level *level) { // reset the player's game mode (first pick from old, then copy level if @@ -1239,7 +1239,7 @@ void PlayerList::setAllowCheatsForAllPlayers(bool allowCommands) this->allowCheatsForAllPlayers = allowCommands; } -shared_ptr PlayerList::findAlivePlayerOnSystem(shared_ptr player) +std::shared_ptr PlayerList::findAlivePlayerOnSystem(std::shared_ptr player) { int dimIndex, playerDim; dimIndex = playerDim = player->dimension; @@ -1251,7 +1251,7 @@ shared_ptr PlayerList::findAlivePlayerOnSystem(shared_ptr newPlayer = *itP; + std::shared_ptr newPlayer = *itP; INetworkPlayer *otherPlayer = newPlayer->connection->getNetworkPlayer(); @@ -1270,7 +1270,7 @@ shared_ptr PlayerList::findAlivePlayerOnSystem(shared_ptr player, bool usePlayerDimension /*= true*/, int dimension /*= 0*/) +void PlayerList::removePlayerFromReceiving(std::shared_ptr player, bool usePlayerDimension /*= true*/, int dimension /*= 0*/) { int dimIndex, playerDim; dimIndex = playerDim = usePlayerDimension ? player->dimension : dimension; @@ -1297,7 +1297,7 @@ void PlayerList::removePlayerFromReceiving(shared_ptr player, bool { for(AUTO_VAR(itP, players.begin()); itP != players.end(); ++itP) { - shared_ptr newPlayer = *itP; + std::shared_ptr newPlayer = *itP; INetworkPlayer *otherPlayer = newPlayer->connection->getNetworkPlayer(); @@ -1324,7 +1324,7 @@ void PlayerList::removePlayerFromReceiving(shared_ptr player, bool // Re-check all active players and make sure they have someone on their system to receive all packets for(AUTO_VAR(itP, players.begin()); itP != players.end(); ++itP) { - shared_ptr newPlayer = *itP; + std::shared_ptr newPlayer = *itP; INetworkPlayer *checkingPlayer = newPlayer->connection->getNetworkPlayer(); if( checkingPlayer != NULL ) @@ -1335,7 +1335,7 @@ void PlayerList::removePlayerFromReceiving(shared_ptr player, bool bool foundPrimary = false; for(AUTO_VAR(it, receiveAllPlayers[newPlayerDim].begin()); it != receiveAllPlayers[newPlayerDim].end(); ++it) { - shared_ptr primaryPlayer = *it; + std::shared_ptr primaryPlayer = *it; INetworkPlayer *primPlayer = primaryPlayer->connection->getNetworkPlayer(); if(primPlayer != NULL && checkingPlayer->IsSameSystem( primPlayer ) ) { @@ -1355,7 +1355,7 @@ void PlayerList::removePlayerFromReceiving(shared_ptr player, bool } } -void PlayerList::addPlayerToReceiving(shared_ptr player) +void PlayerList::addPlayerToReceiving(std::shared_ptr player) { int playerDim = 0; if( player->dimension == -1 ) playerDim = 1; @@ -1380,16 +1380,16 @@ void PlayerList::addPlayerToReceiving(shared_ptr player) { for(AUTO_VAR(it, receiveAllPlayers[playerDim].begin()); it != receiveAllPlayers[playerDim].end(); ++it) { - shared_ptr oldPlayer = *it; + std::shared_ptr oldPlayer = *it; INetworkPlayer *checkingPlayer = oldPlayer->connection->getNetworkPlayer(); - if(checkingPlayer != NULL && checkingPlayer->IsSameSystem( thisPlayer ) ) + if(checkingPlayer != NULL && checkingPlayer->IsSameSystem( thisPlayer ) ) { shouldAddPlayer = false; break; } } } - + if( shouldAddPlayer ) { #ifndef _CONTENT_PACKAGE @@ -1399,14 +1399,14 @@ void PlayerList::addPlayerToReceiving(shared_ptr player) } } -bool PlayerList::canReceiveAllPackets(shared_ptr player) +bool PlayerList::canReceiveAllPackets(std::shared_ptr player) { int playerDim = 0; if( player->dimension == -1 ) playerDim = 1; else if( player->dimension == 1) playerDim = 2; for(AUTO_VAR(it, receiveAllPlayers[playerDim].begin()); it != receiveAllPlayers[playerDim].end(); ++it) { - shared_ptr newPlayer = *it; + std::shared_ptr newPlayer = *it; if(newPlayer == player) { return true; diff --git a/Minecraft.Client/PlayerList.h b/Minecraft.Client/PlayerList.h index 14bd6b2d..23b48f74 100644 --- a/Minecraft.Client/PlayerList.h +++ b/Minecraft.Client/PlayerList.h @@ -22,7 +22,7 @@ private: static const int SEND_PLAYER_INFO_INTERVAL = 20 * 10; // 4J - brought forward from 1.2.3 // public static Logger logger = Logger.getLogger("Minecraft"); public: - vector > players; + vector > players; private: MinecraftServer *server; @@ -51,60 +51,60 @@ private: int sendAllPlayerInfoIn; // 4J Added to maintain which players in which dimensions can receive all packet types - vector > receiveAllPlayers[3]; + vector > receiveAllPlayers[3]; private: - shared_ptr findAlivePlayerOnSystem(shared_ptr currentPlayer); + std::shared_ptr findAlivePlayerOnSystem(std::shared_ptr currentPlayer); public: - void removePlayerFromReceiving(shared_ptr player, bool usePlayerDimension = true, int dimension = 0); - void addPlayerToReceiving(shared_ptr player); - bool canReceiveAllPackets(shared_ptr player); + void removePlayerFromReceiving(std::shared_ptr player, bool usePlayerDimension = true, int dimension = 0); + void addPlayerToReceiving(std::shared_ptr player); + bool canReceiveAllPackets(std::shared_ptr player); public: PlayerList(MinecraftServer *server); ~PlayerList(); - void placeNewPlayer(Connection *connection, shared_ptr player, shared_ptr packet); + void placeNewPlayer(Connection *connection, std::shared_ptr player, std::shared_ptr packet); void setLevel(ServerLevelArray levels); - void changeDimension(shared_ptr player, ServerLevel *from); + void changeDimension(std::shared_ptr player, ServerLevel *from); int getMaxRange(); - bool load(shared_ptr player); // 4J Changed return val to bool to check if new player or loaded player + bool load(std::shared_ptr player); // 4J Changed return val to bool to check if new player or loaded player protected: - void save(shared_ptr player); + void save(std::shared_ptr player); public: - void validatePlayerSpawnPosition(shared_ptr player); // 4J Added - void add(shared_ptr player); - void move(shared_ptr player); - void remove(shared_ptr player); - shared_ptr getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID OnlineXuid); - shared_ptr respawn(shared_ptr serverPlayer, int targetDimension, bool keepAllPlayerData); - void toggleDimension(shared_ptr player, int targetDimension); + void validatePlayerSpawnPosition(std::shared_ptr player); // 4J Added + void add(std::shared_ptr player); + void move(std::shared_ptr player); + void remove(std::shared_ptr player); + std::shared_ptr getPlayerForLogin(PendingConnection *pendingConnection, const wstring& userName, PlayerUID xuid, PlayerUID OnlineXuid); + std::shared_ptr respawn(std::shared_ptr serverPlayer, int targetDimension, bool keepAllPlayerData); + void toggleDimension(std::shared_ptr player, int targetDimension); void tick(); bool isTrackingTile(int x, int y, int z, int dimension); // 4J added void prioritiseTileChanges(int x, int y, int z, int dimension); // 4J added - void broadcastAll(shared_ptr packet); - void broadcastAll(shared_ptr packet, int dimension); + void broadcastAll(std::shared_ptr packet); + void broadcastAll(std::shared_ptr packet, int dimension); wstring getPlayerNames(); public: bool isWhiteListed(const wstring& name); bool isOp(const wstring& name); - bool isOp(shared_ptr player); // 4J Added - shared_ptr getPlayer(const wstring& name); - shared_ptr getPlayer(PlayerUID uid); + bool isOp(std::shared_ptr player); // 4J Added + std::shared_ptr getPlayer(const wstring& name); + std::shared_ptr getPlayer(PlayerUID uid); void sendMessage(const wstring& name, const wstring& message); - void broadcast(double x, double y, double z, double range, int dimension, shared_ptr packet); - void broadcast(shared_ptr except, double x, double y, double z, double range, int dimension, shared_ptr packet); + void broadcast(double x, double y, double z, double range, int dimension, std::shared_ptr packet); + void broadcast(std::shared_ptr except, double x, double y, double z, double range, int dimension, std::shared_ptr packet); void broadcastToAllOps(const wstring& message); - bool sendTo(const wstring& name, shared_ptr packet); + bool sendTo(const wstring& name, std::shared_ptr packet); // 4J Added ProgressListener *progressListener param and bDeleteGuestMaps param void saveAll(ProgressListener *progressListener, bool bDeleteGuestMaps = false); void whiteList(const wstring& playerName); void blackList(const wstring& playerName); // Set getWhiteList(); / 4J removed void reloadWhitelist(); - void sendLevelInfo(shared_ptr player, ServerLevel *level); - void sendAllPlayerInfo(shared_ptr player); + void sendLevelInfo(std::shared_ptr player, ServerLevel *level); + void sendAllPlayerInfo(std::shared_ptr player); int getPlayerCount(); int getPlayerCount(ServerLevel *level); // 4J Added int getMaxPlayers(); @@ -113,7 +113,7 @@ public: void setOverrideGameMode(GameType *gameMode); private: - void updatePlayerGameMode(shared_ptr newPlayer, shared_ptr oldPlayer, Level *level); + void updatePlayerGameMode(std::shared_ptr newPlayer, std::shared_ptr oldPlayer, Level *level); public: void setAllowCheatsForAllPlayers(bool allowCommands); diff --git a/Minecraft.Client/PlayerRenderer.cpp b/Minecraft.Client/PlayerRenderer.cpp index c332b41c..a4455c71 100644 --- a/Minecraft.Client/PlayerRenderer.cpp +++ b/Minecraft.Client/PlayerRenderer.cpp @@ -13,7 +13,7 @@ #include "..\Minecraft.World\net.minecraft.h" #include "..\Minecraft.World\StringHelpers.h" -const unsigned int PlayerRenderer::s_nametagColors[MINECRAFT_NET_MAX_PLAYERS] = +const unsigned int PlayerRenderer::s_nametagColors[MINECRAFT_NET_MAX_PLAYERS] = { 0xff000000, // WHITE (represents the "white" player, but using black as the colour) 0xff33cc33, // GREEN @@ -46,10 +46,10 @@ unsigned int PlayerRenderer::getNametagColour(int index) return 0xFF000000; } -int PlayerRenderer::prepareArmor(shared_ptr _player, int layer, float a) +int PlayerRenderer::prepareArmor(std::shared_ptr _player, int layer, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr player = dynamic_pointer_cast(_player); + std::shared_ptr player = dynamic_pointer_cast(_player); // 4J-PB - need to disable rendering armour for some special skins (Daleks) unsigned int uiAnimOverrideBitmask=player->getAnimOverrideBitmask(); @@ -58,7 +58,7 @@ int PlayerRenderer::prepareArmor(shared_ptr _player, int layer, float a) return -1; } - shared_ptr itemInstance = player->inventory->getArmor(3 - layer); + std::shared_ptr itemInstance = player->inventory->getArmor(3 - layer); if (itemInstance != NULL) { Item *item = itemInstance->getItem(); @@ -108,11 +108,11 @@ int PlayerRenderer::prepareArmor(shared_ptr _player, int layer, float a) } -void PlayerRenderer::prepareSecondPassArmor(shared_ptr _player, int layer, float a) +void PlayerRenderer::prepareSecondPassArmor(std::shared_ptr _player, int layer, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr player = dynamic_pointer_cast(_player); - shared_ptr itemInstance = player->inventory->getArmor(3 - layer); + std::shared_ptr player = dynamic_pointer_cast(_player); + std::shared_ptr itemInstance = player->inventory->getArmor(3 - layer); if (itemInstance != NULL) { Item *item = itemInstance->getItem(); @@ -127,14 +127,14 @@ void PlayerRenderer::prepareSecondPassArmor(shared_ptr _player, int layer, } } -void PlayerRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void PlayerRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); if(mob->hasInvisiblePrivilege()) return; - shared_ptr item = mob->inventory->getSelected(); + std::shared_ptr item = mob->inventory->getSelected(); armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = item != NULL ? 1 : 0; if (item != NULL) { @@ -228,10 +228,10 @@ void PlayerRenderer::render(shared_ptr _mob, double x, double y, double } -void PlayerRenderer::renderName(shared_ptr _mob, double x, double y, double z) +void PlayerRenderer::renderName(std::shared_ptr _mob, double x, double y, double z) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); if (Minecraft::renderNames() && mob != entityRenderDispatcher->cameraEntity && !mob->isInvisibleTo(Minecraft::GetInstance()->player) ) // 4J-JEV: Todo, move to LivingEntityRenderer. @@ -256,7 +256,7 @@ void PlayerRenderer::renderName(shared_ptr _mob, double x, double y, double { if ( app.GetGameSettings(eGameSetting_DisplayHUD)==0 ) { - // 4J-PB - turn off gamertag render + // 4J-PB - turn off gamertag render return; } @@ -316,14 +316,14 @@ void PlayerRenderer::renderName(shared_ptr _mob, double x, double y, double } -void PlayerRenderer::additionalRendering(shared_ptr _mob, float a) +void PlayerRenderer::additionalRendering(std::shared_ptr _mob, float a) { MobRenderer::additionalRendering(_mob,a); // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); - shared_ptr headGear = mob->inventory->getArmor(3); + std::shared_ptr headGear = mob->inventory->getArmor(3); if (headGear != NULL) { // don't render the pumpkin for the skins @@ -426,9 +426,9 @@ void PlayerRenderer::additionalRendering(shared_ptr _mob, float a) humanoidModel->renderCloak(1 / 16.0f,true); glPopMatrix(); } - - shared_ptr item = mob->inventory->getSelected(); + + std::shared_ptr item = mob->inventory->getSelected(); if (item != NULL) { @@ -438,7 +438,7 @@ void PlayerRenderer::additionalRendering(shared_ptr _mob, float a) if (mob->fishing != NULL) { - item = shared_ptr( new ItemInstance(Item::stick) ); + item = std::shared_ptr( new ItemInstance(Item::stick) ); } UseAnim anim = UseAnim_none;//null; @@ -521,7 +521,7 @@ void PlayerRenderer::additionalRendering(shared_ptr _mob, float a) } -void PlayerRenderer::scale(shared_ptr player, float a) +void PlayerRenderer::scale(std::shared_ptr player, float a) { float s = 15 / 16.0f; glScalef(s, s, s); @@ -540,10 +540,10 @@ void PlayerRenderer::renderHand() } } -void PlayerRenderer::setupPosition(shared_ptr _mob, double x, double y, double z) +void PlayerRenderer::setupPosition(std::shared_ptr _mob, double x, double y, double z) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); if (mob->isAlive() && mob->isSleeping()) { @@ -556,10 +556,10 @@ void PlayerRenderer::setupPosition(shared_ptr _mob, double x, double y, dou } } -void PlayerRenderer::setupRotations(shared_ptr _mob, float bob, float bodyRot, float a) +void PlayerRenderer::setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); if (mob->isAlive() && mob->isSleeping()) { @@ -574,11 +574,11 @@ void PlayerRenderer::setupRotations(shared_ptr _mob, float bob, float bodyR } // 4J Added override to stop rendering shadow if player is invisible -void PlayerRenderer::renderShadow(shared_ptr e, double x, double y, double z, float pow, float a) +void PlayerRenderer::renderShadow(std::shared_ptr e, double x, double y, double z, float pow, float a) { if(app.GetGameHostOption(eGameHostOption_HostCanBeInvisible) > 0) { - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); if(player != NULL && player->hasInvisiblePrivilege()) return; } EntityRenderer::renderShadow(e,x,y,z,pow,a); diff --git a/Minecraft.Client/PlayerRenderer.h b/Minecraft.Client/PlayerRenderer.h index 10564104..0d82fb8f 100644 --- a/Minecraft.Client/PlayerRenderer.h +++ b/Minecraft.Client/PlayerRenderer.h @@ -23,20 +23,20 @@ private: static const wstring MATERIAL_NAMES[5]; protected: - virtual int prepareArmor(shared_ptr _player, int layer, float a); - virtual void prepareSecondPassArmor(shared_ptr mob, int layer, float a); + virtual int prepareArmor(std::shared_ptr _player, int layer, float a); + virtual void prepareSecondPassArmor(std::shared_ptr mob, int layer, float a); public: - virtual void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); protected: - virtual void renderName(shared_ptr _mob, double x, double y, double z); - virtual void additionalRendering(shared_ptr _mob, float a); - virtual void scale(shared_ptr _player, float a); + virtual void renderName(std::shared_ptr _mob, double x, double y, double z); + virtual void additionalRendering(std::shared_ptr _mob, float a); + virtual void scale(std::shared_ptr _player, float a); public: void renderHand(); protected: - virtual void setupPosition(shared_ptr _mob, double x, double y, double z); - virtual void setupRotations(shared_ptr _mob, float bob, float bodyRot, float a); + virtual void setupPosition(std::shared_ptr _mob, double x, double y, double z); + virtual void setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a); -private: - virtual void renderShadow(shared_ptr e, double x, double y, double z, float pow, float a); // 4J Added override +private: + virtual void renderShadow(std::shared_ptr e, double x, double y, double z, float pow, float a); // 4J Added override }; \ No newline at end of file diff --git a/Minecraft.Client/QuadrupedModel.cpp b/Minecraft.Client/QuadrupedModel.cpp index fa7e3b4b..f106607d 100644 --- a/Minecraft.Client/QuadrupedModel.cpp +++ b/Minecraft.Client/QuadrupedModel.cpp @@ -41,11 +41,11 @@ QuadrupedModel::QuadrupedModel(int legSize, float g) : Model() leg3->compile(1.0f/16.0f); } -void QuadrupedModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void QuadrupedModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); - if (young) + if (young) { float ss = 2.0f; glPushMatrix(); @@ -61,8 +61,8 @@ void QuadrupedModel::render(shared_ptr entity, float time, float r, floa leg2->render(scale, usecompiled); leg3->render(scale, usecompiled); glPopMatrix(); - } - else + } + else { head->render(scale, usecompiled); body->render(scale, usecompiled); @@ -102,7 +102,7 @@ void QuadrupedModel::render(QuadrupedModel *model, float scale, bool usecompiled leg2->xRot = model->leg2->xRot; leg3->xRot = model->leg3->xRot; - if (young) + if (young) { float ss = 2.0f; glPushMatrix(); @@ -118,8 +118,8 @@ void QuadrupedModel::render(QuadrupedModel *model, float scale, bool usecompiled leg2->render(scale, usecompiled); leg3->render(scale, usecompiled); glPopMatrix(); - } - else + } + else { head->render(scale, usecompiled); body->render(scale, usecompiled); diff --git a/Minecraft.Client/QuadrupedModel.h b/Minecraft.Client/QuadrupedModel.h index 47c50599..d1c24de7 100644 --- a/Minecraft.Client/QuadrupedModel.h +++ b/Minecraft.Client/QuadrupedModel.h @@ -7,7 +7,7 @@ public: ModelPart *head, *body, *leg0, *leg1, *leg2, *leg3; QuadrupedModel(int legSize, float g); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); void render(QuadrupedModel *model, float scale, bool usecompiled); }; \ No newline at end of file diff --git a/Minecraft.Client/ReceivingLevelScreen.cpp b/Minecraft.Client/ReceivingLevelScreen.cpp index 0e9fe3ec..1089dc51 100644 --- a/Minecraft.Client/ReceivingLevelScreen.cpp +++ b/Minecraft.Client/ReceivingLevelScreen.cpp @@ -23,7 +23,7 @@ void ReceivingLevelScreen::tick() tickCount++; if (tickCount % 20 == 0) { - connection->send( shared_ptr( new KeepAlivePacket() ) ); + connection->send( std::shared_ptr( new KeepAlivePacket() ) ); } if (connection != NULL) { diff --git a/Minecraft.Client/RemotePlayer.cpp b/Minecraft.Client/RemotePlayer.cpp index c1b72864..d5deca18 100644 --- a/Minecraft.Client/RemotePlayer.cpp +++ b/Minecraft.Client/RemotePlayer.cpp @@ -66,7 +66,7 @@ void RemotePlayer::tick() if (!hasStartedUsingItem && isUsingItemFlag() && inventory->items[inventory->selected] != NULL) { - shared_ptr item = inventory->items[inventory->selected]; + std::shared_ptr item = inventory->items[inventory->selected]; startUsingItem(inventory->items[inventory->selected], Item::items[item->id]->getUseDuration(item)); hasStartedUsingItem = true; } @@ -129,7 +129,7 @@ void RemotePlayer::aiStep() } // 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game -void RemotePlayer::setEquippedSlot(int slot, shared_ptr item) +void RemotePlayer::setEquippedSlot(int slot, std::shared_ptr item) { if (slot == 0) { diff --git a/Minecraft.Client/RemotePlayer.h b/Minecraft.Client/RemotePlayer.h index b55fab16..19076ef6 100644 --- a/Minecraft.Client/RemotePlayer.h +++ b/Minecraft.Client/RemotePlayer.h @@ -26,7 +26,7 @@ public: virtual void tick(); virtual float getShadowHeightOffs(); virtual void aiStep(); - virtual void setEquippedSlot(int slot, shared_ptr item);// 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game + virtual void setEquippedSlot(int slot, std::shared_ptr item);// 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game virtual void animateRespawn(); virtual float getHeadHeight(); bool hasPermission(EGameCommand command) { return false; } diff --git a/Minecraft.Client/ServerCommandDispatcher.cpp b/Minecraft.Client/ServerCommandDispatcher.cpp index 51dd42fe..af0271fe 100644 --- a/Minecraft.Client/ServerCommandDispatcher.cpp +++ b/Minecraft.Client/ServerCommandDispatcher.cpp @@ -52,13 +52,13 @@ ServerCommandDispatcher::ServerCommandDispatcher() Command::setLogger(this); } -void ServerCommandDispatcher::logAdminCommand(shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) +void ServerCommandDispatcher::logAdminCommand(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) { PlayerList *playerList = MinecraftServer::getInstance()->getPlayers(); //for (Player player : MinecraftServer.getInstance().getPlayers().players) for(AUTO_VAR(it, playerList->players.begin()); it != playerList->players.end(); ++it) { - shared_ptr player = *it; + std::shared_ptr player = *it; if (player != source && playerList->isOp(player)) { // TODO: Change chat packet to be able to send more bits of data diff --git a/Minecraft.Client/ServerCommandDispatcher.h b/Minecraft.Client/ServerCommandDispatcher.h index 306d4384..04847fce 100644 --- a/Minecraft.Client/ServerCommandDispatcher.h +++ b/Minecraft.Client/ServerCommandDispatcher.h @@ -7,5 +7,5 @@ class ServerCommandDispatcher : public CommandDispatcher, public AdminLogCommand { public: ServerCommandDispatcher(); - void logAdminCommand(shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); + void logAdminCommand(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); }; \ No newline at end of file diff --git a/Minecraft.Client/ServerConnection.cpp b/Minecraft.Client/ServerConnection.cpp index 9880a8c6..064c7b51 100644 --- a/Minecraft.Client/ServerConnection.cpp +++ b/Minecraft.Client/ServerConnection.cpp @@ -26,16 +26,16 @@ ServerConnection::~ServerConnection() // 4J - added to handle incoming connections, to replace thread that original used to have void ServerConnection::NewIncomingSocket(Socket *socket) { - shared_ptr unconnectedClient = shared_ptr(new PendingConnection(server, socket, L"Connection #" + _toString(connectionCounter++))); - handleConnection(unconnectedClient); + std::shared_ptr unconnectedClient = std::shared_ptr(new PendingConnection(server, socket, L"Connection #" + _toString(connectionCounter++))); + handleConnection(unconnectedClient); } -void ServerConnection::addPlayerConnection(shared_ptr uc) +void ServerConnection::addPlayerConnection(std::shared_ptr uc) { players.push_back(uc); } -void ServerConnection::handleConnection(shared_ptr uc) +void ServerConnection::handleConnection(std::shared_ptr uc) { EnterCriticalSection(&pending_cs); pending.push_back(uc); @@ -47,14 +47,14 @@ void ServerConnection::stop() EnterCriticalSection(&pending_cs); for (unsigned int i = 0; i < pending.size(); i++) { - shared_ptr uc = pending[i]; + std::shared_ptr uc = pending[i]; uc->connection->close(DisconnectPacket::eDisconnect_Closed); } LeaveCriticalSection(&pending_cs); for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr player = players[i]; + std::shared_ptr player = players[i]; player->connection->close(DisconnectPacket::eDisconnect_Closed); } } @@ -64,12 +64,12 @@ void ServerConnection::tick() { // MGH - changed this so that the the CS lock doesn't cover the tick (was causing a lockup when 2 players tried to join) EnterCriticalSection(&pending_cs); - vector< shared_ptr > tempPending = pending; + vector< std::shared_ptr > tempPending = pending; LeaveCriticalSection(&pending_cs); for (unsigned int i = 0; i < tempPending.size(); i++) { - shared_ptr uc = tempPending[i]; + std::shared_ptr uc = tempPending[i]; // try { // 4J - removed try/catch uc->tick(); // } catch (Exception e) { @@ -92,8 +92,8 @@ void ServerConnection::tick() for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr player = players[i]; - shared_ptr serverPlayer = player->getPlayer(); + std::shared_ptr player = players[i]; + std::shared_ptr serverPlayer = player->getPlayer(); if( serverPlayer ) { serverPlayer->doChunkSendingTick(false); @@ -138,7 +138,7 @@ void ServerConnection::handleTextureReceived(const wstring &textureName) } for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr player = players[i]; + std::shared_ptr player = players[i]; if (!player->done) { player->handleTextureReceived(textureName); @@ -155,7 +155,7 @@ void ServerConnection::handleTextureAndGeometryReceived(const wstring &textureNa } for (unsigned int i = 0; i < players.size(); i++) { - shared_ptr player = players[i]; + std::shared_ptr player = players[i]; if (!player->done) { player->handleTextureAndGeometryReceived(textureName); @@ -163,7 +163,7 @@ void ServerConnection::handleTextureAndGeometryReceived(const wstring &textureNa } } -void ServerConnection::handleServerSettingsChanged(shared_ptr packet) +void ServerConnection::handleServerSettingsChanged(std::shared_ptr packet) { Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -176,7 +176,7 @@ void ServerConnection::handleServerSettingsChanged(shared_ptrdata); pMinecraft->levels[i]->difficulty = packet->data; } - } + } } // else if(packet->action==ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS)// options // { @@ -194,11 +194,11 @@ void ServerConnection::handleServerSettingsChanged(shared_ptroptions->SetGamertagSetting(false); // } -// +// // for (unsigned int i = 0; i < players.size(); i++) // { -// shared_ptr playerconnection = players[i]; -// playerconnection->setShowOnMaps(pMinecraft->options->GetGamertagSetting()); +// std::shared_ptr playerconnection = players[i]; +// playerconnection->setShowOnMaps(pMinecraft->options->GetGamertagSetting()); // } // } } \ No newline at end of file diff --git a/Minecraft.Client/ServerConnection.h b/Minecraft.Client/ServerConnection.h index 56c5d39e..e4105675 100644 --- a/Minecraft.Client/ServerConnection.h +++ b/Minecraft.Client/ServerConnection.h @@ -20,8 +20,8 @@ private: int connectionCounter; private: CRITICAL_SECTION pending_cs; // 4J added - vector< shared_ptr > pending; - vector< shared_ptr > players; + vector< std::shared_ptr > pending; + vector< std::shared_ptr > players; // 4J - When the server requests a texture, it should add it to here while we are waiting for it vector m_pendingTextureRequests; @@ -34,9 +34,9 @@ public: void NewIncomingSocket(Socket *socket); // 4J - added void removeSpamProtection(Socket *socket) { }// 4J Stu - Not implemented as not required - void addPlayerConnection(shared_ptr uc); + void addPlayerConnection(std::shared_ptr uc); private: - void handleConnection(shared_ptr uc); + void handleConnection(std::shared_ptr uc); public: void stop(); void tick(); @@ -45,5 +45,5 @@ public: bool addPendingTextureRequest(const wstring &textureName); void handleTextureReceived(const wstring &textureName); void handleTextureAndGeometryReceived(const wstring &textureName); - void handleServerSettingsChanged(shared_ptr packet); + void handleServerSettingsChanged(std::shared_ptr packet); }; diff --git a/Minecraft.Client/ServerLevel.cpp b/Minecraft.Client/ServerLevel.cpp index 05566ad8..c416bb85 100644 --- a/Minecraft.Client/ServerLevel.cpp +++ b/Minecraft.Client/ServerLevel.cpp @@ -91,7 +91,7 @@ void ServerLevel::staticCtor() }; -ServerLevel::ServerLevel(MinecraftServer *server, shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings) : Level(levelStorage, levelName, levelSettings, Dimension::getNew(dimension), false) +ServerLevel::ServerLevel(MinecraftServer *server, std::shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings) : Level(levelStorage, levelName, levelSettings, Dimension::getNew(dimension), false) { InitializeCriticalSection(&m_limiterCS); InitializeCriticalSection(&m_tickNextTickCS); @@ -289,7 +289,7 @@ void ServerLevel::updateSleepingPlayerList() m_bAtLeastOnePlayerSleeping = false; AUTO_VAR(itEnd, players.end()); - for (vector >::iterator it = players.begin(); it != itEnd; it++) + for (vector >::iterator it = players.begin(); it != itEnd; it++) { if (!(*it)->isSleeping()) { @@ -310,7 +310,7 @@ void ServerLevel::awakenAllPlayers() m_bAtLeastOnePlayerSleeping = false; AUTO_VAR(itEnd, players.end()); - for (vector >::iterator it = players.begin(); it != itEnd; it++) + for (vector >::iterator it = players.begin(); it != itEnd; it++) { if ((*it)->isSleeping()) { @@ -335,7 +335,7 @@ bool ServerLevel::allPlayersAreSleeping() { // all players are sleeping, but have they slept long enough? AUTO_VAR(itEnd, players.end()); - for (vector >::iterator it = players.begin(); it != itEnd; it++ ) + for (vector >::iterator it = players.begin(); it != itEnd; it++ ) { // System.out.println(player->entityId + ": " + player->getSleepTimer()); if (! (*it)->isSleepingLongEnough()) @@ -467,7 +467,7 @@ void ServerLevel::tickTiles() if (isRainingAt(x, y, z)) { - addGlobalEntity( shared_ptr( new LightningBolt(this, x, y, z) ) ); + addGlobalEntity( std::shared_ptr( new LightningBolt(this, x, y, z) ) ); lightningTime = 2; } } @@ -665,7 +665,7 @@ vector *ServerLevel::fetchTicksInChunk(LevelChunk *chunk, bool return results; } -void ServerLevel::tick(shared_ptr e, bool actual) +void ServerLevel::tick(std::shared_ptr e, bool actual) { if (!server->isAnimals() && ((e->GetType() & eTYPE_ANIMAL) || (e->GetType() & eTYPE_WATERANIMAL))) { @@ -681,7 +681,7 @@ void ServerLevel::tick(shared_ptr e, bool actual) } } -void ServerLevel::forceTick(shared_ptr e, bool actual) +void ServerLevel::forceTick(std::shared_ptr e, bool actual) { Level::tick(e, actual); } @@ -693,12 +693,12 @@ ChunkSource *ServerLevel::createChunkSource() return cache; } -vector > *ServerLevel::getTileEntitiesInRegion(int x0, int y0, int z0, int x1, int y1, int z1) +vector > *ServerLevel::getTileEntitiesInRegion(int x0, int y0, int z0, int x1, int y1, int z1) { - vector > *result = new vector >; + vector > *result = new vector >; for (unsigned int i = 0; i < tileEntityList.size(); i++) { - shared_ptr te = tileEntityList[i]; + std::shared_ptr te = tileEntityList[i]; if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && te->y < y1 && te->z < z1) { result->push_back(te); @@ -707,7 +707,7 @@ vector > *ServerLevel::getTileEntitiesInRegion(int x0, in return result; } -bool ServerLevel::mayInteract(shared_ptr player, int xt, int yt, int zt, int content) +bool ServerLevel::mayInteract(std::shared_ptr player, int xt, int yt, int zt, int content) { // 4J-PB - This will look like a bug to players, and we really should have a message to explain why we're not allowing lava to be placed at or near a spawn point // We'll need to do this in a future update @@ -814,7 +814,7 @@ void ServerLevel::generateBonusItemsNearSpawn() if( getTile( x, y, z ) == Tile::chest_Id ) { - shared_ptr chest = dynamic_pointer_cast(getTileEntity(x, y, z)); + std::shared_ptr chest = dynamic_pointer_cast(getTileEntity(x, y, z)); if (chest != NULL) { if( chest->isBonusChest ) @@ -948,11 +948,11 @@ void ServerLevel::saveLevelData() savedDataStorage->save(); } -void ServerLevel::entityAdded(shared_ptr e) +void ServerLevel::entityAdded(std::shared_ptr e) { Level::entityAdded(e); entitiesById[e->entityId] = e; - vector > *es = e->getSubEntities(); + vector > *es = e->getSubEntities(); if (es != NULL) { //for (int i = 0; i < es.length; i++) @@ -964,11 +964,11 @@ void ServerLevel::entityAdded(shared_ptr e) entityAddedExtra(e); // 4J added } -void ServerLevel::entityRemoved(shared_ptr e) +void ServerLevel::entityRemoved(std::shared_ptr e) { Level::entityRemoved(e); entitiesById.erase(e->entityId); - vector > *es = e->getSubEntities(); + vector > *es = e->getSubEntities(); if (es != NULL) { //for (int i = 0; i < es.length; i++) @@ -980,32 +980,32 @@ void ServerLevel::entityRemoved(shared_ptr e) entityRemovedExtra(e); // 4J added } -shared_ptr ServerLevel::getEntity(int id) +std::shared_ptr ServerLevel::getEntity(int id) { return entitiesById[id]; } -bool ServerLevel::addGlobalEntity(shared_ptr e) +bool ServerLevel::addGlobalEntity(std::shared_ptr e) { if (Level::addGlobalEntity(e)) { - server->getPlayers()->broadcast(e->x, e->y, e->z, 512, dimension->id, shared_ptr( new AddGlobalEntityPacket(e) ) ); + server->getPlayers()->broadcast(e->x, e->y, e->z, 512, dimension->id, std::shared_ptr( new AddGlobalEntityPacket(e) ) ); return true; } return false; } -void ServerLevel::broadcastEntityEvent(shared_ptr e, byte event) +void ServerLevel::broadcastEntityEvent(std::shared_ptr e, byte event) { - shared_ptr p = shared_ptr( new EntityEventPacket(e->entityId, event) ); + std::shared_ptr p = std::shared_ptr( new EntityEventPacket(e->entityId, event) ); server->getLevel(dimension->id)->getTracker()->broadcastAndSend(e, p); } -shared_ptr ServerLevel::explode(shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks) +std::shared_ptr ServerLevel::explode(std::shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks) { // instead of calling super, we run the same explosion code here except // we don't generate any particles - shared_ptr explosion = shared_ptr( new Explosion(this, source, x, y, z, r) ); + std::shared_ptr explosion = std::shared_ptr( new Explosion(this, source, x, y, z, r) ); explosion->fire = fire; explosion->destroyBlocks = destroyBlocks; explosion->explode(); @@ -1016,10 +1016,10 @@ shared_ptr ServerLevel::explode(shared_ptr source, double x, explosion->toBlow.clear(); } - vector > sentTo; + vector > sentTo; for(AUTO_VAR(it, players.begin()); it != players.end(); ++it) { - shared_ptr player = dynamic_pointer_cast(*it); + std::shared_ptr player = dynamic_pointer_cast(*it); if (player->dimension != dimension->id) continue; bool knockbackOnly = false; @@ -1034,7 +1034,7 @@ shared_ptr ServerLevel::explode(shared_ptr source, double x, { for(unsigned int j = 0; j < sentTo.size(); j++ ) { - shared_ptr player2 = sentTo[j]; + std::shared_ptr player2 = sentTo[j]; INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); if( otherPlayer != NULL && thisPlayer->IsSameSystem(otherPlayer) ) { @@ -1049,7 +1049,7 @@ shared_ptr ServerLevel::explode(shared_ptr source, double x, Vec3 *knockbackVec = explosion->getHitPlayerKnockback(player); //app.DebugPrintf("Sending %s with knockback (%f,%f,%f)\n", knockbackOnly?"knockbackOnly":"allExplosion",knockbackVec->x,knockbackVec->y,knockbackVec->z); // If the player is not the primary on the system, then we only want to send info for the knockback - player->connection->send( shared_ptr( new ExplodePacket(x, y, z, r, &explosion->toBlow, knockbackVec, knockbackOnly))); + player->connection->send( std::shared_ptr( new ExplodePacket(x, y, z, r, &explosion->toBlow, knockbackVec, knockbackOnly))); sentTo.push_back( player ); } } @@ -1088,7 +1088,7 @@ void ServerLevel::runTileEvents() if (doTileEvent(&(*it))) { TileEventData te = *it; - server->getPlayers()->broadcast(te.getX(), te.getY(), te.getZ(), 64, dimension->id, shared_ptr( new TileEventPacket(te.getX(), te.getY(), te.getZ(), te.getTile(), te.getParamA(), te.getParamB()))); + server->getPlayers()->broadcast(te.getX(), te.getY(), te.getZ(), 64, dimension->id, std::shared_ptr( new TileEventPacket(te.getX(), te.getY(), te.getZ(), te.getTile(), te.getParamA(), te.getParamB()))); } } tileEvents[runList].clear(); @@ -1119,11 +1119,11 @@ void ServerLevel::tickWeather() { if (wasRaining) { - server->getPlayers()->broadcastAll( shared_ptr( new GameEventPacket(GameEventPacket::STOP_RAINING, 0) ) ); + server->getPlayers()->broadcastAll( std::shared_ptr( new GameEventPacket(GameEventPacket::STOP_RAINING, 0) ) ); } else { - server->getPlayers()->broadcastAll( shared_ptr( new GameEventPacket(GameEventPacket::START_RAINING, 0) ) ); + server->getPlayers()->broadcastAll( std::shared_ptr( new GameEventPacket(GameEventPacket::START_RAINING, 0) ) ); } } @@ -1185,7 +1185,7 @@ void ServerLevel::runQueuedSendTileUpdates() } // 4J - added special versions of addEntity and extra processing on entity removed and added so we can limit the number of itementities created -bool ServerLevel::addEntity(shared_ptr e) +bool ServerLevel::addEntity(std::shared_ptr e) { // If its an item entity, and we've got to our capacity, delete the oldest if( dynamic_pointer_cast(e) != NULL ) @@ -1244,7 +1244,7 @@ bool ServerLevel::addEntity(shared_ptr e) } // Maintain a cound of primed tnt & falling tiles in this level -void ServerLevel::entityAddedExtra(shared_ptr e) +void ServerLevel::entityAddedExtra(std::shared_ptr e) { if( dynamic_pointer_cast(e) != NULL ) { @@ -1289,7 +1289,7 @@ void ServerLevel::entityAddedExtra(shared_ptr e) } // Maintain a cound of primed tnt & falling tiles in this level, and remove any item entities from our list -void ServerLevel::entityRemovedExtra(shared_ptr e) +void ServerLevel::entityRemovedExtra(std::shared_ptr e) { if( dynamic_pointer_cast(e) != NULL ) { diff --git a/Minecraft.Client/ServerLevel.h b/Minecraft.Client/ServerLevel.h index ae413d11..82c5400e 100644 --- a/Minecraft.Client/ServerLevel.h +++ b/Minecraft.Client/ServerLevel.h @@ -41,7 +41,7 @@ private: int activeTileEventsList; public: static void staticCtor(); - ServerLevel(MinecraftServer *server, shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings); + ServerLevel(MinecraftServer *server, std::shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings); ~ServerLevel(); void tick(); Biome::MobSpawnerData *getRandomMobSpawnAt(MobCategory *mobCategory, int x, int y, int z); @@ -65,15 +65,15 @@ public: void tickEntities(); bool tickPendingTicks(bool force); vector *fetchTicksInChunk(LevelChunk *chunk, bool remove); - virtual void tick(shared_ptr e, bool actual); - void forceTick(shared_ptr e, bool actual); + virtual void tick(std::shared_ptr e, bool actual); + void forceTick(std::shared_ptr e, bool actual); bool AllPlayersAreSleeping() { return allPlayersSleeping;} // 4J added for a message to other players bool isAtLeastOnePlayerSleeping() { return m_bAtLeastOnePlayerSleeping;} protected: ChunkSource *createChunkSource(); // 4J - was virtual, but was called from parent ctor public: - vector > *getTileEntitiesInRegion(int x0, int y0, int z0, int x1, int y1, int z1); - virtual bool mayInteract(shared_ptr player, int xt, int yt, int zt, int id); + vector > *getTileEntitiesInRegion(int x0, int y0, int z0, int x1, int y1, int z1); + virtual bool mayInteract(std::shared_ptr player, int xt, int yt, int zt, int id); protected: virtual void initializeLevel(LevelSettings *settings); virtual void setInitialSpawn(LevelSettings *settings); @@ -90,16 +90,16 @@ public: private: void saveLevelData(); - typedef unordered_map , IntKeyHash2, IntKeyEq> intEntityMap; + typedef unordered_map , IntKeyHash2, IntKeyEq> intEntityMap; intEntityMap entitiesById; // 4J - was IntHashMap, using same hashing function as this uses protected: - virtual void entityAdded(shared_ptr e); - virtual void entityRemoved(shared_ptr e); + virtual void entityAdded(std::shared_ptr e); + virtual void entityRemoved(std::shared_ptr e); public: - shared_ptr getEntity(int id); - virtual bool addGlobalEntity(shared_ptr e); - void broadcastEntityEvent(shared_ptr e, byte event); - virtual shared_ptr explode(shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks); + std::shared_ptr getEntity(int id); + virtual bool addGlobalEntity(std::shared_ptr e); + void broadcastEntityEvent(std::shared_ptr e, byte event); + virtual std::shared_ptr explode(std::shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks); virtual void tileEvent(int x, int y, int z, int tile, int b0, int b1); private: @@ -134,14 +134,14 @@ public: int m_primedTntCount; int m_fallingTileCount; CRITICAL_SECTION m_limiterCS; - list< shared_ptr > m_itemEntities; - list< shared_ptr > m_hangingEntities; - list< shared_ptr > m_arrowEntities; - list< shared_ptr > m_experienceOrbEntities; + list< std::shared_ptr > m_itemEntities; + list< std::shared_ptr > m_hangingEntities; + list< std::shared_ptr > m_arrowEntities; + list< std::shared_ptr > m_experienceOrbEntities; - virtual bool addEntity(shared_ptr e); - void entityAddedExtra(shared_ptr e); - void entityRemovedExtra(shared_ptr e); + virtual bool addEntity(std::shared_ptr e); + void entityAddedExtra(std::shared_ptr e); + void entityRemovedExtra(std::shared_ptr e); virtual bool newPrimedTntAllowed(); virtual bool newFallingTileAllowed(); diff --git a/Minecraft.Client/ServerLevelListener.cpp b/Minecraft.Client/ServerLevelListener.cpp index 3b12630f..6bcf5d28 100644 --- a/Minecraft.Client/ServerLevelListener.cpp +++ b/Minecraft.Client/ServerLevelListener.cpp @@ -18,7 +18,7 @@ ServerLevelListener::ServerLevelListener(MinecraftServer *server, ServerLevel *l this->level = level; } -// 4J removed - +// 4J removed - /* void ServerLevelListener::addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za) { @@ -33,22 +33,22 @@ void ServerLevelListener::allChanged() { } -void ServerLevelListener::entityAdded(shared_ptr entity) +void ServerLevelListener::entityAdded(std::shared_ptr entity) { MemSect(10); level->getTracker()->addEntity(entity); MemSect(0); } -void ServerLevelListener::entityRemoved(shared_ptr entity) +void ServerLevelListener::entityRemoved(std::shared_ptr entity) { level->getTracker()->removeEntity(entity); } // 4J added -void ServerLevelListener::playerRemoved(shared_ptr entity) +void ServerLevelListener::playerRemoved(std::shared_ptr entity) { - shared_ptr player = dynamic_pointer_cast(entity); + std::shared_ptr player = dynamic_pointer_cast(entity); player->getLevel()->getTracker()->removePlayer(entity); } @@ -59,25 +59,25 @@ void ServerLevelListener::playSound(int iSound, double x, double y, double z, fl app.DebugPrintf("ServerLevelListener received request for sound less than 0, so ignoring\n"); } else - { + { // 4J-PB - I don't want to broadcast player sounds to my local machine, since we're already playing these in the LevelRenderer::playSound. // The PC version does seem to do this and the result is I can stop walking , and then I'll hear my footstep sound with a delay - server->getPlayers()->broadcast(x, y, z, volume > 1 ? 16 * volume : 16, level->dimension->id, shared_ptr(new LevelSoundPacket(iSound, x, y, z, volume, pitch))); + server->getPlayers()->broadcast(x, y, z, volume > 1 ? 16 * volume : 16, level->dimension->id, std::shared_ptr(new LevelSoundPacket(iSound, x, y, z, volume, pitch))); } } -void ServerLevelListener::playSound(shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fClipSoundDist) +void ServerLevelListener::playSound(std::shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fClipSoundDist) { if(iSound < 0) { app.DebugPrintf("ServerLevelListener received request for sound less than 0, so ignoring\n"); } else - { + { // 4J-PB - I don't want to broadcast player sounds to my local machine, since we're already playing these in the LevelRenderer::playSound. // The PC version does seem to do this and the result is I can stop walking , and then I'll hear my footstep sound with a delay - shared_ptr player= dynamic_pointer_cast(entity); - server->getPlayers()->broadcast(player,x, y, z, volume > 1 ? 16 * volume : 16, level->dimension->id, shared_ptr(new LevelSoundPacket(iSound, x, y, z, volume, pitch))); + std::shared_ptr player= dynamic_pointer_cast(entity); + server->getPlayers()->broadcast(player,x, y, z, volume > 1 ? 16 * volume : 16, level->dimension->id, std::shared_ptr(new LevelSoundPacket(iSound, x, y, z, volume, pitch))); } } @@ -102,9 +102,9 @@ void ServerLevelListener::playStreamingMusic(const wstring& name, int x, int y, { } -void ServerLevelListener::levelEvent(shared_ptr source, int type, int x, int y, int z, int data) +void ServerLevelListener::levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data) { - server->getPlayers()->broadcast(source, x, y, z, 64, level->dimension->id, shared_ptr( new LevelEventPacket(type, x, y, z, data) ) ); + server->getPlayers()->broadcast(source, x, y, z, 64, level->dimension->id, std::shared_ptr( new LevelEventPacket(type, x, y, z, data) ) ); } void ServerLevelListener::destroyTileProgress(int id, int x, int y, int z, int progress) @@ -112,7 +112,7 @@ void ServerLevelListener::destroyTileProgress(int id, int x, int y, int z, int p //for (ServerPlayer p : server->getPlayers()->players) for(AUTO_VAR(it, server->getPlayers()->players.begin()); it != server->getPlayers()->players.end(); ++it) { - shared_ptr p = *it; + std::shared_ptr p = *it; if (p == NULL || p->level != level || p->entityId == id) continue; double xd = (double) x - p->x; double yd = (double) y - p->y; @@ -120,7 +120,7 @@ void ServerLevelListener::destroyTileProgress(int id, int x, int y, int z, int p if (xd * xd + yd * yd + zd * zd < 32 * 32) { - p->connection->send(shared_ptr(new TileDestructionPacket(id, x, y, z, progress))); + p->connection->send(std::shared_ptr(new TileDestructionPacket(id, x, y, z, progress))); } } } \ No newline at end of file diff --git a/Minecraft.Client/ServerLevelListener.h b/Minecraft.Client/ServerLevelListener.h index 1886a89d..562aa013 100644 --- a/Minecraft.Client/ServerLevelListener.h +++ b/Minecraft.Client/ServerLevelListener.h @@ -18,16 +18,16 @@ public: // 4J removed - virtual void addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za); virtual void addParticle(ePARTICLE_TYPE name, double x, double y, double z, double xa, double ya, double za); // 4J added virtual void allChanged(); - virtual void entityAdded(shared_ptr entity); - virtual void entityRemoved(shared_ptr entity); - virtual void playerRemoved(shared_ptr entity); // 4J added - for when a player is removed from the level's player array, not just the entity storage + virtual void entityAdded(std::shared_ptr entity); + virtual void entityRemoved(std::shared_ptr entity); + virtual void playerRemoved(std::shared_ptr entity); // 4J added - for when a player is removed from the level's player array, not just the entity storage virtual void playSound(int iSound, double x, double y, double z, float volume, float pitch, float fClipSoundDist); - virtual void playSound(shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fClipSoundDist); + virtual void playSound(std::shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fClipSoundDist); virtual void setTilesDirty(int x0, int y0, int z0, int x1, int y1, int z1, Level *level); // 4J - added level param virtual void skyColorChanged(); virtual void tileChanged(int x, int y, int z); virtual void tileLightChanged(int x, int y, int z); virtual void playStreamingMusic(const wstring& name, int x, int y, int z); - virtual void levelEvent(shared_ptr source, int type, int x, int y, int z, int data); + virtual void levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data); virtual void destroyTileProgress(int id, int x, int y, int z, int progress); }; diff --git a/Minecraft.Client/ServerPlayer.cpp b/Minecraft.Client/ServerPlayer.cpp index eebab435..0f85998c 100644 --- a/Minecraft.Client/ServerPlayer.cpp +++ b/Minecraft.Client/ServerPlayer.cpp @@ -236,10 +236,10 @@ void ServerPlayer::tick() for (int i = 0; i < 5; i++) { - shared_ptr currentCarried = getCarried(i); + std::shared_ptr currentCarried = getCarried(i); if (currentCarried != lastCarried[i]) { - getLevel()->getTracker()->broadcast(shared_from_this(), shared_ptr( new SetEquippedItemPacket(this->entityId, i, currentCarried) ) ); + getLevel()->getTracker()->broadcast(shared_from_this(), std::shared_ptr( new SetEquippedItemPacket(this->entityId, i, currentCarried) ) ); lastCarried[i] = currentCarried; } } @@ -264,7 +264,7 @@ void ServerPlayer::flushEntitiesToRemove() it = entitiesToRemove.erase(it); } - connection->send(shared_ptr(new RemoveEntitiesPacket(ids))); + connection->send(std::shared_ptr(new RemoveEntitiesPacket(ids))); } } @@ -286,14 +286,14 @@ void ServerPlayer::doTickA() for (unsigned int i = 0; i < inventory->getContainerSize(); i++) { - shared_ptr ie = inventory->getItem(i); + std::shared_ptr ie = inventory->getItem(i); if (ie != NULL) { // 4J - removed condition. These were getting lower priority than tile update packets etc. on the slow outbound queue, and so were extremely slow to send sometimes, // particularly at the start of a game. They don't typically seem to be massive and shouldn't be send when there isn't actually any updating to do. if (Item::items[ie->id]->isComplex() ) // && connection->countDelayedPackets() <= 2) { - shared_ptr packet = (dynamic_cast(Item::items[ie->id])->getUpdatePacket(ie, level, dynamic_pointer_cast( shared_from_this() ) ) ); + std::shared_ptr packet = (dynamic_cast(Item::items[ie->id])->getUpdatePacket(ie, level, dynamic_pointer_cast( shared_from_this() ) ) ); if (packet != NULL) { connection->send(packet); @@ -402,7 +402,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) { // app.DebugPrintf("Creating BRUP for %d %d\n",nearest.x, nearest.z); PIXBeginNamedEvent(0,"Creation BRUP for sending\n"); - shared_ptr packet = shared_ptr( new BlockRegionUpdatePacket(nearest.x * 16, 0, nearest.z * 16, 16, Level::maxBuildHeight, 16, level) ); + std::shared_ptr packet = std::shared_ptr( new BlockRegionUpdatePacket(nearest.x * 16, 0, nearest.z * 16, 16, Level::maxBuildHeight, 16, level) ); PIXEndNamedEvent(); if( dontDelayChunks ) packet->shouldDelay = false; @@ -441,7 +441,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) // Don't send TileEntity data until we have sent the block data if( connection->isLocal() || chunkDataSent) { - vector > *tes = level->getTileEntitiesInRegion(nearest.x * 16, 0, nearest.z * 16, nearest.x * 16 + 16, Level::maxBuildHeight, nearest.z * 16 + 16); + vector > *tes = level->getTileEntitiesInRegion(nearest.x * 16, 0, nearest.z * 16, nearest.x * 16 + 16, Level::maxBuildHeight, nearest.z * 16 + 16); for (unsigned int i = 0; i < tes->size(); i++) { // 4J Stu - Added delay param to ensure that these arrive after the BRUPs from above @@ -541,7 +541,7 @@ void ServerPlayer::doTickB(bool ignorePortal) if (getHealth() != lastSentHealth || lastSentFood != foodData.getFoodLevel() || ((foodData.getSaturationLevel() == 0) != lastFoodSaturationZero)) { // 4J Stu - Added m_lastDamageSource for telemetry - connection->send( shared_ptr( new SetHealthPacket(getHealth(), foodData.getFoodLevel(), foodData.getSaturationLevel(), m_lastDamageSource) ) ); + connection->send( std::shared_ptr( new SetHealthPacket(getHealth(), foodData.getFoodLevel(), foodData.getSaturationLevel(), m_lastDamageSource) ) ); lastSentHealth = getHealth(); lastSentFood = foodData.getFoodLevel(); lastFoodSaturationZero = foodData.getSaturationLevel() == 0; @@ -550,12 +550,12 @@ void ServerPlayer::doTickB(bool ignorePortal) if (totalExperience != lastSentExp) { lastSentExp = totalExperience; - connection->send( shared_ptr( new SetExperiencePacket(experienceProgress, totalExperience, experienceLevel) ) ); + connection->send( std::shared_ptr( new SetExperiencePacket(experienceProgress, totalExperience, experienceLevel) ) ); } } -shared_ptr ServerPlayer::getCarried(int slot) +std::shared_ptr ServerPlayer::getCarried(int slot) { if (slot == 0) return inventory->getSelected(); return inventory->armor[slot - 1]; @@ -575,7 +575,7 @@ bool ServerPlayer::hurt(DamageSource *dmgSource, int dmg) { // 4J Stu - Fix for #46422 - TU5: Crash: Gameplay: Crash when being hit by a trap using a dispenser // getEntity returns the owner of projectiles, and this would never be the arrow. The owner is sometimes NULL. - shared_ptr source = dmgSource->getDirectEntity(); + std::shared_ptr source = dmgSource->getDirectEntity(); if (dynamic_pointer_cast(source) != NULL && (!server->pvp || !dynamic_pointer_cast(source)->isAllowedToAttackPlayers()) ) @@ -585,7 +585,7 @@ bool ServerPlayer::hurt(DamageSource *dmgSource, int dmg) if (source != NULL && source->GetType() == eTYPE_ARROW) { - shared_ptr arrow = dynamic_pointer_cast(source); + std::shared_ptr arrow = dynamic_pointer_cast(source); if (dynamic_pointer_cast(arrow->owner) != NULL && (!server->pvp || !dynamic_pointer_cast(arrow->owner)->isAllowedToAttackPlayers()) ) { return false; @@ -608,7 +608,7 @@ bool ServerPlayer::hurt(DamageSource *dmgSource, int dmg) else if(dmgSource == DamageSource::cactus) m_lastDamageSource = eTelemetryPlayerDeathSource_Cactus; else { - shared_ptr source = dmgSource->getEntity(); + std::shared_ptr source = dmgSource->getEntity(); if( source != NULL ) { switch(source->GetType()) @@ -647,7 +647,7 @@ bool ServerPlayer::hurt(DamageSource *dmgSource, int dmg) case eTYPE_ARROW: if ((dynamic_pointer_cast(source))->owner != NULL) { - shared_ptr attacker = (dynamic_pointer_cast(source))->owner; + std::shared_ptr attacker = (dynamic_pointer_cast(source))->owner; if (attacker != NULL) { switch(attacker->GetType()) @@ -696,19 +696,19 @@ void ServerPlayer::changeDimension(int i) level->removeEntity(shared_from_this()); wonGame = true; m_enteredEndExitPortal = true; // We only flag this for the player in the portal - connection->send( shared_ptr( new GameEventPacket(GameEventPacket::WIN_GAME, thisPlayer->GetUserIndex()) ) ); + connection->send( std::shared_ptr( new GameEventPacket(GameEventPacket::WIN_GAME, thisPlayer->GetUserIndex()) ) ); app.DebugPrintf("Sending packet to %d\n", thisPlayer->GetUserIndex()); } if(thisPlayer != NULL) { for(AUTO_VAR(it, MinecraftServer::getInstance()->getPlayers()->players.begin()); it != MinecraftServer::getInstance()->getPlayers()->players.end(); ++it) { - shared_ptr servPlayer = *it; + std::shared_ptr servPlayer = *it; INetworkPlayer *checkPlayer = servPlayer->connection->getNetworkPlayer(); if(thisPlayer != checkPlayer && checkPlayer != NULL && thisPlayer->IsSameSystem( checkPlayer ) && !servPlayer->wonGame ) { servPlayer->wonGame = true; - servPlayer->connection->send( shared_ptr( new GameEventPacket(GameEventPacket::WIN_GAME, thisPlayer->GetUserIndex() ) ) ); + servPlayer->connection->send( std::shared_ptr( new GameEventPacket(GameEventPacket::WIN_GAME, thisPlayer->GetUserIndex() ) ) ); app.DebugPrintf("Sending packet to %d\n", thisPlayer->GetUserIndex()); } } @@ -733,11 +733,11 @@ void ServerPlayer::changeDimension(int i) } // 4J Added delay param -void ServerPlayer::broadcast(shared_ptr te, bool delay /*= false*/) +void ServerPlayer::broadcast(std::shared_ptr te, bool delay /*= false*/) { if (te != NULL) { - shared_ptr p = te->getUpdatePacket(); + std::shared_ptr p = te->getUpdatePacket(); if (p != NULL) { p->shouldDelay = delay; @@ -747,22 +747,22 @@ void ServerPlayer::broadcast(shared_ptr te, bool delay /*= false*/) } } -void ServerPlayer::take(shared_ptr e, int orgCount) +void ServerPlayer::take(std::shared_ptr e, int orgCount) { if (!e->removed) { EntityTracker *entityTracker = getLevel()->getTracker(); if (e->GetType() == eTYPE_ITEMENTITY) { - entityTracker->broadcast(e, shared_ptr( new TakeItemEntityPacket(e->entityId, entityId) ) ); + entityTracker->broadcast(e, std::shared_ptr( new TakeItemEntityPacket(e->entityId, entityId) ) ); } if (e->GetType() == eTYPE_ARROW) { - entityTracker->broadcast(e, shared_ptr( new TakeItemEntityPacket(e->entityId, entityId) ) ); + entityTracker->broadcast(e, std::shared_ptr( new TakeItemEntityPacket(e->entityId, entityId) ) ); } if (e->GetType() == eTYPE_EXPERIENCEORB) { - entityTracker->broadcast(e, shared_ptr( new TakeItemEntityPacket(e->entityId, entityId) ) ); + entityTracker->broadcast(e, std::shared_ptr( new TakeItemEntityPacket(e->entityId, entityId) ) ); } } Player::take(e, orgCount); @@ -775,7 +775,7 @@ void ServerPlayer::swing() { swingTime = -1; swinging = true; - getLevel()->getTracker()->broadcast(shared_from_this(), shared_ptr( new AnimatePacket(shared_from_this(), AnimatePacket::SWING) ) ); + getLevel()->getTracker()->broadcast(shared_from_this(), std::shared_ptr( new AnimatePacket(shared_from_this(), AnimatePacket::SWING) ) ); } } @@ -784,7 +784,7 @@ Player::BedSleepingResult ServerPlayer::startSleepInBed(int x, int y, int z, boo BedSleepingResult result = Player::startSleepInBed(x, y, z, bTestUse); if (result == OK) { - shared_ptr p = shared_ptr( new EntityActionAtPositionPacket(shared_from_this(), EntityActionAtPositionPacket::START_SLEEP, x, y, z) ); + std::shared_ptr p = std::shared_ptr( new EntityActionAtPositionPacket(shared_from_this(), EntityActionAtPositionPacket::START_SLEEP, x, y, z) ); getLevel()->getTracker()->broadcast(shared_from_this(), p); connection->teleport(this->x, this->y, this->z, yRot, xRot); connection->send(p); @@ -796,16 +796,16 @@ void ServerPlayer::stopSleepInBed(bool forcefulWakeUp, bool updateLevelList, boo { if (isSleeping()) { - getLevel()->getTracker()->broadcastAndSend(shared_from_this(), shared_ptr( new AnimatePacket(shared_from_this(), AnimatePacket::WAKE_UP) ) ); + getLevel()->getTracker()->broadcastAndSend(shared_from_this(), std::shared_ptr( new AnimatePacket(shared_from_this(), AnimatePacket::WAKE_UP) ) ); } Player::stopSleepInBed(forcefulWakeUp, updateLevelList, saveRespawnPoint); if (connection != NULL) connection->teleport(x, y, z, yRot, xRot); } -void ServerPlayer::ride(shared_ptr e) +void ServerPlayer::ride(std::shared_ptr e) { Player::ride(e); - connection->send( shared_ptr( new SetRidingPacket(shared_from_this(), riding) ) ); + connection->send( std::shared_ptr( new SetRidingPacket(shared_from_this(), riding) ) ); // 4J Removed this - The act of riding will be handled on the client and will change the position // of the player. If we also teleport it then we can end up with a repeating movements, e.g. bouncing @@ -832,7 +832,7 @@ bool ServerPlayer::startCrafting(int x, int y, int z) if(containerMenu == inventoryMenu) { nextContainerCounter(); - connection->send( shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::WORKBENCH, 0, 9) ) ); + connection->send( std::shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::WORKBENCH, 0, 9) ) ); containerMenu = new CraftingMenu(inventory, level, x, y, z); containerMenu->containerId = containerCounter; containerMenu->addSlotListener(this); @@ -850,7 +850,7 @@ bool ServerPlayer::startEnchanting(int x, int y, int z) if(containerMenu == inventoryMenu) { nextContainerCounter(); - connection->send(shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::ENCHANTMENT, 0, 9) )); + connection->send(std::shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::ENCHANTMENT, 0, 9) )); containerMenu = new EnchantmentMenu(inventory, level, x, y, z); containerMenu->containerId = containerCounter; containerMenu->addSlotListener(this); @@ -868,7 +868,7 @@ bool ServerPlayer::startRepairing(int x, int y, int z) if(containerMenu == inventoryMenu) { nextContainerCounter(); - connection->send(shared_ptr ( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::REPAIR_TABLE, 0, 9)) ); + connection->send(std::shared_ptr ( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::REPAIR_TABLE, 0, 9)) ); containerMenu = new RepairMenu(inventory, level, x, y, z, dynamic_pointer_cast(shared_from_this())); containerMenu->containerId = containerCounter; containerMenu->addSlotListener(this); @@ -881,12 +881,12 @@ bool ServerPlayer::startRepairing(int x, int y, int z) return true; } -bool ServerPlayer::openContainer(shared_ptr container) +bool ServerPlayer::openContainer(std::shared_ptr container) { if(containerMenu == inventoryMenu) { nextContainerCounter(); - connection->send( shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::CONTAINER, container->getName(), container->getContainerSize()) ) ); + connection->send( std::shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::CONTAINER, container->getName(), container->getContainerSize()) ) ); containerMenu = new ContainerMenu(inventory, container); containerMenu->containerId = containerCounter; @@ -900,12 +900,12 @@ bool ServerPlayer::openContainer(shared_ptr container) return true; } -bool ServerPlayer::openFurnace(shared_ptr furnace) +bool ServerPlayer::openFurnace(std::shared_ptr furnace) { if(containerMenu == inventoryMenu) { nextContainerCounter(); - connection->send( shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::FURNACE, 0, furnace->getContainerSize()) ) ); + connection->send( std::shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::FURNACE, 0, furnace->getContainerSize()) ) ); containerMenu = new FurnaceMenu(inventory, furnace); containerMenu->containerId = containerCounter; containerMenu->addSlotListener(this); @@ -918,12 +918,12 @@ bool ServerPlayer::openFurnace(shared_ptr furnace) return true; } -bool ServerPlayer::openTrap(shared_ptr trap) +bool ServerPlayer::openTrap(std::shared_ptr trap) { if(containerMenu == inventoryMenu) { nextContainerCounter(); - connection->send( shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::TRAP, 0, trap->getContainerSize()) ) ); + connection->send( std::shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::TRAP, 0, trap->getContainerSize()) ) ); containerMenu = new TrapMenu(inventory, trap); containerMenu->containerId = containerCounter; containerMenu->addSlotListener(this); @@ -936,12 +936,12 @@ bool ServerPlayer::openTrap(shared_ptr trap) return true; } -bool ServerPlayer::openBrewingStand(shared_ptr brewingStand) +bool ServerPlayer::openBrewingStand(std::shared_ptr brewingStand) { if(containerMenu == inventoryMenu) { nextContainerCounter(); - connection->send(shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::BREWING_STAND, 0, brewingStand->getContainerSize()))); + connection->send(std::shared_ptr( new ContainerOpenPacket(containerCounter, ContainerOpenPacket::BREWING_STAND, 0, brewingStand->getContainerSize()))); containerMenu = new BrewingStandMenu(inventory, brewingStand); containerMenu->containerId = containerCounter; containerMenu->addSlotListener(this); @@ -954,7 +954,7 @@ bool ServerPlayer::openBrewingStand(shared_ptr brewingSt return true; } -bool ServerPlayer::openTrading(shared_ptr traderTarget) +bool ServerPlayer::openTrading(std::shared_ptr traderTarget) { if(containerMenu == inventoryMenu) { @@ -962,9 +962,9 @@ bool ServerPlayer::openTrading(shared_ptr traderTarget) containerMenu = new MerchantMenu(inventory, traderTarget, level); containerMenu->containerId = containerCounter; containerMenu->addSlotListener(this); - shared_ptr container = ((MerchantMenu *) containerMenu)->getTradeContainer(); + std::shared_ptr container = ((MerchantMenu *) containerMenu)->getTradeContainer(); - connection->send(shared_ptr(new ContainerOpenPacket(containerCounter, ContainerOpenPacket::TRADER_NPC, container->getName(), container->getContainerSize()))); + connection->send(std::shared_ptr(new ContainerOpenPacket(containerCounter, ContainerOpenPacket::TRADER_NPC, container->getName(), container->getContainerSize()))); MerchantRecipeList *offers = traderTarget->getOffers(dynamic_pointer_cast(shared_from_this())); if (offers != NULL) @@ -976,7 +976,7 @@ bool ServerPlayer::openTrading(shared_ptr traderTarget) output.writeInt(containerCounter); offers->writeToStream(&output); - connection->send(shared_ptr( new CustomPayloadPacket(CustomPayloadPacket::TRADER_LIST_PACKET, rawOutput.toByteArray()))); + connection->send(std::shared_ptr( new CustomPayloadPacket(CustomPayloadPacket::TRADER_LIST_PACKET, rawOutput.toByteArray()))); } } else @@ -987,7 +987,7 @@ bool ServerPlayer::openTrading(shared_ptr traderTarget) return true; } -void ServerPlayer::slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr item) +void ServerPlayer::slotChanged(AbstractContainerMenu *container, int slotIndex, std::shared_ptr item) { if (dynamic_cast(container->getSlot(slotIndex))) { @@ -1004,21 +1004,21 @@ void ServerPlayer::slotChanged(AbstractContainerMenu *container, int slotIndex, return; } - connection->send( shared_ptr( new ContainerSetSlotPacket(container->containerId, slotIndex, item) ) ); + connection->send( std::shared_ptr( new ContainerSetSlotPacket(container->containerId, slotIndex, item) ) ); } void ServerPlayer::refreshContainer(AbstractContainerMenu *menu) { - vector > *items = menu->getItems(); + vector > *items = menu->getItems(); refreshContainer(menu, items); delete items; } -void ServerPlayer::refreshContainer(AbstractContainerMenu *container, vector > *items) +void ServerPlayer::refreshContainer(AbstractContainerMenu *container, vector > *items) { - connection->send( shared_ptr( new ContainerSetContentPacket(container->containerId, items) ) ); - connection->send( shared_ptr( new ContainerSetSlotPacket(-1, -1, inventory->getCarried()) ) ); + connection->send( std::shared_ptr( new ContainerSetContentPacket(container->containerId, items) ) ); + connection->send( std::shared_ptr( new ContainerSetSlotPacket(-1, -1, inventory->getCarried()) ) ); } void ServerPlayer::setContainerData(AbstractContainerMenu *container, int id, int value) @@ -1033,12 +1033,12 @@ void ServerPlayer::setContainerData(AbstractContainerMenu *container, int id, in // client again. return; } - connection->send( shared_ptr( new ContainerSetDataPacket(container->containerId, id, value) ) ); + connection->send( std::shared_ptr( new ContainerSetDataPacket(container->containerId, id, value) ) ); } void ServerPlayer::closeContainer() { - connection->send( shared_ptr( new ContainerClosePacket(containerMenu->containerId) ) ); + connection->send( std::shared_ptr( new ContainerClosePacket(containerMenu->containerId) ) ); doCloseContainer(); } @@ -1052,7 +1052,7 @@ void ServerPlayer::broadcastCarriedItem() // client again. return; } - connection->send( shared_ptr( new ContainerSetSlotPacket(-1, -1, inventory->getCarried()) ) ); + connection->send( std::shared_ptr( new ContainerSetSlotPacket(-1, -1, inventory->getCarried()) ) ); } void ServerPlayer::doCloseContainer() @@ -1087,12 +1087,12 @@ void ServerPlayer::awardStat(Stat *stat, byteArray param) while (count > 100) { - connection->send( shared_ptr( new AwardStatPacket(stat->id, 100) ) ); + connection->send( std::shared_ptr( new AwardStatPacket(stat->id, 100) ) ); count -= 100; } - connection->send( shared_ptr( new AwardStatPacket(stat->id, count) ) ); + connection->send( std::shared_ptr( new AwardStatPacket(stat->id, count) ) ); #else - connection->send( shared_ptr( new AwardStatPacket(stat->id, param) ) ); + connection->send( std::shared_ptr( new AwardStatPacket(stat->id, param) ) ); // byteArray deleted in AwardStatPacket destructor. #endif } @@ -1122,33 +1122,33 @@ void ServerPlayer::displayClientMessage(int messageId) { case IDS_TILE_BED_OCCUPIED: messageType = ChatPacket::e_ChatBedOccupied; - connection->send( shared_ptr( new ChatPacket(L"", messageType) ) ); + connection->send( std::shared_ptr( new ChatPacket(L"", messageType) ) ); break; case IDS_TILE_BED_NO_SLEEP: messageType = ChatPacket::e_ChatBedNoSleep; - connection->send( shared_ptr( new ChatPacket(L"", messageType) ) ); + connection->send( std::shared_ptr( new ChatPacket(L"", messageType) ) ); break; case IDS_TILE_BED_NOT_VALID: messageType = ChatPacket::e_ChatBedNotValid; - connection->send( shared_ptr( new ChatPacket(L"", messageType) ) ); + connection->send( std::shared_ptr( new ChatPacket(L"", messageType) ) ); break; case IDS_TILE_BED_NOTSAFE: messageType = ChatPacket::e_ChatBedNotSafe; - connection->send( shared_ptr( new ChatPacket(L"", messageType) ) ); + connection->send( std::shared_ptr( new ChatPacket(L"", messageType) ) ); break; case IDS_TILE_BED_PLAYERSLEEP: messageType = ChatPacket::e_ChatBedPlayerSleep; // broadcast to all the other players in the game for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()!=player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatBedPlayerSleep))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatBedPlayerSleep))); } else { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatBedMeSleep))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatBedMeSleep))); } } return; @@ -1156,85 +1156,85 @@ void ServerPlayer::displayClientMessage(int messageId) case IDS_PLAYER_ENTERED_END: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()!=player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerEnteredEnd))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerEnteredEnd))); } } break; case IDS_PLAYER_LEFT_END: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()!=player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerLeftEnd))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerLeftEnd))); } } break; case IDS_TILE_BED_MESLEEP: messageType = ChatPacket::e_ChatBedMeSleep; - connection->send( shared_ptr( new ChatPacket(L"", messageType) ) ); + connection->send( std::shared_ptr( new ChatPacket(L"", messageType) ) ); break; case IDS_MAX_PIGS_SHEEP_COWS_CATS_SPAWNED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxPigsSheepCows))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxPigsSheepCows))); } } break; case IDS_MAX_CHICKENS_SPAWNED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxChickens))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxChickens))); } } break; case IDS_MAX_SQUID_SPAWNED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxSquid))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxSquid))); } } break; case IDS_MAX_WOLVES_SPAWNED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxWolves))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxWolves))); } } break; case IDS_MAX_MOOSHROOMS_SPAWNED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxMooshrooms))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxMooshrooms))); } } break; case IDS_MAX_ENEMIES_SPAWNED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxEnemies))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxEnemies))); } } break; @@ -1242,40 +1242,40 @@ void ServerPlayer::displayClientMessage(int messageId) case IDS_MAX_VILLAGERS_SPAWNED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxVillagers))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxVillagers))); } } break; case IDS_MAX_PIGS_SHEEP_COWS_CATS_BRED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredPigsSheepCows))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredPigsSheepCows))); } } break; case IDS_MAX_CHICKENS_BRED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredChickens))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredChickens))); } } break; case IDS_MAX_MUSHROOMCOWS_BRED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredMooshrooms))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredMooshrooms))); } } break; @@ -1283,10 +1283,10 @@ void ServerPlayer::displayClientMessage(int messageId) case IDS_MAX_WOLVES_BRED: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredWolves))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredWolves))); } } break; @@ -1294,10 +1294,10 @@ void ServerPlayer::displayClientMessage(int messageId) case IDS_CANT_SHEAR_MOOSHROOM: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerCantShearMooshroom))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerCantShearMooshroom))); } } break; @@ -1306,20 +1306,20 @@ void ServerPlayer::displayClientMessage(int messageId) case IDS_MAX_HANGINGENTITIES: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxHangingEntities))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxHangingEntities))); } } break; case IDS_CANT_SPAWN_IN_PEACEFUL: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerCantSpawnInPeaceful))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerCantSpawnInPeaceful))); } } break; @@ -1327,10 +1327,10 @@ void ServerPlayer::displayClientMessage(int messageId) case IDS_MAX_BOATS: for (unsigned int i = 0; i < server->getPlayers()->players.size(); i++) { - shared_ptr player = server->getPlayers()->players[i]; + std::shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBoats))); + player->connection->send(std::shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBoats))); } } break; @@ -1343,26 +1343,26 @@ void ServerPlayer::displayClientMessage(int messageId) //Language *language = Language::getInstance(); //wstring languageString = app.GetString(messageId);//language->getElement(messageId); - //connection->send( shared_ptr( new ChatPacket(L"", messageType) ) ); + //connection->send( std::shared_ptr( new ChatPacket(L"", messageType) ) ); } void ServerPlayer::completeUsingItem() { - connection->send(shared_ptr( new EntityEventPacket(entityId, EntityEvent::USE_ITEM_COMPLETE) ) ); + connection->send(std::shared_ptr( new EntityEventPacket(entityId, EntityEvent::USE_ITEM_COMPLETE) ) ); Player::completeUsingItem(); } -void ServerPlayer::startUsingItem(shared_ptr instance, int duration) +void ServerPlayer::startUsingItem(std::shared_ptr instance, int duration) { Player::startUsingItem(instance, duration); if (instance != NULL && instance->getItem() != NULL && instance->getItem()->getUseAnimation(instance) == UseAnim_eat) { - getLevel()->getTracker()->broadcastAndSend(shared_from_this(), shared_ptr( new AnimatePacket(shared_from_this(), AnimatePacket::EAT) ) ); + getLevel()->getTracker()->broadcastAndSend(shared_from_this(), std::shared_ptr( new AnimatePacket(shared_from_this(), AnimatePacket::EAT) ) ); } } -void ServerPlayer::restoreFrom(shared_ptr oldPlayer, bool restoreAll) +void ServerPlayer::restoreFrom(std::shared_ptr oldPlayer, bool restoreAll) { Player::restoreFrom(oldPlayer, restoreAll); lastSentExp = -1; @@ -1374,21 +1374,21 @@ void ServerPlayer::restoreFrom(shared_ptr oldPlayer, bool restoreAll) void ServerPlayer::onEffectAdded(MobEffectInstance *effect) { Player::onEffectAdded(effect); - connection->send(shared_ptr( new UpdateMobEffectPacket(entityId, effect) ) ); + connection->send(std::shared_ptr( new UpdateMobEffectPacket(entityId, effect) ) ); } void ServerPlayer::onEffectUpdated(MobEffectInstance *effect) { Player::onEffectUpdated(effect); - connection->send(shared_ptr( new UpdateMobEffectPacket(entityId, effect) ) ); + connection->send(std::shared_ptr( new UpdateMobEffectPacket(entityId, effect) ) ); } void ServerPlayer::onEffectRemoved(MobEffectInstance *effect) { Player::onEffectRemoved(effect); - connection->send(shared_ptr( new RemoveMobEffectPacket(entityId, effect) ) ); + connection->send(std::shared_ptr( new RemoveMobEffectPacket(entityId, effect) ) ); } void ServerPlayer::teleportTo(double x, double y, double z) @@ -1396,20 +1396,20 @@ void ServerPlayer::teleportTo(double x, double y, double z) connection->teleport(x, y, z, yRot, xRot); } -void ServerPlayer::crit(shared_ptr entity) +void ServerPlayer::crit(std::shared_ptr entity) { - getLevel()->getTracker()->broadcastAndSend(shared_from_this(), shared_ptr( new AnimatePacket(entity, AnimatePacket::CRITICAL_HIT) )); + getLevel()->getTracker()->broadcastAndSend(shared_from_this(), std::shared_ptr( new AnimatePacket(entity, AnimatePacket::CRITICAL_HIT) )); } -void ServerPlayer::magicCrit(shared_ptr entity) +void ServerPlayer::magicCrit(std::shared_ptr entity) { - getLevel()->getTracker()->broadcastAndSend(shared_from_this(), shared_ptr( new AnimatePacket(entity, AnimatePacket::MAGIC_CRITICAL_HIT) )); + getLevel()->getTracker()->broadcastAndSend(shared_from_this(), std::shared_ptr( new AnimatePacket(entity, AnimatePacket::MAGIC_CRITICAL_HIT) )); } void ServerPlayer::onUpdateAbilities() { if (connection == NULL) return; - connection->send(shared_ptr(new PlayerAbilitiesPacket(&abilities))); + connection->send(std::shared_ptr(new PlayerAbilitiesPacket(&abilities))); } ServerLevel *ServerPlayer::getLevel() @@ -1420,12 +1420,12 @@ ServerLevel *ServerPlayer::getLevel() void ServerPlayer::setGameMode(GameType *mode) { gameMode->setGameModeForPlayer(mode); - connection->send(shared_ptr(new GameEventPacket(GameEventPacket::CHANGE_GAME_MODE, mode->getId()))); + connection->send(std::shared_ptr(new GameEventPacket(GameEventPacket::CHANGE_GAME_MODE, mode->getId()))); } void ServerPlayer::sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type /*= e_ChatCustom*/, int customData /*= -1*/, const wstring& additionalMessage /*= L""*/) { - connection->send(shared_ptr(new ChatPacket(message,type,customData,additionalMessage))); + connection->send(std::shared_ptr(new ChatPacket(message,type,customData,additionalMessage))); } bool ServerPlayer::hasPermission(EGameCommand command) @@ -1434,7 +1434,7 @@ bool ServerPlayer::hasPermission(EGameCommand command) } // 4J - Don't use -//void ServerPlayer::updateOptions(shared_ptr packet) +//void ServerPlayer::updateOptions(std::shared_ptr packet) //{ // // 4J - Don't need // //if (language.getLanguageList().containsKey(packet.getLanguage())) @@ -1502,7 +1502,7 @@ int ServerPlayer::getPlayerViewDistanceModifier() return value; } -void ServerPlayer::handleCollectItem(shared_ptr item) +void ServerPlayer::handleCollectItem(std::shared_ptr item) { if(gameMode->getGameRules() != NULL) gameMode->getGameRules()->onCollectItem(item); } diff --git a/Minecraft.Client/ServerPlayer.h b/Minecraft.Client/ServerPlayer.h index a9b37594..1e896ec0 100644 --- a/Minecraft.Client/ServerPlayer.h +++ b/Minecraft.Client/ServerPlayer.h @@ -17,7 +17,7 @@ class ServerPlayer : public Player, public net_minecraft_world_inventory::Contai { public: eINSTANCEOF GetType() { return eTYPE_SERVERPLAYER; } - shared_ptr connection; + std::shared_ptr connection; MinecraftServer *server; ServerPlayerGameMode *gameMode; double lastMoveX, lastMoveZ; @@ -59,7 +59,7 @@ public: virtual float getHeadHeight(); virtual void tick(); void flushEntitiesToRemove(); - virtual shared_ptr getCarried(int slot); + virtual std::shared_ptr getCarried(int slot); virtual void die(DamageSource *source); virtual bool hurt(DamageSource *dmgSource, int dmg); virtual bool isPlayerVersusPlayer(); @@ -69,15 +69,15 @@ public: void doTickB(bool ignorePortal); virtual void changeDimension(int i); private: - void broadcast(shared_ptr te, bool delay = false); + void broadcast(std::shared_ptr te, bool delay = false); public: - virtual void take(shared_ptr e, int orgCount); + virtual void take(std::shared_ptr e, int orgCount); virtual void swing(); virtual BedSleepingResult startSleepInBed(int x, int y, int z, bool bTestUse = false); public: virtual void stopSleepInBed(bool forcefulWakeUp, bool updateLevelList, bool saveRespawnPoint); - virtual void ride(shared_ptr e); + virtual void ride(std::shared_ptr e); protected: virtual void checkFallDamage(double ya, bool onGround); public: @@ -97,14 +97,14 @@ public: virtual bool startCrafting(int x, int y, int z); // 4J added bool return virtual bool startEnchanting(int x, int y, int z); // 4J added bool return virtual bool startRepairing(int x, int y, int z); // 4J added bool return - virtual bool openContainer(shared_ptr container); // 4J added bool return - virtual bool openFurnace(shared_ptr furnace); // 4J added bool return - virtual bool openTrap(shared_ptr trap); // 4J added bool return - virtual bool openBrewingStand(shared_ptr brewingStand); // 4J added bool return - virtual bool openTrading(shared_ptr traderTarget); // 4J added bool return - virtual void slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr item); + virtual bool openContainer(std::shared_ptr container); // 4J added bool return + virtual bool openFurnace(std::shared_ptr furnace); // 4J added bool return + virtual bool openTrap(std::shared_ptr trap); // 4J added bool return + virtual bool openBrewingStand(std::shared_ptr brewingStand); // 4J added bool return + virtual bool openTrading(std::shared_ptr traderTarget); // 4J added bool return + virtual void slotChanged(AbstractContainerMenu *container, int slotIndex, std::shared_ptr item); void refreshContainer(AbstractContainerMenu *menu); - virtual void refreshContainer(AbstractContainerMenu *container, vector > *items); + virtual void refreshContainer(AbstractContainerMenu *container, vector > *items); virtual void setContainerData(AbstractContainerMenu *container, int id, int value); virtual void closeContainer(); void broadcastCarriedItem(); @@ -121,8 +121,8 @@ protected: virtual void completeUsingItem(); public: - virtual void startUsingItem(shared_ptr instance, int duration); - virtual void restoreFrom(shared_ptr oldPlayer, bool restoreAll); + virtual void startUsingItem(std::shared_ptr instance, int duration); + virtual void restoreFrom(std::shared_ptr oldPlayer, bool restoreAll); protected: virtual void onEffectAdded(MobEffectInstance *effect); @@ -131,8 +131,8 @@ protected: public: virtual void teleportTo(double x, double y, double z); - virtual void crit(shared_ptr entity); - virtual void magicCrit(shared_ptr entity); + virtual void crit(std::shared_ptr entity); + virtual void magicCrit(std::shared_ptr entity); void onUpdateAbilities(); ServerLevel *getLevel(); @@ -140,7 +140,7 @@ public: void sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const wstring& additionalMessage = L""); bool hasPermission(EGameCommand command); // 4J - Don't use - //void updateOptions(shared_ptr packet); + //void updateOptions(std::shared_ptr packet); int getViewDistance(); //bool canChatInColor(); //int getChatVisibility(); @@ -152,7 +152,7 @@ public: public: // 4J Stu - Added hooks for the game rules - virtual void handleCollectItem(shared_ptr item); + virtual void handleCollectItem(std::shared_ptr item); #ifndef _CONTENT_PACKAGE void debug_setPosition(double,double,double,double,double); @@ -160,5 +160,5 @@ public: protected: // 4J Added to record telemetry of player deaths, this should store the last source of damage - ETelemetryChallenges m_lastDamageSource; + ETelemetryChallenges m_lastDamageSource; }; diff --git a/Minecraft.Client/ServerPlayerGameMode.cpp b/Minecraft.Client/ServerPlayerGameMode.cpp index 9b31df0d..3bd69310 100644 --- a/Minecraft.Client/ServerPlayerGameMode.cpp +++ b/Minecraft.Client/ServerPlayerGameMode.cpp @@ -235,9 +235,9 @@ bool ServerPlayerGameMode::destroyBlock(int x, int y, int z) int t = level->getTile(x, y, z); int data = level->getData(x, y, z); - + level->levelEvent(player, LevelEvent::PARTICLES_DESTROY_BLOCK, x, y, z, t + (level->getData(x, y, z) << Tile::TILE_NUM_SHIFT)); - + // 4J - In creative mode, the point where we need to tell the renderer that we are about to destroy a tile via destroyingTileAt is quite complicated. // If the player being told is remote, then we always want the client to do it as it does the final update. If the player being told is local, // then we need to update the renderer Here if we are sharing data between host & client as this is the final point where the original data is still intact. @@ -272,7 +272,7 @@ bool ServerPlayerGameMode::destroyBlock(int x, int y, int z) if (isCreative()) { - shared_ptr tup = shared_ptr( new TileUpdatePacket(x, y, z, level) ); + std::shared_ptr tup = std::shared_ptr( new TileUpdatePacket(x, y, z, level) ); // 4J - a bit of a hack here, but if we want to tell the client that it needs to inform the renderer of a block being destroyed, then send a block 255 instead of a 0. This is handled in ClientConnection::handleTileUpdate if( tup->block == 0 ) { @@ -280,9 +280,9 @@ bool ServerPlayerGameMode::destroyBlock(int x, int y, int z) } player->connection->send( tup ); } - else + else { - shared_ptr item = player->getSelectedItem(); + std::shared_ptr item = player->getSelectedItem(); bool canDestroy = player->canDestroy(Tile::tiles[t]); if (item != NULL) { @@ -301,13 +301,13 @@ bool ServerPlayerGameMode::destroyBlock(int x, int y, int z) } -bool ServerPlayerGameMode::useItem(shared_ptr player, Level *level, shared_ptr item, bool bTestUseOnly) +bool ServerPlayerGameMode::useItem(std::shared_ptr player, Level *level, std::shared_ptr item, bool bTestUseOnly) { if(!player->isAllowedToUse(item)) return false; int oldCount = item->count; int oldAux = item->getAuxValue(); - shared_ptr itemInstance = item->use(level, player); + std::shared_ptr itemInstance = item->use(level, player); if ((itemInstance != NULL && itemInstance != item) || (itemInstance != NULL && itemInstance->count != oldCount) || (itemInstance != NULL && itemInstance->getUseDuration() > 0)) { player->inventory->items[player->inventory->selected] = itemInstance; @@ -326,7 +326,7 @@ bool ServerPlayerGameMode::useItem(shared_ptr player, Level *level, shar } -bool ServerPlayerGameMode::useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly, bool *pbUsedItem) +bool ServerPlayerGameMode::useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly, bool *pbUsedItem) { // 4J-PB - Adding a test only version to allow tooltips to be displayed int t = level->getTile(x, y, z); @@ -336,7 +336,7 @@ bool ServerPlayerGameMode::useItemOn(shared_ptr player, Level *level, sh { if (Tile::tiles[t]->TestUse()) return true; } - else + else { if (Tile::tiles[t]->use(level, x, y, z, player, face, clickX, clickY, clickZ)) { @@ -345,7 +345,7 @@ bool ServerPlayerGameMode::useItemOn(shared_ptr player, Level *level, sh } } } - + if (item == NULL || !player->isAllowedToUse(item)) return false; if (isCreative()) { diff --git a/Minecraft.Client/ServerPlayerGameMode.h b/Minecraft.Client/ServerPlayerGameMode.h index 89b9e9b4..c590f11e 100644 --- a/Minecraft.Client/ServerPlayerGameMode.h +++ b/Minecraft.Client/ServerPlayerGameMode.h @@ -10,7 +10,7 @@ class ServerPlayerGameMode { public: Level *level; - shared_ptr player; + std::shared_ptr player; private: GameType *gameModeForPlayer; @@ -53,8 +53,8 @@ private: public: bool destroyBlock(int x, int y, int z); - bool useItem(shared_ptr player, Level *level, shared_ptr item, bool bTestUseOnly=false); - bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false, bool *pbUsedItem=NULL); + bool useItem(std::shared_ptr player, Level *level, std::shared_ptr item, bool bTestUseOnly=false); + bool useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false, bool *pbUsedItem=NULL); void setLevel(ServerLevel *newLevel); }; \ No newline at end of file diff --git a/Minecraft.Client/SheepFurModel.cpp b/Minecraft.Client/SheepFurModel.cpp index bb84e80d..2e8b494d 100644 --- a/Minecraft.Client/SheepFurModel.cpp +++ b/Minecraft.Client/SheepFurModel.cpp @@ -41,11 +41,11 @@ SheepFurModel::SheepFurModel() : QuadrupedModel(12, 0) leg3->compile(1.0f/16.0f); } -void SheepFurModel::prepareMobModel(shared_ptr mob, float time, float r, float a) +void SheepFurModel::prepareMobModel(std::shared_ptr mob, float time, float r, float a) { QuadrupedModel::prepareMobModel(mob, time, r, a); - shared_ptr sheep = dynamic_pointer_cast(mob); + std::shared_ptr sheep = dynamic_pointer_cast(mob); head->y = 6 + sheep->getHeadEatPositionScale(a) * 9.0f; headXRot = sheep->getHeadEatAngleScale(a); } diff --git a/Minecraft.Client/SheepFurModel.h b/Minecraft.Client/SheepFurModel.h index c614765e..65bb913e 100644 --- a/Minecraft.Client/SheepFurModel.h +++ b/Minecraft.Client/SheepFurModel.h @@ -8,6 +8,6 @@ private: public: SheepFurModel(); - virtual void prepareMobModel(shared_ptr mob, float time, float r, float a); + virtual void prepareMobModel(std::shared_ptr mob, float time, float r, float a); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; \ No newline at end of file diff --git a/Minecraft.Client/SheepModel.cpp b/Minecraft.Client/SheepModel.cpp index 7d093353..9c161c33 100644 --- a/Minecraft.Client/SheepModel.cpp +++ b/Minecraft.Client/SheepModel.cpp @@ -10,7 +10,7 @@ SheepModel::SheepModel() : QuadrupedModel(12, 0) head = new ModelPart(this, 0, 0); head->addBox(-3, -4, -6, 6, 6, 8, 0); // Head head->setPos(0, 12-6, -8); - + body = new ModelPart(this, 28, 8); body->addBox(-4, -10, -7, 8, 16, 6, 0); // Body body->setPos(0, 11+6-12, 2); @@ -20,11 +20,11 @@ SheepModel::SheepModel() : QuadrupedModel(12, 0) body->compile(1.0f/16.0f); } -void SheepModel::prepareMobModel(shared_ptr mob, float time, float r, float a) +void SheepModel::prepareMobModel(std::shared_ptr mob, float time, float r, float a) { QuadrupedModel::prepareMobModel(mob, time, r, a); - shared_ptr sheep = dynamic_pointer_cast(mob); + std::shared_ptr sheep = dynamic_pointer_cast(mob); head->y = 6 + sheep->getHeadEatPositionScale(a) * 9.0f; headXRot = sheep->getHeadEatAngleScale(a); } diff --git a/Minecraft.Client/SheepModel.h b/Minecraft.Client/SheepModel.h index d4136c25..78c3b7c8 100644 --- a/Minecraft.Client/SheepModel.h +++ b/Minecraft.Client/SheepModel.h @@ -8,6 +8,6 @@ private: public: SheepModel(); - virtual void prepareMobModel(shared_ptr mob, float time, float r, float a); + virtual void prepareMobModel(std::shared_ptr mob, float time, float r, float a); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; \ No newline at end of file diff --git a/Minecraft.Client/SheepRenderer.cpp b/Minecraft.Client/SheepRenderer.cpp index 4af155d3..0aab6c7c 100644 --- a/Minecraft.Client/SheepRenderer.cpp +++ b/Minecraft.Client/SheepRenderer.cpp @@ -8,10 +8,10 @@ SheepRenderer::SheepRenderer(Model *model, Model *armor, float shadow) : MobRend setArmor(armor); } -int SheepRenderer::prepareArmor(shared_ptr _sheep, int layer, float a) +int SheepRenderer::prepareArmor(std::shared_ptr _sheep, int layer, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr sheep = dynamic_pointer_cast(_sheep); + std::shared_ptr sheep = dynamic_pointer_cast(_sheep); if (layer == 0 && !sheep->isSheared() && !sheep->isInvisibleTo(Minecraft::GetInstance()->player)) // 4J-JEV: Todo, merge with java fix (for invisible sheep armour) in '1.7.5'. @@ -28,7 +28,7 @@ int SheepRenderer::prepareArmor(shared_ptr _sheep, int layer, float a) return -1; } -void SheepRenderer::render(shared_ptr mob, double x, double y, double z, float rot, float a) +void SheepRenderer::render(std::shared_ptr mob, double x, double y, double z, float rot, float a) { MobRenderer::render(mob, x, y, z, rot, a); -} +} diff --git a/Minecraft.Client/SheepRenderer.h b/Minecraft.Client/SheepRenderer.h index c0dea04f..637c53d0 100644 --- a/Minecraft.Client/SheepRenderer.h +++ b/Minecraft.Client/SheepRenderer.h @@ -7,8 +7,8 @@ public: SheepRenderer(Model *model, Model *armor, float shadow); protected: - virtual int prepareArmor(shared_ptr _sheep, int layer, float a); + virtual int prepareArmor(std::shared_ptr _sheep, int layer, float a); public: - virtual void render(shared_ptr mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr mob, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/SignRenderer.cpp b/Minecraft.Client/SignRenderer.cpp index 97eff4bd..b4457f9b 100644 --- a/Minecraft.Client/SignRenderer.cpp +++ b/Minecraft.Client/SignRenderer.cpp @@ -13,10 +13,10 @@ SignRenderer::SignRenderer() signModel = new SignModel(); } -void SignRenderer::render(shared_ptr _sign, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +void SignRenderer::render(std::shared_ptr _sign, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr sign = dynamic_pointer_cast(_sign); + std::shared_ptr sign = dynamic_pointer_cast(_sign); Tile *tile = sign->getTile(); @@ -73,10 +73,10 @@ void SignRenderer::render(shared_ptr _sign, double x, double y, doub { switch(dwLanguage) { - case XC_LANGUAGE_KOREAN: + case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_JAPANESE: case XC_LANGUAGE_TCHINESE: - msg = L"Censored";// In-game font, so English only + msg = L"Censored";// In-game font, so English only break; default: msg = app.GetString(IDS_STRINGVERIFY_CENSORED); @@ -92,16 +92,16 @@ void SignRenderer::render(shared_ptr _sign, double x, double y, doub { switch(dwLanguage) { - case XC_LANGUAGE_KOREAN: + case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_JAPANESE: case XC_LANGUAGE_TCHINESE: - msg = L"Awaiting Approval";// In-game font, so English only + msg = L"Awaiting Approval";// In-game font, so English only break; default: msg = app.GetString(IDS_STRINGVERIFY_AWAITING_APPROVAL); break; } - } + } if (i == sign->GetSelectedLine()) { diff --git a/Minecraft.Client/SignRenderer.h b/Minecraft.Client/SignRenderer.h index 48d4d954..d7411af4 100644 --- a/Minecraft.Client/SignRenderer.h +++ b/Minecraft.Client/SignRenderer.h @@ -8,5 +8,5 @@ private: SignModel *signModel; public: SignRenderer(); // 4J - added - virtual void render(shared_ptr sign, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param + virtual void render(std::shared_ptr sign, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param }; diff --git a/Minecraft.Client/SilverfishModel.cpp b/Minecraft.Client/SilverfishModel.cpp index 128a7e79..a7a14629 100644 --- a/Minecraft.Client/SilverfishModel.cpp +++ b/Minecraft.Client/SilverfishModel.cpp @@ -82,7 +82,7 @@ int SilverfishModel::modelVersion() return 38; } -void SilverfishModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void SilverfishModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); diff --git a/Minecraft.Client/SilverfishModel.h b/Minecraft.Client/SilverfishModel.h index d6be3059..4ce0e16e 100644 --- a/Minecraft.Client/SilverfishModel.h +++ b/Minecraft.Client/SilverfishModel.h @@ -21,6 +21,6 @@ public: SilverfishModel(); int modelVersion(); - void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; \ No newline at end of file diff --git a/Minecraft.Client/SilverfishRenderer.cpp b/Minecraft.Client/SilverfishRenderer.cpp index 9ed194ca..714cab8b 100644 --- a/Minecraft.Client/SilverfishRenderer.cpp +++ b/Minecraft.Client/SilverfishRenderer.cpp @@ -7,17 +7,17 @@ SilverfishRenderer::SilverfishRenderer() : MobRenderer(new SilverfishModel(), 0. { } -float SilverfishRenderer::getFlipDegrees(shared_ptr spider) +float SilverfishRenderer::getFlipDegrees(std::shared_ptr spider) { return 180; } -void SilverfishRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void SilverfishRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { MobRenderer::render(_mob, x, y, z, rot, a); } -int SilverfishRenderer::prepareArmor(shared_ptr _silverfish, int layer, float a) +int SilverfishRenderer::prepareArmor(std::shared_ptr _silverfish, int layer, float a) { return -1; } \ No newline at end of file diff --git a/Minecraft.Client/SilverfishRenderer.h b/Minecraft.Client/SilverfishRenderer.h index c1df4505..91ff2e45 100644 --- a/Minecraft.Client/SilverfishRenderer.h +++ b/Minecraft.Client/SilverfishRenderer.h @@ -13,11 +13,11 @@ public: SilverfishRenderer(); protected: - float getFlipDegrees(shared_ptr spider); + float getFlipDegrees(std::shared_ptr spider); public: - void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); protected: - int prepareArmor(shared_ptr _silverfish, int layer, float a); + int prepareArmor(std::shared_ptr _silverfish, int layer, float a); }; diff --git a/Minecraft.Client/SkeletonHeadModel.cpp b/Minecraft.Client/SkeletonHeadModel.cpp index 340047fe..4fb15b31 100644 --- a/Minecraft.Client/SkeletonHeadModel.cpp +++ b/Minecraft.Client/SkeletonHeadModel.cpp @@ -27,7 +27,7 @@ SkeletonHeadModel::SkeletonHeadModel(int u, int v, int tw, int th) _init(u,v,tw,th); } -void SkeletonHeadModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void SkeletonHeadModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); diff --git a/Minecraft.Client/SkeletonHeadModel.h b/Minecraft.Client/SkeletonHeadModel.h index 6f136c46..aa045571 100644 --- a/Minecraft.Client/SkeletonHeadModel.h +++ b/Minecraft.Client/SkeletonHeadModel.h @@ -14,6 +14,6 @@ public: SkeletonHeadModel(); SkeletonHeadModel(int u, int v, int tw, int th); - void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; \ No newline at end of file diff --git a/Minecraft.Client/SkullTileRenderer.cpp b/Minecraft.Client/SkullTileRenderer.cpp index 641a7a02..129e21a5 100644 --- a/Minecraft.Client/SkullTileRenderer.cpp +++ b/Minecraft.Client/SkullTileRenderer.cpp @@ -19,9 +19,9 @@ SkullTileRenderer::~SkullTileRenderer() delete zombieModel; } -void SkullTileRenderer::render(shared_ptr _skull, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +void SkullTileRenderer::render(std::shared_ptr _skull, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) { - shared_ptr skull = dynamic_pointer_cast(_skull); + std::shared_ptr skull = dynamic_pointer_cast(_skull); renderSkull((float) x, (float) y, (float) z, skull->getData() & SkullTile::PLACEMENT_MASK, skull->getRotation() * 360 / 16.0f, skull->getSkullType(), skull->getExtraType()); } diff --git a/Minecraft.Client/SkullTileRenderer.h b/Minecraft.Client/SkullTileRenderer.h index 09c83f9d..e9d2bf0f 100644 --- a/Minecraft.Client/SkullTileRenderer.h +++ b/Minecraft.Client/SkullTileRenderer.h @@ -18,7 +18,7 @@ public: SkullTileRenderer(); ~SkullTileRenderer(); - void render(shared_ptr skull, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled = true); + void render(std::shared_ptr skull, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled = true); void init(TileEntityRenderDispatcher *tileEntityRenderDispatcher); void renderSkull(float x, float y, float z, int face, float rot, int type, const wstring &extra); }; diff --git a/Minecraft.Client/SlimeModel.cpp b/Minecraft.Client/SlimeModel.cpp index 1dafc2fb..df0ae37d 100644 --- a/Minecraft.Client/SlimeModel.cpp +++ b/Minecraft.Client/SlimeModel.cpp @@ -34,7 +34,7 @@ SlimeModel::SlimeModel(int vOffs) cube->compile(1.0f/16.0f); } -void SlimeModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void SlimeModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); diff --git a/Minecraft.Client/SlimeModel.h b/Minecraft.Client/SlimeModel.h index 9eee5eb1..fe2a4fc2 100644 --- a/Minecraft.Client/SlimeModel.h +++ b/Minecraft.Client/SlimeModel.h @@ -9,5 +9,5 @@ public: SlimeModel(int vOffs); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); }; \ No newline at end of file diff --git a/Minecraft.Client/SlimeRenderer.cpp b/Minecraft.Client/SlimeRenderer.cpp index 23c9c16e..dbad3d26 100644 --- a/Minecraft.Client/SlimeRenderer.cpp +++ b/Minecraft.Client/SlimeRenderer.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "SlimeRenderer.h" +#include "SlimeRenderer.h" #include "..\Minecraft.World\net.minecraft.world.entity.monster.h" SlimeRenderer::SlimeRenderer(Model *model, Model *armor, float shadow) : MobRenderer(model, shadow) @@ -7,10 +7,10 @@ SlimeRenderer::SlimeRenderer(Model *model, Model *armor, float shadow) : MobRend this->armor = armor; } -int SlimeRenderer::prepareArmor(shared_ptr _slime, int layer, float a) +int SlimeRenderer::prepareArmor(std::shared_ptr _slime, int layer, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr slime = dynamic_pointer_cast(_slime); + std::shared_ptr slime = dynamic_pointer_cast(_slime); if (slime->isInvisible()) return 0; @@ -32,10 +32,10 @@ int SlimeRenderer::prepareArmor(shared_ptr _slime, int layer, float a) return -1; } -void SlimeRenderer::scale(shared_ptr _slime, float a) +void SlimeRenderer::scale(std::shared_ptr _slime, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr slime = dynamic_pointer_cast(_slime); + std::shared_ptr slime = dynamic_pointer_cast(_slime); float size = (float) slime->getSize(); float ss = (slime->oSquish + (slime->squish - slime->oSquish) * a) / (size * 0.5f + 1); diff --git a/Minecraft.Client/SlimeRenderer.h b/Minecraft.Client/SlimeRenderer.h index 58f510aa..86de3a76 100644 --- a/Minecraft.Client/SlimeRenderer.h +++ b/Minecraft.Client/SlimeRenderer.h @@ -8,6 +8,6 @@ private: public: SlimeRenderer(Model *model, Model *armor, float shadow); protected: - virtual int prepareArmor(shared_ptr _slime, int layer, float a); - virtual void scale(shared_ptr _slime, float a); + virtual int prepareArmor(std::shared_ptr _slime, int layer, float a); + virtual void scale(std::shared_ptr _slime, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/SnowManModel.cpp b/Minecraft.Client/SnowManModel.cpp index 4344a17a..9380cce0 100644 --- a/Minecraft.Client/SnowManModel.cpp +++ b/Minecraft.Client/SnowManModel.cpp @@ -26,7 +26,7 @@ SnowManModel::SnowManModel() : Model() piece2 = (new ModelPart(this, 0, 36))->setTexSize(64, 64); piece2->addBox(-6, -12, -6, 12, 12, 12, g - 0.5f); // lower body - piece2->setPos(0, 0 + yOffset + 20, 0); + piece2->setPos(0, 0 + yOffset + 20, 0); // 4J added - compile now to avoid random performance hit first time cubes are rendered head->compile(1.0f/16.0f); @@ -53,12 +53,12 @@ void SnowManModel::setupAnim(float time, float r, float bob, float yRot, float x arm1->x = (c) * 5; arm1->z = (-s) * 5; - + arm2->x = (-c) * 5; arm2->z = (s) * 5; } -void SnowManModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void SnowManModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); diff --git a/Minecraft.Client/SnowManModel.h b/Minecraft.Client/SnowManModel.h index eb31e503..5f2d64c5 100644 --- a/Minecraft.Client/SnowManModel.h +++ b/Minecraft.Client/SnowManModel.h @@ -1,7 +1,7 @@ #pragma once #include "Model.h" -class SnowManModel : public Model +class SnowManModel : public Model { public: ModelPart *piece1, *piece2, *head; @@ -9,5 +9,5 @@ public: SnowManModel() ; virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); - void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); }; diff --git a/Minecraft.Client/SnowManRenderer.cpp b/Minecraft.Client/SnowManRenderer.cpp index 83edb3f5..cd08e5ce 100644 --- a/Minecraft.Client/SnowManRenderer.cpp +++ b/Minecraft.Client/SnowManRenderer.cpp @@ -13,14 +13,14 @@ SnowManRenderer::SnowManRenderer() : MobRenderer(new SnowManModel(), 0.5f) this->setArmor(model); } -void SnowManRenderer::additionalRendering(shared_ptr _mob, float a) +void SnowManRenderer::additionalRendering(std::shared_ptr _mob, float a) { - // 4J - original version used generics and thus had an input parameter of type SnowMan rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type SnowMan rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); MobRenderer::additionalRendering(mob, a); - shared_ptr headGear = shared_ptr( new ItemInstance(Tile::pumpkin, 1) ); + std::shared_ptr headGear = std::shared_ptr( new ItemInstance(Tile::pumpkin, 1) ); if (headGear != NULL && headGear->getItem()->id < 256) { glPushMatrix(); diff --git a/Minecraft.Client/SnowManRenderer.h b/Minecraft.Client/SnowManRenderer.h index 9bdecb4d..ab003fe6 100644 --- a/Minecraft.Client/SnowManRenderer.h +++ b/Minecraft.Client/SnowManRenderer.h @@ -13,5 +13,5 @@ public: SnowManRenderer(); protected: - virtual void additionalRendering(shared_ptr _mob, float a); + virtual void additionalRendering(std::shared_ptr _mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/SpiderModel.cpp b/Minecraft.Client/SpiderModel.cpp index 35c51d3e..83ff82a4 100644 --- a/Minecraft.Client/SpiderModel.cpp +++ b/Minecraft.Client/SpiderModel.cpp @@ -6,7 +6,7 @@ SpiderModel::SpiderModel() : Model() { float g = 0; - + int yo = 18+6-9; head = new ModelPart(this, 32, 4); @@ -68,7 +68,7 @@ SpiderModel::SpiderModel() : Model() leg7->compile(1.0f/16.0f); } -void SpiderModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void SpiderModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); @@ -93,13 +93,13 @@ void SpiderModel::setupAnim(float time, float r, float bob, float yRot, float xR float sr = (float) PI / 4.0f; leg0->zRot = -sr; leg1->zRot = sr; - + leg2->zRot = -sr * 0.74f; leg3->zRot = sr * 0.74f; - + leg4->zRot = -sr * 0.74f; leg5->zRot = sr * 0.74f; - + leg6->zRot = -sr; leg7->zRot = sr; diff --git a/Minecraft.Client/SpiderModel.h b/Minecraft.Client/SpiderModel.h index 61666983..2d9d1527 100644 --- a/Minecraft.Client/SpiderModel.h +++ b/Minecraft.Client/SpiderModel.h @@ -7,6 +7,6 @@ public: ModelPart *head, *body0, *body1, *leg0, *leg1, *leg2, *leg3, *leg4, *leg5, *leg6, *leg7; SpiderModel(); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; \ No newline at end of file diff --git a/Minecraft.Client/SpiderRenderer.cpp b/Minecraft.Client/SpiderRenderer.cpp index 9c31eb9e..d19472c5 100644 --- a/Minecraft.Client/SpiderRenderer.cpp +++ b/Minecraft.Client/SpiderRenderer.cpp @@ -8,15 +8,15 @@ SpiderRenderer::SpiderRenderer() : MobRenderer(new SpiderModel(), 1.0f) this->setArmor(new SpiderModel()); } -float SpiderRenderer::getFlipDegrees(shared_ptr spider) +float SpiderRenderer::getFlipDegrees(std::shared_ptr spider) { return 180; } -int SpiderRenderer::prepareArmor(shared_ptr _spider, int layer, float a) +int SpiderRenderer::prepareArmor(std::shared_ptr _spider, int layer, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr spider = dynamic_pointer_cast(_spider); + std::shared_ptr spider = dynamic_pointer_cast(_spider); if (layer!=0) return -1; MemSect(31); @@ -40,7 +40,7 @@ int SpiderRenderer::prepareArmor(shared_ptr _spider, int layer, float a) { // 4J - was 0xf0f0 but that looks like it is a mistake - maybe meant to be 0xf000f0 to enable both sky & block lighting? choosing 0x00f0 here instead // as most likely replicates what the java game does, without breaking our lighting (which doesn't like UVs out of the 0 to 255 range) - int col = 0x00f0; + int col = 0x00f0; int u = col % 65536; int v = col / 65536; @@ -52,10 +52,10 @@ int SpiderRenderer::prepareArmor(shared_ptr _spider, int layer, float a) return 1; } -void SpiderRenderer::scale(shared_ptr _mob, float a) +void SpiderRenderer::scale(std::shared_ptr _mob, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); float scale = mob->getModelScale(); glScalef(scale, scale, scale); } \ No newline at end of file diff --git a/Minecraft.Client/SpiderRenderer.h b/Minecraft.Client/SpiderRenderer.h index 3b937458..7946ed46 100644 --- a/Minecraft.Client/SpiderRenderer.h +++ b/Minecraft.Client/SpiderRenderer.h @@ -6,7 +6,7 @@ class SpiderRenderer : public MobRenderer public: SpiderRenderer(); protected: - virtual float getFlipDegrees(shared_ptr spider); - virtual int prepareArmor(shared_ptr _spider, int layer, float a); - void scale(shared_ptr _mob, float a); + virtual float getFlipDegrees(std::shared_ptr spider); + virtual int prepareArmor(std::shared_ptr _spider, int layer, float a); + void scale(std::shared_ptr _mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/SquidModel.cpp b/Minecraft.Client/SquidModel.cpp index 8ad20f8e..6f87cbde 100644 --- a/Minecraft.Client/SquidModel.cpp +++ b/Minecraft.Client/SquidModel.cpp @@ -43,7 +43,7 @@ void SquidModel::setupAnim(float time, float r, float bob, float yRot, float xRo } } -void SquidModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void SquidModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); diff --git a/Minecraft.Client/SquidModel.h b/Minecraft.Client/SquidModel.h index 8f43950f..0b7948a8 100644 --- a/Minecraft.Client/SquidModel.h +++ b/Minecraft.Client/SquidModel.h @@ -10,5 +10,5 @@ public: SquidModel(); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); }; \ No newline at end of file diff --git a/Minecraft.Client/SquidRenderer.cpp b/Minecraft.Client/SquidRenderer.cpp index 135f6d9b..3ee79eb1 100644 --- a/Minecraft.Client/SquidRenderer.cpp +++ b/Minecraft.Client/SquidRenderer.cpp @@ -6,15 +6,15 @@ SquidRenderer::SquidRenderer(Model *model, float shadow) : MobRenderer(model, sh { } -void SquidRenderer::render(shared_ptr mob, double x, double y, double z, float rot, float a) +void SquidRenderer::render(std::shared_ptr mob, double x, double y, double z, float rot, float a) { MobRenderer::render(mob, x, y, z, rot, a); } -void SquidRenderer::setupRotations(shared_ptr _mob, float bob, float bodyRot, float a) +void SquidRenderer::setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); float bodyXRot = (mob->xBodyRotO + (mob->xBodyRot - mob->xBodyRotO) * a); float bodyZRot = (mob->zBodyRotO + (mob->zBodyRot - mob->zBodyRotO) * a); @@ -26,10 +26,10 @@ void SquidRenderer::setupRotations(shared_ptr _mob, float bob, float bodyRo glTranslatef(0, -1.2f, 0); } -float SquidRenderer::getBob(shared_ptr _mob, float a) +float SquidRenderer::getBob(std::shared_ptr _mob, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); return mob->oldTentacleAngle + (mob->tentacleAngle - mob->oldTentacleAngle) * a; } \ No newline at end of file diff --git a/Minecraft.Client/SquidRenderer.h b/Minecraft.Client/SquidRenderer.h index ccc81944..13270b5f 100644 --- a/Minecraft.Client/SquidRenderer.h +++ b/Minecraft.Client/SquidRenderer.h @@ -7,9 +7,9 @@ public: SquidRenderer(Model *model, float shadow); public: - virtual void render(shared_ptr mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr mob, double x, double y, double z, float rot, float a); protected: - virtual void setupRotations(shared_ptr _mob, float bob, float bodyRot, float a); - virtual float getBob(shared_ptr _mob, float a); + virtual void setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a); + virtual float getBob(std::shared_ptr _mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/SurvivalMode.cpp b/Minecraft.Client/SurvivalMode.cpp index 27a992df..b1b727a4 100644 --- a/Minecraft.Client/SurvivalMode.cpp +++ b/Minecraft.Client/SurvivalMode.cpp @@ -43,7 +43,7 @@ SurvivalMode::SurvivalMode(SurvivalMode *copy) : GameMode( copy->minecraft ) destroyDelay = copy->destroyDelay; } -void SurvivalMode::initPlayer(shared_ptr player) +void SurvivalMode::initPlayer(std::shared_ptr player) { player->yRot = -180; } @@ -63,7 +63,7 @@ bool SurvivalMode::destroyBlock(int x, int y, int z, int face) int data = minecraft->level->getData(x, y, z); bool changed = GameMode::destroyBlock(x, y, z, face); - shared_ptr item = minecraft->player->getSelectedItem(); + std::shared_ptr item = minecraft->player->getSelectedItem(); bool couldDestroy = minecraft->player->canDestroy(Tile::tiles[t]); if (item != NULL) { @@ -73,7 +73,7 @@ bool SurvivalMode::destroyBlock(int x, int y, int z, int face) minecraft->player->removeSelectedItem(); } } - if (changed && couldDestroy) + if (changed && couldDestroy) { Tile::tiles[t]->playerDestroy(minecraft->level, minecraft->player, x, y, z, data); } @@ -171,9 +171,9 @@ void SurvivalMode::initLevel(Level *level) GameMode::initLevel(level); } -shared_ptr SurvivalMode::createPlayer(Level *level) +std::shared_ptr SurvivalMode::createPlayer(Level *level) { - shared_ptr player = GameMode::createPlayer(level); + std::shared_ptr player = GameMode::createPlayer(level); // player.inventory.add(new ItemInstance(Item.pickAxe_diamond)); // player.inventory.add(new ItemInstance(Item.hatchet_diamond)); // player.inventory.add(new ItemInstance(Tile.torch, 64)); @@ -189,7 +189,7 @@ void SurvivalMode::tick() //minecraft->soundEngine->playMusicTick(); } -bool SurvivalMode::useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly, bool *pbUsedItem) +bool SurvivalMode::useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly, bool *pbUsedItem) { int t = level->getTile(x, y, z); if (t > 0) diff --git a/Minecraft.Client/SurvivalMode.h b/Minecraft.Client/SurvivalMode.h index b4ce5e6d..643e50d1 100644 --- a/Minecraft.Client/SurvivalMode.h +++ b/Minecraft.Client/SurvivalMode.h @@ -15,7 +15,7 @@ private: public: SurvivalMode(Minecraft *minecraft); SurvivalMode(SurvivalMode *copy); - virtual void initPlayer(shared_ptr player); + virtual void initPlayer(std::shared_ptr player); virtual void init(); virtual bool canHurtPlayer(); virtual bool destroyBlock(int x, int y, int z, int face); @@ -25,8 +25,8 @@ public: virtual void render(float a); virtual float getPickRange(); virtual void initLevel(Level *level); - virtual shared_ptr createPlayer(Level *level); + virtual std::shared_ptr createPlayer(Level *level); virtual void tick(); - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem=NULL); + virtual bool useItemOn(std::shared_ptr player, Level *level, std::shared_ptr item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem=NULL); virtual bool hasExperience(); }; \ No newline at end of file diff --git a/Minecraft.Client/TakeAnimationParticle.cpp b/Minecraft.Client/TakeAnimationParticle.cpp index c9530b0a..3f00c004 100644 --- a/Minecraft.Client/TakeAnimationParticle.cpp +++ b/Minecraft.Client/TakeAnimationParticle.cpp @@ -5,7 +5,7 @@ #include "..\Minecraft.World\net.minecraft.world.level.h" #include "..\Minecraft.World\Mth.h" -TakeAnimationParticle::TakeAnimationParticle(Level *level, shared_ptr item, shared_ptr target, float yOffs) : Particle(level, item->x, item->y, item->z, item->xd, item->yd, item->zd) +TakeAnimationParticle::TakeAnimationParticle(Level *level, std::shared_ptr item, std::shared_ptr target, float yOffs) : Particle(level, item->x, item->y, item->z, item->xd, item->yd, item->zd) { // 4J - added initialisers life = 0; @@ -39,7 +39,7 @@ void TakeAnimationParticle::render(Tesselator *t, float a, float xa, float ya, f double xx = xo + (xt - xo) * time; double yy = yo + (yt - yo) * time; double zz = zo + (zt - zo) * time; - + int xTile = Mth::floor(xx); int yTile = Mth::floor(yy + heightOffset / 2.0f); int zTile = Mth::floor(zz); @@ -58,12 +58,12 @@ void TakeAnimationParticle::render(Tesselator *t, float a, float xa, float ya, f float br = level->getBrightness(xTile, yTile, zTile); glColor4f(br, br, br, 1); } - + xx-=xOff; yy-=yOff; zz-=zOff; - - + + EntityRenderDispatcher::instance->render(item, (float)xx, (float)yy, (float)zz, item->yRot, a); } diff --git a/Minecraft.Client/TakeAnimationParticle.h b/Minecraft.Client/TakeAnimationParticle.h index 10026fda..33c4535f 100644 --- a/Minecraft.Client/TakeAnimationParticle.h +++ b/Minecraft.Client/TakeAnimationParticle.h @@ -7,14 +7,14 @@ class TakeAnimationParticle : public Particle public: virtual eINSTANCEOF GetType() { return eType_TAKEANIMATIONPARTICLE; } private: - shared_ptr item; - shared_ptr target; + std::shared_ptr item; + std::shared_ptr target; int life; int lifeTime; float yOffs; public: - TakeAnimationParticle(Level *level, shared_ptr item, shared_ptr target, float yOffs); + TakeAnimationParticle(Level *level, std::shared_ptr item, std::shared_ptr target, float yOffs); ~TakeAnimationParticle(); virtual void render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2); virtual void tick(); diff --git a/Minecraft.Client/TeleportCommand.cpp b/Minecraft.Client/TeleportCommand.cpp index 2132cfd4..d80baca9 100644 --- a/Minecraft.Client/TeleportCommand.cpp +++ b/Minecraft.Client/TeleportCommand.cpp @@ -14,20 +14,20 @@ EGameCommand TeleportCommand::getId() return eGameCommand_Teleport; } -void TeleportCommand::execute(shared_ptr source, byteArray commandData) +void TeleportCommand::execute(std::shared_ptr source, byteArray commandData) { ByteArrayInputStream bais(commandData); DataInputStream dis(&bais); PlayerUID subjectID = dis.readPlayerUID(); PlayerUID destinationID = dis.readPlayerUID(); - + bais.reset(); PlayerList *players = MinecraftServer::getInstance()->getPlayerList(); - shared_ptr subject = players->getPlayer(subjectID); - shared_ptr destination = players->getPlayer(destinationID); + std::shared_ptr subject = players->getPlayer(subjectID); + std::shared_ptr destination = players->getPlayer(destinationID); if(subject != NULL && destination != NULL && subject->level->dimension->id == destination->level->dimension->id && subject->isAlive() ) { @@ -78,7 +78,7 @@ void TeleportCommand::execute(shared_ptr source, byteArray comman //} } -shared_ptr TeleportCommand::preparePacket(PlayerUID subject, PlayerUID destination) +std::shared_ptr TeleportCommand::preparePacket(PlayerUID subject, PlayerUID destination) { ByteArrayOutputStream baos; DataOutputStream dos(&baos); @@ -86,5 +86,5 @@ shared_ptr TeleportCommand::preparePacket(PlayerUID subject, dos.writePlayerUID(subject); dos.writePlayerUID(destination); - return shared_ptr( new GameCommandPacket(eGameCommand_Teleport, baos.toByteArray() )); + return std::shared_ptr( new GameCommandPacket(eGameCommand_Teleport, baos.toByteArray() )); } \ No newline at end of file diff --git a/Minecraft.Client/TeleportCommand.h b/Minecraft.Client/TeleportCommand.h index 9015a52d..b6f3b742 100644 --- a/Minecraft.Client/TeleportCommand.h +++ b/Minecraft.Client/TeleportCommand.h @@ -6,7 +6,7 @@ class TeleportCommand : public Command { public: virtual EGameCommand getId(); - virtual void execute(shared_ptr source, byteArray commandData); + virtual void execute(std::shared_ptr source, byteArray commandData); - static shared_ptr preparePacket(PlayerUID subject, PlayerUID destination); + static std::shared_ptr preparePacket(PlayerUID subject, PlayerUID destination); }; \ No newline at end of file diff --git a/Minecraft.Client/TerrainParticle.cpp b/Minecraft.Client/TerrainParticle.cpp index 811ba840..5d2efbdc 100644 --- a/Minecraft.Client/TerrainParticle.cpp +++ b/Minecraft.Client/TerrainParticle.cpp @@ -14,7 +14,7 @@ TerrainParticle::TerrainParticle(Level *level, double x, double y, double z, dou size /= 2; } -shared_ptr TerrainParticle::init(int x, int y, int z, int data) // 4J - added data parameter +std::shared_ptr TerrainParticle::init(int x, int y, int z, int data) // 4J - added data parameter { if (tile == Tile::grass) return dynamic_pointer_cast( shared_from_this() ); int col = tile->getColor(level, x, y, z, data); // 4J - added data parameter @@ -24,7 +24,7 @@ shared_ptr TerrainParticle::init(int x, int y, int z, int data) return dynamic_pointer_cast( shared_from_this() ); } -shared_ptr TerrainParticle::init(int data) +std::shared_ptr TerrainParticle::init(int data) { if (tile == Tile::grass) return dynamic_pointer_cast( shared_from_this() ); int col = tile->getColor(data); @@ -59,7 +59,7 @@ void TerrainParticle::render(Tesselator *t, float a, float xa, float ya, float z float y = (float) (yo + (this->y - yo) * a - yOff); float z = (float) (zo + (this->z - zo) * a - zOff); - // 4J - don't render terrain particles that are less than a metre away, to try and avoid large particles that are causing us problems with + // 4J - don't render terrain particles that are less than a metre away, to try and avoid large particles that are causing us problems with // photosensitivity testing float distSq = (x*x + y*y + z*z); if( distSq < 1.0f ) return; diff --git a/Minecraft.Client/TerrainParticle.h b/Minecraft.Client/TerrainParticle.h index 5d4a743f..df9ca42f 100644 --- a/Minecraft.Client/TerrainParticle.h +++ b/Minecraft.Client/TerrainParticle.h @@ -11,8 +11,8 @@ private: public: TerrainParticle(Level *level, double x, double y, double z, double xa, double ya, double za, Tile *tile, int face, int data, Textures *textures); - shared_ptr init(int x, int y, int z, int data); // 4J - added data parameter - shared_ptr init(int data); + std::shared_ptr init(int x, int y, int z, int data); // 4J - added data parameter + std::shared_ptr init(int data); virtual int getParticleTexture(); virtual void render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2); }; \ No newline at end of file diff --git a/Minecraft.Client/TextEditScreen.cpp b/Minecraft.Client/TextEditScreen.cpp index 9537b969..24f86a4a 100644 --- a/Minecraft.Client/TextEditScreen.cpp +++ b/Minecraft.Client/TextEditScreen.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "TextEditScreen.h" +#include "TextEditScreen.h" #include "Button.h" #include "TileEntityRenderDispatcher.h" #include "ClientConnection.h" @@ -13,7 +13,7 @@ const wstring TextEditScreen::allowedChars = SharedConstants::acceptableLetters;; -TextEditScreen::TextEditScreen(shared_ptr sign) +TextEditScreen::TextEditScreen(std::shared_ptr sign) { // 4J - added initialisers line = 0; @@ -35,7 +35,7 @@ void TextEditScreen::removed() Keyboard::enableRepeatEvents(false); if (minecraft->level->isClientSide) { - minecraft->getConnection(0)->send( shared_ptr( new SignUpdatePacket(sign->x, sign->y, sign->z, sign->IsVerified(), sign->IsCensored(), sign->GetMessages()) ) ); + minecraft->getConnection(0)->send( std::shared_ptr( new SignUpdatePacket(sign->x, sign->y, sign->z, sign->IsVerified(), sign->IsCensored(), sign->GetMessages()) ) ); } } diff --git a/Minecraft.Client/TextEditScreen.h b/Minecraft.Client/TextEditScreen.h index aad6ebc8..b089f998 100644 --- a/Minecraft.Client/TextEditScreen.h +++ b/Minecraft.Client/TextEditScreen.h @@ -8,12 +8,12 @@ class TextEditScreen : public Screen protected: wstring title; private: - shared_ptr sign; + std::shared_ptr sign; int frame; int line; public: - TextEditScreen(shared_ptr sign); + TextEditScreen(std::shared_ptr sign); virtual void init(); virtual void removed(); virtual void tick(); diff --git a/Minecraft.Client/TheEndPortalRenderer.cpp b/Minecraft.Client/TheEndPortalRenderer.cpp index 52581579..7837a4fa 100644 --- a/Minecraft.Client/TheEndPortalRenderer.cpp +++ b/Minecraft.Client/TheEndPortalRenderer.cpp @@ -7,10 +7,10 @@ #include "..\Minecraft.World\FloatBuffer.h" #include "TheEndPortalRenderer.h" -void TheEndPortalRenderer::render(shared_ptr _table, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +void TheEndPortalRenderer::render(std::shared_ptr _table, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) { // 4J Convert as we aren't using a templated class - shared_ptr table = dynamic_pointer_cast(_table); + std::shared_ptr table = dynamic_pointer_cast(_table); float xx = (float) (tileEntityRenderDispatcher->xPlayer); float yy = (float) (tileEntityRenderDispatcher->yPlayer); float zz = (float) (tileEntityRenderDispatcher->zPlayer); diff --git a/Minecraft.Client/TheEndPortalRenderer.h b/Minecraft.Client/TheEndPortalRenderer.h index 1e4ca546..fe489275 100644 --- a/Minecraft.Client/TheEndPortalRenderer.h +++ b/Minecraft.Client/TheEndPortalRenderer.h @@ -5,7 +5,7 @@ class TheEndPortalRenderer : public TileEntityRenderer { public: - virtual void render(shared_ptr _table, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); + virtual void render(std::shared_ptr _table, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); FloatBuffer *lb; diff --git a/Minecraft.Client/TileEntityRenderDispatcher.cpp b/Minecraft.Client/TileEntityRenderDispatcher.cpp index 1708d215..43111e6e 100644 --- a/Minecraft.Client/TileEntityRenderDispatcher.cpp +++ b/Minecraft.Client/TileEntityRenderDispatcher.cpp @@ -80,18 +80,18 @@ TileEntityRenderer *TileEntityRenderDispatcher::getRenderer(eINSTANCEOF e) return it->second; } -bool TileEntityRenderDispatcher::hasRenderer(shared_ptr e) +bool TileEntityRenderDispatcher::hasRenderer(std::shared_ptr e) { return getRenderer(e) != NULL; } -TileEntityRenderer *TileEntityRenderDispatcher::getRenderer(shared_ptr e) +TileEntityRenderer *TileEntityRenderDispatcher::getRenderer(std::shared_ptr e) { if (e == NULL) return NULL; return getRenderer(e->GetType()); } -void TileEntityRenderDispatcher::prepare(Level *level, Textures *textures, Font *font, shared_ptr player, float a) +void TileEntityRenderDispatcher::prepare(Level *level, Textures *textures, Font *font, std::shared_ptr player, float a) { if( this->level != level ) { @@ -109,7 +109,7 @@ void TileEntityRenderDispatcher::prepare(Level *level, Textures *textures, Font zPlayer = player->zOld + (player->z - player->zOld) * a; } -void TileEntityRenderDispatcher::render(shared_ptr e, float a, bool setColor/*=true*/) +void TileEntityRenderDispatcher::render(std::shared_ptr e, float a, bool setColor/*=true*/) { if (e->distanceToSqr(xPlayer, yPlayer, zPlayer) < 64 * 64) { @@ -131,7 +131,7 @@ void TileEntityRenderDispatcher::render(shared_ptr e, float a, bool } } -void TileEntityRenderDispatcher::render(shared_ptr entity, double x, double y, double z, float a, bool setColor/*=true*/, float alpha, bool useCompiled) +void TileEntityRenderDispatcher::render(std::shared_ptr entity, double x, double y, double z, float a, bool setColor/*=true*/, float alpha, bool useCompiled) { TileEntityRenderer *renderer = getRenderer(entity); if (renderer != NULL) diff --git a/Minecraft.Client/TileEntityRenderDispatcher.h b/Minecraft.Client/TileEntityRenderDispatcher.h index d86ddb01..de006bcf 100644 --- a/Minecraft.Client/TileEntityRenderDispatcher.h +++ b/Minecraft.Client/TileEntityRenderDispatcher.h @@ -25,7 +25,7 @@ public: Textures *textures; Level *level; - shared_ptr cameraEntity; + std::shared_ptr cameraEntity; float playerRotY; float playerRotX; double xPlayer, yPlayer, zPlayer; @@ -35,11 +35,11 @@ private: public: TileEntityRenderer *getRenderer(eINSTANCEOF e); - bool hasRenderer(shared_ptr e); - TileEntityRenderer * getRenderer(shared_ptr e); - void prepare(Level *level, Textures *textures, Font *font, shared_ptr player, float a); - void render(shared_ptr e, float a, bool setColor = true); - void render(shared_ptr entity, double x, double y, double z, float a, bool setColor = true, float alpha=1.0f, bool useCompiled = true); // 4J Added useCompiled + bool hasRenderer(std::shared_ptr e); + TileEntityRenderer * getRenderer(std::shared_ptr e); + void prepare(Level *level, Textures *textures, Font *font, std::shared_ptr player, float a); + void render(std::shared_ptr e, float a, bool setColor = true); + void render(std::shared_ptr entity, double x, double y, double z, float a, bool setColor = true, float alpha=1.0f, bool useCompiled = true); // 4J Added useCompiled void setLevel(Level *level); double distanceToSqr(double x, double y, double z); Font *getFont(); diff --git a/Minecraft.Client/TileEntityRenderer.h b/Minecraft.Client/TileEntityRenderer.h index b7d08b86..292e1d00 100644 --- a/Minecraft.Client/TileEntityRenderer.h +++ b/Minecraft.Client/TileEntityRenderer.h @@ -10,7 +10,7 @@ class TileEntityRenderer protected: TileEntityRenderDispatcher *tileEntityRenderDispatcher; public: - virtual void render(shared_ptr entity, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) = 0; // 4J added setColor param and alpha and useCompiled + virtual void render(std::shared_ptr entity, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) = 0; // 4J added setColor param and alpha and useCompiled virtual void onNewLevel(Level *level) {} protected: void bindTexture(int resourceName); // 4J - changed from wstring to int diff --git a/Minecraft.Client/TileRenderer.cpp b/Minecraft.Client/TileRenderer.cpp index 3962cc71..cb9b02f6 100644 --- a/Minecraft.Client/TileRenderer.cpp +++ b/Minecraft.Client/TileRenderer.cpp @@ -244,7 +244,7 @@ void TileRenderer::tesselateInWorldFixedTexture( Tile* tile, int x, int y, int z } void TileRenderer::tesselateInWorldNoCulling( Tile* tile, int x, int y, int z, int forceData, - shared_ptr< TileEntity > forceEntity ) // 4J added forceData, forceEntity param + std::shared_ptr< TileEntity > forceEntity ) // 4J added forceData, forceEntity param { noCulling = true; tesselateInWorld( tile, x, y, z, forceData ); @@ -252,7 +252,7 @@ void TileRenderer::tesselateInWorldNoCulling( Tile* tile, int x, int y, int z, i } bool TileRenderer::tesselateInWorld( Tile* tt, int x, int y, int z, int forceData, - shared_ptr< TileEntity > forceEntity ) // 4J added forceData, forceEntity param + std::shared_ptr< TileEntity > forceEntity ) // 4J added forceData, forceEntity param { Tesselator* t = Tesselator::getInstance(); int shape = tt->getRenderShape(); diff --git a/Minecraft.Client/TileRenderer.h b/Minecraft.Client/TileRenderer.h index 4045ece2..ec369939 100644 --- a/Minecraft.Client/TileRenderer.h +++ b/Minecraft.Client/TileRenderer.h @@ -79,9 +79,9 @@ public: void tesselateInWorldFixedTexture( Tile* tile, int x, int y, int z, Icon *fixedTexture ); // 4J renamed to differentiate from tesselateInWorld void tesselateInWorldNoCulling( Tile* tile, int x, int y, int z, int forceData = -1, - shared_ptr< TileEntity > forceEntity = shared_ptr< TileEntity >() ); // 4J added forceData, forceEntity param - bool tesselateInWorld( Tile* tt, int x, int y, int z, int forceData = -1, shared_ptr< TileEntity > forceEntity = - shared_ptr< TileEntity >() ); // 4J added forceData, forceEntity param + std::shared_ptr< TileEntity > forceEntity = std::shared_ptr< TileEntity >() ); // 4J added forceData, forceEntity param + bool tesselateInWorld( Tile* tt, int x, int y, int z, int forceData = -1, std::shared_ptr< TileEntity > forceEntity = + std::shared_ptr< TileEntity >() ); // 4J added forceData, forceEntity param private: bool tesselateAirPortalFrameInWorld(TheEndPortalFrameTile *tt, int x, int y, int z); diff --git a/Minecraft.Client/TntRenderer.cpp b/Minecraft.Client/TntRenderer.cpp index 3bb7484f..755abea4 100644 --- a/Minecraft.Client/TntRenderer.cpp +++ b/Minecraft.Client/TntRenderer.cpp @@ -10,10 +10,10 @@ TntRenderer::TntRenderer() this->shadowRadius = 0.5f; } -void TntRenderer::render(shared_ptr _tnt, double x, double y, double z, float rot, float a) +void TntRenderer::render(std::shared_ptr _tnt, double x, double y, double z, float rot, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr tnt = dynamic_pointer_cast(_tnt); + std::shared_ptr tnt = dynamic_pointer_cast(_tnt); glPushMatrix(); glTranslatef((float) x, (float) y, (float) z); diff --git a/Minecraft.Client/TntRenderer.h b/Minecraft.Client/TntRenderer.h index 4d9c029c..1f70c8da 100644 --- a/Minecraft.Client/TntRenderer.h +++ b/Minecraft.Client/TntRenderer.h @@ -8,5 +8,5 @@ private: public: TntRenderer(); - virtual void render(shared_ptr _tnt, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr _tnt, double x, double y, double z, float rot, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/TrackedEntity.cpp b/Minecraft.Client/TrackedEntity.cpp index 70f25c93..c372bdaf 100644 --- a/Minecraft.Client/TrackedEntity.cpp +++ b/Minecraft.Client/TrackedEntity.cpp @@ -20,7 +20,7 @@ #include "PlayerChunkMap.h" #include -TrackedEntity::TrackedEntity(shared_ptr e, int range, int updateInterval, bool trackDelta) +TrackedEntity::TrackedEntity(std::shared_ptr e, int range, int updateInterval, bool trackDelta) { // 4J added initialisers xap = yap = zap = 0; @@ -29,7 +29,7 @@ TrackedEntity::TrackedEntity(shared_ptr e, int range, int updateInterval updatedPlayerVisibility = false; teleportDelay = 0; moved = false; - + this->e = e; this->range = range; this->updateInterval = updateInterval; @@ -46,7 +46,7 @@ TrackedEntity::TrackedEntity(shared_ptr e, int range, int updateInterval int c0a = 0, c0b = 0, c1a = 0, c1b = 0, c1c = 0, c2a = 0, c2b = 0; -void TrackedEntity::tick(EntityTracker *tracker, vector > *players) +void TrackedEntity::tick(EntityTracker *tracker, vector > *players) { moved = false; if (!updatedPlayerVisibility || e->distanceToSqr(xpu, ypu, zpu) > 4 * 4) @@ -62,35 +62,35 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl if (wasRiding != e->riding) { wasRiding = e->riding; - broadcast(shared_ptr(new SetRidingPacket(e, e->riding))); + broadcast(std::shared_ptr(new SetRidingPacket(e, e->riding))); } // Moving forward special case for item frames - if (e->GetType()== eTYPE_ITEM_FRAME && tickCount % 10 == 0) + if (e->GetType()== eTYPE_ITEM_FRAME && tickCount % 10 == 0) { - shared_ptr frame = dynamic_pointer_cast (e); - shared_ptr item = frame->getItem(); + std::shared_ptr frame = dynamic_pointer_cast (e); + std::shared_ptr item = frame->getItem(); - if (item != NULL && item->getItem()->id == Item::map_Id && !e->removed) + if (item != NULL && item->getItem()->id == Item::map_Id && !e->removed) { - shared_ptr data = Item::map->getSavedData(item, e->level); + std::shared_ptr data = Item::map->getSavedData(item, e->level); for (AUTO_VAR(it,players->begin() ); it != players->end(); ++it) { - shared_ptr player = dynamic_pointer_cast(*it); + std::shared_ptr player = dynamic_pointer_cast(*it); data->tickCarriedBy(player, item); - - if (!player->removed && player->connection && player->connection->countDelayedPackets() <= 5) + + if (!player->removed && player->connection && player->connection->countDelayedPackets() <= 5) { - shared_ptr packet = Item::map->getUpdatePacket(item, e->level, player); + std::shared_ptr packet = Item::map->getUpdatePacket(item, e->level, player); if (packet != NULL) player->connection->send(packet); } } } - shared_ptr entityData = e->getEntityData(); - if (entityData->isDirty()) + std::shared_ptr entityData = e->getEntityData(); + if (entityData->isDirty()) { - broadcastAndSend( shared_ptr( new SetEntityDataPacket(e->entityId, entityData, false) ) ); + broadcastAndSend( std::shared_ptr( new SetEntityDataPacket(e->entityId, entityData, false) ) ); } } else @@ -111,14 +111,14 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl int ya = yn - yp; int za = zn - zp; - shared_ptr packet = nullptr; + std::shared_ptr packet = nullptr; // 4J - this pos flag used to be set based on abs(xn) etc. but that just seems wrong bool pos = abs(xa) >= TOLERANCE_LEVEL || abs(ya) >= TOLERANCE_LEVEL || abs(za) >= TOLERANCE_LEVEL; // 4J - changed rotation to be generally sent as a delta as well as position int yRota = yRotn - yRotp; int xRota = xRotn - xRotp; - // Keep rotation deltas in +/- 180 degree range + // Keep rotation deltas in +/- 180 degree range while( yRota > 127 ) yRota -= 256; while( yRota < -128 ) yRota += 256; while( xRota > 127 ) xRota -= 256; @@ -134,7 +134,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl ) { teleportDelay = 0; - packet = shared_ptr( new TeleportEntityPacket(e->entityId, xn, yn, zn, (byte) yRotn, (byte) xRotn) ); + packet = std::shared_ptr( new TeleportEntityPacket(e->entityId, xn, yn, zn, (byte) yRotn, (byte) xRotn) ); // printf("%d: New teleport rot %d\n",e->entityId,yRotn); yRotp = yRotn; xRotp = xRotn; @@ -161,12 +161,12 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl yRotn = yRotp + yRota; } // 5 bits each for x & z, and 6 for y - packet = shared_ptr( new MoveEntityPacketSmall::PosRot(e->entityId, (char) xa, (char) ya, (char) za, (char) yRota, 0 ) ); + packet = std::shared_ptr( new MoveEntityPacketSmall::PosRot(e->entityId, (char) xa, (char) ya, (char) za, (char) yRota, 0 ) ); c0a++; } else { - packet = shared_ptr( new MoveEntityPacket::PosRot(e->entityId, (char) xa, (char) ya, (char) za, (char) yRota, (char) xRota) ); + packet = std::shared_ptr( new MoveEntityPacket::PosRot(e->entityId, (char) xa, (char) ya, (char) za, (char) yRota, (char) xRota) ); // printf("%d: New posrot %d + %d = %d\n",e->entityId,yRotp,yRota,yRotn); c0b++; } @@ -179,7 +179,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl ( ya >= -16 ) && ( ya <= 15 ) ) { // 4 bits each for x & z, and 5 for y - packet = shared_ptr( new MoveEntityPacketSmall::Pos(e->entityId, (char) xa, (char) ya, (char) za) ); + packet = std::shared_ptr( new MoveEntityPacketSmall::Pos(e->entityId, (char) xa, (char) ya, (char) za) ); c1a++; } @@ -188,12 +188,12 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl ( ya >= -32 ) && ( ya <= 31 ) ) { // use the packet with small packet with rotation if we can - 5 bits each for x & z, and 6 for y - still a byte less than the alternative - packet = shared_ptr( new MoveEntityPacketSmall::PosRot(e->entityId, (char) xa, (char) ya, (char) za, 0, 0 )); + packet = std::shared_ptr( new MoveEntityPacketSmall::PosRot(e->entityId, (char) xa, (char) ya, (char) za, 0, 0 )); c1b++; } else { - packet = shared_ptr( new MoveEntityPacket::Pos(e->entityId, (char) xa, (char) ya, (char) za) ); + packet = std::shared_ptr( new MoveEntityPacket::Pos(e->entityId, (char) xa, (char) ya, (char) za) ); c1c++; } } @@ -213,13 +213,13 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl yRota = 15; yRotn = yRotp + yRota; } - packet = shared_ptr( new MoveEntityPacketSmall::Rot(e->entityId, (char) yRota, 0) ); + packet = std::shared_ptr( new MoveEntityPacketSmall::Rot(e->entityId, (char) yRota, 0) ); c2a++; } else { // printf("%d: New rot %d + %d = %d\n",e->entityId,yRotp,yRota,yRotn); - packet = shared_ptr( new MoveEntityPacket::Rot(e->entityId, (char) yRota, (char) xRota) ); + packet = std::shared_ptr( new MoveEntityPacket::Rot(e->entityId, (char) yRota, (char) xRota) ); c2b++; } } @@ -240,7 +240,7 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl xap = e->xd; yap = e->yd; zap = e->zd; - broadcast( shared_ptr( new SetEntityMotionPacket(e->entityId, xap, yap, zap) ) ); + broadcast( std::shared_ptr( new SetEntityMotionPacket(e->entityId, xap, yap, zap) ) ); } } @@ -250,17 +250,17 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl broadcast(packet); } - shared_ptr entityData = e->getEntityData(); + std::shared_ptr entityData = e->getEntityData(); if (entityData->isDirty()) { - broadcastAndSend( shared_ptr( new SetEntityDataPacket(e->entityId, entityData, false) ) ); + broadcastAndSend( std::shared_ptr( new SetEntityDataPacket(e->entityId, entityData, false) ) ); } int yHeadRot = Mth::floor(e->getYHeadRot() * 256 / 360); if (abs(yHeadRot - yHeadRotp) >= TOLERANCE_LEVEL) { - broadcast(shared_ptr(new RotateHeadPacket(e->entityId, (byte) yHeadRot))); + broadcast(std::shared_ptr(new RotateHeadPacket(e->entityId, (byte) yHeadRot))); yHeadRotp = yHeadRot; } @@ -281,13 +281,13 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl // printf("%d: %d + %d = %d (%f)\n",e->entityId,xRotp,xRota,xRotn,e->xRot); // } } - + } else // 4J-JEV: Added: Mobs in minecarts weren't synching their invisibility. { - shared_ptr entityData = e->getEntityData(); + std::shared_ptr entityData = e->getEntityData(); if (entityData->isDirty()) - broadcastAndSend( shared_ptr( new SetEntityDataPacket(e->entityId, entityData, false) ) ); + broadcastAndSend( std::shared_ptr( new SetEntityDataPacket(e->entityId, entityData, false) ) ); } e->hasImpulse = false; } @@ -295,20 +295,20 @@ void TrackedEntity::tick(EntityTracker *tracker, vector > *pl if (e->hurtMarked) { // broadcast(new AnimatePacket(e, AnimatePacket.HURT)); - broadcastAndSend( shared_ptr( new SetEntityMotionPacket(e) ) ); + broadcastAndSend( std::shared_ptr( new SetEntityMotionPacket(e) ) ); e->hurtMarked = false; } } -void TrackedEntity::broadcast(shared_ptr packet) +void TrackedEntity::broadcast(std::shared_ptr packet) { if( Packet::canSendToAnyClient( packet ) ) { // 4J-PB - due to the knockback on a player being hit, we need to send to all players, but limit the network traffic here to players that have not already had it sent to their system - vector< shared_ptr > sentTo; + vector< std::shared_ptr > sentTo; - // 4J - don't send to a player we've already sent this data to that shares the same machine. + // 4J - don't send to a player we've already sent this data to that shares the same machine. // EntityMotionPacket used to limit themselves to sending once to each machine // by only sending to the primary player on each machine. This was causing trouble for split screen // as only the primary player would get a knockback velocity. Now these packets can be sent to any @@ -316,7 +316,7 @@ void TrackedEntity::broadcast(shared_ptr packet) for( AUTO_VAR(it, seenBy.begin()); it != seenBy.end(); it++ ) { - shared_ptr player = *it; + std::shared_ptr player = *it; bool dontSend = false; if( sentTo.size() ) { @@ -327,15 +327,15 @@ void TrackedEntity::broadcast(shared_ptr packet) } else { - for(unsigned int j = 0; j < sentTo.size(); j++ ) + for(unsigned int j = 0; j < sentTo.size(); j++ ) { - shared_ptr player2 = sentTo[j]; + std::shared_ptr player2 = sentTo[j]; INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); if( otherPlayer != NULL && thisPlayer->IsSameSystem(otherPlayer) ) { dontSend = true; // #ifdef _DEBUG - // shared_ptr emp= dynamic_pointer_cast (packet); + // std::shared_ptr emp= dynamic_pointer_cast (packet); // if(emp!=NULL) // { // app.DebugPrintf("Not sending this SetEntityMotionPacket to player - it's already been sent to a player on their console\n"); @@ -366,11 +366,11 @@ void TrackedEntity::broadcast(shared_ptr packet) } } -void TrackedEntity::broadcastAndSend(shared_ptr packet) +void TrackedEntity::broadcastAndSend(std::shared_ptr packet) { - vector< shared_ptr > sentTo; + vector< std::shared_ptr > sentTo; broadcast(packet); - shared_ptr sp = dynamic_pointer_cast(e); + std::shared_ptr sp = dynamic_pointer_cast(e); if (sp != NULL && sp->connection) { sp->connection->send(packet); @@ -385,7 +385,7 @@ void TrackedEntity::broadcastRemoved() } } -void TrackedEntity::removePlayer(shared_ptr sp) +void TrackedEntity::removePlayer(std::shared_ptr sp) { AUTO_VAR(it, seenBy.find( sp )); if( it != seenBy.end() ) @@ -395,7 +395,7 @@ void TrackedEntity::removePlayer(shared_ptr sp) } // 4J-JEV: Added for code reuse. -TrackedEntity::eVisibility TrackedEntity::isVisible(EntityTracker *tracker, shared_ptr sp, bool forRider) +TrackedEntity::eVisibility TrackedEntity::isVisible(EntityTracker *tracker, std::shared_ptr sp, bool forRider) { // 4J Stu - We call update players when the entity has moved more than a certain amount at the start of it's tick // Before this call we set xpu, ypu and zpu to the entities new position, but xp,yp and zp are the old position until later in the tick. @@ -424,7 +424,7 @@ TrackedEntity::eVisibility TrackedEntity::isVisible(EntityTracker *tracker, shar for( unsigned int i = 0; i < server->getPlayers()->players.size(); i++ ) { // Consider extra players, but not if they are the entity we are tracking, or the player we've been passed as input, or in another dimension - shared_ptr ep = server->getPlayers()->players[i]; + std::shared_ptr ep = server->getPlayers()->players[i]; if( ep == sp ) continue; if( ep == e ) continue; if( ep->dimension != sp->dimension ) continue; @@ -461,24 +461,24 @@ TrackedEntity::eVisibility TrackedEntity::isVisible(EntityTracker *tracker, shar else return eVisibility_NotVisible; } -void TrackedEntity::updatePlayer(EntityTracker *tracker, shared_ptr sp) +void TrackedEntity::updatePlayer(EntityTracker *tracker, std::shared_ptr sp) { if (sp == e) return; eVisibility visibility = this->isVisible(tracker, sp); - + if ( visibility == eVisibility_SeenAndVisible && seenBy.find(sp) == seenBy.end() ) { seenBy.insert(sp); - shared_ptr packet = getAddEntityPacket(); + std::shared_ptr packet = getAddEntityPacket(); sp->connection->send(packet); xap = e->xd; yap = e->yd; zap = e->zd; - shared_ptr plr = dynamic_pointer_cast(e); + std::shared_ptr plr = dynamic_pointer_cast(e); if (plr != NULL) { app.DebugPrintf( "TrackedEntity:: Player '%ls' is now visible to player '%ls', %s.\n", @@ -490,17 +490,17 @@ void TrackedEntity::updatePlayer(EntityTracker *tracker, shared_ptrgetEntityData()->isEmpty() && !(dynamic_pointer_cast(packet))) { - sp->connection->send(shared_ptr( new SetEntityDataPacket(e->entityId, e->getEntityData(), true))); + sp->connection->send(std::shared_ptr( new SetEntityDataPacket(e->entityId, e->getEntityData(), true))); } if (this->trackDelta) { - sp->connection->send( shared_ptr( new SetEntityMotionPacket(e->entityId, e->xd, e->yd, e->zd) ) ); + sp->connection->send( std::shared_ptr( new SetEntityMotionPacket(e->entityId, e->xd, e->yd, e->zd) ) ); } if (e->riding != NULL) { - sp->connection->send(shared_ptr(new SetRidingPacket(e, e->riding))); + sp->connection->send(std::shared_ptr(new SetRidingPacket(e, e->riding))); } ItemInstanceArray equipped = e->getEquipmentSlots(); @@ -508,28 +508,28 @@ void TrackedEntity::updatePlayer(EntityTracker *tracker, shared_ptrconnection->send( shared_ptr( new SetEquippedItemPacket(e->entityId, i, equipped[i]) ) ); + sp->connection->send( std::shared_ptr( new SetEquippedItemPacket(e->entityId, i, equipped[i]) ) ); } } if (dynamic_pointer_cast(e) != NULL) { - shared_ptr spe = dynamic_pointer_cast(e); + std::shared_ptr spe = dynamic_pointer_cast(e); if (spe->isSleeping()) { - sp->connection->send( shared_ptr( new EntityActionAtPositionPacket(e, EntityActionAtPositionPacket::START_SLEEP, Mth::floor(e->x), Mth::floor(e->y), Mth::floor(e->z)) ) ); + sp->connection->send( std::shared_ptr( new EntityActionAtPositionPacket(e, EntityActionAtPositionPacket::START_SLEEP, Mth::floor(e->x), Mth::floor(e->y), Mth::floor(e->z)) ) ); } } if (dynamic_pointer_cast(e) != NULL) { - shared_ptr mob = dynamic_pointer_cast(e); + std::shared_ptr mob = dynamic_pointer_cast(e); vector *activeEffects = mob->getActiveEffects(); for(AUTO_VAR(it, activeEffects->begin()); it != activeEffects->end(); ++it) { MobEffectInstance *effect = *it; - sp->connection->send(shared_ptr( new UpdateMobEffectPacket(e->entityId, effect) ) ); + sp->connection->send(std::shared_ptr( new UpdateMobEffectPacket(e->entityId, effect) ) ); } delete activeEffects; } @@ -546,7 +546,7 @@ void TrackedEntity::updatePlayer(EntityTracker *tracker, shared_ptr player) +bool TrackedEntity::canBySeenBy(std::shared_ptr player) { // 4J - for some reason this isn't currently working, and is causing players to not appear until we are really close to them. Not sure // what the conflict is between the java & our version, but removing for now as it is causing issues and we shouldn't *really* need it @@ -556,7 +556,7 @@ bool TrackedEntity::canBySeenBy(shared_ptr player) // return player->getLevel()->getChunkMap()->isPlayerIn(player, e->xChunk, e->zChunk); } -void TrackedEntity::updatePlayers(EntityTracker *tracker, vector > *players) +void TrackedEntity::updatePlayers(EntityTracker *tracker, vector > *players) { for (unsigned int i = 0; i < players->size(); i++) { @@ -564,7 +564,7 @@ void TrackedEntity::updatePlayers(EntityTracker *tracker, vector TrackedEntity::getAddEntityPacket() +std::shared_ptr TrackedEntity::getAddEntityPacket() { if (e->removed) { @@ -575,20 +575,20 @@ shared_ptr TrackedEntity::getAddEntityPacket() if (dynamic_pointer_cast(e) != NULL) { yHeadRotp = Mth::floor(e->getYHeadRot() * 256 / 360); - return shared_ptr( new AddMobPacket(dynamic_pointer_cast(e), yRotp, xRotp, xp, yp, zp, yHeadRotp) ); + return std::shared_ptr( new AddMobPacket(dynamic_pointer_cast(e), yRotp, xRotp, xp, yp, zp, yHeadRotp) ); } switch(e->GetType()) { case eTYPE_ITEMENTITY: { - shared_ptr packet = shared_ptr( new AddEntityPacket(e, AddEntityPacket::ITEM, 1, yRotp, xRotp, xp, yp, zp) ); + std::shared_ptr packet = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::ITEM, 1, yRotp, xRotp, xp, yp, zp) ); return packet; } break; case eTYPE_SERVERPLAYER: { - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); PlayerUID xuid = INVALID_XUID; PlayerUID OnlineXuid = INVALID_XUID; if( player != NULL ) @@ -597,76 +597,76 @@ shared_ptr TrackedEntity::getAddEntityPacket() OnlineXuid = player->getOnlineXuid(); } // 4J Added yHeadRotp param to fix #102563 - TU12: Content: Gameplay: When one of the Players is idle for a few minutes his head turns 180 degrees. - return shared_ptr( new AddPlayerPacket(dynamic_pointer_cast(e), xuid, OnlineXuid, xp, yp, zp, yRotp, xRotp, yHeadRotp ) ); + return std::shared_ptr( new AddPlayerPacket(dynamic_pointer_cast(e), xuid, OnlineXuid, xp, yp, zp, yRotp, xRotp, yHeadRotp ) ); } break; case eTYPE_MINECART: { - shared_ptr minecart = dynamic_pointer_cast(e); - if (minecart->type == Minecart::RIDEABLE) return shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_RIDEABLE, yRotp, xRotp, xp, yp, zp) ); - if (minecart->type == Minecart::CHEST) return shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_CHEST, yRotp, xRotp, xp, yp, zp) ); - if (minecart->type == Minecart::FURNACE) return shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_FURNACE, yRotp, xRotp, xp, yp, zp) ); + std::shared_ptr minecart = dynamic_pointer_cast(e); + if (minecart->type == Minecart::RIDEABLE) return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_RIDEABLE, yRotp, xRotp, xp, yp, zp) ); + if (minecart->type == Minecart::CHEST) return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_CHEST, yRotp, xRotp, xp, yp, zp) ); + if (minecart->type == Minecart::FURNACE) return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_FURNACE, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_BOAT: { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::BOAT, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::BOAT, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_ENDERDRAGON: { yHeadRotp = Mth::floor(e->getYHeadRot() * 256 / 360); - return shared_ptr( new AddMobPacket(dynamic_pointer_cast(e), yRotp, xRotp, xp, yp, zp, yHeadRotp ) ); + return std::shared_ptr( new AddMobPacket(dynamic_pointer_cast(e), yRotp, xRotp, xp, yp, zp, yHeadRotp ) ); } break; case eTYPE_FISHINGHOOK: { - shared_ptr owner = dynamic_pointer_cast(e)->owner; - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::FISH_HOOK, owner != NULL ? owner->entityId : e->entityId, yRotp, xRotp, xp, yp, zp) ); + std::shared_ptr owner = dynamic_pointer_cast(e)->owner; + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FISH_HOOK, owner != NULL ? owner->entityId : e->entityId, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_ARROW: { - shared_ptr owner = (dynamic_pointer_cast(e))->owner; - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::ARROW, owner != NULL ? owner->entityId : e->entityId, yRotp, xRotp, xp, yp, zp) ); + std::shared_ptr owner = (dynamic_pointer_cast(e))->owner; + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::ARROW, owner != NULL ? owner->entityId : e->entityId, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_SNOWBALL: { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::SNOWBALL, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::SNOWBALL, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_THROWNPOTION: { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_POTION, ((dynamic_pointer_cast(e))->getPotionValue()), yRotp, xRotp, xp, yp, zp)); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_POTION, ((dynamic_pointer_cast(e))->getPotionValue()), yRotp, xRotp, xp, yp, zp)); } break; case eTYPE_THROWNEXPBOTTLE: { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_EXPBOTTLE, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_EXPBOTTLE, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_THROWNENDERPEARL: { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_ENDERPEARL, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_ENDERPEARL, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_EYEOFENDERSIGNAL: { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::EYEOFENDERSIGNAL, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::EYEOFENDERSIGNAL, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_SMALL_FIREBALL: { - shared_ptr fb = dynamic_pointer_cast(e); - shared_ptr aep = nullptr; + std::shared_ptr fb = dynamic_pointer_cast(e); + std::shared_ptr aep = nullptr; if (fb->owner != NULL) { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::SMALL_FIREBALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::SMALL_FIREBALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); } else { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::SMALL_FIREBALL, 0, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::SMALL_FIREBALL, 0, yRotp, xRotp, xp, yp, zp) ); } aep->xa = (int) (fb->xPower * 8000); aep->ya = (int) (fb->yPower * 8000); @@ -676,15 +676,15 @@ shared_ptr TrackedEntity::getAddEntityPacket() break; case eTYPE_DRAGON_FIREBALL: { - shared_ptr fb = dynamic_pointer_cast(e); - shared_ptr aep = nullptr; + std::shared_ptr fb = dynamic_pointer_cast(e); + std::shared_ptr aep = nullptr; if (fb->owner != NULL) { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::DRAGON_FIRE_BALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::DRAGON_FIRE_BALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); } else { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::DRAGON_FIRE_BALL, 0, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::DRAGON_FIRE_BALL, 0, yRotp, xRotp, xp, yp, zp) ); } aep->xa = (int) (fb->xPower * 8000); aep->ya = (int) (fb->yPower * 8000); @@ -694,15 +694,15 @@ shared_ptr TrackedEntity::getAddEntityPacket() break; case eTYPE_FIREBALL: { - shared_ptr fb = dynamic_pointer_cast(e); - shared_ptr aep = nullptr; + std::shared_ptr fb = dynamic_pointer_cast(e); + std::shared_ptr aep = nullptr; if (fb->owner != NULL) { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::FIREBALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FIREBALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); } else { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::FIREBALL, 0, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FIREBALL, 0, yRotp, xRotp, xp, yp, zp) ); } aep->xa = (int) (fb->xPower * 8000); aep->ya = (int) (fb->yPower * 8000); @@ -712,33 +712,33 @@ shared_ptr TrackedEntity::getAddEntityPacket() break; case eTYPE_THROWNEGG: { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::EGG, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::EGG, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_PRIMEDTNT: { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::PRIMED_TNT, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::PRIMED_TNT, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_ENDER_CRYSTAL: { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::ENDER_CRYSTAL, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::ENDER_CRYSTAL, yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_FALLINGTILE: { - shared_ptr ft = dynamic_pointer_cast(e); - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::FALLING, ft->tile | (ft->data << 16), yRotp, xRotp, xp, yp, zp) ); + std::shared_ptr ft = dynamic_pointer_cast(e); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FALLING, ft->tile | (ft->data << 16), yRotp, xRotp, xp, yp, zp) ); } break; case eTYPE_PAINTING: { - return shared_ptr( new AddPaintingPacket(dynamic_pointer_cast(e)) ); + return std::shared_ptr( new AddPaintingPacket(dynamic_pointer_cast(e)) ); } break; case eTYPE_ITEM_FRAME: { - shared_ptr frame = dynamic_pointer_cast(e); + std::shared_ptr frame = dynamic_pointer_cast(e); { int ix= (int)frame->xTile; @@ -747,7 +747,7 @@ shared_ptr TrackedEntity::getAddEntityPacket() app.DebugPrintf("eTYPE_ITEM_FRAME xyz %d,%d,%d\n",ix,iy,iz); } - shared_ptr packet = shared_ptr(new AddEntityPacket(e, AddEntityPacket::ITEM_FRAME, frame->dir, yRotp, xRotp, xp, yp, zp)); + std::shared_ptr packet = std::shared_ptr(new AddEntityPacket(e, AddEntityPacket::ITEM_FRAME, frame->dir, yRotp, xRotp, xp, yp, zp)); packet->x = Mth::floor(frame->xTile * 32.0f); packet->y = Mth::floor(frame->yTile * 32.0f); packet->z = Mth::floor(frame->zTile * 32.0f); @@ -756,18 +756,18 @@ shared_ptr TrackedEntity::getAddEntityPacket() break; case eTYPE_EXPERIENCEORB: { - return shared_ptr( new AddExperienceOrbPacket(dynamic_pointer_cast(e)) ); + return std::shared_ptr( new AddExperienceOrbPacket(dynamic_pointer_cast(e)) ); } break; default: assert(false); - break; + break; } /* if (e->GetType() == eTYPE_ITEMENTITY) { - shared_ptr itemEntity = dynamic_pointer_cast(e); - shared_ptr packet = shared_ptr( new AddItemEntityPacket(itemEntity, xp, yp, zp) ); + std::shared_ptr itemEntity = dynamic_pointer_cast(e); + std::shared_ptr packet = std::shared_ptr( new AddItemEntityPacket(itemEntity, xp, yp, zp) ); itemEntity->x = packet->x / 32.0; itemEntity->y = packet->y / 32.0; itemEntity->z = packet->z / 32.0; @@ -776,7 +776,7 @@ shared_ptr TrackedEntity::getAddEntityPacket() if (e->GetType() == eTYPE_SERVERPLAYER ) { - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); XUID xuid = INVALID_XUID; XUID OnlineXuid = INVALID_XUID; if( player != NULL ) @@ -784,68 +784,68 @@ shared_ptr TrackedEntity::getAddEntityPacket() xuid = player->getXuid(); OnlineXuid = player->getOnlineXuid(); } - return shared_ptr( new AddPlayerPacket(dynamic_pointer_cast(e), xuid, OnlineXuid, xp, yp, zp, yRotp, xRotp ) ); + return std::shared_ptr( new AddPlayerPacket(dynamic_pointer_cast(e), xuid, OnlineXuid, xp, yp, zp, yRotp, xRotp ) ); } if (e->GetType() == eTYPE_MINECART) { - shared_ptr minecart = dynamic_pointer_cast(e); - if (minecart->type == Minecart::RIDEABLE) return shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_RIDEABLE, yRotp, xRotp, xp, yp, zp) ); - if (minecart->type == Minecart::CHEST) return shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_CHEST, yRotp, xRotp, xp, yp, zp) ); - if (minecart->type == Minecart::FURNACE) return shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_FURNACE, yRotp, xRotp, xp, yp, zp) ); + std::shared_ptr minecart = dynamic_pointer_cast(e); + if (minecart->type == Minecart::RIDEABLE) return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_RIDEABLE, yRotp, xRotp, xp, yp, zp) ); + if (minecart->type == Minecart::CHEST) return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_CHEST, yRotp, xRotp, xp, yp, zp) ); + if (minecart->type == Minecart::FURNACE) return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::MINECART_FURNACE, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_BOAT) { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::BOAT, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::BOAT, yRotp, xRotp, xp, yp, zp) ); } if (dynamic_pointer_cast(e) != NULL) { - return shared_ptr( new AddMobPacket(dynamic_pointer_cast(e), yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddMobPacket(dynamic_pointer_cast(e), yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_ENDERDRAGON) { - return shared_ptr( new AddMobPacket(dynamic_pointer_cast(e), yRotp, xRotp, xp, yp, zp ) ); + return std::shared_ptr( new AddMobPacket(dynamic_pointer_cast(e), yRotp, xRotp, xp, yp, zp ) ); } if (e->GetType() == eTYPE_FISHINGHOOK) { - shared_ptr owner = dynamic_pointer_cast(e)->owner; - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::FISH_HOOK, owner != NULL ? owner->entityId : e->entityId, yRotp, xRotp, xp, yp, zp) ); + std::shared_ptr owner = dynamic_pointer_cast(e)->owner; + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FISH_HOOK, owner != NULL ? owner->entityId : e->entityId, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_ARROW) { - shared_ptr owner = (dynamic_pointer_cast(e))->owner; - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::ARROW, owner != NULL ? owner->entityId : e->entityId, yRotp, xRotp, xp, yp, zp) ); + std::shared_ptr owner = (dynamic_pointer_cast(e))->owner; + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::ARROW, owner != NULL ? owner->entityId : e->entityId, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_SNOWBALL) { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::SNOWBALL, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::SNOWBALL, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_THROWNPOTION) { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_POTION, ((dynamic_pointer_cast(e))->getPotionValue()), yRotp, xRotp, xp, yp, zp)); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_POTION, ((dynamic_pointer_cast(e))->getPotionValue()), yRotp, xRotp, xp, yp, zp)); } if (e->GetType() == eTYPE_THROWNEXPBOTTLE) { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_EXPBOTTLE, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_EXPBOTTLE, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_THROWNENDERPEARL) { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_ENDERPEARL, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::THROWN_ENDERPEARL, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_EYEOFENDERSIGNAL) { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::EYEOFENDERSIGNAL, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::EYEOFENDERSIGNAL, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_SMALL_FIREBALL) { - shared_ptr fb = dynamic_pointer_cast(e); - shared_ptr aep = NULL; + std::shared_ptr fb = dynamic_pointer_cast(e); + std::shared_ptr aep = NULL; if (fb->owner != NULL) { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::SMALL_FIREBALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::SMALL_FIREBALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); } else { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::SMALL_FIREBALL, 0, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::SMALL_FIREBALL, 0, yRotp, xRotp, xp, yp, zp) ); } aep->xa = (int) (fb->xPower * 8000); aep->ya = (int) (fb->yPower * 8000); @@ -854,15 +854,15 @@ shared_ptr TrackedEntity::getAddEntityPacket() } if (e->GetType() == eTYPE_FIREBALL) { - shared_ptr fb = dynamic_pointer_cast(e); - shared_ptr aep = NULL; + std::shared_ptr fb = dynamic_pointer_cast(e); + std::shared_ptr aep = NULL; if (fb->owner != NULL) { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::FIREBALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FIREBALL, fb->owner->entityId, yRotp, xRotp, xp, yp, zp) ); } else { - aep = shared_ptr( new AddEntityPacket(e, AddEntityPacket::FIREBALL, 0, yRotp, xRotp, xp, yp, zp) ); + aep = std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FIREBALL, 0, yRotp, xRotp, xp, yp, zp) ); } aep->xa = (int) (fb->xPower * 8000); aep->ya = (int) (fb->yPower * 8000); @@ -871,30 +871,30 @@ shared_ptr TrackedEntity::getAddEntityPacket() } if (e->GetType() == eTYPE_THROWNEGG) { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::EGG, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::EGG, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_PRIMEDTNT) { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::PRIMED_TNT, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::PRIMED_TNT, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_ENDER_CRYSTAL) { - return shared_ptr( new AddEntityPacket(e, AddEntityPacket::ENDER_CRYSTAL, yRotp, xRotp, xp, yp, zp) ); + return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::ENDER_CRYSTAL, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_FALLINGTILE) { - shared_ptr ft = dynamic_pointer_cast(e); - if (ft->tile == Tile::sand_Id) return shared_ptr( new AddEntityPacket(e, AddEntityPacket::FALLING_SAND, yRotp, xRotp, xp, yp, zp) ); - if (ft->tile == Tile::gravel_Id) return shared_ptr( new AddEntityPacket(e, AddEntityPacket::FALLING_GRAVEL, yRotp, xRotp, xp, yp, zp) ); - if (ft->tile == Tile::dragonEgg_Id) return shared_ptr( new AddEntityPacket(e, AddEntityPacket::FALLING_EGG, yRotp, xRotp, xp, yp, zp) ); + std::shared_ptr ft = dynamic_pointer_cast(e); + if (ft->tile == Tile::sand_Id) return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FALLING_SAND, yRotp, xRotp, xp, yp, zp) ); + if (ft->tile == Tile::gravel_Id) return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FALLING_GRAVEL, yRotp, xRotp, xp, yp, zp) ); + if (ft->tile == Tile::dragonEgg_Id) return std::shared_ptr( new AddEntityPacket(e, AddEntityPacket::FALLING_EGG, yRotp, xRotp, xp, yp, zp) ); } if (e->GetType() == eTYPE_PAINTING) { - return shared_ptr( new AddPaintingPacket(dynamic_pointer_cast(e)) ); + return std::shared_ptr( new AddPaintingPacket(dynamic_pointer_cast(e)) ); } - if (e->GetType() == eTYPE_ITEM_FRAME) + if (e->GetType() == eTYPE_ITEM_FRAME) { - shared_ptr frame = dynamic_pointer_cast(e); + std::shared_ptr frame = dynamic_pointer_cast(e); { int ix= (int)frame->xTile; @@ -903,7 +903,7 @@ shared_ptr TrackedEntity::getAddEntityPacket() app.DebugPrintf("eTYPE_ITEM_FRAME xyz %d,%d,%d\n",ix,iy,iz); } - shared_ptr packet = shared_ptr(new AddEntityPacket(e, AddEntityPacket::ITEM_FRAME, frame->dir, yRotp, xRotp, xp, yp, zp)); + std::shared_ptr packet = std::shared_ptr(new AddEntityPacket(e, AddEntityPacket::ITEM_FRAME, frame->dir, yRotp, xRotp, xp, yp, zp)); packet->x = Mth::floor(frame->xTile * 32.0f); packet->y = Mth::floor(frame->yTile * 32.0f); packet->z = Mth::floor(frame->zTile * 32.0f); @@ -911,14 +911,14 @@ shared_ptr TrackedEntity::getAddEntityPacket() } if (e->GetType() == eTYPE_EXPERIENCEORB) { - return shared_ptr( new AddExperienceOrbPacket(dynamic_pointer_cast(e)) ); + return std::shared_ptr( new AddExperienceOrbPacket(dynamic_pointer_cast(e)) ); } assert(false); */ return nullptr; } -void TrackedEntity::clear(shared_ptr sp) +void TrackedEntity::clear(std::shared_ptr sp) { AUTO_VAR(it, seenBy.find(sp)); if (it != seenBy.end()) diff --git a/Minecraft.Client/TrackedEntity.h b/Minecraft.Client/TrackedEntity.h index 9fb564a4..1efd169b 100644 --- a/Minecraft.Client/TrackedEntity.h +++ b/Minecraft.Client/TrackedEntity.h @@ -15,7 +15,7 @@ private: static const int TOLERANCE_LEVEL = 4; public: - shared_ptr e; + std::shared_ptr e; int range, updateInterval; int xp, yp, zp, yRotp, xRotp, yHeadRotp; @@ -27,23 +27,23 @@ private: bool updatedPlayerVisibility; bool trackDelta; int teleportDelay; - shared_ptr wasRiding; + std::shared_ptr wasRiding; public: bool moved; - unordered_set , PlayerKeyHash, PlayerKeyEq > seenBy; + unordered_set , PlayerKeyHash, PlayerKeyEq > seenBy; - TrackedEntity(shared_ptr e, int range, int updateInterval, bool trackDelta); + TrackedEntity(std::shared_ptr e, int range, int updateInterval, bool trackDelta); - void tick(EntityTracker *tracker, vector > *players); - void broadcast(shared_ptr packet); - void broadcastAndSend(shared_ptr packet); + void tick(EntityTracker *tracker, vector > *players); + void broadcast(std::shared_ptr packet); + void broadcastAndSend(std::shared_ptr packet); void broadcastRemoved(); - void removePlayer(shared_ptr sp); + void removePlayer(std::shared_ptr sp); private: - bool canBySeenBy(shared_ptr player); + bool canBySeenBy(std::shared_ptr player); enum eVisibility { @@ -52,14 +52,14 @@ private: eVisibility_SeenAndVisible = 2, }; - eVisibility isVisible(EntityTracker *tracker, shared_ptr sp, bool forRider = false); // 4J Added forRider - + eVisibility isVisible(EntityTracker *tracker, std::shared_ptr sp, bool forRider = false); // 4J Added forRider + public: - void updatePlayer(EntityTracker *tracker, shared_ptr sp); - void updatePlayers(EntityTracker *tracker, vector > *players); + void updatePlayer(EntityTracker *tracker, std::shared_ptr sp); + void updatePlayers(EntityTracker *tracker, vector > *players); private: - void sendEntityData(shared_ptr conn); - shared_ptr getAddEntityPacket(); + void sendEntityData(std::shared_ptr conn); + std::shared_ptr getAddEntityPacket(); public: - void clear(shared_ptr sp); + void clear(std::shared_ptr sp); }; diff --git a/Minecraft.Client/TrapScreen.cpp b/Minecraft.Client/TrapScreen.cpp index c7eb1472..6a199d0e 100644 --- a/Minecraft.Client/TrapScreen.cpp +++ b/Minecraft.Client/TrapScreen.cpp @@ -6,7 +6,7 @@ #include "..\Minecraft.World\DispenserTileEntity.h" #include "..\Minecraft.World\net.minecraft.world.h" -TrapScreen::TrapScreen(shared_ptr inventory, shared_ptr trap) : AbstractContainerScreen(new TrapMenu(inventory, trap)) +TrapScreen::TrapScreen(std::shared_ptr inventory, std::shared_ptr trap) : AbstractContainerScreen(new TrapMenu(inventory, trap)) { } diff --git a/Minecraft.Client/TrapScreen.h b/Minecraft.Client/TrapScreen.h index bda3158f..a993805d 100644 --- a/Minecraft.Client/TrapScreen.h +++ b/Minecraft.Client/TrapScreen.h @@ -6,7 +6,7 @@ class Inventory; class TrapScreen : public AbstractContainerScreen { public: - TrapScreen(shared_ptr inventory, shared_ptr trap); + TrapScreen(std::shared_ptr inventory, std::shared_ptr trap); protected: virtual void renderLabels(); virtual void renderBg(float a); diff --git a/Minecraft.Client/ViewportCuller.cpp b/Minecraft.Client/ViewportCuller.cpp index bc22faa6..a6d3c87e 100644 --- a/Minecraft.Client/ViewportCuller.cpp +++ b/Minecraft.Client/ViewportCuller.cpp @@ -7,17 +7,17 @@ ViewportCuller::Face::Face(double x, double y, double z, float yRot, float xRot) this->xc = x; this->yc = y; this->zc = z; - + xd = Mth::sin(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI); zd = -Mth::cos(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI); yd = -Mth::sin(xRot / 180 * PI); - - cullOffs = xc*xd+yc*yd+zc*zd; + + cullOffs = xc*xd+yc*yd+zc*zd; } - + bool ViewportCuller::Face::inFront(double x, double y, double z, double r) { - return x*xd+y*yd+z*zd>cullOffs-r; + return x*xd+y*yd+z*zd>cullOffs-r; } bool ViewportCuller::Face::inFront(double x0, double y0, double z0, double x1, double y1, double z1) @@ -30,7 +30,7 @@ bool ViewportCuller::Face::inFront(double x0, double y0, double z0, double x1, d x0*xd+y0*yd+z1*zd>cullOffs || x1*xd+y0*yd+z1*zd>cullOffs || x0*xd+y1*yd+z1*zd>cullOffs || - x1*xd+y1*yd+z1*zd>cullOffs + x1*xd+y1*yd+z1*zd>cullOffs ) return true; return false; } @@ -44,18 +44,18 @@ bool ViewportCuller::Face::fullyInFront(double x0, double y0, double z0, double x0*xd+y0*yd+z1*zd mob, double fogDistance, float a) +ViewportCuller::ViewportCuller(std::shared_ptr mob, double fogDistance, float a) { float yRot = mob->yRotO+(mob->yRot-mob->yRotO)*a; float xRot = mob->xRotO+(mob->xRot-mob->xRotO)*a; - - double x = mob->xOld+(mob->x-mob->xOld)*a; - double y = mob->yOld+(mob->y-mob->yOld)*a; + + double x = mob->xOld+(mob->x-mob->xOld)*a; + double y = mob->yOld+(mob->y-mob->yOld)*a; double z = mob->zOld+(mob->z-mob->zOld)*a; double xd = Mth::sin(yRot / 180 * PI) * Mth::cos(xRot / 180 * PI); @@ -69,7 +69,7 @@ ViewportCuller::ViewportCuller(shared_ptr mob, double fogDistance, float a) faces[2] = Face(x, y, z, yRot-xFov, xRot); faces[3] = Face(x, y, z, yRot, xRot+yFov); faces[4] = Face(x, y, z, yRot, xRot-yFov); - faces[5] = Face(x+xd*fogDistance, y+yd*fogDistance, z+zd*fogDistance, yRot+180, -xRot); + faces[5] = Face(x+xd*fogDistance, y+yd*fogDistance, z+zd*fogDistance, yRot+180, -xRot); } bool ViewportCuller::isVisible(AABB bb) @@ -88,12 +88,12 @@ bool ViewportCuller::cubeInFrustum(double x0, double y0, double z0, double x1, d double xd = (x1-x0)/2.0f; double yd = (y1-y0)/2.0f; double zd = (z1-z0)/2.0f; - + double xc = x0+xd; double yc = y0+yd; double zc = z0+zd; double r = _max(xd, yd, zd)*1.5f; - + if (!faces[0].inFront(xc, yc, zc, r)) return false; if (!faces[1].inFront(xc, yc, zc, r)) return false; if (!faces[2].inFront(xc, yc, zc, r)) return false; @@ -123,7 +123,7 @@ bool ViewportCuller::cubeFullyInFrustum(double x0, double y0, double z0, double double xd = (x1-x0)/2.0f; double yd = (y1-y0)/2.0f; double zd = (z1-z0)/2.0f; - + double xc = x0+xd; double yc = y0+yd; double zc = z0+zd; @@ -135,8 +135,8 @@ bool ViewportCuller::cubeFullyInFrustum(double x0, double y0, double z0, double if (!faces[3].inFront(xc, yc, zc, r)) return false; if (!faces[4].inFront(xc, yc, zc, r)) return false; if (!faces[5].inFront(xc, yc, zc, r)) return false; - - + + if (!faces[0].fullyInFront(x0, y0, z0, x1, y1, z1)) return false; if (!faces[1].fullyInFront(x0, y0, z0, x1, y1, z1)) return false; if (!faces[2].fullyInFront(x0, y0, z0, x1, y1, z1)) return false; diff --git a/Minecraft.Client/ViewportCuller.h b/Minecraft.Client/ViewportCuller.h index 2a975de9..31739cb6 100644 --- a/Minecraft.Client/ViewportCuller.h +++ b/Minecraft.Client/ViewportCuller.h @@ -14,17 +14,17 @@ private: double cullOffs; public: Face() {} // 4J - added so we can declare an array of these (unitialised) in the class - Face(double x, double y, double z, float yRot, float xRot); + Face(double x, double y, double z, float yRot, float xRot); bool inFront(double x, double y, double z, double r); bool inFront(double x0, double y0, double z0, double x1, double y1, double z1); - bool fullyInFront(double x0, double y0, double z0, double x1, double y1, double z1); + bool fullyInFront(double x0, double y0, double z0, double x1, double y1, double z1); }; private: Face faces[6]; double xOff, yOff, zOff; public: - ViewportCuller(shared_ptr mob, double fogDistance, float a); + ViewportCuller(std::shared_ptr mob, double fogDistance, float a); virtual bool isVisible(AABB bb); virtual bool cubeInFrustum(double x0, double y0, double z0, double x1, double y1, double z1); virtual bool cubeFullyInFrustum(double x0, double y0, double z0, double x1, double y1, double z1); diff --git a/Minecraft.Client/VillagerGolemModel.cpp b/Minecraft.Client/VillagerGolemModel.cpp index aaeabd53..5e3b4730 100644 --- a/Minecraft.Client/VillagerGolemModel.cpp +++ b/Minecraft.Client/VillagerGolemModel.cpp @@ -36,7 +36,7 @@ VillagerGolemModel::VillagerGolemModel(float g, float yOffset) leg1->addBox(-3.5f, -3, -3, 6, 16, 5, g); } -void VillagerGolemModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void VillagerGolemModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); @@ -59,9 +59,9 @@ void VillagerGolemModel::setupAnim(float time, float r, float bob, float yRot, f leg1->yRot = 0; } -void VillagerGolemModel::prepareMobModel(shared_ptr mob, float time, float r, float a) +void VillagerGolemModel::prepareMobModel(std::shared_ptr mob, float time, float r, float a) { - shared_ptr vg = dynamic_pointer_cast(mob); + std::shared_ptr vg = dynamic_pointer_cast(mob); int attackTick = vg->getAttackAnimationTick(); if (attackTick > 0) { diff --git a/Minecraft.Client/VillagerGolemModel.h b/Minecraft.Client/VillagerGolemModel.h index 83e73616..80c822d5 100644 --- a/Minecraft.Client/VillagerGolemModel.h +++ b/Minecraft.Client/VillagerGolemModel.h @@ -21,9 +21,9 @@ public: VillagerGolemModel(float g = 0.0f, float yOffset = -7.0f); - void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); - void prepareMobModel(shared_ptr mob, float time, float r, float a); + void prepareMobModel(std::shared_ptr mob, float time, float r, float a); private: float triangleWave(float bob, float period); diff --git a/Minecraft.Client/VillagerGolemRenderer.cpp b/Minecraft.Client/VillagerGolemRenderer.cpp index f03cea4c..dd7396e6 100644 --- a/Minecraft.Client/VillagerGolemRenderer.cpp +++ b/Minecraft.Client/VillagerGolemRenderer.cpp @@ -15,16 +15,16 @@ int VillagerGolemRenderer::prepareArmor(VillagerGolemModel *villagerGolem, int l return -1; } -void VillagerGolemRenderer::render(shared_ptr mob, double x, double y, double z, float rot, float a) +void VillagerGolemRenderer::render(std::shared_ptr mob, double x, double y, double z, float rot, float a) { MobRenderer::render(mob, x, y, z, rot, a); } -void VillagerGolemRenderer::setupRotations(shared_ptr _mob, float bob, float bodyRot, float a) +void VillagerGolemRenderer::setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a) { - // 4J - original version used generics and thus had an input parameter of type Blaze rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Blaze rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); MobRenderer::setupRotations(mob, bob, bodyRot, a); if (mob->walkAnimSpeed < 0.01) return; @@ -34,11 +34,11 @@ void VillagerGolemRenderer::setupRotations(shared_ptr _mob, float bob, floa glRotatef(6.5f * triangleWave, 0, 0, 1); } -void VillagerGolemRenderer::additionalRendering(shared_ptr _mob, float a) +void VillagerGolemRenderer::additionalRendering(std::shared_ptr _mob, float a) { - // 4J - original version used generics and thus had an input parameter of type Blaze rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Blaze rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); MobRenderer::additionalRendering(mob, a); if (mob->getOfferFlowerTick() == 0) return; diff --git a/Minecraft.Client/VillagerGolemRenderer.h b/Minecraft.Client/VillagerGolemRenderer.h index 4bc3fd9c..185e38d4 100644 --- a/Minecraft.Client/VillagerGolemRenderer.h +++ b/Minecraft.Client/VillagerGolemRenderer.h @@ -16,9 +16,9 @@ protected: int prepareArmor(VillagerGolemModel *villagerGolem, int layer, float a); public: - void render(shared_ptr mob, double x, double y, double z, float rot, float a); + void render(std::shared_ptr mob, double x, double y, double z, float rot, float a); protected: - void setupRotations(shared_ptr _mob, float bob, float bodyRot, float a); - void additionalRendering(shared_ptr mob, float a); + void setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a); + void additionalRendering(std::shared_ptr mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/VillagerModel.cpp b/Minecraft.Client/VillagerModel.cpp index 8885484d..72e6ea3a 100644 --- a/Minecraft.Client/VillagerModel.cpp +++ b/Minecraft.Client/VillagerModel.cpp @@ -55,7 +55,7 @@ VillagerModel::VillagerModel(float g, float yOffset) : Model() _init(g,yOffset); } -void VillagerModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void VillagerModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { setupAnim(time, r, bob, yRot, xRot, scale); @@ -70,11 +70,11 @@ void VillagerModel::setupAnim(float time, float r, float bob, float yRot, float { head->yRot = yRot / (float) (180 / PI); head->xRot = xRot / (float) (180 / PI); - + arms->y = 3; arms->z = -1; arms->xRot = -0.75f; - + leg0->xRot = ((float) Mth::cos(time * 0.6662f) * 1.4f) * r * 0.5f; leg1->xRot = ((float) Mth::cos(time * 0.6662f + PI) * 1.4f) * r * 0.5f; leg0->yRot = 0; diff --git a/Minecraft.Client/VillagerModel.h b/Minecraft.Client/VillagerModel.h index 24c8b858..07a301c4 100644 --- a/Minecraft.Client/VillagerModel.h +++ b/Minecraft.Client/VillagerModel.h @@ -2,7 +2,7 @@ #pragma once #include "Model.h" -class VillagerModel : public Model +class VillagerModel : public Model { public: ModelPart *head, *body, *arms, *leg0, *leg1; @@ -10,6 +10,6 @@ public: void _init(float g, float yOffset); // 4J added VillagerModel(float g, float yOffset); VillagerModel(float g); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) ; + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) ; virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; diff --git a/Minecraft.Client/VillagerRenderer.cpp b/Minecraft.Client/VillagerRenderer.cpp index b4c88173..bb31caa5 100644 --- a/Minecraft.Client/VillagerRenderer.cpp +++ b/Minecraft.Client/VillagerRenderer.cpp @@ -8,30 +8,30 @@ VillagerRenderer::VillagerRenderer() : MobRenderer(new VillagerModel(0), 0.5f) villagerModel = (VillagerModel *) model; } -int VillagerRenderer::prepareArmor(shared_ptr villager, int layer, float a) +int VillagerRenderer::prepareArmor(std::shared_ptr villager, int layer, float a) { return -1; } -void VillagerRenderer::render(shared_ptr mob, double x, double y, double z, float rot, float a) +void VillagerRenderer::render(std::shared_ptr mob, double x, double y, double z, float rot, float a) { MobRenderer::render(mob, x, y, z, rot, a); } -void VillagerRenderer::renderName(shared_ptr mob, double x, double y, double z) +void VillagerRenderer::renderName(std::shared_ptr mob, double x, double y, double z) { } -void VillagerRenderer::additionalRendering(shared_ptr mob, float a) +void VillagerRenderer::additionalRendering(std::shared_ptr mob, float a) { MobRenderer::additionalRendering(mob, a); } -void VillagerRenderer::scale(shared_ptr _mob, float a) +void VillagerRenderer::scale(std::shared_ptr _mob, float a) { - // 4J - original version used generics and thus had an input parameter of type Blaze rather than shared_ptr we have here - + // 4J - original version used generics and thus had an input parameter of type Blaze rather than std::shared_ptr we have here - // do some casting around instead - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); float s = 15 / 16.0f; if (mob->getAge() < 0) { diff --git a/Minecraft.Client/VillagerRenderer.h b/Minecraft.Client/VillagerRenderer.h index 21c2a631..1263f485 100644 --- a/Minecraft.Client/VillagerRenderer.h +++ b/Minecraft.Client/VillagerRenderer.h @@ -13,13 +13,13 @@ public: VillagerRenderer(); protected: - virtual int prepareArmor(shared_ptr villager, int layer, float a); + virtual int prepareArmor(std::shared_ptr villager, int layer, float a); public: - virtual void render(shared_ptr mob, double x, double y, double z, float rot, float a); + virtual void render(std::shared_ptr mob, double x, double y, double z, float rot, float a); protected: - virtual void renderName(shared_ptr mob, double x, double y, double z); - virtual void additionalRendering(shared_ptr mob, float a); - virtual void scale(shared_ptr player, float a); + virtual void renderName(std::shared_ptr mob, double x, double y, double z); + virtual void additionalRendering(std::shared_ptr mob, float a); + virtual void scale(std::shared_ptr player, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/WolfModel.cpp b/Minecraft.Client/WolfModel.cpp index f4835ec3..18dd96cf 100644 --- a/Minecraft.Client/WolfModel.cpp +++ b/Minecraft.Client/WolfModel.cpp @@ -57,12 +57,12 @@ WolfModel::WolfModel() tail->compile(1.0f/16.0f); } -void WolfModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +void WolfModel::render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { Model::render(entity, time, r, bob, yRot, xRot, scale, usecompiled); setupAnim(time, r, bob, yRot, xRot, scale); - if (young) + if (young) { float ss = 2; glPushMatrix(); @@ -80,8 +80,8 @@ void WolfModel::render(shared_ptr entity, float time, float r, float bob tail->renderRollable(scale, usecompiled); upperBody->render(scale, usecompiled); glPopMatrix(); - } - else + } + else { head->renderRollable(scale, usecompiled); body->render(scale, usecompiled); @@ -94,9 +94,9 @@ void WolfModel::render(shared_ptr entity, float time, float r, float bob } } -void WolfModel::prepareMobModel(shared_ptr mob, float time, float r, float a) +void WolfModel::prepareMobModel(std::shared_ptr mob, float time, float r, float a) { - shared_ptr wolf = dynamic_pointer_cast(mob); + std::shared_ptr wolf = dynamic_pointer_cast(mob); if (wolf->isAngry()) { diff --git a/Minecraft.Client/WolfModel.h b/Minecraft.Client/WolfModel.h index ab26a9e8..6fb5fb6f 100644 --- a/Minecraft.Client/WolfModel.h +++ b/Minecraft.Client/WolfModel.h @@ -15,7 +15,7 @@ private: static const int legSize = 8; public: WolfModel(); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); - void prepareMobModel(shared_ptr mob, float time, float r, float a); + virtual void render(std::shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + void prepareMobModel(std::shared_ptr mob, float time, float r, float a); virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0); }; \ No newline at end of file diff --git a/Minecraft.Client/WolfRenderer.cpp b/Minecraft.Client/WolfRenderer.cpp index a21affa2..96b3ee7e 100644 --- a/Minecraft.Client/WolfRenderer.cpp +++ b/Minecraft.Client/WolfRenderer.cpp @@ -8,19 +8,19 @@ WolfRenderer::WolfRenderer(Model *model, Model *armor, float shadow) : MobRender setArmor(armor); } -float WolfRenderer::getBob(shared_ptr _mob, float a) +float WolfRenderer::getBob(std::shared_ptr _mob, float a) { // 4J - dynamic cast required because we aren't using templates/generics in our version - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); return mob->getTailAngle(); } -int WolfRenderer::prepareArmor(shared_ptr mob, int layer, float a) +int WolfRenderer::prepareArmor(std::shared_ptr mob, int layer, float a) { if (mob->isInvisibleTo(Minecraft::GetInstance()->player)) return -1; // 4J-JEV: Todo, merge with java fix in '1.7.5'. - shared_ptr wolf = dynamic_pointer_cast(mob); + std::shared_ptr wolf = dynamic_pointer_cast(mob); if (layer == 0 && wolf->isWet()) { float brightness = wolf->getBrightness(a) * wolf->getWetShade(a); diff --git a/Minecraft.Client/WolfRenderer.h b/Minecraft.Client/WolfRenderer.h index 9cdf8caa..218951c9 100644 --- a/Minecraft.Client/WolfRenderer.h +++ b/Minecraft.Client/WolfRenderer.h @@ -6,6 +6,6 @@ class WolfRenderer : public MobRenderer public: WolfRenderer(Model *model, Model *armor, float shadow); protected: - virtual float getBob(shared_ptr _mob, float a); - virtual int prepareArmor(shared_ptr mob, int layer, float a); + virtual float getBob(std::shared_ptr _mob, float a); + virtual int prepareArmor(std::shared_ptr mob, int layer, float a); }; diff --git a/Minecraft.Client/Xbox/Audio/SoundEngine.cpp b/Minecraft.Client/Xbox/Audio/SoundEngine.cpp index b088150c..e7e2dded 100644 --- a/Minecraft.Client/Xbox/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Xbox/Audio/SoundEngine.cpp @@ -327,7 +327,7 @@ void SoundEngine::CreateStreamingWavebank(const char *pchName, IXACT3WaveBank ** HANDLE file = CreateFile(pchName, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, NULL); if( file == INVALID_HANDLE_VALUE ) - { + { app.FatalLoadError(); assert(false); return; @@ -638,7 +638,7 @@ void SoundEngine::playUI(int iSound, float, float) void SoundEngine::playStreaming(const wstring& name, float x, float y, float z, float vol, float pitch, bool bMusicDelay) { IXACT3SoundBank *pSoundBank=NULL; - + bool bSoundBank2=false; MemSect(34); if(m_MusicInfo.pCue!=NULL) @@ -747,7 +747,7 @@ void SoundEngine::playStreaming(const wstring& name, float x, float y, float z, MemSect(0); return; } - + if(GetIsPlayingStreamingCDMusic()) { @@ -984,7 +984,7 @@ void SoundEngine::update3DPosition(SoundEngine::soundInfo *pInfo, bool bPlaceEmi XACT3DApply( &m_DSPSettings, pInfo->pCue); } -void SoundEngine::tick(shared_ptr *players, float a) +void SoundEngine::tick(std::shared_ptr *players, float a) { if( m_pXACT3Engine == NULL ) return; diff --git a/Minecraft.Client/Xbox/Audio/SoundEngine.h b/Minecraft.Client/Xbox/Audio/SoundEngine.h index e2f22869..4dc398b5 100644 --- a/Minecraft.Client/Xbox/Audio/SoundEngine.h +++ b/Minecraft.Client/Xbox/Audio/SoundEngine.h @@ -86,7 +86,7 @@ public: virtual void updateSystemMusicPlaying(bool isPlaying); virtual void updateSoundEffectVolume(float fVal); virtual void init(Options *); - virtual void tick(shared_ptr *players, float a); // 4J - updated to take array of local players rather than single one + virtual void tick(std::shared_ptr *players, float a); // 4J - updated to take array of local players rather than single one virtual void add(const wstring& name, File *file); virtual void addMusic(const wstring& name, File *file); virtual void addStreaming(const wstring& name, File *file); @@ -107,4 +107,4 @@ private: #ifndef __PS3__ static void XACTNotificationCallback( const XACT_NOTIFICATION* pNotification ); #endif // __PS3__ -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/Minecraft.Client/ZombieRenderer.cpp b/Minecraft.Client/ZombieRenderer.cpp index 5408736d..b2125701 100644 --- a/Minecraft.Client/ZombieRenderer.cpp +++ b/Minecraft.Client/ZombieRenderer.cpp @@ -34,28 +34,28 @@ void ZombieRenderer::createArmorParts() villagerArmorParts2 = new VillagerZombieModel(0.5f, 0, true); } -int ZombieRenderer::prepareArmor(shared_ptr _mob, int layer, float a) +int ZombieRenderer::prepareArmor(std::shared_ptr _mob, int layer, float a) { - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); swapArmor(mob); return HumanoidMobRenderer::prepareArmor(_mob, layer, a); } -void ZombieRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +void ZombieRenderer::render(std::shared_ptr _mob, double x, double y, double z, float rot, float a) { - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); swapArmor(mob); HumanoidMobRenderer::render(_mob, x, y, z, rot, a); } -void ZombieRenderer::additionalRendering(shared_ptr _mob, float a) +void ZombieRenderer::additionalRendering(std::shared_ptr _mob, float a) { - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); swapArmor(mob); HumanoidMobRenderer::additionalRendering(_mob, a); } -void ZombieRenderer::swapArmor(shared_ptr mob) +void ZombieRenderer::swapArmor(std::shared_ptr mob) { if (mob->isVillager()) { @@ -80,9 +80,9 @@ void ZombieRenderer::swapArmor(shared_ptr mob) humanoidModel = (HumanoidModel *) model; } -void ZombieRenderer::setupRotations(shared_ptr _mob, float bob, float bodyRot, float a) +void ZombieRenderer::setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a) { - shared_ptr mob = dynamic_pointer_cast(_mob); + std::shared_ptr mob = dynamic_pointer_cast(_mob); if (mob->isConverting()) { bodyRot += (float) (cos(mob->tickCount * 3.25) * PI * .25f); diff --git a/Minecraft.Client/ZombieRenderer.h b/Minecraft.Client/ZombieRenderer.h index e070cc7b..b727659a 100644 --- a/Minecraft.Client/ZombieRenderer.h +++ b/Minecraft.Client/ZombieRenderer.h @@ -25,17 +25,17 @@ public: protected: void createArmorParts(); - int prepareArmor(shared_ptr _mob, int layer, float a); + int prepareArmor(std::shared_ptr _mob, int layer, float a); public: - void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + void render(std::shared_ptr _mob, double x, double y, double z, float rot, float a); protected: - void additionalRendering(shared_ptr _mob, float a); + void additionalRendering(std::shared_ptr _mob, float a); private: - void swapArmor(shared_ptr mob); + void swapArmor(std::shared_ptr mob); protected: - void setupRotations(shared_ptr _mob, float bob, float bodyRot, float a); + void setupRotations(std::shared_ptr _mob, float bob, float bodyRot, float a); }; \ No newline at end of file diff --git a/Minecraft.World/AbstractContainerMenu.cpp b/Minecraft.World/AbstractContainerMenu.cpp index 71d30feb..dcef1d46 100644 --- a/Minecraft.World/AbstractContainerMenu.cpp +++ b/Minecraft.World/AbstractContainerMenu.cpp @@ -8,7 +8,7 @@ // TODO Make sure all derived classes also call this AbstractContainerMenu::AbstractContainerMenu() { - lastSlots = new vector >(); + lastSlots = new vector >(); slots = new vector(); containerId = 0; @@ -49,15 +49,15 @@ void AbstractContainerMenu::addSlotListener(ContainerListener *listener) containerListeners->push_back(listener); - vector > *items = getItems(); + vector > *items = getItems(); listener->refreshContainer(this, items); delete items; broadcastChanges(); } -vector > *AbstractContainerMenu::getItems() +vector > *AbstractContainerMenu::getItems() { - vector > *items = new vector >(); + vector > *items = new vector >(); AUTO_VAR(itEnd, slots->end()); for (AUTO_VAR(it, slots->begin()); it != itEnd; it++) { @@ -79,8 +79,8 @@ void AbstractContainerMenu::broadcastChanges() { for (unsigned int i = 0; i < slots->size(); i++) { - shared_ptr current = slots->at(i)->getItem(); - shared_ptr expected = lastSlots->at(i); + std::shared_ptr current = slots->at(i)->getItem(); + std::shared_ptr expected = lastSlots->at(i); if (!ItemInstance::matches(expected, current)) { expected = current == NULL ? nullptr : current->copy(); @@ -103,8 +103,8 @@ bool AbstractContainerMenu::needsRendered() for (unsigned int i = 0; i < slots->size(); i++) { - shared_ptr current = slots->at(i)->getItem(); - shared_ptr expected = lastSlots->at(i); + std::shared_ptr current = slots->at(i)->getItem(); + std::shared_ptr expected = lastSlots->at(i); if (!ItemInstance::matches(expected, current)) { expected = current == NULL ? nullptr : current->copy(); @@ -116,12 +116,12 @@ bool AbstractContainerMenu::needsRendered() return needsRendered; } -bool AbstractContainerMenu::clickMenuButton(shared_ptr player, int buttonId) +bool AbstractContainerMenu::clickMenuButton(std::shared_ptr player, int buttonId) { return false; } -Slot *AbstractContainerMenu::getSlotFor(shared_ptr c, int index) +Slot *AbstractContainerMenu::getSlotFor(std::shared_ptr c, int index) { AUTO_VAR(itEnd, slots->end()); for (AUTO_VAR(it, slots->begin()); it != itEnd; it++) @@ -140,7 +140,7 @@ Slot *AbstractContainerMenu::getSlot(int index) return slots->at(index); } -shared_ptr AbstractContainerMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr AbstractContainerMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { Slot *slot = slots->at(slotIndex); if (slot != NULL) @@ -150,10 +150,10 @@ shared_ptr AbstractContainerMenu::quickMoveStack(shared_ptr AbstractContainerMenu::clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player) +std::shared_ptr AbstractContainerMenu::clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr player) { - shared_ptr clickedEntity = nullptr; - shared_ptr inventory = player->inventory; + std::shared_ptr clickedEntity = nullptr; + std::shared_ptr inventory = player->inventory; if ((clickType == CLICK_PICKUP || clickType == CLICK_QUICK_MOVE) && (buttonNum == 0 || buttonNum == 1)) { @@ -182,7 +182,7 @@ shared_ptr AbstractContainerMenu::clicked(int slotIndex, int butto Slot *slot = slots->at(slotIndex); if(slot != NULL && slot->mayPickup(player)) { - shared_ptr piiClicked = quickMoveStack(player, slotIndex); + std::shared_ptr piiClicked = quickMoveStack(player, slotIndex); if (piiClicked != NULL) { //int oldSize = piiClicked->count; // 4J - Commented 1.8.2 and replaced with below @@ -208,8 +208,8 @@ shared_ptr AbstractContainerMenu::clicked(int slotIndex, int butto Slot *slot = slots->at(slotIndex); if (slot != NULL) { - shared_ptr clicked = slot->getItem(); - shared_ptr carried = inventory->getCarried(); + std::shared_ptr clicked = slot->getItem(); + std::shared_ptr carried = inventory->getCarried(); if (clicked != NULL) { @@ -235,7 +235,7 @@ shared_ptr AbstractContainerMenu::clicked(int slotIndex, int butto // 4J Added for dyable armour and combinining damaged items else if (buttonNum == 1 && mayCombine(slot, carried)) { - shared_ptr combined = slot->combine(carried); + std::shared_ptr combined = slot->combine(carried); if(combined != NULL) { slot->set(combined); @@ -252,7 +252,7 @@ shared_ptr AbstractContainerMenu::clicked(int slotIndex, int butto { // pick up to empty hand int c = buttonNum == 0 ? clicked->count : (clicked->count + 1) / 2; - shared_ptr removed = slot->remove(c); + std::shared_ptr removed = slot->remove(c); inventory->setCarried(removed); if (clicked->count == 0) @@ -321,7 +321,7 @@ shared_ptr AbstractContainerMenu::clicked(int slotIndex, int butto Slot *slot = slots->at(slotIndex); if (slot->mayPickup(player)) { - shared_ptr current = inventory->getItem(buttonNum); + std::shared_ptr current = inventory->getItem(buttonNum); bool canMove = current == NULL || (slot->container == inventory && slot->mayPlace(current)); int freeSlot = -1; @@ -333,7 +333,7 @@ shared_ptr AbstractContainerMenu::clicked(int slotIndex, int butto if (slot->hasItem() && canMove) { - shared_ptr taking = slot->getItem(); + std::shared_ptr taking = slot->getItem(); inventory->setItem(buttonNum, taking); if ((slot->container == inventory && slot->mayPlace(current)) || current == NULL) @@ -362,7 +362,7 @@ shared_ptr AbstractContainerMenu::clicked(int slotIndex, int butto Slot *slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - shared_ptr copy = slot->getItem()->copy(); + std::shared_ptr copy = slot->getItem()->copy(); copy->count = copy->getMaxStackSize(); inventory->setCarried(copy); } @@ -371,19 +371,19 @@ shared_ptr AbstractContainerMenu::clicked(int slotIndex, int butto } // 4J Stu - Brought forward from 1.2 to fix infinite recursion bug in creative -void AbstractContainerMenu::loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, shared_ptr player) +void AbstractContainerMenu::loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, std::shared_ptr player) { clicked(slotIndex, buttonNum, CLICK_QUICK_MOVE, player); } -bool AbstractContainerMenu::mayCombine(Slot *slot, shared_ptr item) +bool AbstractContainerMenu::mayCombine(Slot *slot, std::shared_ptr item) { return false; } -void AbstractContainerMenu::removed(shared_ptr player) +void AbstractContainerMenu::removed(std::shared_ptr player) { - shared_ptr inventory = player->inventory; + std::shared_ptr inventory = player->inventory; if (inventory->getCarried() != NULL) { player->drop(inventory->getCarried()); @@ -391,7 +391,7 @@ void AbstractContainerMenu::removed(shared_ptr player) } } -void AbstractContainerMenu::slotsChanged()// 4J used to take a shared_ptr but wasn't using it, so removed to simplify things +void AbstractContainerMenu::slotsChanged()// 4J used to take a std::shared_ptr but wasn't using it, so removed to simplify things { broadcastChanges(); } @@ -401,14 +401,14 @@ bool AbstractContainerMenu::isPauseScreen() return false; } -void AbstractContainerMenu::setItem(unsigned int slot, shared_ptr item) +void AbstractContainerMenu::setItem(unsigned int slot, std::shared_ptr item) { getSlot(slot)->set(item); } void AbstractContainerMenu::setAll(ItemInstanceArray *items) { - for (unsigned int i = 0; i < items->length; i++) + for (unsigned int i = 0; i < items->length; i++) { getSlot(i)->set( (*items)[i] ); } @@ -418,18 +418,18 @@ void AbstractContainerMenu::setData(int id, int value) { } -short AbstractContainerMenu::backup(shared_ptr inventory) +short AbstractContainerMenu::backup(std::shared_ptr inventory) { changeUid++; return changeUid; } -bool AbstractContainerMenu::isSynched(shared_ptr player) +bool AbstractContainerMenu::isSynched(std::shared_ptr player) { return !(unSynchedPlayers.find(player) != unSynchedPlayers.end()); } -void AbstractContainerMenu::setSynched(shared_ptr player, bool synched) +void AbstractContainerMenu::setSynched(std::shared_ptr player, bool synched) { if (synched) { @@ -444,7 +444,7 @@ void AbstractContainerMenu::setSynched(shared_ptr player, bool synched) } // 4J Stu - Brought a few changes in this function forward from 1.2 to make it return a bool -bool AbstractContainerMenu::moveItemStackTo(shared_ptr itemStack, int startSlot, int endSlot, bool backwards) +bool AbstractContainerMenu::moveItemStackTo(std::shared_ptr itemStack, int startSlot, int endSlot, bool backwards) { bool anythingChanged = false; @@ -461,7 +461,7 @@ bool AbstractContainerMenu::moveItemStackTo(shared_ptr itemStack, { Slot *slot = slots->at(destSlot); - shared_ptr target = slot->getItem(); + std::shared_ptr target = slot->getItem(); if (target != NULL && target->id == itemStack->id && (!itemStack->isStackedByData() || itemStack->getAuxValue() == target->getAuxValue()) && ItemInstance::tagMatches(itemStack, target) ) { @@ -507,7 +507,7 @@ bool AbstractContainerMenu::moveItemStackTo(shared_ptr itemStack, while ((!backwards && destSlot < endSlot) || (backwards && destSlot >= startSlot)) { Slot *slot = slots->at(destSlot); - shared_ptr target = slot->getItem(); + std::shared_ptr target = slot->getItem(); if (target == NULL) { diff --git a/Minecraft.World/AbstractContainerMenu.h b/Minecraft.World/AbstractContainerMenu.h index f34e1afc..0875d65c 100644 --- a/Minecraft.World/AbstractContainerMenu.h +++ b/Minecraft.World/AbstractContainerMenu.h @@ -26,7 +26,7 @@ public: static const int CONTAINER_ID_INVENTORY = 0; static const int CONTAINER_ID_CREATIVE = -2; - vector > *lastSlots; + vector > *lastSlots; vector *slots; int containerId; @@ -46,34 +46,34 @@ protected: public: virtual ~AbstractContainerMenu(); virtual void addSlotListener(ContainerListener *listener); - vector > *getItems(); + vector > *getItems(); void sendData(int id, int value); virtual void broadcastChanges(); virtual bool needsRendered(); - virtual bool clickMenuButton(shared_ptr player, int buttonId); - Slot *getSlotFor(shared_ptr c, int index); + virtual bool clickMenuButton(std::shared_ptr player, int buttonId); + Slot *getSlotFor(std::shared_ptr c, int index); Slot *getSlot(int index); - virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); - virtual shared_ptr clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player); - virtual bool mayCombine(Slot *slot, shared_ptr item); + virtual std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); + virtual std::shared_ptr clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr player); + virtual bool mayCombine(Slot *slot, std::shared_ptr item); protected: - virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, shared_ptr player); + virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, std::shared_ptr player); public: - virtual void removed(shared_ptr player); - virtual void slotsChanged();// 4J used to take a shared_ptr container but wasn't using it, so removed to simplify things + virtual void removed(std::shared_ptr player); + virtual void slotsChanged();// 4J used to take a std::shared_ptr container but wasn't using it, so removed to simplify things bool isPauseScreen(); - void setItem(unsigned int slot, shared_ptr item); + void setItem(unsigned int slot, std::shared_ptr item); void setAll(ItemInstanceArray *items); virtual void setData(int id, int value); - short backup(shared_ptr inventory); + short backup(std::shared_ptr inventory); private: - unordered_set , PlayerKeyHash, PlayerKeyEq> unSynchedPlayers; + unordered_set , PlayerKeyHash, PlayerKeyEq> unSynchedPlayers; public: - bool isSynched(shared_ptr player); - void setSynched(shared_ptr player, bool synched); - virtual bool stillValid(shared_ptr player) = 0; + bool isSynched(std::shared_ptr player); + void setSynched(std::shared_ptr player, bool synched); + virtual bool stillValid(std::shared_ptr player) = 0; // 4J Stu Added for UI unsigned int getSize() { return (unsigned int)slots->size(); } @@ -81,7 +81,7 @@ public: protected: // 4J Stu - Changes to return bool brought forward from 1.2 - bool moveItemStackTo(shared_ptr itemStack, int startSlot, int endSlot, bool backwards); + bool moveItemStackTo(std::shared_ptr itemStack, int startSlot, int endSlot, bool backwards); public: virtual bool isOverrideResultClick(int slotNum, int buttonNum); diff --git a/Minecraft.World/Achievement.cpp b/Minecraft.World/Achievement.cpp index a0dfd533..23f54c12 100644 --- a/Minecraft.World/Achievement.cpp +++ b/Minecraft.World/Achievement.cpp @@ -25,7 +25,7 @@ Achievement::Achievement(int id, const wstring& name, int x, int y, Tile *icon, { } -Achievement::Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requires) +Achievement::Achievement(int id, const wstring& name, int x, int y, std::shared_ptr icon, Achievement *requires) : Stat( Achievements::ACHIEVEMENT_OFFSET + id, I18n::get(wstring(L"achievement.").append(name)) ), desc( I18n::get(wstring(L"achievement.").append(name).append(L".desc"))), icon(icon), x(x), y(y), requires(requires) { } @@ -36,7 +36,7 @@ Achievement *Achievement::setAwardLocallyOnly() return this; } -Achievement *Achievement::setGolden() +Achievement *Achievement::setGolden() { isGoldenVar = true; return this; @@ -51,14 +51,14 @@ Achievement *Achievement::postConstruct() return this; } -bool Achievement::isAchievement() +bool Achievement::isAchievement() { return true; } -wstring Achievement::getDescription() +wstring Achievement::getDescription() { - if (descFormatter != NULL) + if (descFormatter != NULL) { return descFormatter->format(desc); } diff --git a/Minecraft.World/Achievement.h b/Minecraft.World/Achievement.h index b39c44b3..71487392 100644 --- a/Minecraft.World/Achievement.h +++ b/Minecraft.World/Achievement.h @@ -11,12 +11,12 @@ public: const int x, y; Achievement *requires; -private: +private: const wstring desc; DescFormatter *descFormatter; public: - const shared_ptr icon; + const std::shared_ptr icon; private: bool isGoldenVar; @@ -25,7 +25,7 @@ private: public: Achievement(int id, const wstring& name, int x, int y, Item *icon, Achievement *requires); Achievement(int id, const wstring& name, int x, int y, Tile *icon, Achievement *requires); - Achievement(int id, const wstring& name, int x, int y, shared_ptr icon, Achievement *requires); + Achievement(int id, const wstring& name, int x, int y, std::shared_ptr icon, Achievement *requires); Achievement *setAwardLocallyOnly(); Achievement *setGolden(); diff --git a/Minecraft.World/AddEntityPacket.cpp b/Minecraft.World/AddEntityPacket.cpp index 6231537d..9263bfda 100644 --- a/Minecraft.World/AddEntityPacket.cpp +++ b/Minecraft.World/AddEntityPacket.cpp @@ -8,7 +8,7 @@ -void AddEntityPacket::_init(shared_ptr e, int type, int data, int xp, int yp, int zp, int yRotp, int xRotp) +void AddEntityPacket::_init(std::shared_ptr e, int type, int data, int xp, int yp, int zp, int yRotp, int xRotp) { id = e->entityId; // 4J Stu - We should add entities at their "last sent" position so that the relative update packets @@ -38,16 +38,16 @@ void AddEntityPacket::_init(shared_ptr e, int type, int data, int xp, in } } -AddEntityPacket::AddEntityPacket() +AddEntityPacket::AddEntityPacket() { } -AddEntityPacket::AddEntityPacket(shared_ptr e, int type, int yRotp, int xRotp, int xp, int yp, int zp ) +AddEntityPacket::AddEntityPacket(std::shared_ptr e, int type, int yRotp, int xRotp, int xp, int yp, int zp ) { _init(e, type, -1, xp, yp, zp, yRotp, xRotp); // 4J - changed "no data" value to be -1, we can have a valid entity id of 0 } -AddEntityPacket::AddEntityPacket(shared_ptr e, int type, int data, int yRotp, int xRotp, int xp, int yp, int zp ) +AddEntityPacket::AddEntityPacket(std::shared_ptr e, int type, int data, int yRotp, int xRotp, int xp, int yp, int zp ) { _init(e, type, data, xp, yp, zp, yRotp, xRotp); } @@ -100,12 +100,12 @@ void AddEntityPacket::write(DataOutputStream *dos) // throws IOException TODO 4J } } -void AddEntityPacket::handle(PacketListener *listener) +void AddEntityPacket::handle(PacketListener *listener) { listener->handleAddEntity(shared_from_this()); } -int AddEntityPacket::getEstimatedSize() +int AddEntityPacket::getEstimatedSize() { return 11 + data > -1 ? 6 : 0; } diff --git a/Minecraft.World/AddEntityPacket.h b/Minecraft.World/AddEntityPacket.h index 5ac7286c..57b813e9 100644 --- a/Minecraft.World/AddEntityPacket.h +++ b/Minecraft.World/AddEntityPacket.h @@ -40,12 +40,12 @@ public: byte yRot,xRot; // 4J added private: - void _init(shared_ptr e, int type, int data, int xp, int yp, int zp, int yRotp, int xRotp ); + void _init(std::shared_ptr e, int type, int data, int xp, int yp, int zp, int yRotp, int xRotp ); public: AddEntityPacket(); - AddEntityPacket(shared_ptr e, int type, int yRotp, int xRotp, int xp, int yp, int zp); - AddEntityPacket(shared_ptr e, int type, int data, int yRotp, int xRotp, int xp, int yp, int zp ); + AddEntityPacket(std::shared_ptr e, int type, int yRotp, int xRotp, int xp, int yp, int zp); + AddEntityPacket(std::shared_ptr e, int type, int data, int yRotp, int xRotp, int xp, int yp, int zp ); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); @@ -53,6 +53,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new AddEntityPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new AddEntityPacket()); } virtual int getId() { return 23; } }; \ No newline at end of file diff --git a/Minecraft.World/AddExperienceOrbPacket.cpp b/Minecraft.World/AddExperienceOrbPacket.cpp index a1a22844..1d7a1f22 100644 --- a/Minecraft.World/AddExperienceOrbPacket.cpp +++ b/Minecraft.World/AddExperienceOrbPacket.cpp @@ -13,7 +13,7 @@ AddExperienceOrbPacket::AddExperienceOrbPacket() value = 0; } -AddExperienceOrbPacket::AddExperienceOrbPacket(shared_ptr e) +AddExperienceOrbPacket::AddExperienceOrbPacket(std::shared_ptr e) { id = e->entityId; x = Mth::floor(e->x * 32); diff --git a/Minecraft.World/AddExperienceOrbPacket.h b/Minecraft.World/AddExperienceOrbPacket.h index 59accfb3..33ae0642 100644 --- a/Minecraft.World/AddExperienceOrbPacket.h +++ b/Minecraft.World/AddExperienceOrbPacket.h @@ -12,13 +12,13 @@ public: int value; AddExperienceOrbPacket(); - AddExperienceOrbPacket(shared_ptr e); + AddExperienceOrbPacket(std::shared_ptr e); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); - static shared_ptr create() { return shared_ptr(new AddExperienceOrbPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new AddExperienceOrbPacket()); } virtual int getId() { return 26; } }; \ No newline at end of file diff --git a/Minecraft.World/AddGlobalEntityPacket.cpp b/Minecraft.World/AddGlobalEntityPacket.cpp index bfb27331..db476433 100644 --- a/Minecraft.World/AddGlobalEntityPacket.cpp +++ b/Minecraft.World/AddGlobalEntityPacket.cpp @@ -20,13 +20,13 @@ AddGlobalEntityPacket::AddGlobalEntityPacket() type = 0; } -AddGlobalEntityPacket::AddGlobalEntityPacket(shared_ptr e) +AddGlobalEntityPacket::AddGlobalEntityPacket(std::shared_ptr e) { id = e->entityId; x = Mth::floor(e->x * 32); y = Mth::floor(e->y * 32); z = Mth::floor(e->z * 32); - if (dynamic_pointer_cast(e) != NULL) + if (dynamic_pointer_cast(e) != NULL) { this->type = LIGHTNING; } @@ -45,7 +45,7 @@ void AddGlobalEntityPacket::read(DataInputStream *dis) // throws IOException z = dis->readInt(); } -void AddGlobalEntityPacket::write(DataOutputStream *dos) // throws IOException +void AddGlobalEntityPacket::write(DataOutputStream *dos) // throws IOException { dos->writeInt(id); dos->writeByte(type); diff --git a/Minecraft.World/AddGlobalEntityPacket.h b/Minecraft.World/AddGlobalEntityPacket.h index 80c10db2..9f0f518c 100644 --- a/Minecraft.World/AddGlobalEntityPacket.h +++ b/Minecraft.World/AddGlobalEntityPacket.h @@ -12,7 +12,7 @@ public: int type; AddGlobalEntityPacket(); - AddGlobalEntityPacket(shared_ptr e); + AddGlobalEntityPacket(std::shared_ptr e); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); @@ -20,6 +20,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new AddGlobalEntityPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new AddGlobalEntityPacket()); } virtual int getId() { return 71; } }; \ No newline at end of file diff --git a/Minecraft.World/AddIslandLayer.cpp b/Minecraft.World/AddIslandLayer.cpp index a8842936..96f762cb 100644 --- a/Minecraft.World/AddIslandLayer.cpp +++ b/Minecraft.World/AddIslandLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddIslandLayer::AddIslandLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) +AddIslandLayer::AddIslandLayer(int64_t seedMixup, std::shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddIslandLayer.h b/Minecraft.World/AddIslandLayer.h index 2446bbf8..c7de422e 100644 --- a/Minecraft.World/AddIslandLayer.h +++ b/Minecraft.World/AddIslandLayer.h @@ -5,7 +5,7 @@ class AddIslandLayer : public Layer { public: - AddIslandLayer(int64_t seedMixup, shared_ptrparent); + AddIslandLayer(int64_t seedMixup, std::shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/AddMobPacket.cpp b/Minecraft.World/AddMobPacket.cpp index 7e744c04..b6fd61ea 100644 --- a/Minecraft.World/AddMobPacket.cpp +++ b/Minecraft.World/AddMobPacket.cpp @@ -25,7 +25,7 @@ AddMobPacket::~AddMobPacket() delete unpack; } -AddMobPacket::AddMobPacket(shared_ptr mob, int yRotp, int xRotp, int xp, int yp, int zp, int yHeadRotp) +AddMobPacket::AddMobPacket(std::shared_ptr mob, int yRotp, int xRotp, int xp, int yp, int zp, int yHeadRotp) { id = mob->entityId; @@ -115,7 +115,7 @@ void AddMobPacket::handle(PacketListener *listener) listener->handleAddMob(shared_from_this()); } -int AddMobPacket::getEstimatedSize() +int AddMobPacket::getEstimatedSize() { int size = 11; if( entityData != NULL ) @@ -130,7 +130,7 @@ int AddMobPacket::getEstimatedSize() return size; } -vector > *AddMobPacket::getUnpackedData() +vector > *AddMobPacket::getUnpackedData() { if (unpack == NULL) { diff --git a/Minecraft.World/AddMobPacket.h b/Minecraft.World/AddMobPacket.h index 37de84c3..bdb91e4b 100644 --- a/Minecraft.World/AddMobPacket.h +++ b/Minecraft.World/AddMobPacket.h @@ -16,22 +16,22 @@ public: byte yRot, xRot, yHeadRot; private: - shared_ptr entityData; - vector > *unpack; + std::shared_ptr entityData; + vector > *unpack; public: AddMobPacket(); ~AddMobPacket(); - AddMobPacket(shared_ptr mob, int yRotp, int xRotp, int xp, int yp, int zp, int yHeadRotp); + AddMobPacket(std::shared_ptr mob, int yRotp, int xRotp, int xp, int yp, int zp, int yHeadRotp); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); - vector > *getUnpackedData(); + vector > *getUnpackedData(); public: - static shared_ptr create() { return shared_ptr(new AddMobPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new AddMobPacket()); } virtual int getId() { return 24; } }; diff --git a/Minecraft.World/AddMushroomIslandLayer.cpp b/Minecraft.World/AddMushroomIslandLayer.cpp index 324c88ee..2166e465 100644 --- a/Minecraft.World/AddMushroomIslandLayer.cpp +++ b/Minecraft.World/AddMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -AddMushroomIslandLayer::AddMushroomIslandLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) +AddMushroomIslandLayer::AddMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddMushroomIslandLayer.h b/Minecraft.World/AddMushroomIslandLayer.h index f691ebda..39c6feea 100644 --- a/Minecraft.World/AddMushroomIslandLayer.h +++ b/Minecraft.World/AddMushroomIslandLayer.h @@ -4,6 +4,6 @@ class AddMushroomIslandLayer : public Layer { public: - AddMushroomIslandLayer(int64_t seedMixup, shared_ptr parent); + AddMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/AddPaintingPacket.cpp b/Minecraft.World/AddPaintingPacket.cpp index f574cbf2..83fc9d67 100644 --- a/Minecraft.World/AddPaintingPacket.cpp +++ b/Minecraft.World/AddPaintingPacket.cpp @@ -17,7 +17,7 @@ AddPaintingPacket::AddPaintingPacket() motive = L""; } -AddPaintingPacket::AddPaintingPacket(shared_ptr e) +AddPaintingPacket::AddPaintingPacket(std::shared_ptr e) { id = e->entityId; x = e->xTile; diff --git a/Minecraft.World/AddPaintingPacket.h b/Minecraft.World/AddPaintingPacket.h index a5694b74..0a002ddb 100644 --- a/Minecraft.World/AddPaintingPacket.h +++ b/Minecraft.World/AddPaintingPacket.h @@ -15,13 +15,13 @@ public: public: AddPaintingPacket(); - AddPaintingPacket(shared_ptr e); + AddPaintingPacket(std::shared_ptr e); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new AddPaintingPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new AddPaintingPacket()); } virtual int getId() { return 25; } }; diff --git a/Minecraft.World/AddPlayerPacket.cpp b/Minecraft.World/AddPlayerPacket.cpp index f3d8a32b..a9076fdb 100644 --- a/Minecraft.World/AddPlayerPacket.cpp +++ b/Minecraft.World/AddPlayerPacket.cpp @@ -32,7 +32,7 @@ AddPlayerPacket::~AddPlayerPacket() if(unpack != NULL) delete unpack; } -AddPlayerPacket::AddPlayerPacket(shared_ptr player, PlayerUID xuid, PlayerUID OnlineXuid,int xp, int yp, int zp, int yRotp, int xRotp, int yHeadRotp) +AddPlayerPacket::AddPlayerPacket(std::shared_ptr player, PlayerUID xuid, PlayerUID OnlineXuid,int xp, int yp, int zp, int yRotp, int xRotp, int yHeadRotp) { id = player->entityId; name = player->name; @@ -50,7 +50,7 @@ AddPlayerPacket::AddPlayerPacket(shared_ptr player, PlayerUID xuid, Play //printf("%d: New add player (%f,%f,%f) : (%d,%d,%d) : xRot %d, yRot %d\n",id,player->x,player->y,player->z,x,y,z,xRot,yRot); - shared_ptr itemInstance = player->inventory->getSelected(); + std::shared_ptr itemInstance = player->inventory->getSelected(); carriedItem = itemInstance == NULL ? 0 : itemInstance->id; this->xuid = xuid; @@ -72,14 +72,14 @@ void AddPlayerPacket::read(DataInputStream *dis) //throws IOException y = dis->readInt(); z = dis->readInt(); yRot = dis->readByte(); - xRot = dis->readByte(); + xRot = dis->readByte(); yHeadRot = dis->readByte(); // 4J Added carriedItem = dis->readShort(); xuid = dis->readPlayerUID(); OnlineXuid = dis->readPlayerUID(); m_playerIndex = dis->readByte(); INT skinId = dis->readInt(); - m_skinId = *(DWORD *)&skinId; + m_skinId = *(DWORD *)&skinId; INT capeId = dis->readInt(); m_capeId = *(DWORD *)&capeId; INT privileges = dis->readInt(); @@ -132,7 +132,7 @@ int AddPlayerPacket::getEstimatedSize() return iSize; } -vector > *AddPlayerPacket::getUnpackedData() +vector > *AddPlayerPacket::getUnpackedData() { if (unpack == NULL) { diff --git a/Minecraft.World/AddPlayerPacket.h b/Minecraft.World/AddPlayerPacket.h index 30f6bcdd..5c55c863 100644 --- a/Minecraft.World/AddPlayerPacket.h +++ b/Minecraft.World/AddPlayerPacket.h @@ -10,8 +10,8 @@ class AddPlayerPacket : public Packet, public enable_shared_from_this entityData; - vector > *unpack; + std::shared_ptr entityData; + vector > *unpack; public: int id; @@ -29,15 +29,15 @@ public: AddPlayerPacket(); ~AddPlayerPacket(); - AddPlayerPacket(shared_ptr player, PlayerUID xuid, PlayerUID OnlineXuid,int xp, int yp, int zp, int yRotp, int xRotp, int yHeadRotp); + AddPlayerPacket(std::shared_ptr player, PlayerUID xuid, PlayerUID OnlineXuid,int xp, int yp, int zp, int yRotp, int xRotp, int yHeadRotp); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); - vector > *getUnpackedData(); + vector > *getUnpackedData(); public: - static shared_ptr create() { return shared_ptr(new AddPlayerPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new AddPlayerPacket()); } virtual int getId() { return 20; } }; diff --git a/Minecraft.World/AddSnowLayer.cpp b/Minecraft.World/AddSnowLayer.cpp index aa459789..aaf41e43 100644 --- a/Minecraft.World/AddSnowLayer.cpp +++ b/Minecraft.World/AddSnowLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddSnowLayer::AddSnowLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) +AddSnowLayer::AddSnowLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddSnowLayer.h b/Minecraft.World/AddSnowLayer.h index 0b3702da..04009ad6 100644 --- a/Minecraft.World/AddSnowLayer.h +++ b/Minecraft.World/AddSnowLayer.h @@ -4,6 +4,6 @@ class AddSnowLayer : public Layer { public: - AddSnowLayer(int64_t seedMixup, shared_ptr parent); + AddSnowLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/AdminLogCommand.h b/Minecraft.World/AdminLogCommand.h index 26299c56..c9ab5800 100644 --- a/Minecraft.World/AdminLogCommand.h +++ b/Minecraft.World/AdminLogCommand.h @@ -9,5 +9,5 @@ class AdminLogCommand public: static const int LOGTYPE_DONT_SHOW_TO_SELF = 1; - virtual void logAdminCommand(shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L"") = 0; + virtual void logAdminCommand(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L"") = 0; }; \ No newline at end of file diff --git a/Minecraft.World/AgableMob.cpp b/Minecraft.World/AgableMob.cpp index 39bcadbe..a433076e 100644 --- a/Minecraft.World/AgableMob.cpp +++ b/Minecraft.World/AgableMob.cpp @@ -13,9 +13,9 @@ AgableMob::AgableMob(Level *level) : PathfinderMob(level) registeredBBHeight = 0; } -bool AgableMob::interact(shared_ptr player) +bool AgableMob::interact(std::shared_ptr player) { - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); if (item != NULL && item->id == Item::monsterPlacer_Id) { @@ -24,7 +24,7 @@ bool AgableMob::interact(shared_ptr player) eINSTANCEOF classToSpawn = EntityIO::getClass(item->getAuxValue()); if (classToSpawn != eTYPE_NOTSET && (classToSpawn & eTYPE_AGABLE_MOB) == eTYPE_AGABLE_MOB && classToSpawn == GetType() ) // 4J Added GetType() check to only spawn same type { - shared_ptr offspring = getBreedOffspring(dynamic_pointer_cast(shared_from_this())); + std::shared_ptr offspring = getBreedOffspring(dynamic_pointer_cast(shared_from_this())); if (offspring != NULL) { offspring->setAge(-20 * 60 * 20); diff --git a/Minecraft.World/AgableMob.h b/Minecraft.World/AgableMob.h index 0020e876..f7f70ed6 100644 --- a/Minecraft.World/AgableMob.h +++ b/Minecraft.World/AgableMob.h @@ -13,13 +13,13 @@ private: public: AgableMob(Level *level); - virtual bool interact(shared_ptr player); + virtual bool interact(std::shared_ptr player); protected: virtual void defineSynchedData(); public: - virtual shared_ptr getBreedOffspring(shared_ptr target) = 0; + virtual std::shared_ptr getBreedOffspring(std::shared_ptr target) = 0; virtual int getAge(); virtual void setAge(int age); virtual void addAdditonalSaveData(CompoundTag *tag); diff --git a/Minecraft.World/Animal.cpp b/Minecraft.World/Animal.cpp index 45fc304f..36cdbe37 100644 --- a/Minecraft.World/Animal.cpp +++ b/Minecraft.World/Animal.cpp @@ -18,7 +18,7 @@ Animal::Animal(Level *level) : AgableMob( level ) { // inLove = 0; // 4J removed - now synched data loveTime = 0; - loveCause = shared_ptr(); + loveCause = std::shared_ptr(); setDespawnProtected(); } @@ -62,7 +62,7 @@ void Animal::aiStep() updateDespawnProtectedState(); // 4J added } -void Animal::checkHurtTarget(shared_ptr target, float d) +void Animal::checkHurtTarget(std::shared_ptr target, float d) { if (dynamic_pointer_cast(target) != NULL) { @@ -75,7 +75,7 @@ void Animal::checkHurtTarget(shared_ptr target, float d) holdGround = true; } - shared_ptr p = dynamic_pointer_cast(target); + std::shared_ptr p = dynamic_pointer_cast(target); if (p->getSelectedItem() != NULL && this->isFood(p->getSelectedItem())) { } @@ -87,7 +87,7 @@ void Animal::checkHurtTarget(shared_ptr target, float d) } else if (dynamic_pointer_cast(target) != NULL) { - shared_ptr a = dynamic_pointer_cast(target); + std::shared_ptr a = dynamic_pointer_cast(target); if (getAge() > 0 && a->getAge() < 0) { if (d < 2.5) @@ -123,9 +123,9 @@ void Animal::checkHurtTarget(shared_ptr target, float d) } -void Animal::breedWith(shared_ptr target) +void Animal::breedWith(std::shared_ptr target) { - shared_ptr offspring = getBreedOffspring(target); + std::shared_ptr offspring = getBreedOffspring(target); setInLoveValue(0); loveTime = 0; @@ -154,7 +154,7 @@ void Animal::breedWith(shared_ptr target) } level->addEntity(offspring); - level->addEntity( shared_ptr( new ExperienceOrb(level, x, y, z, random->nextInt(4) + 1) ) ); + level->addEntity( std::shared_ptr( new ExperienceOrb(level, x, y, z, random->nextInt(4) + 1) ) ); } setDespawnProtected(); @@ -170,7 +170,7 @@ bool Animal::hurt(DamageSource *dmgSource, int dmg) { if (dynamic_cast(dmgSource) != NULL) { - shared_ptr source = dmgSource->getDirectEntity(); + std::shared_ptr source = dmgSource->getDirectEntity(); if (dynamic_pointer_cast(source) != NULL && !dynamic_pointer_cast(source)->isAllowedToAttackAnimals() ) { @@ -179,7 +179,7 @@ bool Animal::hurt(DamageSource *dmgSource, int dmg) if (source != NULL && source->GetType() == eTYPE_ARROW) { - shared_ptr arrow = dynamic_pointer_cast(source); + std::shared_ptr arrow = dynamic_pointer_cast(source); if (dynamic_pointer_cast(arrow->owner) != NULL && ! dynamic_pointer_cast(arrow->owner)->isAllowedToAttackAnimals() ) { return false; @@ -207,18 +207,18 @@ void Animal::readAdditionalSaveData(CompoundTag *tag) setDespawnProtected(); } -shared_ptr Animal::findAttackTarget() +std::shared_ptr Animal::findAttackTarget() { if (fleeTime > 0) return nullptr; float r = 8; if (getInLoveValue() > 0) { - vector > *others = level->getEntitiesOfClass(typeid(*this), bb->grow(r, r, r)); + vector > *others = level->getEntitiesOfClass(typeid(*this), bb->grow(r, r, r)); //for (int i = 0; i < others->size(); i++) for(AUTO_VAR(it, others->begin()); it != others->end(); ++it) { - shared_ptr p = dynamic_pointer_cast(*it); + std::shared_ptr p = dynamic_pointer_cast(*it); if (p != shared_from_this() && p->getInLoveValue() > 0) { delete others; @@ -231,13 +231,13 @@ shared_ptr Animal::findAttackTarget() { if (getAge() == 0) { - vector > *players = level->getEntitiesOfClass(typeid(Player), bb->grow(r, r, r)); + vector > *players = level->getEntitiesOfClass(typeid(Player), bb->grow(r, r, r)); //for (int i = 0; i < players.size(); i++) for(AUTO_VAR(it, players->begin()); it != players->end(); ++it) { setDespawnProtected(); - shared_ptr p = dynamic_pointer_cast(*it); + std::shared_ptr p = dynamic_pointer_cast(*it); if (p->getSelectedItem() != NULL && this->isFood(p->getSelectedItem())) { delete players; @@ -248,11 +248,11 @@ shared_ptr Animal::findAttackTarget() } else if (getAge() > 0) { - vector > *others = level->getEntitiesOfClass(typeid(*this), bb->grow(r, r, r)); - //for (int i = 0; i < others.size(); i++) + vector > *others = level->getEntitiesOfClass(typeid(*this), bb->grow(r, r, r)); + //for (int i = 0; i < others.size(); i++) for(AUTO_VAR(it, others->begin()); it != others->end(); ++it) { - shared_ptr p = dynamic_pointer_cast(*it); + std::shared_ptr p = dynamic_pointer_cast(*it); if (p != shared_from_this() && p->getAge() < 0) { delete others; @@ -283,19 +283,19 @@ bool Animal::removeWhenFarAway() return !isDespawnProtected(); // 4J changed - was false } -int Animal::getExperienceReward(shared_ptr killedBy) +int Animal::getExperienceReward(std::shared_ptr killedBy) { return 1 + level->random->nextInt(3); } -bool Animal::isFood(shared_ptr itemInstance) +bool Animal::isFood(std::shared_ptr itemInstance) { return itemInstance->id == Item::wheat_Id; } -bool Animal::interact(shared_ptr player) +bool Animal::interact(std::shared_ptr player) { - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); if (item != NULL && isFood(item) && getAge() == 0) { if (!player->abilities.instabuild) @@ -306,7 +306,7 @@ bool Animal::interact(shared_ptr player) player->inventory->setItem(player->inventory->selected, nullptr); } } - + // 4J-PB - If we can't produce another animal through breeding because of the spawn limits, display a message here if(!level->isClientSide) @@ -318,21 +318,21 @@ bool Animal::interact(shared_ptr player) { player->displayClientMessage(IDS_MAX_CHICKENS_BRED ); return false; - } + } break; case eTYPE_WOLF: if( !level->canCreateMore(eTYPE_WOLF, Level::eSpawnType_Breed) ) { player->displayClientMessage(IDS_MAX_WOLVES_BRED ); return false; - } + } break; case eTYPE_MUSHROOMCOW: if( !level->canCreateMore(eTYPE_MUSHROOMCOW, Level::eSpawnType_Breed) ) { player->displayClientMessage(IDS_MAX_MUSHROOMCOWS_BRED ); return false; - } + } break; default: if((GetType() & eTYPE_ANIMALS_SPAWN_LIMIT_CHECK) == eTYPE_ANIMALS_SPAWN_LIMIT_CHECK) @@ -380,13 +380,13 @@ void Animal::setInLoveValue(int value) } // 4J added -void Animal::setInLove(shared_ptr player) +void Animal::setInLove(std::shared_ptr player) { loveCause = player; setInLoveValue(20*30); } -shared_ptr Animal::getLoveCause() +std::shared_ptr Animal::getLoveCause() { return loveCause.lock(); } @@ -400,7 +400,7 @@ void Animal::resetLove() { entityData->set(DATA_IN_LOVE, 0); } -bool Animal::canMate(shared_ptr partner) +bool Animal::canMate(std::shared_ptr partner) { if (partner == shared_from_this()) return false; if (typeid(*partner) != typeid(*this)) return false; diff --git a/Minecraft.World/Animal.h b/Minecraft.World/Animal.h index 8c0cda8e..987b360e 100644 --- a/Minecraft.World/Animal.h +++ b/Minecraft.World/Animal.h @@ -26,10 +26,10 @@ public: virtual void aiStep(); protected: - virtual void checkHurtTarget(shared_ptr target, float d); + virtual void checkHurtTarget(std::shared_ptr target, float d); private: - virtual void breedWith(shared_ptr target); + virtual void breedWith(std::shared_ptr target); public: virtual float getWalkTargetValue(int x, int y, int z); @@ -40,7 +40,7 @@ public: virtual void readAdditionalSaveData(CompoundTag *tag); protected: - virtual shared_ptr findAttackTarget(); + virtual std::shared_ptr findAttackTarget(); public: virtual bool canSpawn(); @@ -48,22 +48,22 @@ public: protected: virtual bool removeWhenFarAway(); - virtual int getExperienceReward(shared_ptr killedBy); + virtual int getExperienceReward(std::shared_ptr killedBy); public: - virtual bool isFood(shared_ptr itemInstance); - virtual bool interact(shared_ptr player); + virtual bool isFood(std::shared_ptr itemInstance); + virtual bool interact(std::shared_ptr player); protected: int getInLoveValue(); // 4J added public: void setInLoveValue(int value); // 4J added - void setInLove(shared_ptr player); // 4J added, then modified to match latest Java for XboxOne achievements - shared_ptr getLoveCause(); + void setInLove(std::shared_ptr player); // 4J added, then modified to match latest Java for XboxOne achievements + std::shared_ptr getLoveCause(); bool isInLove(); void resetLove(); - virtual bool canMate(shared_ptr partner); + virtual bool canMate(std::shared_ptr partner); // 4J added for determining whether animals are enclosed or not private: diff --git a/Minecraft.World/AnimatePacket.cpp b/Minecraft.World/AnimatePacket.cpp index 2ca4ed49..4a2823fa 100644 --- a/Minecraft.World/AnimatePacket.cpp +++ b/Minecraft.World/AnimatePacket.cpp @@ -13,30 +13,30 @@ AnimatePacket::AnimatePacket() action = 0; } -AnimatePacket::AnimatePacket(shared_ptr e, int action) +AnimatePacket::AnimatePacket(std::shared_ptr e, int action) { id = e->entityId; this->action = action; } -void AnimatePacket::read(DataInputStream *dis) //throws IOException +void AnimatePacket::read(DataInputStream *dis) //throws IOException { id = dis->readInt(); action = dis->readByte(); } -void AnimatePacket::write(DataOutputStream *dos) //throws IOException +void AnimatePacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(id); dos->writeByte(action); } -void AnimatePacket::handle(PacketListener *listener) +void AnimatePacket::handle(PacketListener *listener) { listener->handleAnimate(shared_from_this()); } -int AnimatePacket::getEstimatedSize() +int AnimatePacket::getEstimatedSize() { return 5; } diff --git a/Minecraft.World/AnimatePacket.h b/Minecraft.World/AnimatePacket.h index 0287b9a6..78c8fae6 100644 --- a/Minecraft.World/AnimatePacket.h +++ b/Minecraft.World/AnimatePacket.h @@ -9,7 +9,7 @@ public: static const int SWING = 1; static const int HURT = 2; static const int WAKE_UP = 3; - static const int RESPAWN = 4; + static const int RESPAWN = 4; static const int EAT = 5; // 1.8.2 static const int CRITICAL_HIT = 6; static const int MAGIC_CRITICAL_HIT = 7; @@ -18,14 +18,14 @@ public: int action; AnimatePacket(); - AnimatePacket(shared_ptr e, int action); + AnimatePacket(std::shared_ptr e, int action); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); - + public: - static shared_ptr create() { return shared_ptr(new AnimatePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new AnimatePacket()); } virtual int getId() { return 18; } }; \ No newline at end of file diff --git a/Minecraft.World/AnvilTile.cpp b/Minecraft.World/AnvilTile.cpp index e5fd736d..f0a6d2a7 100644 --- a/Minecraft.World/AnvilTile.cpp +++ b/Minecraft.World/AnvilTile.cpp @@ -55,7 +55,7 @@ void AnvilTile::registerIcons(IconRegister *iconRegister) } } -void AnvilTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void AnvilTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int dir = (Mth::floor(by->yRot * 4 / (360) + 0.5)) & 3; int dmg = level->getData(x, y, z) >> 2; @@ -67,7 +67,7 @@ void AnvilTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr b if (dir == 3) level->setData(x, y, z, Direction::WEST | (dmg << 2)); } -bool AnvilTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly) +bool AnvilTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly) { if (level->isClientSide) { @@ -87,7 +87,7 @@ int AnvilTile::getSpawnResourcesAuxValue(int data) return data >> 2; } -void AnvilTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +void AnvilTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) { int dir = level->getData(x, y, z) & 3; @@ -101,7 +101,7 @@ void AnvilTile::updateShape(LevelSource *level, int x, int y, int z, int forceDa } } -void AnvilTile::falling(shared_ptr entity) +void AnvilTile::falling(std::shared_ptr entity) { entity->setHurtsEntities(true); } diff --git a/Minecraft.World/AnvilTile.h b/Minecraft.World/AnvilTile.h index 1a4f0ed7..e625777d 100644 --- a/Minecraft.World/AnvilTile.h +++ b/Minecraft.World/AnvilTile.h @@ -35,14 +35,14 @@ public: bool isSolidRender(bool isServerLevel = false); Icon *getTexture(int face, int data); void registerIcons(IconRegister *iconRegister); - void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); - bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); + void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); + bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); int getRenderShape(); int getSpawnResourcesAuxValue(int data); - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); protected: - void falling(shared_ptr entity); + void falling(std::shared_ptr entity); public: void onLand(Level *level, int xt, int yt, int zt, int data); diff --git a/Minecraft.World/ArmorDyeRecipe.cpp b/Minecraft.World/ArmorDyeRecipe.cpp index 3b74a8bb..8c5f52e0 100644 --- a/Minecraft.World/ArmorDyeRecipe.cpp +++ b/Minecraft.World/ArmorDyeRecipe.cpp @@ -5,14 +5,14 @@ #include "net.minecraft.world.item.crafting.h" #include "ArmorDyeRecipe.h" -bool ArmorDyeRecipe::matches(shared_ptr craftSlots, Level *level) +bool ArmorDyeRecipe::matches(std::shared_ptr craftSlots, Level *level) { - shared_ptr target = nullptr; - vector > dyes; + std::shared_ptr target = nullptr; + vector > dyes; for (int slot = 0; slot < craftSlots->getContainerSize(); slot++) { - shared_ptr item = craftSlots->getItem(slot); + std::shared_ptr item = craftSlots->getItem(slot); if (item == NULL) continue; ArmorItem *armor = dynamic_cast(item->getItem()); @@ -40,9 +40,9 @@ bool ArmorDyeRecipe::matches(shared_ptr craftSlots, Level *le return target != NULL && !dyes.empty(); } -shared_ptr ArmorDyeRecipe::assembleDyedArmor(shared_ptr craftSlots) +std::shared_ptr ArmorDyeRecipe::assembleDyedArmor(std::shared_ptr craftSlots) { - shared_ptr target = nullptr; + std::shared_ptr target = nullptr; int colorTotals[3]; colorTotals[0] = 0; colorTotals[1] = 0; @@ -55,7 +55,7 @@ shared_ptr ArmorDyeRecipe::assembleDyedArmor(shared_ptrgetContainerSize(); slot++) { - shared_ptr item = craftSlots->getItem(slot); + std::shared_ptr item = craftSlots->getItem(slot); if (item == NULL) continue; armor = dynamic_cast(item->getItem()); @@ -128,7 +128,7 @@ shared_ptr ArmorDyeRecipe::assembleDyedArmor(shared_ptr ArmorDyeRecipe::assemble(shared_ptr craftSlots) +std::shared_ptr ArmorDyeRecipe::assemble(std::shared_ptr craftSlots) { return ArmorDyeRecipe::assembleDyedArmor(craftSlots); } @@ -181,8 +181,8 @@ void ArmorDyeRecipe::requires(INGREDIENTS_REQUIRED *pIngReq) { ItemInstance *expected = *ingredient; - if (expected!=NULL) - { + if (expected!=NULL) + { int iAuxVal = (*ingredient)->getAuxValue(); TempIngReq.uiGridA[iCount++]=expected->id | iAuxVal<<24; // 4J-PB - put the ingredients in boxes 1,2,4,5 so we can see them in a 2x2 crafting screen diff --git a/Minecraft.World/ArmorDyeRecipe.h b/Minecraft.World/ArmorDyeRecipe.h index b983ba7b..715b08e2 100644 --- a/Minecraft.World/ArmorDyeRecipe.h +++ b/Minecraft.World/ArmorDyeRecipe.h @@ -5,17 +5,17 @@ class ArmorDyeRecipe : public Recipy { public: - bool matches(shared_ptr craftSlots, Level *level); + bool matches(std::shared_ptr craftSlots, Level *level); // 4J Stu - Made static as we use this in a different way from the Java (but needs to be a different name otherwise Orbis compiler complains - static shared_ptr assembleDyedArmor(shared_ptr craftSlots); - shared_ptr assemble(shared_ptr craftSlots); + static std::shared_ptr assembleDyedArmor(std::shared_ptr craftSlots); + std::shared_ptr assemble(std::shared_ptr craftSlots); int size(); const ItemInstance *getResultItem(); - - virtual const int getGroup(); + + virtual const int getGroup(); // 4J-PB virtual bool requires(int iRecipe); diff --git a/Minecraft.World/ArmorItem.cpp b/Minecraft.World/ArmorItem.cpp index 0b2c24e4..be7f6b9d 100644 --- a/Minecraft.World/ArmorItem.cpp +++ b/Minecraft.World/ArmorItem.cpp @@ -88,7 +88,7 @@ ArmorItem::ArmorItem(int id, const ArmorMaterial *armorType, int icon, int slot) maxStackSize = 1; } -int ArmorItem::getColor(shared_ptr item, int spriteLayer) +int ArmorItem::getColor(std::shared_ptr item, int spriteLayer) { if (spriteLayer > 0) { @@ -116,7 +116,7 @@ const _ArmorMaterial *ArmorItem::getMaterial() return armorType; } -bool ArmorItem::hasCustomColor(shared_ptr item) +bool ArmorItem::hasCustomColor(std::shared_ptr item) { if (armorType != ArmorMaterial::CLOTH) return false; if (!item->hasTag()) return false; @@ -126,7 +126,7 @@ bool ArmorItem::hasCustomColor(shared_ptr item) return true; } -int ArmorItem::getColor(shared_ptr item) +int ArmorItem::getColor(std::shared_ptr item) { if (armorType != ArmorMaterial::CLOTH) return -1; @@ -155,7 +155,7 @@ Icon *ArmorItem::getLayerIcon(int auxValue, int spriteLayer) return Item::getLayerIcon(auxValue, spriteLayer); } -void ArmorItem::clearColor(shared_ptr item) +void ArmorItem::clearColor(std::shared_ptr item) { if (armorType != ArmorMaterial::CLOTH) return; CompoundTag *tag = item->getTag(); @@ -164,7 +164,7 @@ void ArmorItem::clearColor(shared_ptr item) if (display->contains(L"color")) display->remove(L"color"); } -void ArmorItem::setColor(shared_ptr item, int color) +void ArmorItem::setColor(std::shared_ptr item, int color) { if (armorType != ArmorMaterial::CLOTH) { @@ -189,7 +189,7 @@ void ArmorItem::setColor(shared_ptr item, int color) display->putInt(L"color", color); } -bool ArmorItem::isValidRepairItem(shared_ptr source, shared_ptr repairItem) +bool ArmorItem::isValidRepairItem(std::shared_ptr source, std::shared_ptr repairItem) { if (armorType->getTierItemId() == repairItem->id) { diff --git a/Minecraft.World/ArmorItem.h b/Minecraft.World/ArmorItem.h index c711e2f9..04b483e2 100644 --- a/Minecraft.World/ArmorItem.h +++ b/Minecraft.World/ArmorItem.h @@ -65,7 +65,7 @@ public: ArmorItem(int id, const ArmorMaterial *armorType, int icon, int slot); //@Override - int getColor(shared_ptr item, int spriteLayer); + int getColor(std::shared_ptr item, int spriteLayer); //@Override bool hasMultipleSpriteLayers(); @@ -73,15 +73,15 @@ public: virtual int getEnchantmentValue(); const ArmorMaterial *getMaterial(); - bool hasCustomColor(shared_ptr item); - int getColor(shared_ptr item); + bool hasCustomColor(std::shared_ptr item); + int getColor(std::shared_ptr item); //@Override Icon *getLayerIcon(int auxValue, int spriteLayer); - void clearColor(shared_ptr item); - void setColor(shared_ptr item, int color); + void clearColor(std::shared_ptr item); + void setColor(std::shared_ptr item, int color); - bool isValidRepairItem(shared_ptr source, shared_ptr repairItem); + bool isValidRepairItem(std::shared_ptr source, std::shared_ptr repairItem); //@Override void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/ArmorSlot.cpp b/Minecraft.World/ArmorSlot.cpp index 1efe0b71..c3006aaa 100644 --- a/Minecraft.World/ArmorSlot.cpp +++ b/Minecraft.World/ArmorSlot.cpp @@ -6,7 +6,7 @@ #include "net.minecraft.world.item.crafting.h" #include "ArmorSlot.h" -ArmorSlot::ArmorSlot(int slotNum, shared_ptr container, int id, int x, int y) +ArmorSlot::ArmorSlot(int slotNum, std::shared_ptr container, int id, int x, int y) : Slot( container, id, x, y ), slotNum( slotNum ) { @@ -17,7 +17,7 @@ int ArmorSlot::getMaxStackSize() return 1; } -bool ArmorSlot::mayPlace(shared_ptr item) +bool ArmorSlot::mayPlace(std::shared_ptr item) { if ( dynamic_cast( item->getItem() ) != NULL) { @@ -36,9 +36,9 @@ Icon *ArmorSlot::getNoItemIcon() } // -//bool ArmorSlot::mayCombine(shared_ptr item) +//bool ArmorSlot::mayCombine(std::shared_ptr item) //{ -// shared_ptr thisItemI = getItem(); +// std::shared_ptr thisItemI = getItem(); // if(thisItemI == NULL || item == NULL) return false; // // ArmorItem *thisItem = (ArmorItem *)thisItemI->getItem(); @@ -47,12 +47,12 @@ Icon *ArmorSlot::getNoItemIcon() // return thisIsDyableArmor && itemIsDye; //} // -//shared_ptr ArmorSlot::combine(shared_ptr item) +//std::shared_ptr ArmorSlot::combine(std::shared_ptr item) //{ -// shared_ptr craftSlots = shared_ptr( new CraftingContainer(NULL, 2, 2) ); +// std::shared_ptr craftSlots = std::shared_ptr( new CraftingContainer(NULL, 2, 2) ); // craftSlots->setItem(0, item); // craftSlots->setItem(1, getItem()); // Armour item needs to go second -// shared_ptr result = ArmorDyeRecipe::assembleDyedArmor(craftSlots); +// std::shared_ptr result = ArmorDyeRecipe::assembleDyedArmor(craftSlots); // craftSlots->setItem(0, nullptr); // craftSlots->setItem(1, nullptr); // return result; diff --git a/Minecraft.World/ArmorSlot.h b/Minecraft.World/ArmorSlot.h index a9797be2..2bf02067 100644 --- a/Minecraft.World/ArmorSlot.h +++ b/Minecraft.World/ArmorSlot.h @@ -13,12 +13,12 @@ private: const int slotNum; public: - ArmorSlot(int slotNum, shared_ptr container, int id, int x, int y); + ArmorSlot(int slotNum, std::shared_ptr container, int id, int x, int y); virtual ~ArmorSlot() {} virtual int getMaxStackSize(); - virtual bool mayPlace(shared_ptr item); + virtual bool mayPlace(std::shared_ptr item); Icon *getNoItemIcon(); - //virtual bool mayCombine(shared_ptr item); // 4J Added - //virtual shared_ptr combine(shared_ptr item); // 4J Added + //virtual bool mayCombine(std::shared_ptr item); // 4J Added + //virtual std::shared_ptr combine(std::shared_ptr item); // 4J Added }; \ No newline at end of file diff --git a/Minecraft.World/ArrayWithLength.h b/Minecraft.World/ArrayWithLength.h index 4e9f9941..bee447f0 100644 --- a/Minecraft.World/ArrayWithLength.h +++ b/Minecraft.World/ArrayWithLength.h @@ -105,11 +105,11 @@ typedef arrayWithLength LevelArray; typedef arrayWithLength LevelRendererArray; typedef arrayWithLength WeighedRandomItemArray; typedef arrayWithLength WeighedTreasureArray; -typedef arrayWithLength< shared_ptr > LayerArray; +typedef arrayWithLength< std::shared_ptr > LayerArray; //typedef arrayWithLength CubeArray; typedef arrayWithLength ModelPartArray; typedef arrayWithLength EnchantmentArray; typedef arrayWithLength ClipChunkArray; #include "ItemInstance.h" -typedef arrayWithLength > ItemInstanceArray; +typedef arrayWithLength > ItemInstanceArray; diff --git a/Minecraft.World/Arrow.cpp b/Minecraft.World/Arrow.cpp index 1b102c65..9edd2208 100644 --- a/Minecraft.World/Arrow.cpp +++ b/Minecraft.World/Arrow.cpp @@ -52,7 +52,7 @@ Arrow::Arrow(Level *level) : Entity( level ) this->setSize(0.5f, 0.5f); } -Arrow::Arrow(Level *level, shared_ptr mob, shared_ptr target, float power, float uncertainty) : Entity( level ) +Arrow::Arrow(Level *level, std::shared_ptr mob, std::shared_ptr target, float power, float uncertainty) : Entity( level ) { _init(); @@ -88,8 +88,8 @@ Arrow::Arrow(Level *level, double x, double y, double z) : Entity( level ) this->setPos(x, y, z); this->heightOffset = 0; } - -Arrow::Arrow(Level *level, shared_ptr mob, float power) : Entity( level ) + +Arrow::Arrow(Level *level, std::shared_ptr mob, float power) : Entity( level ) { _init(); @@ -171,12 +171,12 @@ void Arrow::lerpMotion(double xd, double yd, double zd) } } -void Arrow::tick() +void Arrow::tick() { Entity::tick(); - if (xRotO == 0 && yRotO == 0) + if (xRotO == 0 && yRotO == 0) { double sd = sqrt(xd * xd + zd * zd); yRotO = this->yRot = (float) (atan2(xd, zd) * 180 / PI); @@ -214,17 +214,17 @@ void Arrow::tick() life = 0; flightTime = 0; return; - } + } - else + else { life++; if (life == 20 * 60) remove(); return; } - } - - else + } + + else { flightTime++; } @@ -239,13 +239,13 @@ void Arrow::tick() { to = Vec3::newTemp(res->pos->x, res->pos->y, res->pos->z); } - shared_ptr hitEntity = nullptr; - vector > *objects = level->getEntities(shared_from_this(), this->bb->expand(xd, yd, zd)->grow(1, 1, 1)); + std::shared_ptr hitEntity = nullptr; + vector > *objects = level->getEntities(shared_from_this(), this->bb->expand(xd, yd, zd)->grow(1, 1, 1)); double nearest = 0; AUTO_VAR(itEnd, objects->end()); for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) { - shared_ptr e = *it; //objects->at(i); + std::shared_ptr e = *it; //objects->at(i); if (!e->isPickable() || (e == owner && flightTime < 5)) continue; float rr = 0.3f; @@ -299,7 +299,7 @@ void Arrow::tick() res->entity->setOnFire(5); } - shared_ptr mob = dynamic_pointer_cast(res->entity); + std::shared_ptr mob = dynamic_pointer_cast(res->entity); if (mob != NULL) { mob->arrowCount++; @@ -333,7 +333,7 @@ void Arrow::tick() // 4J - sound change brought forward from 1.2.3 level->playSound(shared_from_this(), eSoundType_RANDOM_BOW_HIT, 1.0f, 1.2f / (random->nextFloat() * 0.2f + 0.9f)); remove(); - } + } else { xd *= -0.1f; @@ -343,7 +343,7 @@ void Arrow::tick() yRotO += 180; flightTime = 0; } - + delete damageSource; } else @@ -464,7 +464,7 @@ void Arrow::readAdditionalSaveData(CompoundTag *tag) } } -void Arrow::playerTouch(shared_ptr player) +void Arrow::playerTouch(std::shared_ptr player) { if (level->isClientSide || !inGround || shakeTime > 0) return; @@ -472,7 +472,7 @@ void Arrow::playerTouch(shared_ptr player) if (pickup == PICKUP_ALLOWED) { - if (!player->inventory->add( shared_ptr( new ItemInstance(Item::arrow, 1) ) )) + if (!player->inventory->add( std::shared_ptr( new ItemInstance(Item::arrow, 1) ) )) { bRemove = false; } diff --git a/Minecraft.World/Arrow.h b/Minecraft.World/Arrow.h index b96aa210..9ac5a900 100644 --- a/Minecraft.World/Arrow.h +++ b/Minecraft.World/Arrow.h @@ -36,7 +36,7 @@ private: public: int pickup; int shakeTime; - shared_ptr owner; + std::shared_ptr owner; private: double baseDamage; @@ -52,9 +52,9 @@ private: public: Arrow(Level *level); - Arrow(Level *level, shared_ptr mob, shared_ptr target, float power, float uncertainty); + Arrow(Level *level, std::shared_ptr mob, std::shared_ptr target, float power, float uncertainty); Arrow(Level *level, double x, double y, double z); - Arrow(Level *level, shared_ptr mob, float power); + Arrow(Level *level, std::shared_ptr mob, float power); protected: virtual void defineSynchedData(); @@ -66,7 +66,7 @@ public: virtual void tick(); virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); - virtual void playerTouch(shared_ptr player); + virtual void playerTouch(std::shared_ptr player); virtual float getShadowHeightOffs(); void setBaseDamage(double baseDamage); diff --git a/Minecraft.World/ArrowAttackGoal.cpp b/Minecraft.World/ArrowAttackGoal.cpp index 23a2d2ac..735b8389 100644 --- a/Minecraft.World/ArrowAttackGoal.cpp +++ b/Minecraft.World/ArrowAttackGoal.cpp @@ -26,7 +26,7 @@ ArrowAttackGoal::ArrowAttackGoal(Mob *mob, float speed, int projectileType, int bool ArrowAttackGoal::canUse() { - shared_ptr bestTarget = mob->getTarget(); + std::shared_ptr bestTarget = mob->getTarget(); if (bestTarget == NULL) return false; target = weak_ptr(bestTarget); return true; @@ -45,7 +45,7 @@ void ArrowAttackGoal::stop() void ArrowAttackGoal::tick() { double attackRadiusSqr = 10 * 10; - shared_ptr tar = target.lock(); + std::shared_ptr tar = target.lock(); double targetDistSqr = mob->distanceToSqr(tar->x, tar->bb->y0, tar->z); bool canSee = mob->getSensing()->canSee(tar); @@ -69,16 +69,16 @@ void ArrowAttackGoal::tick() void ArrowAttackGoal::fireAtTarget() { - shared_ptr tar = target.lock(); + std::shared_ptr tar = target.lock(); if (projectileType == ArrowType) { - shared_ptr arrow = shared_ptr( new Arrow(level, dynamic_pointer_cast(mob->shared_from_this()), tar, 1.60f, 12) ); + std::shared_ptr arrow = std::shared_ptr( new Arrow(level, dynamic_pointer_cast(mob->shared_from_this()), tar, 1.60f, 12) ); level->playSound(mob->shared_from_this(), eSoundType_RANDOM_BOW, 1.0f, 1 / (mob->getRandom()->nextFloat() * 0.4f + 0.8f)); level->addEntity(arrow); } else if (projectileType == SnowballType) { - shared_ptr snowball = shared_ptr( new Snowball(level, dynamic_pointer_cast(mob->shared_from_this())) ); + std::shared_ptr snowball = std::shared_ptr( new Snowball(level, dynamic_pointer_cast(mob->shared_from_this())) ); double xd = tar->x - mob->x; double yd = (tar->y + tar->getHeadHeight() - 1.1f) - snowball->y; double zd = tar->z - mob->z; diff --git a/Minecraft.World/AvoidPlayerGoal.cpp b/Minecraft.World/AvoidPlayerGoal.cpp index c94d5cb1..56202028 100644 --- a/Minecraft.World/AvoidPlayerGoal.cpp +++ b/Minecraft.World/AvoidPlayerGoal.cpp @@ -33,14 +33,14 @@ bool AvoidPlayerGoal::canUse() { if (avoidType == typeid(Player)) { - shared_ptr tamableAnimal = dynamic_pointer_cast(mob->shared_from_this()); + std::shared_ptr tamableAnimal = dynamic_pointer_cast(mob->shared_from_this()); if (tamableAnimal != NULL && tamableAnimal->isTame()) return false; toAvoid = weak_ptr(mob->level->getNearestPlayer(mob->shared_from_this(), maxDist)); if (toAvoid.lock() == NULL) return false; } else { - vector > *entities = mob->level->getEntitiesOfClass(avoidType, mob->bb->grow(maxDist, 3, maxDist)); + vector > *entities = mob->level->getEntitiesOfClass(avoidType, mob->bb->grow(maxDist, 3, maxDist)); if (entities->empty()) { delete entities; diff --git a/Minecraft.World/AwardStatPacket.h b/Minecraft.World/AwardStatPacket.h index 6b79c023..aad8511d 100644 --- a/Minecraft.World/AwardStatPacket.h +++ b/Minecraft.World/AwardStatPacket.h @@ -24,7 +24,7 @@ public: virtual int getEstimatedSize(); virtual bool isAync(); - static shared_ptr create() { return shared_ptr(new AwardStatPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new AwardStatPacket()); } virtual int getId() { return 200; } public: diff --git a/Minecraft.World/BedItem.cpp b/Minecraft.World/BedItem.cpp index 1ff50c6c..d0417387 100644 --- a/Minecraft.World/BedItem.cpp +++ b/Minecraft.World/BedItem.cpp @@ -12,7 +12,7 @@ BedItem::BedItem(int id) : Item( id ) { } -bool BedItem::useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool BedItem::useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { if (face != Facing::UP) { diff --git a/Minecraft.World/BedItem.h b/Minecraft.World/BedItem.h index ad0297bd..261423b3 100644 --- a/Minecraft.World/BedItem.h +++ b/Minecraft.World/BedItem.h @@ -11,5 +11,5 @@ class BedItem : public Item public: BedItem(int id); - virtual bool useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); }; \ No newline at end of file diff --git a/Minecraft.World/BedTile.cpp b/Minecraft.World/BedTile.cpp index 7d32c6d3..47f2f86c 100644 --- a/Minecraft.World/BedTile.cpp +++ b/Minecraft.World/BedTile.cpp @@ -28,7 +28,7 @@ void BedTile::updateDefaultShape() } // 4J-PB - Adding a TestUse for tooltip display -bool BedTile::TestUse(Level *level, int x, int y, int z, shared_ptr player) +bool BedTile::TestUse(Level *level, int x, int y, int z, std::shared_ptr player) { //if (level->isClientSide) return true; @@ -65,7 +65,7 @@ bool BedTile::TestUse(Level *level, int x, int y, int z, shared_ptr play return false; } -bool BedTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool BedTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly) return false; if (level->isClientSide) return true; @@ -106,11 +106,11 @@ bool BedTile::use(Level *level, int x, int y, int z, shared_ptr player, if (BedTile::isOccupied(data)) { - shared_ptr sleepingPlayer = nullptr; + std::shared_ptr sleepingPlayer = nullptr; AUTO_VAR(itEnd, level->players.end()); for (AUTO_VAR(it, level->players.begin()); it != itEnd; it++ ) { - shared_ptr p = *it; + std::shared_ptr p = *it; if (p->isSleeping()) { Pos pos = p->bedPosition; @@ -128,7 +128,7 @@ bool BedTile::use(Level *level, int x, int y, int z, shared_ptr player, else { player->displayClientMessage(IDS_TILE_BED_OCCUPIED ); - + return true; } } @@ -142,7 +142,7 @@ bool BedTile::use(Level *level, int x, int y, int z, shared_ptr player, if(level->AllPlayersAreSleeping()==false) { player->displayClientMessage(IDS_TILE_BED_PLAYERSLEEP); - } + } return true; } @@ -211,7 +211,7 @@ bool BedTile::isSolidRender(bool isServerLevel) return false; } -void BedTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void BedTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { setShape(); } diff --git a/Minecraft.World/BedTile.h b/Minecraft.World/BedTile.h index 339080d3..a749f4b4 100644 --- a/Minecraft.World/BedTile.h +++ b/Minecraft.World/BedTile.h @@ -23,17 +23,17 @@ public: static int HEAD_DIRECTION_OFFSETS[4][2]; BedTile(int id); - + virtual void updateDefaultShape(); - virtual bool TestUse(Level *level, int x, int y, int z, shared_ptr player); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool TestUse(Level *level, int x, int y, int z, std::shared_ptr player); + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param virtual Icon *getTexture(int face, int data); //@Override void registerIcons(IconRegister *iconRegister); virtual int getRenderShape(); virtual bool isCubeShaped(); virtual bool isSolidRender(bool isServerLevel = false); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual void neighborChanged(Level *level, int x, int y, int z, int type); virtual int getResource(int data, Random *random,int playerBonusLevel); diff --git a/Minecraft.World/BegGoal.cpp b/Minecraft.World/BegGoal.cpp index 97553928..39bb63da 100644 --- a/Minecraft.World/BegGoal.cpp +++ b/Minecraft.World/BegGoal.cpp @@ -51,9 +51,9 @@ void BegGoal::tick() --lookTime; } -bool BegGoal::playerHoldingInteresting(shared_ptr player) +bool BegGoal::playerHoldingInteresting(std::shared_ptr player) { - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); if (item == NULL) return false; if (!wolf->isTame() && item->id == Item::bone_Id) return true; return wolf->isFood(item); diff --git a/Minecraft.World/BegGoal.h b/Minecraft.World/BegGoal.h index 607937a7..b80a68a5 100644 --- a/Minecraft.World/BegGoal.h +++ b/Minecraft.World/BegGoal.h @@ -23,7 +23,7 @@ public: virtual void tick(); private: - bool playerHoldingInteresting(shared_ptr player); + bool playerHoldingInteresting(std::shared_ptr player); public: // 4J Added override to update ai elements when loading entity from schematics diff --git a/Minecraft.World/BiomeInitLayer.cpp b/Minecraft.World/BiomeInitLayer.cpp index 6edd18de..99aafa7d 100644 --- a/Minecraft.World/BiomeInitLayer.cpp +++ b/Minecraft.World/BiomeInitLayer.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.h" #include "BiomeInitLayer.h" -BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptrparent, LevelType *levelType) : Layer(seed) +BiomeInitLayer::BiomeInitLayer(int64_t seed, std::shared_ptrparent, LevelType *levelType) : Layer(seed) { this->parent = parent; diff --git a/Minecraft.World/BiomeInitLayer.h b/Minecraft.World/BiomeInitLayer.h index 00bf3812..eaa1502f 100644 --- a/Minecraft.World/BiomeInitLayer.h +++ b/Minecraft.World/BiomeInitLayer.h @@ -10,7 +10,7 @@ private: BiomeArray startBiomes; public: - BiomeInitLayer(int64_t seed, shared_ptr parent, LevelType *levelType); + BiomeInitLayer(int64_t seed, std::shared_ptr parent, LevelType *levelType); virtual ~BiomeInitLayer(); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/BiomeSource.h b/Minecraft.World/BiomeSource.h index a1e8a50b..0d6cca5e 100644 --- a/Minecraft.World/BiomeSource.h +++ b/Minecraft.World/BiomeSource.h @@ -13,8 +13,8 @@ class LevelType; class BiomeSource { private: - shared_ptr layer; - shared_ptr zoomedLayer; + std::shared_ptr layer; + std::shared_ptr zoomedLayer; public: static const int CACHE_DIAMETER = 256; diff --git a/Minecraft.World/Blaze.cpp b/Minecraft.World/Blaze.cpp index 57726363..1218ec2c 100644 --- a/Minecraft.World/Blaze.cpp +++ b/Minecraft.World/Blaze.cpp @@ -115,7 +115,7 @@ void Blaze::aiStep() Monster::aiStep(); } -void Blaze::checkHurtTarget(shared_ptr target, float d) +void Blaze::checkHurtTarget(std::shared_ptr target, float d) { if (attackTime <= 0 && d < 2.0f && target->bb->y1 > bb->y0 && target->bb->y0 < bb->y1) { @@ -154,7 +154,7 @@ void Blaze::checkHurtTarget(shared_ptr target, float d) level->levelEvent(nullptr, LevelEvent::SOUND_BLAZE_FIREBALL, (int) x, (int) y, (int) z, 0); // level.playSound(this, "mob.ghast.fireball", getSoundVolume(), (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f); for (int i = 0; i < 1; i++) { - shared_ptr ie = shared_ptr( new SmallFireball(level, dynamic_pointer_cast( shared_from_this() ), xd + random->nextGaussian() * sqd, yd, zd + random->nextGaussian() * sqd) ); + std::shared_ptr ie = std::shared_ptr( new SmallFireball(level, dynamic_pointer_cast( shared_from_this() ), xd + random->nextGaussian() * sqd, yd, zd + random->nextGaussian() * sqd) ); // Vec3 v = getViewVector(1); // ie.x = x + v.x * 1.5; ie->y = y + bbHeight / 2 + 0.5f; diff --git a/Minecraft.World/Blaze.h b/Minecraft.World/Blaze.h index 4f60a4a4..640b9f39 100644 --- a/Minecraft.World/Blaze.h +++ b/Minecraft.World/Blaze.h @@ -32,7 +32,7 @@ public: virtual void aiStep(); protected: - virtual void checkHurtTarget(shared_ptr target, float d); + virtual void checkHurtTarget(std::shared_ptr target, float d); virtual void causeFallDamage(float distance); virtual int getDeathLoot(); diff --git a/Minecraft.World/BlockRegionUpdatePacket.h b/Minecraft.World/BlockRegionUpdatePacket.h index 54dfea4e..ac38a381 100644 --- a/Minecraft.World/BlockRegionUpdatePacket.h +++ b/Minecraft.World/BlockRegionUpdatePacket.h @@ -28,6 +28,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new BlockRegionUpdatePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new BlockRegionUpdatePacket()); } virtual int getId() { return 51; } }; diff --git a/Minecraft.World/Boat.cpp b/Minecraft.World/Boat.cpp index 39211e44..26f02203 100644 --- a/Minecraft.World/Boat.cpp +++ b/Minecraft.World/Boat.cpp @@ -56,7 +56,7 @@ void Boat::defineSynchedData() } -AABB *Boat::getCollideAgainstBox(shared_ptr entity) +AABB *Boat::getCollideAgainstBox(std::shared_ptr entity) { return entity->bb; } @@ -98,9 +98,9 @@ bool Boat::hurt(DamageSource *source, int hurtDamage) // Untrusted players shouldn't be able to damage minecarts or boats. if (dynamic_cast(source) != NULL) { - shared_ptr attacker = source->getDirectEntity(); + std::shared_ptr attacker = source->getDirectEntity(); - if (dynamic_pointer_cast(attacker) != NULL && + if (dynamic_pointer_cast(attacker) != NULL && !dynamic_pointer_cast(attacker)->isAllowedToHurtEntity( shared_from_this() )) return false; } @@ -117,7 +117,7 @@ bool Boat::hurt(DamageSource *source, int hurtDamage) markHurt(); // 4J Stu - Brought froward from 12w36 to fix #46611 - TU5: Gameplay: Minecarts and boat requires more hits than one to be destroyed in creative mode - shared_ptr player = dynamic_pointer_cast(source->getEntity()); + std::shared_ptr player = dynamic_pointer_cast(source->getEntity()); if (player != NULL && player->abilities.instabuild) setDamage(100); if (getDamage() > 20 * 2) @@ -394,13 +394,13 @@ void Boat::tick() if(level->isClientSide) return; - vector > *entities = level->getEntities(shared_from_this(), this->bb->grow(0.2f, 0, 0.2f)); + vector > *entities = level->getEntities(shared_from_this(), this->bb->grow(0.2f, 0, 0.2f)); if (entities != NULL && !entities->empty()) { AUTO_VAR(itEnd, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { - shared_ptr e = (*it); // entities->at(i); + std::shared_ptr e = (*it); // entities->at(i); if (e != rider.lock() && e->isPushable() && e->GetType() == eTYPE_BOAT) { e->push(shared_from_this()); @@ -467,7 +467,7 @@ wstring Boat::getName() return L"Boat"; } -bool Boat::interact(shared_ptr player) +bool Boat::interact(std::shared_ptr player) { if (rider.lock() != NULL && dynamic_pointer_cast(rider.lock())!=NULL && rider.lock() != player) return true; if (!level->isClientSide) diff --git a/Minecraft.World/Boat.h b/Minecraft.World/Boat.h index 1039e8f9..dbfb3944 100644 --- a/Minecraft.World/Boat.h +++ b/Minecraft.World/Boat.h @@ -40,7 +40,7 @@ protected: virtual void defineSynchedData(); public: - virtual AABB *getCollideAgainstBox(shared_ptr entity); + virtual AABB *getCollideAgainstBox(std::shared_ptr entity); virtual AABB *getCollideBox(); virtual bool isPushable(); @@ -69,7 +69,7 @@ protected: public: virtual float getShadowHeightOffs(); wstring getName(); - virtual bool interact(shared_ptr player); + virtual bool interact(std::shared_ptr player); virtual void setDamage(int damage); virtual int getDamage(); diff --git a/Minecraft.World/BoatItem.cpp b/Minecraft.World/BoatItem.cpp index 3499bc02..af778350 100644 --- a/Minecraft.World/BoatItem.cpp +++ b/Minecraft.World/BoatItem.cpp @@ -12,7 +12,7 @@ BoatItem::BoatItem(int id) : Item( id ) this->maxStackSize = 1; } -bool BoatItem::TestUse(Level *level, shared_ptr player) +bool BoatItem::TestUse(Level *level, std::shared_ptr player) { // 4J-PB - added for tooltips to test use // 4J TODO really we should have the crosshair hitresult telling us if it hit water, and at what distance, so we don't need to do this again @@ -49,7 +49,7 @@ bool BoatItem::TestUse(Level *level, shared_ptr player) delete hr; return false; } -shared_ptr BoatItem::use(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr BoatItem::use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { float a = 1; @@ -80,11 +80,11 @@ shared_ptr BoatItem::use(shared_ptr itemInstance, Le Vec3 *b = player->getViewVector(a); bool hitEntity = false; float overlap = 1; - vector > *objects = level->getEntities(player, player->bb->expand(b->x * (range), b->y * (range), b->z * (range))->grow(overlap, overlap, overlap)); + vector > *objects = level->getEntities(player, player->bb->expand(b->x * (range), b->y * (range), b->z * (range))->grow(overlap, overlap, overlap)); //for (int i = 0; i < objects.size(); i++) { for(AUTO_VAR(it, objects->begin()); it != objects->end(); ++it) { - shared_ptr e = *it; //objects.get(i); + std::shared_ptr e = *it; //objects.get(i); if (!e->isPickable()) continue; float rr = e->getPickRadius(); @@ -105,12 +105,12 @@ shared_ptr BoatItem::use(shared_ptr itemInstance, Le int yt = hr->y; int zt = hr->z; - if (!level->isClientSide) + if (!level->isClientSide) { if (level->getTile(xt, yt, zt) == Tile::topSnow_Id) yt--; if( level->countInstanceOf(eTYPE_BOAT, true) < Level::MAX_XBOX_BOATS ) // 4J - added limit { - level->addEntity( shared_ptr( new Boat(level, xt + 0.5f, yt + 1.0f, zt + 0.5f) ) ); + level->addEntity( std::shared_ptr( new Boat(level, xt + 0.5f, yt + 1.0f, zt + 0.5f) ) ); if (!player->abilities.instabuild) { itemInstance->count--; diff --git a/Minecraft.World/BoatItem.h b/Minecraft.World/BoatItem.h index 81bc4e18..08a2ccf7 100644 --- a/Minecraft.World/BoatItem.h +++ b/Minecraft.World/BoatItem.h @@ -11,8 +11,8 @@ public: BoatItem(int id); - virtual bool TestUse(Level *level, shared_ptr player); - virtual shared_ptr use(shared_ptr itemInstance, Level *level, shared_ptr player); + virtual bool TestUse(Level *level, std::shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); /* * public boolean useOn(ItemInstance instance, Player player, Level level, diff --git a/Minecraft.World/BonusChestFeature.cpp b/Minecraft.World/BonusChestFeature.cpp index 2d7690ee..7fa6c489 100644 --- a/Minecraft.World/BonusChestFeature.cpp +++ b/Minecraft.World/BonusChestFeature.cpp @@ -58,7 +58,7 @@ bool BonusChestFeature::place(Level *level, Random *random, int x, int y, int z, if (force || ( level->isEmptyTile(x2, y2, z2) && level->isTopSolidBlocking(x2, y2 - 1, z2))) { level->setTile(x2, y2, z2, Tile::chest_Id); - shared_ptr chest = dynamic_pointer_cast(level->getTileEntity(x2, y2, z2)); + std::shared_ptr chest = dynamic_pointer_cast(level->getTileEntity(x2, y2, z2)); if (chest != NULL) { WeighedTreasure::addChestItems(random, treasureList, chest, numRolls); diff --git a/Minecraft.World/BookItem.cpp b/Minecraft.World/BookItem.cpp index 8e4098bb..d1fea216 100644 --- a/Minecraft.World/BookItem.cpp +++ b/Minecraft.World/BookItem.cpp @@ -6,7 +6,7 @@ BookItem::BookItem(int id) : Item(id) { } -bool BookItem::isEnchantable(shared_ptr itemInstance) +bool BookItem::isEnchantable(std::shared_ptr itemInstance) { return itemInstance->count == 1; } diff --git a/Minecraft.World/BookItem.h b/Minecraft.World/BookItem.h index f60fc417..8bb5d118 100644 --- a/Minecraft.World/BookItem.h +++ b/Minecraft.World/BookItem.h @@ -7,6 +7,6 @@ class BookItem : public Item public: BookItem(int id); - bool isEnchantable(shared_ptr itemInstance); + bool isEnchantable(std::shared_ptr itemInstance); int getEnchantmentValue(); }; \ No newline at end of file diff --git a/Minecraft.World/BossMob.cpp b/Minecraft.World/BossMob.cpp index 52b88230..a32a4325 100644 --- a/Minecraft.World/BossMob.cpp +++ b/Minecraft.World/BossMob.cpp @@ -6,7 +6,7 @@ BossMob::BossMob(Level *level) : Mob( level ) { - + maxHealth = 100; // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that the derived version of the function is called @@ -18,7 +18,7 @@ int BossMob::getMaxHealth() return maxHealth; } -bool BossMob::hurt(shared_ptr bossMobPart, DamageSource *source, int damage) +bool BossMob::hurt(std::shared_ptr bossMobPart, DamageSource *source, int damage) { return hurt(source, damage); } diff --git a/Minecraft.World/BossMob.h b/Minecraft.World/BossMob.h index 50a6d3ef..f4ef6a54 100644 --- a/Minecraft.World/BossMob.h +++ b/Minecraft.World/BossMob.h @@ -14,7 +14,7 @@ public: BossMob(Level *level); virtual int getMaxHealth(); - virtual bool hurt(shared_ptr bossMobPart, DamageSource *source, int damage); + virtual bool hurt(std::shared_ptr bossMobPart, DamageSource *source, int damage); virtual bool hurt(DamageSource *source, int damage); protected: diff --git a/Minecraft.World/BossMobPart.cpp b/Minecraft.World/BossMobPart.cpp index 923972ad..2f10a891 100644 --- a/Minecraft.World/BossMobPart.cpp +++ b/Minecraft.World/BossMobPart.cpp @@ -37,7 +37,7 @@ bool BossMobPart::hurt(DamageSource *source, int damage) return bossMob->hurt( dynamic_pointer_cast( shared_from_this() ), source, damage); } -bool BossMobPart::is(shared_ptr other) +bool BossMobPart::is(std::shared_ptr other) { return shared_from_this() == other || bossMob == other.get(); } \ No newline at end of file diff --git a/Minecraft.World/BossMobPart.h b/Minecraft.World/BossMobPart.h index 55af809f..7b53126f 100644 --- a/Minecraft.World/BossMobPart.h +++ b/Minecraft.World/BossMobPart.h @@ -23,5 +23,5 @@ protected: public: virtual bool isPickable(); virtual bool hurt(DamageSource *source, int damage); - virtual bool is(shared_ptr other); + virtual bool is(std::shared_ptr other); }; \ No newline at end of file diff --git a/Minecraft.World/BottleItem.cpp b/Minecraft.World/BottleItem.cpp index 3aecafee..804384f7 100644 --- a/Minecraft.World/BottleItem.cpp +++ b/Minecraft.World/BottleItem.cpp @@ -15,7 +15,7 @@ Icon *BottleItem::getIcon(int auxValue) return Item::potion->getIcon(0); } -shared_ptr BottleItem::use(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr BottleItem::use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { HitResult *hr = getPlayerPOVHitResult(level, player, true); if (hr == NULL) return itemInstance; @@ -40,13 +40,13 @@ shared_ptr BottleItem::use(shared_ptr itemInstance, itemInstance->count--; if (itemInstance->count <= 0) { - return shared_ptr( new ItemInstance( (Item *)Item::potion) ); + return std::shared_ptr( new ItemInstance( (Item *)Item::potion) ); } else { - if (!player->inventory->add(shared_ptr( new ItemInstance( (Item *)Item::potion) ))) + if (!player->inventory->add(std::shared_ptr( new ItemInstance( (Item *)Item::potion) ))) { - player->drop( shared_ptr( new ItemInstance(Item::potion_Id, 1, 0) )); + player->drop( std::shared_ptr( new ItemInstance(Item::potion_Id, 1, 0) )); } } } @@ -60,7 +60,7 @@ shared_ptr BottleItem::use(shared_ptr itemInstance, } // 4J-PB - added to allow tooltips -bool BottleItem::TestUse(Level *level, shared_ptr player) +bool BottleItem::TestUse(Level *level, std::shared_ptr player) { HitResult *hr = getPlayerPOVHitResult(level, player, true); if (hr == NULL) return false; diff --git a/Minecraft.World/BottleItem.h b/Minecraft.World/BottleItem.h index a8f5bc09..400902e7 100644 --- a/Minecraft.World/BottleItem.h +++ b/Minecraft.World/BottleItem.h @@ -12,8 +12,8 @@ public: //@Override Icon *getIcon(int auxValue); - virtual shared_ptr use(shared_ptr itemInstance, Level *level, shared_ptr player); - virtual bool TestUse(Level *level, shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); + virtual bool TestUse(Level *level, std::shared_ptr player); //@Override void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/BowItem.cpp b/Minecraft.World/BowItem.cpp index ed2376b0..f0e46c88 100644 --- a/Minecraft.World/BowItem.cpp +++ b/Minecraft.World/BowItem.cpp @@ -18,7 +18,7 @@ BowItem::BowItem(int id) : Item( id ) icons = NULL; } -void BowItem::releaseUsing(shared_ptr itemInstance, Level *level, shared_ptr player, int durationLeft) +void BowItem::releaseUsing(std::shared_ptr itemInstance, Level *level, std::shared_ptr player, int durationLeft) { bool infiniteArrows = player->abilities.instabuild || EnchantmentHelper::getEnchantmentLevel(Enchantment::arrowInfinite->id, itemInstance) > 0; @@ -30,7 +30,7 @@ void BowItem::releaseUsing(shared_ptr itemInstance, Level *level, if (pow < 0.1) return; if (pow > 1) pow = 1; - shared_ptr arrow = shared_ptr( new Arrow(level, player, pow * 2.0f) ); + std::shared_ptr arrow = std::shared_ptr( new Arrow(level, player, pow * 2.0f) ); if (pow == 1) arrow->setCritArrow(true); int damageBonus = EnchantmentHelper::getEnchantmentLevel(Enchantment::arrowBonus->id, itemInstance); if (damageBonus > 0) @@ -62,22 +62,22 @@ void BowItem::releaseUsing(shared_ptr itemInstance, Level *level, } } -shared_ptr BowItem::useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr BowItem::useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player) { return instance; } -int BowItem::getUseDuration(shared_ptr itemInstance) +int BowItem::getUseDuration(std::shared_ptr itemInstance) { return 20 * 60 * 60; } -UseAnim BowItem::getUseAnimation(shared_ptr itemInstance) +UseAnim BowItem::getUseAnimation(std::shared_ptr itemInstance) { return UseAnim_bow; } -shared_ptr BowItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr BowItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { if (player->abilities.instabuild || player->inventory->hasResource(Item::arrow_Id)) { diff --git a/Minecraft.World/BowItem.h b/Minecraft.World/BowItem.h index b4eba111..76b795f9 100644 --- a/Minecraft.World/BowItem.h +++ b/Minecraft.World/BowItem.h @@ -18,11 +18,11 @@ private: public: BowItem(int id); - virtual void releaseUsing(shared_ptr itemInstance, Level *level, shared_ptr player, int durationLeft); - virtual shared_ptr useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player); - virtual int getUseDuration(shared_ptr itemInstance); - virtual UseAnim getUseAnimation(shared_ptr itemInstance); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual void releaseUsing(std::shared_ptr itemInstance, Level *level, std::shared_ptr player, int durationLeft); + virtual std::shared_ptr useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player); + virtual int getUseDuration(std::shared_ptr itemInstance); + virtual UseAnim getUseAnimation(std::shared_ptr itemInstance); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); virtual int getEnchantmentValue(); //@Override diff --git a/Minecraft.World/BowlFoodItem.cpp b/Minecraft.World/BowlFoodItem.cpp index f8ab0605..48953b3c 100644 --- a/Minecraft.World/BowlFoodItem.cpp +++ b/Minecraft.World/BowlFoodItem.cpp @@ -8,9 +8,9 @@ BowlFoodItem::BowlFoodItem(int id, int nutrition) : FoodItem( id, nutrition, fal setMaxStackSize(1); } -shared_ptr BowlFoodItem::useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr BowlFoodItem::useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player) { FoodItem::useTimeDepleted(instance, level, player); - return shared_ptr(new ItemInstance(Item::bowl)); + return std::shared_ptr(new ItemInstance(Item::bowl)); } \ No newline at end of file diff --git a/Minecraft.World/BowlFoodItem.h b/Minecraft.World/BowlFoodItem.h index 77980bc2..1c488c7e 100644 --- a/Minecraft.World/BowlFoodItem.h +++ b/Minecraft.World/BowlFoodItem.h @@ -10,5 +10,5 @@ class BowlFoodItem : public FoodItem public: BowlFoodItem(int id, int nutrition); - shared_ptr useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player); + std::shared_ptr useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/BreedGoal.cpp b/Minecraft.World/BreedGoal.cpp index 2145d371..f9427ccf 100644 --- a/Minecraft.World/BreedGoal.cpp +++ b/Minecraft.World/BreedGoal.cpp @@ -46,13 +46,13 @@ void BreedGoal::tick() if (loveTime == 20 * 3) breed(); } -shared_ptr BreedGoal::getFreePartner() +std::shared_ptr BreedGoal::getFreePartner() { float r = 8; - vector > *others = level->getEntitiesOfClass(typeid(*animal), animal->bb->grow(r, r, r)); + vector > *others = level->getEntitiesOfClass(typeid(*animal), animal->bb->grow(r, r, r)); for(AUTO_VAR(it, others->begin()); it != others->end(); ++it) { - shared_ptr p = dynamic_pointer_cast(*it); + std::shared_ptr p = dynamic_pointer_cast(*it); if (animal->canMate(p)) { delete others; @@ -65,7 +65,7 @@ shared_ptr BreedGoal::getFreePartner() void BreedGoal::breed() { - shared_ptr offspring = animal->getBreedOffspring(partner.lock()); + std::shared_ptr offspring = animal->getBreedOffspring(partner.lock()); animal->setDespawnProtected(); partner.lock()->setDespawnProtected(); if (offspring == NULL) @@ -76,7 +76,7 @@ void BreedGoal::breed() return; } - shared_ptr loveCause = animal->getLoveCause(); + std::shared_ptr loveCause = animal->getLoveCause(); if (loveCause == NULL && partner.lock()->getLoveCause() != NULL) { loveCause = partner.lock()->getLoveCause(); @@ -112,5 +112,5 @@ void BreedGoal::breed() * animal->bbWidth * 2 - animal->bbWidth, xa, ya, za); } // 4J-PB - Fix for 106869- Customer Encountered: TU12: Content: Gameplay: Breeding animals does not give any Experience Orbs. - level->addEntity( shared_ptr( new ExperienceOrb(level, animal->x, animal->y, animal->z, random->nextInt(7) + 1) ) ); + level->addEntity( std::shared_ptr( new ExperienceOrb(level, animal->x, animal->y, animal->z, random->nextInt(7) + 1) ) ); } diff --git a/Minecraft.World/BreedGoal.h b/Minecraft.World/BreedGoal.h index d2b47e7d..0e07119d 100644 --- a/Minecraft.World/BreedGoal.h +++ b/Minecraft.World/BreedGoal.h @@ -23,7 +23,7 @@ public: virtual void tick(); private: - shared_ptr getFreePartner(); + std::shared_ptr getFreePartner(); void breed(); public: diff --git a/Minecraft.World/BrewingStandMenu.cpp b/Minecraft.World/BrewingStandMenu.cpp index af1fac5c..196b9bf8 100644 --- a/Minecraft.World/BrewingStandMenu.cpp +++ b/Minecraft.World/BrewingStandMenu.cpp @@ -6,7 +6,7 @@ #include "net.minecraft.stats.h" #include "BrewingStandMenu.h" -BrewingStandMenu::BrewingStandMenu(shared_ptr inventory, shared_ptr brewingStand) +BrewingStandMenu::BrewingStandMenu(std::shared_ptr inventory, std::shared_ptr brewingStand) { tc = 0; @@ -57,14 +57,14 @@ void BrewingStandMenu::setData(int id, int value) if (id == 0) brewingStand->setBrewTime(value); } -bool BrewingStandMenu::stillValid(shared_ptr player) +bool BrewingStandMenu::stillValid(std::shared_ptr player) { return brewingStand->stillValid(player); } -shared_ptr BrewingStandMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr BrewingStandMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); Slot *IngredientSlot = slots->at(INGREDIENT_SLOT); Slot *PotionSlot1 = slots->at(BOTTLE_SLOT_START); @@ -73,7 +73,7 @@ shared_ptr BrewingStandMenu::quickMoveStack(shared_ptr pla if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if ((slotIndex >= BOTTLE_SLOT_START && slotIndex <= BOTTLE_SLOT_END) || (slotIndex == INGREDIENT_SLOT)) @@ -101,7 +101,7 @@ shared_ptr BrewingStandMenu::quickMoveStack(shared_ptr pla else if (slotIndex >= INV_SLOT_START && slotIndex < INV_SLOT_END) { // 4J-PB - if the item is an ingredient, quickmove it into the ingredient slot - if( (Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherStalkSeeds_Id) ) && + if( (Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherStalkSeeds_Id) ) && (!IngredientSlot->hasItem() || (stack->id==IngredientSlot->getItem()->id) ) ) { if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false)) @@ -125,7 +125,7 @@ shared_ptr BrewingStandMenu::quickMoveStack(shared_ptr pla else if (slotIndex >= USE_ROW_SLOT_START && slotIndex < USE_ROW_SLOT_END) { // 4J-PB - if the item is an ingredient, quickmove it into the ingredient slot - if((Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherStalkSeeds_Id)) && + if((Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherStalkSeeds_Id)) && (!IngredientSlot->hasItem() || (stack->id==IngredientSlot->getItem()->id) )) { if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false)) @@ -140,7 +140,7 @@ shared_ptr BrewingStandMenu::quickMoveStack(shared_ptr pla { return nullptr; } - } + } else if (!moveItemStackTo(stack, INV_SLOT_START, INV_SLOT_END, false)) { return nullptr; @@ -173,12 +173,12 @@ shared_ptr BrewingStandMenu::quickMoveStack(shared_ptr pla return clicked; } -BrewingStandMenu::PotionSlot::PotionSlot(shared_ptr player, shared_ptr container, int slot, int x, int y) : Slot(container, slot, x, y) +BrewingStandMenu::PotionSlot::PotionSlot(std::shared_ptr player, std::shared_ptr container, int slot, int x, int y) : Slot(container, slot, x, y) { this->player = player; } -bool BrewingStandMenu::PotionSlot::mayPlace(shared_ptr item) +bool BrewingStandMenu::PotionSlot::mayPlace(std::shared_ptr item) { return mayPlaceItem(item); } @@ -188,7 +188,7 @@ int BrewingStandMenu::PotionSlot::getMaxStackSize() return 1; } -void BrewingStandMenu::PotionSlot::onTake(shared_ptr player, shared_ptr carried) +void BrewingStandMenu::PotionSlot::onTake(std::shared_ptr player, std::shared_ptr carried) { carried->onCraftedBy(this->player->level, dynamic_pointer_cast( this->player->shared_from_this() ), 1); if (carried->id == Item::potion_Id && carried->getAuxValue() > 0) @@ -196,23 +196,23 @@ void BrewingStandMenu::PotionSlot::onTake(shared_ptr player, shared_ptr< Slot::onTake(player, carried); } -bool BrewingStandMenu::PotionSlot::mayCombine(shared_ptr second) +bool BrewingStandMenu::PotionSlot::mayCombine(std::shared_ptr second) { return false; } -bool BrewingStandMenu::PotionSlot::mayPlaceItem(shared_ptr item) +bool BrewingStandMenu::PotionSlot::mayPlaceItem(std::shared_ptr item) { return item != NULL && (item->id == Item::potion_Id || item->id == Item::glassBottle_Id); } -BrewingStandMenu::IngredientsSlot::IngredientsSlot(shared_ptr container, int slot, int x, int y) : Slot(container, slot, x ,y) +BrewingStandMenu::IngredientsSlot::IngredientsSlot(std::shared_ptr container, int slot, int x, int y) : Slot(container, slot, x ,y) { } -bool BrewingStandMenu::IngredientsSlot::mayPlace(shared_ptr item) +bool BrewingStandMenu::IngredientsSlot::mayPlace(std::shared_ptr item) { if (item != NULL) { @@ -228,7 +228,7 @@ bool BrewingStandMenu::IngredientsSlot::mayPlace(shared_ptr item) return false; } -bool BrewingStandMenu::IngredientsSlot::mayCombine(shared_ptr second) +bool BrewingStandMenu::IngredientsSlot::mayCombine(std::shared_ptr second) { return false; } diff --git a/Minecraft.World/BrewingStandMenu.h b/Minecraft.World/BrewingStandMenu.h index 1f8d705d..7a981acb 100644 --- a/Minecraft.World/BrewingStandMenu.h +++ b/Minecraft.World/BrewingStandMenu.h @@ -21,11 +21,11 @@ public: static const int USE_ROW_SLOT_END = USE_ROW_SLOT_START + 9; private: - shared_ptr brewingStand; + std::shared_ptr brewingStand; Slot *ingredientSlot; public: - BrewingStandMenu(shared_ptr inventory, shared_ptr brewingStand); + BrewingStandMenu(std::shared_ptr inventory, std::shared_ptr brewingStand); private: int tc; @@ -34,32 +34,32 @@ public: virtual void addSlotListener(ContainerListener *listener); virtual void broadcastChanges(); virtual void setData(int id, int value); - virtual bool stillValid(shared_ptr player); - virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); + virtual bool stillValid(std::shared_ptr player); + virtual std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); private: class PotionSlot : public Slot { private: - shared_ptr player; + std::shared_ptr player; public: - PotionSlot(shared_ptr player, shared_ptr container, int slot, int x, int y); + PotionSlot(std::shared_ptr player, std::shared_ptr container, int slot, int x, int y); - virtual bool mayPlace(shared_ptr item); + virtual bool mayPlace(std::shared_ptr item); virtual int getMaxStackSize(); - virtual void onTake(shared_ptr player, shared_ptr carried); - static bool mayPlaceItem(shared_ptr item); - virtual bool mayCombine(shared_ptr item); // 4J Added + virtual void onTake(std::shared_ptr player, std::shared_ptr carried); + static bool mayPlaceItem(std::shared_ptr item); + virtual bool mayCombine(std::shared_ptr item); // 4J Added }; class IngredientsSlot : public Slot { public: - IngredientsSlot(shared_ptr container, int slot, int x, int y); + IngredientsSlot(std::shared_ptr container, int slot, int x, int y); - virtual bool mayPlace(shared_ptr item); + virtual bool mayPlace(std::shared_ptr item); virtual int getMaxStackSize(); - virtual bool mayCombine(shared_ptr item); // 4J Added + virtual bool mayCombine(std::shared_ptr item); // 4J Added }; }; \ No newline at end of file diff --git a/Minecraft.World/BrewingStandTile.cpp b/Minecraft.World/BrewingStandTile.cpp index 5f09ba02..2a6fd2cd 100644 --- a/Minecraft.World/BrewingStandTile.cpp +++ b/Minecraft.World/BrewingStandTile.cpp @@ -29,9 +29,9 @@ int BrewingStandTile::getRenderShape() return SHAPE_BREWING_STAND; } -shared_ptr BrewingStandTile::newTileEntity(Level *level) +std::shared_ptr BrewingStandTile::newTileEntity(Level *level) { - return shared_ptr(new BrewingStandTileEntity()); + return std::shared_ptr(new BrewingStandTileEntity()); } bool BrewingStandTile::isCubeShaped() @@ -39,7 +39,7 @@ bool BrewingStandTile::isCubeShaped() return false; } -void BrewingStandTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void BrewingStandTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { setShape(7.0f / 16.0f, 0, 7.0f / 16.0f, 9.0f / 16.0f, 14.0f / 16.0f, 9.0f / 16.0f); EntityTile::addAABBs(level, x, y, z, box, boxes, source); @@ -52,7 +52,7 @@ void BrewingStandTile::updateDefaultShape() setShape(0, 0, 0, 1, 2.0f / 16.0f, 1); } -bool BrewingStandTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool BrewingStandTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if(soundOnly) return false; @@ -60,7 +60,7 @@ bool BrewingStandTile::use(Level *level, int x, int y, int z, shared_ptr { return true; } - shared_ptr brewingStand = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + std::shared_ptr brewingStand = dynamic_pointer_cast(level->getTileEntity(x, y, z)); if (brewingStand != NULL) player->openBrewingStand(brewingStand); return true; @@ -78,13 +78,13 @@ void BrewingStandTile::animateTick(Level *level, int xt, int yt, int zt, Random void BrewingStandTile::onRemove(Level *level, int x, int y, int z, int id, int data) { - shared_ptr tileEntity = level->getTileEntity(x, y, z); + std::shared_ptr tileEntity = level->getTileEntity(x, y, z); if (tileEntity != NULL && ( dynamic_pointer_cast(tileEntity) != NULL) ) { - shared_ptr container = dynamic_pointer_cast(tileEntity); + std::shared_ptr container = dynamic_pointer_cast(tileEntity); for (int i = 0; i < container->getContainerSize(); i++) { - shared_ptr item = container->getItem(i); + std::shared_ptr item = container->getItem(i); if (item != NULL) { float xo = random->nextFloat() * 0.8f + 0.1f; @@ -97,7 +97,7 @@ void BrewingStandTile::onRemove(Level *level, int x, int y, int z, int id, int d if (count > item->count) count = item->count; item->count -= count; - shared_ptr itemEntity = shared_ptr(new ItemEntity(level, x + xo, y + yo, z + zo, shared_ptr( new ItemInstance(item->id, count, item->getAuxValue())))); + std::shared_ptr itemEntity = std::shared_ptr(new ItemEntity(level, x + xo, y + yo, z + zo, std::shared_ptr( new ItemInstance(item->id, count, item->getAuxValue())))); float pow = 0.05f; itemEntity->xd = (float) random->nextGaussian() * pow; itemEntity->yd = (float) random->nextGaussian() * pow + 0.2f; diff --git a/Minecraft.World/BrewingStandTile.h b/Minecraft.World/BrewingStandTile.h index fc8ff462..1d842e98 100644 --- a/Minecraft.World/BrewingStandTile.h +++ b/Minecraft.World/BrewingStandTile.h @@ -18,11 +18,11 @@ public: ~BrewingStandTile(); virtual bool isSolidRender(bool isServerLevel = false); virtual int getRenderShape(); - virtual shared_ptr newTileEntity(Level *level); + virtual std::shared_ptr newTileEntity(Level *level); virtual bool isCubeShaped(); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); virtual void updateDefaultShape(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param virtual void animateTick(Level *level, int xt, int yt, int zt, Random *random); virtual void onRemove(Level *level, int x, int y, int z, int id, int data); virtual int getResource(int data, Random *random, int playerBonusLevel); diff --git a/Minecraft.World/BrewingStandTileEntity.cpp b/Minecraft.World/BrewingStandTileEntity.cpp index 20cb3737..98334f78 100644 --- a/Minecraft.World/BrewingStandTileEntity.cpp +++ b/Minecraft.World/BrewingStandTileEntity.cpp @@ -79,7 +79,7 @@ bool BrewingStandTileEntity::isBrewable() { return false; } - shared_ptr ingredient = items[INGREDIENT_SLOT]; + std::shared_ptr ingredient = items[INGREDIENT_SLOT]; if (PotionBrewing::SIMPLIFIED_BREWING) { if (!Item::items[ingredient->id]->hasPotionBrewingFormula()) @@ -135,7 +135,7 @@ bool BrewingStandTileEntity::isBrewable() } else { - if (!Item::items[ingredient->id]->hasPotionBrewingFormula() && ingredient->id != Item::bucket_water_Id && ingredient->id != Item::netherStalkSeeds_Id) + if (!Item::items[ingredient->id]->hasPotionBrewingFormula() && ingredient->id != Item::bucket_water_Id && ingredient->id != Item::netherStalkSeeds_Id) { return false; } @@ -172,7 +172,7 @@ void BrewingStandTileEntity::doBrew() return; } - shared_ptr ingredient = items[INGREDIENT_SLOT]; + std::shared_ptr ingredient = items[INGREDIENT_SLOT]; if (PotionBrewing::SIMPLIFIED_BREWING) { @@ -233,14 +233,14 @@ void BrewingStandTileEntity::doBrew() } else if (isWater && items[dest] != NULL && items[dest]->id == Item::glassBottle_Id) { - items[dest] = shared_ptr(new ItemInstance(Item::potion)); + items[dest] = std::shared_ptr(new ItemInstance(Item::potion)); } } } if (Item::items[ingredient->id]->hasCraftingRemainingItem()) { - items[INGREDIENT_SLOT] = shared_ptr(new ItemInstance(Item::items[ingredient->id]->getCraftingRemainingItem())); + items[INGREDIENT_SLOT] = std::shared_ptr(new ItemInstance(Item::items[ingredient->id]->getCraftingRemainingItem())); } else { @@ -252,7 +252,7 @@ void BrewingStandTileEntity::doBrew() } } -int BrewingStandTileEntity::applyIngredient(int currentBrew, shared_ptr ingredient) +int BrewingStandTileEntity::applyIngredient(int currentBrew, std::shared_ptr ingredient) { if (ingredient == NULL) { @@ -278,7 +278,7 @@ int BrewingStandTileEntity::applyIngredient(int currentBrew, shared_ptrputByte(L"Slot", (byte) i); @@ -316,7 +316,7 @@ void BrewingStandTileEntity::save(CompoundTag *base) base->put(L"Items", listTag); } -shared_ptr BrewingStandTileEntity::getItem(unsigned int slot) +std::shared_ptr BrewingStandTileEntity::getItem(unsigned int slot) { if (slot >= 0 && slot < items.length) { @@ -325,7 +325,7 @@ shared_ptr BrewingStandTileEntity::getItem(unsigned int slot) return nullptr; } -shared_ptr BrewingStandTileEntity::removeItem(unsigned int slot, int count) +std::shared_ptr BrewingStandTileEntity::removeItem(unsigned int slot, int count) { // 4J Stu - Changed the implementation of this function to be the same as ChestTileEntity to enable the "Pickup Half" // option on the ingredients slot @@ -333,18 +333,18 @@ shared_ptr BrewingStandTileEntity::removeItem(unsigned int slot, i if (slot >= 0 && slot < items.length && items[slot] != NULL) { - if (items[slot]->count <= count) + if (items[slot]->count <= count) { - shared_ptr item = items[slot]; + std::shared_ptr item = items[slot]; items[slot] = nullptr; this->setChanged(); // 4J Stu - Fix for duplication glitch if(item->count <= 0) return nullptr; return item; - } - else + } + else { - shared_ptr i = items[slot]->remove(count); + std::shared_ptr i = items[slot]->remove(count); if (items[slot]->count == 0) items[slot] = nullptr; this->setChanged(); // 4J Stu - Fix for duplication glitch @@ -354,19 +354,19 @@ shared_ptr BrewingStandTileEntity::removeItem(unsigned int slot, i } return nullptr; } - -shared_ptr BrewingStandTileEntity::removeItemNoUpdate(int slot) + +std::shared_ptr BrewingStandTileEntity::removeItemNoUpdate(int slot) { if (slot >= 0 && slot < items.length) { - shared_ptr item = items[slot]; + std::shared_ptr item = items[slot]; items[slot] = nullptr; return item; } return nullptr; } -void BrewingStandTileEntity::setItem(unsigned int slot, shared_ptr item) +void BrewingStandTileEntity::setItem(unsigned int slot, std::shared_ptr item) { if (slot >= 0 && slot < items.length) { @@ -379,7 +379,7 @@ int BrewingStandTileEntity::getMaxStackSize() return 1; } -bool BrewingStandTileEntity::stillValid(shared_ptr player) +bool BrewingStandTileEntity::stillValid(std::shared_ptr player) { if (level->getTileEntity(x, y, z) != shared_from_this()) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; @@ -413,9 +413,9 @@ int BrewingStandTileEntity::getPotionBits() } // 4J Added -shared_ptr BrewingStandTileEntity::clone() +std::shared_ptr BrewingStandTileEntity::clone() { - shared_ptr result = shared_ptr( new BrewingStandTileEntity() ); + std::shared_ptr result = std::shared_ptr( new BrewingStandTileEntity() ); TileEntity::clone(result); result->brewTime = brewTime; diff --git a/Minecraft.World/BrewingStandTileEntity.h b/Minecraft.World/BrewingStandTileEntity.h index 733e1073..91a2934c 100644 --- a/Minecraft.World/BrewingStandTileEntity.h +++ b/Minecraft.World/BrewingStandTileEntity.h @@ -29,17 +29,17 @@ private: bool isBrewable(); void doBrew(); - int applyIngredient(int currentBrew, shared_ptr ingredient); - + int applyIngredient(int currentBrew, std::shared_ptr ingredient); + public: virtual void load(CompoundTag *base); virtual void save(CompoundTag *base); - virtual shared_ptr getItem(unsigned int slot); - virtual shared_ptr removeItem(unsigned int slot, int i); - virtual shared_ptr removeItemNoUpdate(int slot); - virtual void setItem(unsigned int slot, shared_ptr item); + virtual std::shared_ptr getItem(unsigned int slot); + virtual std::shared_ptr removeItem(unsigned int slot, int i); + virtual std::shared_ptr removeItemNoUpdate(int slot); + virtual void setItem(unsigned int slot, std::shared_ptr item); virtual int getMaxStackSize(); - virtual bool stillValid(shared_ptr player); + virtual bool stillValid(std::shared_ptr player); virtual void startOpen(); virtual void stopOpen(); virtual void setBrewTime(int value); @@ -47,5 +47,5 @@ public: int getPotionBits(); // 4J Added - virtual shared_ptr clone(); + virtual std::shared_ptr clone(); }; \ No newline at end of file diff --git a/Minecraft.World/BucketItem.cpp b/Minecraft.World/BucketItem.cpp index d3570cd7..0aac9c83 100644 --- a/Minecraft.World/BucketItem.cpp +++ b/Minecraft.World/BucketItem.cpp @@ -24,7 +24,7 @@ BucketItem::BucketItem(int id, int content) : Item( id ) this->content = content; } -bool BucketItem::TestUse(Level *level, shared_ptr player) +bool BucketItem::TestUse(Level *level, std::shared_ptr player) { // double x = player->xo + (player->x - player->xo); // double y = player->yo + (player->y - player->yo) + 1.62 - player->heightOffset; @@ -47,7 +47,7 @@ bool BucketItem::TestUse(Level *level, shared_ptr player) } if (content == 0) - { + { if (!player->mayBuild(xt, yt, zt)) return false; if (level->getMaterial(xt, yt, zt) == Material::water && level->getData(xt, yt, zt) == 0) { @@ -73,7 +73,7 @@ bool BucketItem::TestUse(Level *level, shared_ptr player) if (hr->f == 3) zt++; if (hr->f == 4) xt--; if (hr->f == 5) xt++; - + if (!player->mayBuild(xt, yt, zt)) return false; if (level->isEmptyTile(xt, yt, zt) || !level->getMaterial(xt, yt, zt)->isSolid()) @@ -99,7 +99,7 @@ bool BucketItem::TestUse(Level *level, shared_ptr player) return false; } -shared_ptr BucketItem::use(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr BucketItem::use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { float a = 1; @@ -120,19 +120,19 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, if (!level->mayInteract(player, xt, yt, zt,content)) { app.DebugPrintf("!!!!!!!!!!! Can't place that here\n"); - shared_ptr servPlayer = dynamic_pointer_cast(player); + std::shared_ptr servPlayer = dynamic_pointer_cast(player); if( servPlayer != NULL ) { app.DebugPrintf("Sending ChatPacket::e_ChatCannotPlaceLava to player\n"); - servPlayer->connection->send( shared_ptr( new ChatPacket(L"", ChatPacket::e_ChatCannotPlaceLava ) ) ); + servPlayer->connection->send( std::shared_ptr( new ChatPacket(L"", ChatPacket::e_ChatCannotPlaceLava ) ) ); } - + delete hr; return itemInstance; } if (content == 0) - { + { if (!player->mayBuild(xt, yt, zt)) return itemInstance; if (level->getMaterial(xt, yt, zt) == Material::water && level->getData(xt, yt, zt) == 0) { @@ -145,13 +145,13 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, if (--itemInstance->count <= 0) { - return shared_ptr( new ItemInstance(Item::bucket_water) ); + return std::shared_ptr( new ItemInstance(Item::bucket_water) ); } else { - if (!player->inventory->add(shared_ptr( new ItemInstance(Item::bucket_water)))) + if (!player->inventory->add(std::shared_ptr( new ItemInstance(Item::bucket_water)))) { - player->drop(shared_ptr(new ItemInstance(Item::bucket_water_Id, 1, 0))); + player->drop(std::shared_ptr(new ItemInstance(Item::bucket_water_Id, 1, 0))); } return itemInstance; } @@ -160,7 +160,7 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, { if( level->dimension->id == -1 ) player->awardStat( - GenericStats::netherLavaCollected(), + GenericStats::netherLavaCollected(), GenericStats::param_noArgs() ); @@ -172,13 +172,13 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, } if (--itemInstance->count <= 0) { - return shared_ptr( new ItemInstance(Item::bucket_lava) ); + return std::shared_ptr( new ItemInstance(Item::bucket_lava) ); } else { - if (!player->inventory->add(shared_ptr( new ItemInstance(Item::bucket_lava)))) + if (!player->inventory->add(std::shared_ptr( new ItemInstance(Item::bucket_lava)))) { - player->drop(shared_ptr(new ItemInstance(Item::bucket_lava_Id, 1, 0))); + player->drop(std::shared_ptr(new ItemInstance(Item::bucket_lava_Id, 1, 0))); } return itemInstance; } @@ -187,7 +187,7 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, else if (content < 0) { delete hr; - return shared_ptr( new ItemInstance(Item::bucket_empty) ); + return std::shared_ptr( new ItemInstance(Item::bucket_empty) ); } else { @@ -197,13 +197,13 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, if (hr->f == 3) zt++; if (hr->f == 4) xt--; if (hr->f == 5) xt++; - + if (!player->mayBuild(xt, yt, zt)) return itemInstance; if (emptyBucket(level, x, y, z, xt, yt, zt) && !player->abilities.instabuild) { - return shared_ptr( new ItemInstance(Item::bucket_empty) ); + return std::shared_ptr( new ItemInstance(Item::bucket_empty) ); } } @@ -217,13 +217,13 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, delete hr; if (--itemInstance->count <= 0) { - return shared_ptr( new ItemInstance(Item::milk) ); + return std::shared_ptr( new ItemInstance(Item::milk) ); } else { - if (!player->inventory->add(shared_ptr( new ItemInstance(Item::milk)))) + if (!player->inventory->add(std::shared_ptr( new ItemInstance(Item::milk)))) { - player->drop(shared_ptr(new ItemInstance(Item::milk_Id, 1, 0))); + player->drop(std::shared_ptr(new ItemInstance(Item::milk_Id, 1, 0))); } return itemInstance; } @@ -234,22 +234,22 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, return itemInstance; } -bool BucketItem::emptyBucket(Level *level, double x, double y, double z, int xt, int yt, int zt) +bool BucketItem::emptyBucket(Level *level, double x, double y, double z, int xt, int yt, int zt) { if (content <= 0) return false; - if (level->isEmptyTile(xt, yt, zt) || !level->getMaterial(xt, yt, zt)->isSolid()) + if (level->isEmptyTile(xt, yt, zt) || !level->getMaterial(xt, yt, zt)->isSolid()) { - if (level->dimension->ultraWarm && content == Tile::water_Id) + if (level->dimension->ultraWarm && content == Tile::water_Id) { level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, eSoundType_RANDOM_FIZZ, 0.5f, 2.6f + (level->random->nextFloat() - level->random->nextFloat()) * 0.8f); - for (int i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { level->addParticle(eParticleType_largesmoke, xt + Math::random(), yt + Math::random(), zt + Math::random(), 0, 0, 0); } - } - else + } + else { level->setTileAndData(xt, yt, zt, content, 0); } diff --git a/Minecraft.World/BucketItem.h b/Minecraft.World/BucketItem.h index 500d19d8..f865ba21 100644 --- a/Minecraft.World/BucketItem.h +++ b/Minecraft.World/BucketItem.h @@ -13,8 +13,8 @@ private: public: BucketItem(int id, int content); - virtual bool TestUse(Level *level, shared_ptr player); - virtual shared_ptr use(shared_ptr itemInstance, Level *level, shared_ptr player); + virtual bool TestUse(Level *level, std::shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); // TU9 bool emptyBucket(Level *level, double x, double y, double z, int xt, int yt, int zt); diff --git a/Minecraft.World/ButtonTile.cpp b/Minecraft.World/ButtonTile.cpp index 16055a7e..d6192650 100644 --- a/Minecraft.World/ButtonTile.cpp +++ b/Minecraft.World/ButtonTile.cpp @@ -141,7 +141,7 @@ bool ButtonTile::checkCanSurvive(Level *level, int x, int y, int z) return true; } -void ButtonTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void ButtonTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { int data = level->getData(x, y, z); updateShape(data); @@ -176,7 +176,7 @@ void ButtonTile::updateShape(int data) } } -void ButtonTile::attack(Level *level, int x, int y, int z, shared_ptr player) +void ButtonTile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { //use(level, x, y, z, player, 0, 0, 0, 0); } @@ -187,7 +187,7 @@ bool ButtonTile::TestUse() return true; } -bool ButtonTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool ButtonTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly) { @@ -279,7 +279,7 @@ void ButtonTile::updateDefaultShape() setShape(0.5f - x, 0.5f - y, 0.5f - z, 0.5f + x, 0.5f + y, 0.5f + z); } -void ButtonTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void ButtonTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { if (level->isClientSide) return; if (!sensitive) return; @@ -301,7 +301,7 @@ void ButtonTile::checkPressed(Level *level, int x, int y, int z) updateShape(data); Tile::ThreadStorage *tls = (Tile::ThreadStorage *)TlsGetValue(Tile::tlsIdxShape); - vector > *entities = level->getEntitiesOfClass(typeid(Arrow), AABB::newTemp(x + tls->xx0, y + tls->yy0, z + tls->zz0, x + tls->xx1, y + tls->yy1, z + tls->zz1)); + vector > *entities = level->getEntitiesOfClass(typeid(Arrow), AABB::newTemp(x + tls->xx0, y + tls->yy0, z + tls->zz0, x + tls->xx1, y + tls->yy1, z + tls->zz1)); shouldBePressed = !entities->empty(); delete entities; diff --git a/Minecraft.World/ButtonTile.h b/Minecraft.World/ButtonTile.h index e06158e0..0721c05c 100644 --- a/Minecraft.World/ButtonTile.h +++ b/Minecraft.World/ButtonTile.h @@ -37,22 +37,22 @@ private: bool checkCanSurvive(Level *level, int x, int y, int z); public: - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param private: void updateShape(int data); public: - virtual void attack(Level *level, int x, int y, int z, shared_ptr player); + virtual void attack(Level *level, int x, int y, int z, std::shared_ptr player); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param virtual void onRemove(Level *level, int x, int y, int z, int id, int data); virtual bool getSignal(LevelSource *level, int x, int y, int z, int dir); virtual bool getDirectSignal(Level *level, int x, int y, int z, int dir); virtual bool isSignalSource(); virtual void tick(Level *level, int x, int y, int z, Random *random); virtual void updateDefaultShape(); - void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); private: void checkPressed(Level *level, int x, int y, int z); @@ -60,7 +60,7 @@ private: public: void registerIcons(IconRegister *iconRegister); - + // 4J Added so we can check before we try to add a tile to the tick list if it's actually going to do seomthing virtual bool shouldTileTick(Level *level, int x,int y,int z); }; \ No newline at end of file diff --git a/Minecraft.World/CactusTile.cpp b/Minecraft.World/CactusTile.cpp index b72570e1..69190b50 100644 --- a/Minecraft.World/CactusTile.cpp +++ b/Minecraft.World/CactusTile.cpp @@ -18,7 +18,7 @@ CactusTile::CactusTile(int id) : Tile(id, Material::cactus,isSolidRender()) void CactusTile::tick(Level *level, int x, int y, int z, Random *random) { if (level->isEmptyTile(x, y + 1, z)) - { + { int height = 1; while (level->getTile(x, y - height, z) == id) { @@ -100,7 +100,7 @@ bool CactusTile::canSurvive(Level *level, int x, int y, int z) return below == Tile::cactus_Id || below == Tile::sand_Id; } -void CactusTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void CactusTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { entity->hurt(DamageSource::cactus, 1); } diff --git a/Minecraft.World/CactusTile.h b/Minecraft.World/CactusTile.h index 3c5e9b49..4fe1e6e0 100644 --- a/Minecraft.World/CactusTile.h +++ b/Minecraft.World/CactusTile.h @@ -30,10 +30,10 @@ public: virtual bool mayPlace(Level *level, int x, int y, int z); virtual void neighborChanged(Level *level, int x, int y, int z, int type); virtual bool canSurvive(Level *level, int x, int y, int z); - virtual void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + virtual void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); //@Override void registerIcons(IconRegister *iconRegister); - + // 4J Added so we can check before we try to add a tile to the tick list if it's actually going to do seomthing virtual bool shouldTileTick(Level *level, int x,int y,int z); }; \ No newline at end of file diff --git a/Minecraft.World/CakeTile.cpp b/Minecraft.World/CakeTile.cpp index 1254e10e..b857be3b 100644 --- a/Minecraft.World/CakeTile.cpp +++ b/Minecraft.World/CakeTile.cpp @@ -18,7 +18,7 @@ CakeTile::CakeTile(int id) : Tile(id, Material::cake,isSolidRender()) iconInner = NULL; } -void CakeTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void CakeTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { int d = level->getData(x, y, z); float r = 1 / 16.0f; @@ -84,19 +84,19 @@ bool CakeTile::TestUse() return true; } -bool CakeTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool CakeTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly ) return false; eat(level, x, y, z, player); return true; } -void CakeTile::attack(Level *level, int x, int y, int z, shared_ptr player) +void CakeTile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { eat(level, x, y, z, player); } -void CakeTile::eat(Level *level, int x, int y, int z, shared_ptr player) +void CakeTile::eat(Level *level, int x, int y, int z, std::shared_ptr player) { if (player->canEat(false)) { diff --git a/Minecraft.World/CakeTile.h b/Minecraft.World/CakeTile.h index 7f03577d..d8f36b2b 100644 --- a/Minecraft.World/CakeTile.h +++ b/Minecraft.World/CakeTile.h @@ -20,7 +20,7 @@ private: protected: CakeTile(int id); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual void updateDefaultShape(); virtual AABB *getAABB(Level *level, int x, int y, int z); virtual AABB *getTileAABB(Level *level, int x, int y, int z); @@ -30,10 +30,10 @@ protected: virtual bool isCubeShaped(); virtual bool isSolidRender(bool isServerLevel = false); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param - virtual void attack(Level *level, int x, int y, int z, shared_ptr player); + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual void attack(Level *level, int x, int y, int z, std::shared_ptr player); private: - void eat(Level *level, int x, int y, int z, shared_ptr player); + void eat(Level *level, int x, int y, int z, std::shared_ptr player); public: virtual bool mayPlace(Level *level, int x, int y, int z); virtual void neighborChanged(Level *level, int x, int y, int z, int type); diff --git a/Minecraft.World/CarrotOnAStickItem.cpp b/Minecraft.World/CarrotOnAStickItem.cpp index 9845cc25..a0fbdcf6 100644 --- a/Minecraft.World/CarrotOnAStickItem.cpp +++ b/Minecraft.World/CarrotOnAStickItem.cpp @@ -21,11 +21,11 @@ bool CarrotOnAStickItem::isMirroredArt() return true; } -shared_ptr CarrotOnAStickItem::use(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr CarrotOnAStickItem::use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { if (player->isRiding()) { - shared_ptr pig = dynamic_pointer_cast(player->riding); + std::shared_ptr pig = dynamic_pointer_cast(player->riding); if(pig) { if (pig->getControlGoal()->canBoost() && itemInstance->getMaxDamage() - itemInstance->getAuxValue() >= 7) @@ -35,7 +35,7 @@ shared_ptr CarrotOnAStickItem::use(shared_ptr itemIn if (itemInstance->count == 0) { - shared_ptr replacement = shared_ptr(new ItemInstance(Item::fishingRod)); + std::shared_ptr replacement = std::shared_ptr(new ItemInstance(Item::fishingRod)); replacement->setTag(itemInstance->tag); return replacement; } diff --git a/Minecraft.World/CarrotOnAStickItem.h b/Minecraft.World/CarrotOnAStickItem.h index 5e98f592..ef58c40f 100644 --- a/Minecraft.World/CarrotOnAStickItem.h +++ b/Minecraft.World/CarrotOnAStickItem.h @@ -9,5 +9,5 @@ public: bool isHandEquipped(); bool isMirroredArt(); - shared_ptr use(shared_ptr itemInstance, Level *level, shared_ptr player); + std::shared_ptr use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/CauldronTile.cpp b/Minecraft.World/CauldronTile.cpp index 4d5640ca..1ff5d9b0 100644 --- a/Minecraft.World/CauldronTile.cpp +++ b/Minecraft.World/CauldronTile.cpp @@ -46,7 +46,7 @@ Icon *CauldronTile::getTexture(const wstring &name) return NULL; } -void CauldronTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void CauldronTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { setShape(0, 0, 0, 1, 5.0f / 16.0f, 1); Tile::addAABBs(level, x, y, z, box, boxes, source); @@ -83,7 +83,7 @@ bool CauldronTile::isCubeShaped() return false; } -bool CauldronTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool CauldronTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if(soundOnly) return false; @@ -92,7 +92,7 @@ bool CauldronTile::use(Level *level, int x, int y, int z, shared_ptr pla return true; } - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); if (item == NULL) { return true; @@ -106,7 +106,7 @@ bool CauldronTile::use(Level *level, int x, int y, int z, shared_ptr pla { if (!player->abilities.instabuild) { - player->inventory->setItem(player->inventory->selected, shared_ptr(new ItemInstance(Item::bucket_empty))); + player->inventory->setItem(player->inventory->selected, std::shared_ptr(new ItemInstance(Item::bucket_empty))); } level->setData(x, y, z, 3); @@ -117,10 +117,10 @@ bool CauldronTile::use(Level *level, int x, int y, int z, shared_ptr pla { if (currentData > 0) { - shared_ptr potion = shared_ptr(new ItemInstance(Item::potion, 1, 0)); + std::shared_ptr potion = std::shared_ptr(new ItemInstance(Item::potion, 1, 0)); if (!player->inventory->add(potion)) { - level->addEntity(shared_ptr(new ItemEntity(level, x + 0.5, y + 1.5, z + 0.5, potion))); + level->addEntity(std::shared_ptr(new ItemEntity(level, x + 0.5, y + 1.5, z + 0.5, potion))); } // 4J Stu - Brought forward change to update inventory when filling bottles with water else if (dynamic_pointer_cast( player ) != NULL) diff --git a/Minecraft.World/CauldronTile.h b/Minecraft.World/CauldronTile.h index 4ed3fc90..61c98de3 100644 --- a/Minecraft.World/CauldronTile.h +++ b/Minecraft.World/CauldronTile.h @@ -21,12 +21,12 @@ public: //@Override void registerIcons(IconRegister *iconRegister); static Icon *getTexture(const wstring &name); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); virtual void updateDefaultShape(); virtual bool isSolidRender(bool isServerLevel = false); virtual int getRenderShape(); virtual bool isCubeShaped(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param virtual void handleRain(Level *level, int x, int y, int z); virtual int getResource(int data, Random *random, int playerBonusLevel); virtual int cloneTileId(Level *level, int x, int y, int z); diff --git a/Minecraft.World/CaveSpider.cpp b/Minecraft.World/CaveSpider.cpp index 5f7c6028..4bf98956 100644 --- a/Minecraft.World/CaveSpider.cpp +++ b/Minecraft.World/CaveSpider.cpp @@ -28,7 +28,7 @@ float CaveSpider::getModelScale() } -bool CaveSpider::doHurtTarget(shared_ptr target) +bool CaveSpider::doHurtTarget(std::shared_ptr target) { if (Spider::doHurtTarget(target)) { diff --git a/Minecraft.World/CaveSpider.h b/Minecraft.World/CaveSpider.h index 26f07e5f..de9cf370 100644 --- a/Minecraft.World/CaveSpider.h +++ b/Minecraft.World/CaveSpider.h @@ -13,6 +13,6 @@ class CaveSpider : public Spider virtual int getMaxHealth(); virtual float getModelScale(); - virtual bool doHurtTarget(shared_ptr target); + virtual bool doHurtTarget(std::shared_ptr target); void finalizeMobSpawn(); }; \ No newline at end of file diff --git a/Minecraft.World/ChatPacket.h b/Minecraft.World/ChatPacket.h index c480dfd0..2481e903 100644 --- a/Minecraft.World/ChatPacket.h +++ b/Minecraft.World/ChatPacket.h @@ -92,7 +92,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ChatPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ChatPacket()); } virtual int getId() { return 3; } }; diff --git a/Minecraft.World/ChestTile.cpp b/Minecraft.World/ChestTile.cpp index b7964e72..9c462713 100644 --- a/Minecraft.World/ChestTile.cpp +++ b/Minecraft.World/ChestTile.cpp @@ -37,7 +37,7 @@ int ChestTile::getRenderShape() return Tile::SHAPE_ENTITYTILE_ANIMATED; } -void ChestTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +void ChestTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) { if (level->getTile(x, y, z - 1) == id) { @@ -76,7 +76,7 @@ void ChestTile::onPlace(Level *level, int x, int y, int z) if (e == id) recalcLockDir(level, x + 1, y, z); } -void ChestTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void ChestTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int n = level->getTile(x, y, z - 1); // face = 2 int s = level->getTile(x, y, z + 1); // face = 3 @@ -200,18 +200,18 @@ bool ChestTile::isFullChest(Level *level, int x, int y, int z) void ChestTile::neighborChanged(Level *level, int x, int y, int z, int type) { EntityTile::neighborChanged(level, x, y, z, type); - shared_ptr(cte) = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + std::shared_ptr(cte) = dynamic_pointer_cast(level->getTileEntity(x, y, z)); if (cte != NULL) cte->clearCache(); } void ChestTile::onRemove(Level *level, int x, int y, int z, int id, int data) { - shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if (container != NULL ) { for (unsigned int i = 0; i < container->getContainerSize(); i++) { - shared_ptr item = container->getItem(i); + std::shared_ptr item = container->getItem(i); if (item != NULL) { float xo = random->nextFloat() * 0.8f + 0.1f; @@ -224,9 +224,9 @@ void ChestTile::onRemove(Level *level, int x, int y, int z, int id, int data) if (count > item->count) count = item->count; item->count -= count; - shared_ptr newItem = shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ); + std::shared_ptr newItem = std::shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ); newItem->set4JData( item->get4JData() ); - shared_ptr itemEntity = shared_ptr(new ItemEntity(level, x + xo, y + yo, z + zo, newItem ) ); + std::shared_ptr itemEntity = std::shared_ptr(new ItemEntity(level, x + xo, y + yo, z + zo, newItem ) ); float pow = 0.05f; itemEntity->xd = (float) random->nextGaussian() * pow; itemEntity->yd = (float) random->nextGaussian() * pow + 0.2f; @@ -254,7 +254,7 @@ bool ChestTile::TestUse() } // 4J-PB - changing to 1.5 equivalent -bool ChestTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool ChestTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly ) return true; @@ -263,21 +263,21 @@ bool ChestTile::use(Level *level, int x, int y, int z, shared_ptr player return true; } - shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if (container == NULL) return true; if (level->isSolidBlockingTile(x, y + 1, z)) return true; - if (isCatSittingOnChest(level,x, y, z)) return true; + if (isCatSittingOnChest(level,x, y, z)) return true; if (level->getTile(x - 1, y, z) == id && (level->isSolidBlockingTile(x - 1, y + 1, z) || isCatSittingOnChest(level, x - 1, y, z))) return true; if (level->getTile(x + 1, y, z) == id && (level->isSolidBlockingTile(x + 1, y + 1, z) || isCatSittingOnChest(level, x + 1, y, z))) return true; if (level->getTile(x, y, z - 1) == id && (level->isSolidBlockingTile(x, y + 1, z - 1) || isCatSittingOnChest(level, x, y, z - 1))) return true; if (level->getTile(x, y, z + 1) == id && (level->isSolidBlockingTile(x, y + 1, z + 1) || isCatSittingOnChest(level, x, y, z + 1))) return true; - if (level->getTile(x - 1, y, z) == id) container = shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, dynamic_pointer_cast( level->getTileEntity(x - 1, y, z) ), container) ); - if (level->getTile(x + 1, y, z) == id) container = shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, container, dynamic_pointer_cast( level->getTileEntity(x + 1, y, z) )) ); - if (level->getTile(x, y, z - 1) == id) container = shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, dynamic_pointer_cast( level->getTileEntity(x, y, z - 1) ), container) ); - if (level->getTile(x, y, z + 1) == id) container = shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, container, dynamic_pointer_cast( level->getTileEntity(x, y, z + 1) )) ); + if (level->getTile(x - 1, y, z) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, dynamic_pointer_cast( level->getTileEntity(x - 1, y, z) ), container) ); + if (level->getTile(x + 1, y, z) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, container, dynamic_pointer_cast( level->getTileEntity(x + 1, y, z) )) ); + if (level->getTile(x, y, z - 1) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, dynamic_pointer_cast( level->getTileEntity(x, y, z - 1) ), container) ); + if (level->getTile(x, y, z + 1) == id) container = std::shared_ptr( new CompoundContainer(IDS_CHEST_LARGE, container, dynamic_pointer_cast( level->getTileEntity(x, y, z + 1) )) ); player->openContainer(container); @@ -285,12 +285,12 @@ bool ChestTile::use(Level *level, int x, int y, int z, shared_ptr player } // 4J-PB - added from 1.5 -bool ChestTile::isCatSittingOnChest(Level *level, int x, int y, int z) +bool ChestTile::isCatSittingOnChest(Level *level, int x, int y, int z) { - vector > *entities = level->getEntitiesOfClass(typeid(Ozelot), AABB::newTemp(x, y + 1, z, x + 1, y + 2, z + 1)); + vector > *entities = level->getEntitiesOfClass(typeid(Ozelot), AABB::newTemp(x, y + 1, z, x + 1, y + 2, z + 1)); for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - shared_ptr ocelot = dynamic_pointer_cast(*it); + std::shared_ptr ocelot = dynamic_pointer_cast(*it); if(ocelot->isSitting()) { return true; @@ -300,15 +300,15 @@ bool ChestTile::isCatSittingOnChest(Level *level, int x, int y, int z) return false; } -shared_ptr ChestTile::newTileEntity(Level *level) +std::shared_ptr ChestTile::newTileEntity(Level *level) { MemSect(50); - shared_ptr retval = shared_ptr( new ChestTileEntity() ); + std::shared_ptr retval = std::shared_ptr( new ChestTileEntity() ); MemSect(0); return retval; } -void ChestTile::registerIcons(IconRegister *iconRegister) +void ChestTile::registerIcons(IconRegister *iconRegister) { // Register wood as the chest's icon, because it's used by the particles // when destroying the chest diff --git a/Minecraft.World/ChestTile.h b/Minecraft.World/ChestTile.h index ee2185cb..da55c503 100644 --- a/Minecraft.World/ChestTile.h +++ b/Minecraft.World/ChestTile.h @@ -19,9 +19,9 @@ public: virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); virtual int getRenderShape(); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity = shared_ptr()); + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity = std::shared_ptr()); virtual void onPlace(Level *level, int x, int y, int z); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); void recalcLockDir(Level *level, int x, int y, int z); virtual bool mayPlace(Level *level, int x, int y, int z); private: @@ -31,8 +31,8 @@ public: virtual void neighborChanged(Level *level, int x, int y, int z, int type); virtual void onRemove(Level *level, int x, int y, int z, int id, int data); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param - shared_ptr newTileEntity(Level *level); + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + std::shared_ptr newTileEntity(Level *level); //@Override void registerIcons(IconRegister *iconRegister); }; \ No newline at end of file diff --git a/Minecraft.World/ChestTileEntity.cpp b/Minecraft.World/ChestTileEntity.cpp index 406b81b5..85a7d389 100644 --- a/Minecraft.World/ChestTileEntity.cpp +++ b/Minecraft.World/ChestTileEntity.cpp @@ -32,32 +32,32 @@ ChestTileEntity::~ChestTileEntity() delete items; } -unsigned int ChestTileEntity::getContainerSize() +unsigned int ChestTileEntity::getContainerSize() { return 9 * 3; } -shared_ptr ChestTileEntity::getItem(unsigned int slot) +std::shared_ptr ChestTileEntity::getItem(unsigned int slot) { return items->data[slot]; } -shared_ptr ChestTileEntity::removeItem(unsigned int slot, int count) +std::shared_ptr ChestTileEntity::removeItem(unsigned int slot, int count) { if (items->data[slot] != NULL) { - if (items->data[slot]->count <= count) + if (items->data[slot]->count <= count) { - shared_ptr item = items->data[slot]; + std::shared_ptr item = items->data[slot]; items->data[slot] = nullptr; this->setChanged(); // 4J Stu - Fix for duplication glitch if(item->count <= 0) return nullptr; return item; - } - else + } + else { - shared_ptr i = items->data[slot]->remove(count); + std::shared_ptr i = items->data[slot]->remove(count); if (items->data[slot]->count == 0) items->data[slot] = nullptr; this->setChanged(); // 4J Stu - Fix for duplication glitch @@ -68,18 +68,18 @@ shared_ptr ChestTileEntity::removeItem(unsigned int slot, int coun return nullptr; } -shared_ptr ChestTileEntity::removeItemNoUpdate(int slot) +std::shared_ptr ChestTileEntity::removeItemNoUpdate(int slot) { if (items->data[slot] != NULL) { - shared_ptr item = items->data[slot]; + std::shared_ptr item = items->data[slot]; items->data[slot] = nullptr; return item; } return nullptr; } -void ChestTileEntity::setItem(unsigned int slot, shared_ptr item) +void ChestTileEntity::setItem(unsigned int slot, std::shared_ptr item) { items->data[slot] = item; if (item != NULL && item->count > getMaxStackSize()) item->count = getMaxStackSize(); @@ -118,7 +118,7 @@ void ChestTileEntity::save(CompoundTag *base) for (unsigned int i = 0; i < items->length; i++) { - if (items->data[i] != NULL) + if (items->data[i] != NULL) { CompoundTag *tag = new CompoundTag(); tag->putByte(L"Slot", (byte) i); @@ -135,14 +135,14 @@ int ChestTileEntity::getMaxStackSize() return Container::LARGE_MAX_STACK_SIZE; } -bool ChestTileEntity::stillValid(shared_ptr player) +bool ChestTileEntity::stillValid(std::shared_ptr player) { if (level->getTileEntity(x, y, z) != shared_from_this() ) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; return true; } -void ChestTileEntity::setChanged() +void ChestTileEntity::setChanged() { TileEntity::setChanged(); } @@ -208,7 +208,7 @@ void ChestTileEntity::tick() if (s.lock() != NULL) zc += 0.5; if (e.lock() != NULL) xc += 0.5; - // 4J-PB - Seems the chest open volume is much louder than other sounds from user reports. We'll tone it down a bit + // 4J-PB - Seems the chest open volume is much louder than other sounds from user reports. We'll tone it down a bit level->playSound(xc, y + 0.5, zc, eSoundType_RANDOM_CHEST_OPEN, 0.2f, level->random->nextFloat() * 0.1f + 0.9f); } } @@ -233,7 +233,7 @@ void ChestTileEntity::tick() if (s.lock() != NULL) zc += 0.5; if (e.lock() != NULL) xc += 0.5; - // 4J-PB - Seems the chest open volume is much louder than other sounds from user reports. We'll tone it down a bit + // 4J-PB - Seems the chest open volume is much louder than other sounds from user reports. We'll tone it down a bit level->playSound(xc, y + 0.5, zc, eSoundType_RANDOM_CHEST_CLOSE, 0.2f, level->random->nextFloat() * 0.1f + 0.9f); } } @@ -273,9 +273,9 @@ void ChestTileEntity::setRemoved() } // 4J Added -shared_ptr ChestTileEntity::clone() +std::shared_ptr ChestTileEntity::clone() { - shared_ptr result = shared_ptr( new ChestTileEntity() ); + std::shared_ptr result = std::shared_ptr( new ChestTileEntity() ); TileEntity::clone(result); for (unsigned int i = 0; i < items->length; i++) diff --git a/Minecraft.World/ChestTileEntity.h b/Minecraft.World/ChestTileEntity.h index 5eeb3c44..37dde555 100644 --- a/Minecraft.World/ChestTileEntity.h +++ b/Minecraft.World/ChestTileEntity.h @@ -40,15 +40,15 @@ private: public: virtual unsigned int getContainerSize(); - virtual shared_ptr getItem(unsigned int slot); - virtual shared_ptr removeItem(unsigned int slot, int count); - virtual shared_ptr removeItemNoUpdate(int slot); - virtual void setItem(unsigned int slot, shared_ptr item); + virtual std::shared_ptr getItem(unsigned int slot); + virtual std::shared_ptr removeItem(unsigned int slot, int count); + virtual std::shared_ptr removeItemNoUpdate(int slot); + virtual void setItem(unsigned int slot, std::shared_ptr item); virtual int getName(); virtual void load(CompoundTag *base); virtual void save(CompoundTag *base); virtual int getMaxStackSize(); - virtual bool stillValid(shared_ptr player); + virtual bool stillValid(std::shared_ptr player); virtual void setChanged(); virtual void clearCache(); virtual void checkNeighbors(); @@ -59,5 +59,5 @@ public: virtual void setRemoved(); // 4J Added - virtual shared_ptr clone(); + virtual std::shared_ptr clone(); }; \ No newline at end of file diff --git a/Minecraft.World/Chicken.cpp b/Minecraft.World/Chicken.cpp index 0104b2bf..a1193d4a 100644 --- a/Minecraft.World/Chicken.cpp +++ b/Minecraft.World/Chicken.cpp @@ -68,7 +68,7 @@ void Chicken::aiStep() if (!onGround && flapping < 1) flapping = 1; flapping *= 0.9; - if (!onGround && yd < 0) + if (!onGround && yd < 0) { yd *= 0.6; } @@ -77,7 +77,7 @@ void Chicken::aiStep() if (!isBaby()) { - if (!level->isClientSide && --eggTime <= 0) + if (!level->isClientSide && --eggTime <= 0) { level->playSound(shared_from_this(), eSoundType_MOB_CHICKENPLOP, 1.0f, (random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f); spawnAtLocation(Item::egg->id, 1); @@ -87,27 +87,27 @@ void Chicken::aiStep() } -void Chicken::causeFallDamage(float distance) +void Chicken::causeFallDamage(float distance) { } -int Chicken::getAmbientSound() +int Chicken::getAmbientSound() { return eSoundType_MOB_CHICKEN_AMBIENT; } -int Chicken::getHurtSound() +int Chicken::getHurtSound() { return eSoundType_MOB_CHICKEN_HURT; } -int Chicken::getDeathSound() +int Chicken::getDeathSound() { return eSoundType_MOB_CHICKEN_HURT; } -int Chicken::getDeathLoot() +int Chicken::getDeathLoot() { return Item::feather->id; } @@ -121,7 +121,7 @@ void Chicken::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) spawnAtLocation(Item::feather_Id, 1); } // and some meat - if (this->isOnFire()) + if (this->isOnFire()) { spawnAtLocation(Item::chicken_cooked_Id, 1); } @@ -131,12 +131,12 @@ void Chicken::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) } } -shared_ptr Chicken::getBreedOffspring(shared_ptr target) +std::shared_ptr Chicken::getBreedOffspring(std::shared_ptr target) { // 4J - added limit to chickens that can be bred if( level->canCreateMore( GetType(), Level::eSpawnType_Breed) ) { - return shared_ptr(new Chicken(level)); + return std::shared_ptr(new Chicken(level)); } else { @@ -144,7 +144,7 @@ shared_ptr Chicken::getBreedOffspring(shared_ptr target) } } -bool Chicken::isFood(shared_ptr itemInstance) +bool Chicken::isFood(std::shared_ptr itemInstance) { return (itemInstance->id == Item::seeds_wheat_Id) || (itemInstance->id == Item::netherStalkSeeds_Id) || (itemInstance->id == Item::seeds_melon_Id) || (itemInstance->id == Item::seeds_pumpkin_Id); } diff --git a/Minecraft.World/Chicken.h b/Minecraft.World/Chicken.h index a162a5eb..2814a29c 100644 --- a/Minecraft.World/Chicken.h +++ b/Minecraft.World/Chicken.h @@ -18,14 +18,14 @@ public: float flapping; int eggTime; -private: +private: void _init(); public: Chicken(Level *level); virtual bool useNewAi(); virtual int getMaxHealth(); - virtual void aiStep(); + virtual void aiStep(); protected: virtual void causeFallDamage(float distance); @@ -36,7 +36,7 @@ protected: virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel); public: - virtual shared_ptr getBreedOffspring(shared_ptr target); - virtual bool isFood(shared_ptr itemInstance); + virtual std::shared_ptr getBreedOffspring(std::shared_ptr target); + virtual bool isFood(std::shared_ptr itemInstance); }; diff --git a/Minecraft.World/ChunkPos.cpp b/Minecraft.World/ChunkPos.cpp index 1bdf165d..025d1fc9 100644 --- a/Minecraft.World/ChunkPos.cpp +++ b/Minecraft.World/ChunkPos.cpp @@ -21,7 +21,7 @@ int ChunkPos::hashCode() return h1 ^ h2; } -double ChunkPos::distanceToSqr(shared_ptr e) +double ChunkPos::distanceToSqr(std::shared_ptr e) { double xPos = x * 16 + 8; double zPos = z * 16 + 8; diff --git a/Minecraft.World/ChunkPos.h b/Minecraft.World/ChunkPos.h index 55bd1ebb..dc797b02 100644 --- a/Minecraft.World/ChunkPos.h +++ b/Minecraft.World/ChunkPos.h @@ -13,7 +13,7 @@ public: static int64_t hashCode(int x, int z); int hashCode(); - double distanceToSqr(shared_ptr e); + double distanceToSqr(std::shared_ptr e); double distanceToSqr(double px, double pz); // 4J added int getMiddleBlockX(); diff --git a/Minecraft.World/ChunkTilesUpdatePacket.h b/Minecraft.World/ChunkTilesUpdatePacket.h index a97f49a3..2e90d3c6 100644 --- a/Minecraft.World/ChunkTilesUpdatePacket.h +++ b/Minecraft.World/ChunkTilesUpdatePacket.h @@ -25,7 +25,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ChunkTilesUpdatePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ChunkTilesUpdatePacket()); } virtual int getId() { return 52; } }; diff --git a/Minecraft.World/ChunkVisibilityAreaPacket.h b/Minecraft.World/ChunkVisibilityAreaPacket.h index 33087497..cc7f337d 100644 --- a/Minecraft.World/ChunkVisibilityAreaPacket.h +++ b/Minecraft.World/ChunkVisibilityAreaPacket.h @@ -25,6 +25,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ChunkVisibilityAreaPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ChunkVisibilityAreaPacket()); } virtual int getId() { return 155; } }; diff --git a/Minecraft.World/ChunkVisibilityPacket.h b/Minecraft.World/ChunkVisibilityPacket.h index 8c5856c7..d27b0200 100644 --- a/Minecraft.World/ChunkVisibilityPacket.h +++ b/Minecraft.World/ChunkVisibilityPacket.h @@ -22,7 +22,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ChunkVisibilityPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ChunkVisibilityPacket()); } virtual int getId() { return 50; } }; diff --git a/Minecraft.World/ClientCommandPacket.h b/Minecraft.World/ClientCommandPacket.h index 2f614ddf..1dea6b22 100644 --- a/Minecraft.World/ClientCommandPacket.h +++ b/Minecraft.World/ClientCommandPacket.h @@ -19,6 +19,6 @@ public: int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ClientCommandPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ClientCommandPacket()); } virtual int getId() { return 205; } }; \ No newline at end of file diff --git a/Minecraft.World/ClientSideMerchant.cpp b/Minecraft.World/ClientSideMerchant.cpp index 5d021c22..9719cd48 100644 --- a/Minecraft.World/ClientSideMerchant.cpp +++ b/Minecraft.World/ClientSideMerchant.cpp @@ -3,10 +3,10 @@ #include "net.minecraft.world.inventory.h" #include "ClientSideMerchant.h" -ClientSideMerchant::ClientSideMerchant(shared_ptr source, int name) +ClientSideMerchant::ClientSideMerchant(std::shared_ptr source, int name) { this->source = source; - // 4J Stu - Need to do this after creating as a shared_ptr + // 4J Stu - Need to do this after creating as a std::shared_ptr container = NULL; //new MerchantContainer(source, this); currentOffers = NULL; m_name = name; @@ -28,17 +28,17 @@ Container *ClientSideMerchant::getContainer() return container; } -shared_ptr ClientSideMerchant::getTradingPlayer() +std::shared_ptr ClientSideMerchant::getTradingPlayer() { return source; } -void ClientSideMerchant::setTradingPlayer(shared_ptr player) +void ClientSideMerchant::setTradingPlayer(std::shared_ptr player) { } -MerchantRecipeList *ClientSideMerchant::getOffers(shared_ptr forPlayer) +MerchantRecipeList *ClientSideMerchant::getOffers(std::shared_ptr forPlayer) { return currentOffers; } @@ -54,7 +54,7 @@ void ClientSideMerchant::notifyTrade(MerchantRecipe *activeRecipe) activeRecipe->increaseUses(); } -void ClientSideMerchant::notifyTradeUpdated(shared_ptr item) +void ClientSideMerchant::notifyTradeUpdated(std::shared_ptr item) { } diff --git a/Minecraft.World/ClientSideMerchant.h b/Minecraft.World/ClientSideMerchant.h index 33f0c0b1..fa02c486 100644 --- a/Minecraft.World/ClientSideMerchant.h +++ b/Minecraft.World/ClientSideMerchant.h @@ -10,21 +10,21 @@ class ClientSideMerchant : public Merchant, public enable_shared_from_this source; + std::shared_ptr source; MerchantRecipeList *currentOffers; int m_name; public: - ClientSideMerchant(shared_ptr source, int name); + ClientSideMerchant(std::shared_ptr source, int name); ~ClientSideMerchant(); void createContainer(); // 4J Added Container *getContainer(); - shared_ptr getTradingPlayer(); - void setTradingPlayer(shared_ptr player); - MerchantRecipeList *getOffers(shared_ptr forPlayer); + std::shared_ptr getTradingPlayer(); + void setTradingPlayer(std::shared_ptr player); + MerchantRecipeList *getOffers(std::shared_ptr forPlayer); void overrideOffers(MerchantRecipeList *recipeList); void notifyTrade(MerchantRecipe *activeRecipe); - void notifyTradeUpdated(shared_ptr item); + void notifyTradeUpdated(std::shared_ptr item); int getDisplayName(); }; \ No newline at end of file diff --git a/Minecraft.World/ClothTileItem.cpp b/Minecraft.World/ClothTileItem.cpp index 35f3bb96..2879deb8 100644 --- a/Minecraft.World/ClothTileItem.cpp +++ b/Minecraft.World/ClothTileItem.cpp @@ -4,8 +4,8 @@ #include "DyePowderItem.h" #include "ClothTileItem.h" -const unsigned int ClothTileItem::COLOR_DESCS[] = -{ +const unsigned int ClothTileItem::COLOR_DESCS[] = +{ IDS_TILE_CLOTH_BLACK, IDS_TILE_CLOTH_RED, IDS_TILE_CLOTH_GREEN, @@ -24,8 +24,8 @@ const unsigned int ClothTileItem::COLOR_DESCS[] = IDS_TILE_CLOTH_WHITE }; -const unsigned int ClothTileItem::CARPET_COLOR_DESCS[] = -{ +const unsigned int ClothTileItem::CARPET_COLOR_DESCS[] = +{ IDS_TILE_CARPET_BLACK, IDS_TILE_CARPET_RED, IDS_TILE_CARPET_GREEN, @@ -50,18 +50,18 @@ ClothTileItem::ClothTileItem(int id) : TileItem(id) setStackedByData(true); } -Icon *ClothTileItem::getIcon(int itemAuxValue) +Icon *ClothTileItem::getIcon(int itemAuxValue) { return Tile::cloth->getTexture(2, ClothTile::getTileDataForItemAuxValue(itemAuxValue)); } -int ClothTileItem::getLevelDataForAuxValue(int auxValue) +int ClothTileItem::getLevelDataForAuxValue(int auxValue) { return auxValue; } -unsigned int ClothTileItem::getDescriptionId(shared_ptr instance) +unsigned int ClothTileItem::getDescriptionId(std::shared_ptr instance) { if(getTileId() == Tile::woolCarpet_Id) return CARPET_COLOR_DESCS[ClothTile::getTileDataForItemAuxValue(instance->getAuxValue())]; else return COLOR_DESCS[ClothTile::getTileDataForItemAuxValue(instance->getAuxValue())]; diff --git a/Minecraft.World/ClothTileItem.h b/Minecraft.World/ClothTileItem.h index e909df43..a2cf46a7 100644 --- a/Minecraft.World/ClothTileItem.h +++ b/Minecraft.World/ClothTileItem.h @@ -3,15 +3,15 @@ using namespace std; #include "TileItem.h" -class ClothTileItem : public TileItem +class ClothTileItem : public TileItem { -public: +public: static const unsigned int COLOR_DESCS[]; static const unsigned int CARPET_COLOR_DESCS[]; ClothTileItem(int id); - + virtual Icon *getIcon(int itemAuxValue); virtual int getLevelDataForAuxValue(int auxValue); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); }; \ No newline at end of file diff --git a/Minecraft.World/CoalItem.cpp b/Minecraft.World/CoalItem.cpp index 362689e0..2f6d9cb9 100644 --- a/Minecraft.World/CoalItem.cpp +++ b/Minecraft.World/CoalItem.cpp @@ -12,9 +12,9 @@ CoalItem::CoalItem(int id) : Item( id ) setMaxDamage(0); } -unsigned int CoalItem::getDescriptionId(shared_ptr instance) +unsigned int CoalItem::getDescriptionId(std::shared_ptr instance) { - if (instance->getAuxValue() == CHAR_COAL) + if (instance->getAuxValue() == CHAR_COAL) { return IDS_ITEM_CHARCOAL; } diff --git a/Minecraft.World/CoalItem.h b/Minecraft.World/CoalItem.h index 24814548..d45a6056 100644 --- a/Minecraft.World/CoalItem.h +++ b/Minecraft.World/CoalItem.h @@ -13,5 +13,5 @@ public: CoalItem(int id); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); }; \ No newline at end of file diff --git a/Minecraft.World/CocoaTile.cpp b/Minecraft.World/CocoaTile.cpp index 1f575014..db9e7f53 100644 --- a/Minecraft.World/CocoaTile.cpp +++ b/Minecraft.World/CocoaTile.cpp @@ -46,7 +46,7 @@ void CocoaTile::tick(Level *level, int x, int y, int z, Random *random) } } -bool CocoaTile::canSurvive(Level *level, int x, int y, int z) +bool CocoaTile::canSurvive(Level *level, int x, int y, int z) { int dir = getDirection(level->getData(x, y, z)); @@ -84,7 +84,7 @@ AABB *CocoaTile::getTileAABB(Level *level, int x, int y, int z) return DirectionalTile::getTileAABB(level, x, y, z); } -void CocoaTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +void CocoaTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) { int data = level->getData(x, y, z); int dir = getDirection(data); @@ -112,7 +112,7 @@ void CocoaTile::updateShape(LevelSource *level, int x, int y, int z, int forceDa } } -void CocoaTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by, shared_ptr itemInstance) +void CocoaTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by, std::shared_ptr itemInstance) { int dir = (((Mth::floor(by->yRot * 4 / (360) + 0.5)) & 3) + 0) % 4; level->setData(x, y, z, dir); @@ -127,7 +127,7 @@ int CocoaTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int f return Direction::DIRECTION_OPPOSITE[Direction::FACING_DIRECTION[face]]; } -void CocoaTile::neighborChanged(Level *level, int x, int y, int z, int type) +void CocoaTile::neighborChanged(Level *level, int x, int y, int z, int type) { if (!canSurvive(level, x, y, z)) { @@ -151,7 +151,7 @@ void CocoaTile::spawnResources(Level *level, int x, int y, int z, int data, floa } for (int i = 0; i < count; i++) { - popResource(level, x, y, z, shared_ptr( new ItemInstance(Item::dye_powder, 1, DyePowderItem::BROWN) )); + popResource(level, x, y, z, std::shared_ptr( new ItemInstance(Item::dye_powder, 1, DyePowderItem::BROWN) )); } } diff --git a/Minecraft.World/CocoaTile.h b/Minecraft.World/CocoaTile.h index 267225ea..e1b6a92f 100644 --- a/Minecraft.World/CocoaTile.h +++ b/Minecraft.World/CocoaTile.h @@ -4,7 +4,7 @@ class CocoaTile : public DirectionalTile { -public: +public: static const int COCOA_TEXTURES_LENGTH = 3; static const wstring TEXTURE_AGES[]; @@ -25,8 +25,8 @@ public: virtual bool isSolidRender(bool isServerLevel = false); virtual AABB *getAABB(Level *level, int x, int y, int z); virtual AABB *getTileAABB(Level *level, int x, int y, int z); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by, shared_ptr itemInstance); + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by, std::shared_ptr itemInstance); virtual int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue); virtual void neighborChanged(Level *level, int x, int y, int z, int type); static int getAge(int data); diff --git a/Minecraft.World/ColoredTileItem.cpp b/Minecraft.World/ColoredTileItem.cpp index 37ea4c63..ab71641e 100644 --- a/Minecraft.World/ColoredTileItem.cpp +++ b/Minecraft.World/ColoredTileItem.cpp @@ -18,7 +18,7 @@ ColoredTileItem::~ColoredTileItem() if(descriptionPostfixes.data != NULL) delete [] descriptionPostfixes.data; } -int ColoredTileItem::getColor(shared_ptr item, int spriteLayer) +int ColoredTileItem::getColor(std::shared_ptr item, int spriteLayer) { return colorTile->getColor(item->getAuxValue()); } @@ -45,7 +45,7 @@ ColoredTileItem *ColoredTileItem::setDescriptionPostfixes(intArray descriptionPo return this; } -unsigned int ColoredTileItem::getDescriptionId(shared_ptr instance) +unsigned int ColoredTileItem::getDescriptionId(std::shared_ptr instance) { if (descriptionPostfixes.data == NULL) { diff --git a/Minecraft.World/ColoredTileItem.h b/Minecraft.World/ColoredTileItem.h index cc3ef1e7..dfe5ebe6 100644 --- a/Minecraft.World/ColoredTileItem.h +++ b/Minecraft.World/ColoredTileItem.h @@ -16,10 +16,10 @@ public: ColoredTileItem(int id, bool stackedByData); ~ColoredTileItem(); - virtual int getColor(shared_ptr item, int spriteLayer); + virtual int getColor(std::shared_ptr item, int spriteLayer); virtual Icon *getIcon(int auxValue); virtual int getLevelDataForAuxValue(int auxValue); ColoredTileItem *setDescriptionPostfixes(intArray descriptionPostfixes); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); }; diff --git a/Minecraft.World/Command.cpp b/Minecraft.World/Command.cpp index f6d0e592..7c8f56cf 100644 --- a/Minecraft.World/Command.cpp +++ b/Minecraft.World/Command.cpp @@ -7,17 +7,17 @@ AdminLogCommand *Command::logger; -bool Command::canExecute(shared_ptr source) +bool Command::canExecute(std::shared_ptr source) { return source->hasPermission(getId()); } -void Command::logAdminAction(shared_ptr source, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) +void Command::logAdminAction(std::shared_ptr source, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) { logAdminAction(source, 0, messageType, message, customData, additionalMessage); } -void Command::logAdminAction(shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) +void Command::logAdminAction(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message, int customData, const wstring& additionalMessage) { if (logger != NULL) { @@ -30,9 +30,9 @@ void Command::setLogger(AdminLogCommand *logger) Command::logger = logger; } -shared_ptr Command::getPlayer(PlayerUID playerId) +std::shared_ptr Command::getPlayer(PlayerUID playerId) { - shared_ptr player = MinecraftServer::getInstance()->getPlayers()->getPlayer(playerId); + std::shared_ptr player = MinecraftServer::getInstance()->getPlayers()->getPlayer(playerId); if (player == NULL) { diff --git a/Minecraft.World/Command.h b/Minecraft.World/Command.h index 815c24ba..8f923be2 100644 --- a/Minecraft.World/Command.h +++ b/Minecraft.World/Command.h @@ -16,13 +16,13 @@ private: public: virtual EGameCommand getId() = 0; - virtual void execute(shared_ptr source, byteArray commandData) = 0; - virtual bool canExecute(shared_ptr source); + virtual void execute(std::shared_ptr source, byteArray commandData) = 0; + virtual bool canExecute(std::shared_ptr source); - static void logAdminAction(shared_ptr source, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); - static void logAdminAction(shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); + static void logAdminAction(std::shared_ptr source, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); + static void logAdminAction(std::shared_ptr source, int type, ChatPacket::EChatPacketMessage messageType, const wstring& message = L"", int customData = -1, const wstring& additionalMessage = L""); static void setLogger(AdminLogCommand *logger); protected: - shared_ptr getPlayer(PlayerUID playerId); + std::shared_ptr getPlayer(PlayerUID playerId); }; \ No newline at end of file diff --git a/Minecraft.World/CommandDispatcher.cpp b/Minecraft.World/CommandDispatcher.cpp index 68b74ca9..b9db3caf 100644 --- a/Minecraft.World/CommandDispatcher.cpp +++ b/Minecraft.World/CommandDispatcher.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.commands.h" #include "CommandDispatcher.h" -void CommandDispatcher::performCommand(shared_ptr sender, EGameCommand command, byteArray commandData) +void CommandDispatcher::performCommand(std::shared_ptr sender, EGameCommand command, byteArray commandData) { AUTO_VAR(it, commandsById.find(command)); diff --git a/Minecraft.World/CommandDispatcher.h b/Minecraft.World/CommandDispatcher.h index 600f1db1..cfc4486a 100644 --- a/Minecraft.World/CommandDispatcher.h +++ b/Minecraft.World/CommandDispatcher.h @@ -14,6 +14,6 @@ private: unordered_set commands; public: - void performCommand(shared_ptr sender, EGameCommand command, byteArray commandData); + void performCommand(std::shared_ptr sender, EGameCommand command, byteArray commandData); Command *addCommand(Command *command); }; \ No newline at end of file diff --git a/Minecraft.World/ComplexItem.cpp b/Minecraft.World/ComplexItem.cpp index 9cf09b87..1b5f3cff 100644 --- a/Minecraft.World/ComplexItem.cpp +++ b/Minecraft.World/ComplexItem.cpp @@ -13,7 +13,7 @@ bool ComplexItem::isComplex() return true; } -shared_ptr ComplexItem::getUpdatePacket(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr ComplexItem::getUpdatePacket(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { return nullptr; } \ No newline at end of file diff --git a/Minecraft.World/ComplexItem.h b/Minecraft.World/ComplexItem.h index 28aba791..036781a4 100644 --- a/Minecraft.World/ComplexItem.h +++ b/Minecraft.World/ComplexItem.h @@ -14,5 +14,5 @@ protected: public: virtual bool isComplex(); - virtual shared_ptr getUpdatePacket(shared_ptr itemInstance, Level *level, shared_ptr player); + virtual std::shared_ptr getUpdatePacket(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); }; diff --git a/Minecraft.World/ComplexItemDataPacket.h b/Minecraft.World/ComplexItemDataPacket.h index 52de8f49..f299647d 100644 --- a/Minecraft.World/ComplexItemDataPacket.h +++ b/Minecraft.World/ComplexItemDataPacket.h @@ -20,7 +20,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ComplexItemDataPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ComplexItemDataPacket()); } virtual int getId() { return 131; } }; diff --git a/Minecraft.World/CompoundContainer.cpp b/Minecraft.World/CompoundContainer.cpp index 29bf60dd..17f2b6e5 100644 --- a/Minecraft.World/CompoundContainer.cpp +++ b/Minecraft.World/CompoundContainer.cpp @@ -3,7 +3,7 @@ #include "CompoundContainer.h" -CompoundContainer::CompoundContainer(int name, shared_ptr c1, shared_ptr c2) +CompoundContainer::CompoundContainer(int name, std::shared_ptr c1, std::shared_ptr c2) { this->name = name; if (c1 == NULL) c1 = c2; @@ -22,25 +22,25 @@ int CompoundContainer::getName() return name; } -shared_ptr CompoundContainer::getItem(unsigned int slot) +std::shared_ptr CompoundContainer::getItem(unsigned int slot) { if (slot >= c1->getContainerSize()) return c2->getItem(slot - c1->getContainerSize()); else return c1->getItem(slot); } -shared_ptr CompoundContainer::removeItem(unsigned int slot, int i) +std::shared_ptr CompoundContainer::removeItem(unsigned int slot, int i) { if (slot >= c1->getContainerSize()) return c2->removeItem(slot - c1->getContainerSize(), i); else return c1->removeItem(slot, i); } -shared_ptr CompoundContainer::removeItemNoUpdate(int slot) +std::shared_ptr CompoundContainer::removeItemNoUpdate(int slot) { if (slot >= c1->getContainerSize()) return c2->removeItemNoUpdate(slot - c1->getContainerSize()); else return c1->removeItemNoUpdate(slot); } -void CompoundContainer::setItem(unsigned int slot, shared_ptr item) +void CompoundContainer::setItem(unsigned int slot, std::shared_ptr item) { if (slot >= c1->getContainerSize()) c2->setItem(slot - c1->getContainerSize(), item); else c1->setItem(slot, item); @@ -57,7 +57,7 @@ void CompoundContainer::setChanged() c2->setChanged(); } -bool CompoundContainer::stillValid(shared_ptr player) +bool CompoundContainer::stillValid(std::shared_ptr player) { return c1->stillValid(player) && c2->stillValid(player); } diff --git a/Minecraft.World/CompoundContainer.h b/Minecraft.World/CompoundContainer.h index b0b8b934..1103f000 100644 --- a/Minecraft.World/CompoundContainer.h +++ b/Minecraft.World/CompoundContainer.h @@ -9,27 +9,27 @@ class CompoundContainer : public Container { private: int name; - shared_ptr c1, c2; + std::shared_ptr c1, c2; public: - CompoundContainer(int name, shared_ptr c1, shared_ptr c2); + CompoundContainer(int name, std::shared_ptr c1, std::shared_ptr c2); unsigned int getContainerSize(); int getName(); - shared_ptr getItem(unsigned int slot); + std::shared_ptr getItem(unsigned int slot); - shared_ptr removeItem(unsigned int slot, int i); - shared_ptr removeItemNoUpdate(int slot); + std::shared_ptr removeItem(unsigned int slot, int i); + std::shared_ptr removeItemNoUpdate(int slot); - void setItem(unsigned int slot, shared_ptr item); + void setItem(unsigned int slot, std::shared_ptr item); int getMaxStackSize(); void setChanged(); - bool stillValid(shared_ptr player); + bool stillValid(std::shared_ptr player); virtual void startOpen(); virtual void stopOpen(); diff --git a/Minecraft.World/Connection.cpp b/Minecraft.World/Connection.cpp index 4392fe54..17b59dd3 100644 --- a/Minecraft.World/Connection.cpp +++ b/Minecraft.World/Connection.cpp @@ -96,7 +96,7 @@ Connection::Connection(Socket *socket, const wstring& id, PacketListener *packet }*/ dis = new DataInputStream(socket->getInputStream(packetListener->isServerPacketListener())); - + sos = socket->getOutputStream(packetListener->isServerPacketListener()); bufferedDos = new DataOutputStream(new BufferedOutputStream(sos, SEND_BUFFER_SIZE)); baos = new ByteArrayOutputStream( SEND_BUFFER_SIZE ); @@ -124,7 +124,7 @@ Connection::Connection(Socket *socket, const wstring& id, PacketListener *packet writeThread->Run(); - /* 4J JEV, java: + /* 4J JEV, java: new Thread(wstring(id).append(L" read thread")) { }; @@ -145,7 +145,7 @@ void Connection::setListener(PacketListener *packetListener) this->packetListener = packetListener; } -void Connection::send(shared_ptr packet) +void Connection::send(std::shared_ptr packet) { if (quitting) return; @@ -154,7 +154,7 @@ void Connection::send(shared_ptr packet) EnterCriticalSection(&writeLock); estimatedRemaining += packet->getEstimatedSize() + 1; - if (packet->shouldDelay) + if (packet->shouldDelay) { // 4J We have delayed it enough by putting it in the slow queue, so don't delay when we actually send it packet->shouldDelay = false; @@ -171,7 +171,7 @@ void Connection::send(shared_ptr packet) } -void Connection::queueSend(shared_ptr packet) +void Connection::queueSend(std::shared_ptr packet) { if (quitting) return; estimatedRemaining += packet->getEstimatedSize() + 1; @@ -189,7 +189,7 @@ bool Connection::writeTick() // try { if (!outgoing.empty() && (fakeLag == 0 || System::currentTimeMillis() - outgoing.front()->createTime >= fakeLag)) { - shared_ptr packet; + std::shared_ptr packet; EnterCriticalSection(&writeLock); @@ -200,11 +200,11 @@ bool Connection::writeTick() LeaveCriticalSection(&writeLock); Packet::writePacket(packet, bufferedDos); - + #ifndef _CONTENT_PACKAGE // 4J Added for debugging - if( !socket->isLocal() ) + if( !socket->isLocal() ) Packet::recordOutgoingPacket(packet); #endif @@ -220,7 +220,7 @@ bool Connection::writeTick() if ((slowWriteDelay-- <= 0) && !outgoing_slow.empty() && (fakeLag == 0 || System::currentTimeMillis() - outgoing_slow.front()->createTime >= fakeLag)) { - shared_ptr packet; + std::shared_ptr packet; //synchronized (writeLock) { @@ -252,9 +252,9 @@ bool Connection::writeTick() #ifndef _CONTENT_PACKAGE // 4J Added for debugging - if( !socket->isLocal() ) + if( !socket->isLocal() ) Packet::recordOutgoingPacket(packet); -#endif +#endif writeSizes[packet->getId()] += packet->getEstimatedSize() + 1; slowWriteDelay = 0; @@ -290,7 +290,7 @@ bool Connection::readTick() //try { - shared_ptr packet = Packet::readPacket(dis, packetListener->isServerPacketListener()); + std::shared_ptr packet = Packet::readPacket(dis, packetListener->isServerPacketListener()); if (packet != NULL) { @@ -302,13 +302,13 @@ bool Connection::readTick() } LeaveCriticalSection(&incoming_cs); didSomething = true; - } + } else { // printf("Con:0x%x readTick close EOS\n",this); // 4J Stu - Remove this line - // Fix for #10410 - UI: If the player is removed from a splitscreened host’s game, the next game that player joins will produce a message stating that the host has left. + // Fix for #10410 - UI: If the player is removed from a splitscreened host�s game, the next game that player joins will produce a message stating that the host has left. //close(DisconnectPacket::eDisconnect_EndOfStream); } @@ -362,7 +362,7 @@ void Connection::close(DisconnectPacket::eDisconnectReason reason, ...) // int count = 0, sum = 0, i = first; // va_list marker; - // + // // va_start( marker, first ); // while( i != -1 ) // { @@ -440,7 +440,7 @@ void Connection::tick() tickCount++; if (tickCount % 20 == 0) { - send( shared_ptr( new KeepAlivePacket() ) ); + send( std::shared_ptr( new KeepAlivePacket() ) ); } // 4J Stu - 1.8.2 changed from 100 to 1000 @@ -455,10 +455,10 @@ void Connection::tick() EnterCriticalSection(&incoming_cs); // 4J Stu - If disconnected, then we shouldn't process incoming packets - std::vector< shared_ptr > packetsToHandle; + std::vector< std::shared_ptr > packetsToHandle; while (!disconnected && !g_NetworkManager.IsLeavingGame() && g_NetworkManager.IsInSession() && !incoming.empty() && max-- >= 0) { - shared_ptr packet = incoming.front(); + std::shared_ptr packet = incoming.front(); packetsToHandle.push_back(packet); incoming.pop(); } @@ -607,8 +607,8 @@ int Connection::runWrite(void* lpParam) while (con->writeTick()) ; - //Sleep(100L); - // TODO - 4J Stu - 1.8.2 changes these sleeps to 2L, but not sure whether we should do that as well + //Sleep(100L); + // TODO - 4J Stu - 1.8.2 changes these sleeps to 2L, but not sure whether we should do that as well waitResult = con->m_hWakeWriteThread->WaitForSignal(100L); if (con->bufferedDos != NULL) con->bufferedDos->flush(); diff --git a/Minecraft.World/Connection.h b/Minecraft.World/Connection.h index 9db00512..32068dfb 100644 --- a/Minecraft.World/Connection.h +++ b/Minecraft.World/Connection.h @@ -52,11 +52,11 @@ private: bool running; - queue > incoming; // 4J - was using synchronizedList... + queue > incoming; // 4J - was using synchronizedList... CRITICAL_SECTION incoming_cs; // ... now has this critical section - queue > outgoing; // 4J - was using synchronizedList - but don't think it is required as usage is wrapped in writeLock critical section - queue > outgoing_slow; // 4J - was using synchronizedList - but don't think it is required as usage is wrapped in writeLock critical section - + queue > outgoing; // 4J - was using synchronizedList - but don't think it is required as usage is wrapped in writeLock critical section + queue > outgoing_slow; // 4J - was using synchronizedList - but don't think it is required as usage is wrapped in writeLock critical section + PacketListener *packetListener; bool quitting; @@ -98,10 +98,10 @@ public: Connection(Socket *socket, const wstring& id, PacketListener *packetListener); // throws IOException void setListener(PacketListener *packetListener); - void send(shared_ptr packet); + void send(std::shared_ptr packet); public: - void queueSend(shared_ptr packet); + void queueSend(std::shared_ptr packet); private: int slowWriteDelay; diff --git a/Minecraft.World/Container.h b/Minecraft.World/Container.h index 7aa63728..8939cd01 100644 --- a/Minecraft.World/Container.h +++ b/Minecraft.World/Container.h @@ -10,14 +10,14 @@ public: static const int LARGE_MAX_STACK_SIZE = 64; virtual unsigned int getContainerSize() = 0; - virtual shared_ptr getItem(unsigned int slot) = 0; - virtual shared_ptr removeItem(unsigned int slot, int count) = 0; - virtual shared_ptr removeItemNoUpdate(int slot) = 0; - virtual void setItem(unsigned int slot, shared_ptr item) = 0; + virtual std::shared_ptr getItem(unsigned int slot) = 0; + virtual std::shared_ptr removeItem(unsigned int slot, int count) = 0; + virtual std::shared_ptr removeItemNoUpdate(int slot) = 0; + virtual void setItem(unsigned int slot, std::shared_ptr item) = 0; virtual int getName() = 0; virtual int getMaxStackSize() = 0; virtual void setChanged() = 0; - virtual bool stillValid(shared_ptr player) = 0; + virtual bool stillValid(std::shared_ptr player) = 0; virtual void startOpen() = 0; virtual void stopOpen() = 0; }; \ No newline at end of file diff --git a/Minecraft.World/ContainerAckPacket.h b/Minecraft.World/ContainerAckPacket.h index 00f3592e..0dce4e4f 100644 --- a/Minecraft.World/ContainerAckPacket.h +++ b/Minecraft.World/ContainerAckPacket.h @@ -23,7 +23,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ContainerAckPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ContainerAckPacket()); } virtual int getId() { return 106; } }; diff --git a/Minecraft.World/ContainerButtonClickPacket.h b/Minecraft.World/ContainerButtonClickPacket.h index 522c5f86..64ee6cb5 100644 --- a/Minecraft.World/ContainerButtonClickPacket.h +++ b/Minecraft.World/ContainerButtonClickPacket.h @@ -17,6 +17,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ContainerButtonClickPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ContainerButtonClickPacket()); } virtual int getId() { return 108; } }; \ No newline at end of file diff --git a/Minecraft.World/ContainerClickPacket.cpp b/Minecraft.World/ContainerClickPacket.cpp index 5b3ca24f..155f944b 100644 --- a/Minecraft.World/ContainerClickPacket.cpp +++ b/Minecraft.World/ContainerClickPacket.cpp @@ -21,7 +21,7 @@ ContainerClickPacket::ContainerClickPacket() quickKey = false; } -ContainerClickPacket::ContainerClickPacket(int containerId, int slotNum, int buttonNum, bool quickKey, shared_ptr item, short uid) +ContainerClickPacket::ContainerClickPacket(int containerId, int slotNum, int buttonNum, bool quickKey, std::shared_ptr item, short uid) { this->containerId = containerId; this->slotNum = slotNum; @@ -59,7 +59,7 @@ void ContainerClickPacket::write(DataOutputStream *dos) // throws IOException writeItem(item, dos); } -int ContainerClickPacket::getEstimatedSize() +int ContainerClickPacket::getEstimatedSize() { return 4 + 4 + 2 + 1; } diff --git a/Minecraft.World/ContainerClickPacket.h b/Minecraft.World/ContainerClickPacket.h index 8bea7da5..47c7e418 100644 --- a/Minecraft.World/ContainerClickPacket.h +++ b/Minecraft.World/ContainerClickPacket.h @@ -10,12 +10,12 @@ public: int slotNum; int buttonNum; short uid; - shared_ptr item; + std::shared_ptr item; bool quickKey; ContainerClickPacket(); ~ContainerClickPacket(); - ContainerClickPacket(int containerId, int slotNum, int buttonNum, bool quickKey, shared_ptr item, short uid); + ContainerClickPacket(int containerId, int slotNum, int buttonNum, bool quickKey, std::shared_ptr item, short uid); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis); @@ -23,7 +23,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ContainerClickPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ContainerClickPacket()); } virtual int getId() { return 102; } }; diff --git a/Minecraft.World/ContainerClosePacket.h b/Minecraft.World/ContainerClosePacket.h index bf032a97..562646fa 100644 --- a/Minecraft.World/ContainerClosePacket.h +++ b/Minecraft.World/ContainerClosePacket.h @@ -17,7 +17,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ContainerClosePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ContainerClosePacket()); } virtual int getId() { return 101; } }; diff --git a/Minecraft.World/ContainerMenu.cpp b/Minecraft.World/ContainerMenu.cpp index 57190024..534da741 100644 --- a/Minecraft.World/ContainerMenu.cpp +++ b/Minecraft.World/ContainerMenu.cpp @@ -8,7 +8,7 @@ #include "..\Minecraft.Client\LocalPlayer.h" #include "ContainerMenu.h" -ContainerMenu::ContainerMenu(shared_ptr inventory, shared_ptr container) : AbstractContainerMenu() +ContainerMenu::ContainerMenu(std::shared_ptr inventory, std::shared_ptr container) : AbstractContainerMenu() { this->container = container; this->containerRows = container->getContainerSize() / 9; @@ -37,18 +37,18 @@ ContainerMenu::ContainerMenu(shared_ptr inventory, shared_ptr player) +bool ContainerMenu::stillValid(std::shared_ptr player) { return container->stillValid(player); } -shared_ptr ContainerMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr ContainerMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex < containerRows * 9) @@ -79,25 +79,25 @@ shared_ptr ContainerMenu::quickMoveStack(shared_ptr player return clicked; } -void ContainerMenu::removed(shared_ptr player) +void ContainerMenu::removed(std::shared_ptr player) { AbstractContainerMenu::removed(player); container->stopOpen(); } -shared_ptr ContainerMenu::clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player) +std::shared_ptr ContainerMenu::clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr player) { - shared_ptr out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); + std::shared_ptr out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); #ifdef _EXTENDED_ACHIEVEMENTS - shared_ptr localPlayer = dynamic_pointer_cast(player); + std::shared_ptr localPlayer = dynamic_pointer_cast(player); if (localPlayer != NULL) // 4J-JEV: For "Chestful o'Cobblestone" achievement. { int cobblecount = 0; for (int i = 0; i < container->getContainerSize(); i++) { - shared_ptr item = container->getItem(i); + std::shared_ptr item = container->getItem(i); if ( (item != nullptr) && (item->id == Tile::stoneBrick_Id) ) { cobblecount += item->GetCount(); diff --git a/Minecraft.World/ContainerMenu.h b/Minecraft.World/ContainerMenu.h index e6da0782..a738cdc3 100644 --- a/Minecraft.World/ContainerMenu.h +++ b/Minecraft.World/ContainerMenu.h @@ -7,16 +7,16 @@ class Container; class ContainerMenu : public AbstractContainerMenu { private: - shared_ptr container; + std::shared_ptr container; int containerRows; public: - ContainerMenu(shared_ptr inventory, shared_ptr container); + ContainerMenu(std::shared_ptr inventory, std::shared_ptr container); - virtual bool stillValid(shared_ptr player); - virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); - void removed(shared_ptr player); + virtual bool stillValid(std::shared_ptr player); + virtual std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); + void removed(std::shared_ptr player); // 4J ADDED, - virtual shared_ptr clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player); + virtual std::shared_ptr clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr player); }; diff --git a/Minecraft.World/ContainerOpenPacket.h b/Minecraft.World/ContainerOpenPacket.h index dbc65b9a..3d351a93 100644 --- a/Minecraft.World/ContainerOpenPacket.h +++ b/Minecraft.World/ContainerOpenPacket.h @@ -30,7 +30,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ContainerOpenPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ContainerOpenPacket()); } virtual int getId() { return 100; } }; diff --git a/Minecraft.World/ContainerSetContentPacket.cpp b/Minecraft.World/ContainerSetContentPacket.cpp index 13cfebd7..62382888 100644 --- a/Minecraft.World/ContainerSetContentPacket.cpp +++ b/Minecraft.World/ContainerSetContentPacket.cpp @@ -12,28 +12,28 @@ ContainerSetContentPacket::~ContainerSetContentPacket() delete[] items.data; } -ContainerSetContentPacket::ContainerSetContentPacket() +ContainerSetContentPacket::ContainerSetContentPacket() { containerId = 0; } -ContainerSetContentPacket::ContainerSetContentPacket(int containerId, vector > *newItems) +ContainerSetContentPacket::ContainerSetContentPacket(int containerId, vector > *newItems) { this->containerId = containerId; items = ItemInstanceArray((int)newItems->size()); for (unsigned int i = 0; i < items.length; i++) { - shared_ptr item = newItems->at(i); + std::shared_ptr item = newItems->at(i); items[i] = item == NULL ? nullptr : item->copy(); } } -void ContainerSetContentPacket::read(DataInputStream *dis) //throws IOException +void ContainerSetContentPacket::read(DataInputStream *dis) //throws IOException { containerId = dis->readByte(); int count = dis->readShort(); items = ItemInstanceArray(count); - for (int i = 0; i < count; i++) + for (int i = 0; i < count; i++) { items[i] = readItem(dis); } @@ -43,7 +43,7 @@ void ContainerSetContentPacket::write(DataOutputStream *dos) //throws IOExceptio { dos->writeByte(containerId); dos->writeShort(items.length); - for (unsigned int i = 0; i < items.length; i++) + for (unsigned int i = 0; i < items.length; i++) { writeItem(items[i], dos); } @@ -54,7 +54,7 @@ void ContainerSetContentPacket::handle(PacketListener *listener) listener->handleContainerContent(shared_from_this()); } -int ContainerSetContentPacket::getEstimatedSize() +int ContainerSetContentPacket::getEstimatedSize() { return 3 + items.length * 5; } diff --git a/Minecraft.World/ContainerSetContentPacket.h b/Minecraft.World/ContainerSetContentPacket.h index 10315f58..8e2a3c5a 100644 --- a/Minecraft.World/ContainerSetContentPacket.h +++ b/Minecraft.World/ContainerSetContentPacket.h @@ -11,7 +11,7 @@ public: ContainerSetContentPacket(); ~ContainerSetContentPacket(); - ContainerSetContentPacket(int containerId, vector > *newItems); + ContainerSetContentPacket(int containerId, vector > *newItems); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); @@ -19,7 +19,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ContainerSetContentPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ContainerSetContentPacket()); } virtual int getId() { return 104; } }; diff --git a/Minecraft.World/ContainerSetDataPacket.h b/Minecraft.World/ContainerSetDataPacket.h index ce075e00..6f694aeb 100644 --- a/Minecraft.World/ContainerSetDataPacket.h +++ b/Minecraft.World/ContainerSetDataPacket.h @@ -19,6 +19,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ContainerSetDataPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ContainerSetDataPacket()); } virtual int getId() { return 105; } }; \ No newline at end of file diff --git a/Minecraft.World/ContainerSetSlotPacket.cpp b/Minecraft.World/ContainerSetSlotPacket.cpp index 42892f3c..0bb9857f 100644 --- a/Minecraft.World/ContainerSetSlotPacket.cpp +++ b/Minecraft.World/ContainerSetSlotPacket.cpp @@ -18,19 +18,19 @@ ContainerSetSlotPacket::ContainerSetSlotPacket() item = nullptr; } -ContainerSetSlotPacket::ContainerSetSlotPacket(int containerId, int slot, shared_ptr item) +ContainerSetSlotPacket::ContainerSetSlotPacket(int containerId, int slot, std::shared_ptr item) { this->containerId = containerId; this->slot = slot; this->item = item == NULL ? item : item->copy(); } -void ContainerSetSlotPacket::handle(PacketListener *listener) +void ContainerSetSlotPacket::handle(PacketListener *listener) { listener->handleContainerSetSlot(shared_from_this()); } -void ContainerSetSlotPacket::read(DataInputStream *dis) //throws IOException +void ContainerSetSlotPacket::read(DataInputStream *dis) //throws IOException { // 4J Stu - TU-1 hotfix // Fix for #13142 - Holding down the A button on the furnace ingredient slot causes the UI to display incorrect item counts diff --git a/Minecraft.World/ContainerSetSlotPacket.h b/Minecraft.World/ContainerSetSlotPacket.h index 61269df0..f996fc89 100644 --- a/Minecraft.World/ContainerSetSlotPacket.h +++ b/Minecraft.World/ContainerSetSlotPacket.h @@ -12,10 +12,10 @@ public: int containerId; int slot; - shared_ptr item; + std::shared_ptr item; ContainerSetSlotPacket(); - ContainerSetSlotPacket(int containerId, int slot, shared_ptr item); + ContainerSetSlotPacket(int containerId, int slot, std::shared_ptr item); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis); @@ -23,7 +23,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ContainerSetSlotPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ContainerSetSlotPacket()); } virtual int getId() { return 103; } }; diff --git a/Minecraft.World/ControlledByPlayerGoal.cpp b/Minecraft.World/ControlledByPlayerGoal.cpp index 1e035494..ba46debe 100644 --- a/Minecraft.World/ControlledByPlayerGoal.cpp +++ b/Minecraft.World/ControlledByPlayerGoal.cpp @@ -36,13 +36,13 @@ void ControlledByPlayerGoal::stop() bool ControlledByPlayerGoal::canUse() { - shared_ptr player = dynamic_pointer_cast( mob->rider.lock() ); + std::shared_ptr player = dynamic_pointer_cast( mob->rider.lock() ); return mob->isAlive() && player && (boosting || mob->canBeControlledByRider()); } void ControlledByPlayerGoal::tick() { - shared_ptr player = dynamic_pointer_cast(mob->rider.lock()); + std::shared_ptr player = dynamic_pointer_cast(mob->rider.lock()); PathfinderMob *pig = (PathfinderMob *)mob; float yrd = Mth::wrapDegrees(player->yRot - mob->yRot) * 0.5f; @@ -116,7 +116,7 @@ void ControlledByPlayerGoal::tick() if (!player->abilities.instabuild && speed >= maxSpeed * 0.5f && mob->getRandom()->nextFloat() < 0.006f && !boosting) { - shared_ptr carriedItem = player->getCarriedItem(); + std::shared_ptr carriedItem = player->getCarriedItem(); if (carriedItem != NULL && carriedItem->id == Item::carrotOnAStick_Id) { @@ -124,7 +124,7 @@ void ControlledByPlayerGoal::tick() if (carriedItem->count == 0) { - shared_ptr replacement = shared_ptr(new ItemInstance(Item::fishingRod)); + std::shared_ptr replacement = std::shared_ptr(new ItemInstance(Item::fishingRod)); replacement->setTag(carriedItem->tag); player->inventory->items[player->inventory->selected] = replacement; } diff --git a/Minecraft.World/Cow.cpp b/Minecraft.World/Cow.cpp index c259183e..f37cdd9a 100644 --- a/Minecraft.World/Cow.cpp +++ b/Minecraft.World/Cow.cpp @@ -47,27 +47,27 @@ int Cow::getMaxHealth() return 10; } -int Cow::getAmbientSound() +int Cow::getAmbientSound() { return eSoundType_MOB_COW_AMBIENT; } -int Cow::getHurtSound() +int Cow::getHurtSound() { return eSoundType_MOB_COW_HURT; } -int Cow::getDeathSound() +int Cow::getDeathSound() { return eSoundType_MOB_COW_HURT; } -float Cow::getSoundVolume() +float Cow::getSoundVolume() { return 0.4f; } -int Cow::getDeathLoot() +int Cow::getDeathLoot() { return Item::leather->id; } @@ -95,33 +95,33 @@ void Cow::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) } } -bool Cow::interact(shared_ptr player) +bool Cow::interact(std::shared_ptr player) { - shared_ptr item = player->inventory->getSelected(); - if (item != NULL && item->id == Item::bucket_empty->id) + std::shared_ptr item = player->inventory->getSelected(); + if (item != NULL && item->id == Item::bucket_empty->id) { player->awardStat(GenericStats::cowsMilked(),GenericStats::param_cowsMilked()); - if (--item->count <= 0) + if (--item->count <= 0) { - player->inventory->setItem(player->inventory->selected, shared_ptr( new ItemInstance(Item::milk) ) ); - } - else if (!player->inventory->add(shared_ptr( new ItemInstance(Item::milk) ))) - { - player->drop(shared_ptr( new ItemInstance(Item::milk) )); + player->inventory->setItem(player->inventory->selected, std::shared_ptr( new ItemInstance(Item::milk) ) ); } - + else if (!player->inventory->add(std::shared_ptr( new ItemInstance(Item::milk) ))) + { + player->drop(std::shared_ptr( new ItemInstance(Item::milk) )); + } + return true; } return Animal::interact(player); } -shared_ptr Cow::getBreedOffspring(shared_ptr target) +std::shared_ptr Cow::getBreedOffspring(std::shared_ptr target) { // 4J - added limit to number of animals that can be bred if( level->canCreateMore( GetType(), Level::eSpawnType_Breed) ) { - return shared_ptr( new Cow(level) ); + return std::shared_ptr( new Cow(level) ); } else { diff --git a/Minecraft.World/Cow.h b/Minecraft.World/Cow.h index a1a91aba..e721f830 100644 --- a/Minecraft.World/Cow.h +++ b/Minecraft.World/Cow.h @@ -27,6 +27,6 @@ protected: virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel); public: - virtual bool interact(shared_ptr player); - virtual shared_ptr getBreedOffspring(shared_ptr target); + virtual bool interact(std::shared_ptr player); + virtual std::shared_ptr getBreedOffspring(std::shared_ptr target); }; diff --git a/Minecraft.World/CraftItemPacket.h b/Minecraft.World/CraftItemPacket.h index 9793d593..b08d609e 100644 --- a/Minecraft.World/CraftItemPacket.h +++ b/Minecraft.World/CraftItemPacket.h @@ -22,6 +22,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new CraftItemPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new CraftItemPacket()); } virtual int getId() { return 150; } }; \ No newline at end of file diff --git a/Minecraft.World/CraftingContainer.cpp b/Minecraft.World/CraftingContainer.cpp index fbcc5678..db0d593d 100644 --- a/Minecraft.World/CraftingContainer.cpp +++ b/Minecraft.World/CraftingContainer.cpp @@ -22,7 +22,7 @@ unsigned int CraftingContainer::getContainerSize() return items->length; } -shared_ptr CraftingContainer::getItem(unsigned int slot) +std::shared_ptr CraftingContainer::getItem(unsigned int slot) { if (slot >= getContainerSize()) { @@ -31,7 +31,7 @@ shared_ptr CraftingContainer::getItem(unsigned int slot) return (*items)[slot]; } -shared_ptr CraftingContainer::getItem(unsigned int x, unsigned int y) +std::shared_ptr CraftingContainer::getItem(unsigned int x, unsigned int y) { if (x < 0 || x >= width) { @@ -46,31 +46,31 @@ int CraftingContainer::getName() return 0; } -shared_ptr CraftingContainer::removeItemNoUpdate(int slot) +std::shared_ptr CraftingContainer::removeItemNoUpdate(int slot) { if ((*items)[slot] != NULL) { - shared_ptr item = (*items)[slot]; + std::shared_ptr item = (*items)[slot]; (*items)[slot] = nullptr; return item; } return nullptr; } -shared_ptr CraftingContainer::removeItem(unsigned int slot, int count) +std::shared_ptr CraftingContainer::removeItem(unsigned int slot, int count) { if ((*items)[slot] != NULL) { if ((*items)[slot]->count <= count) { - shared_ptr item = (*items)[slot]; + std::shared_ptr item = (*items)[slot]; (*items)[slot] = nullptr; menu->slotsChanged(); // 4J - used to take pointer to this, but wasn't using it so removed return item; } else { - shared_ptr i = (*items)[slot]->remove(count); + std::shared_ptr i = (*items)[slot]->remove(count); if ((*items)[slot]->count == 0) (*items)[slot] = nullptr; menu->slotsChanged(); // 4J - used to take pointer to this, but wasn't using it so removed return i; @@ -79,7 +79,7 @@ shared_ptr CraftingContainer::removeItem(unsigned int slot, int co return nullptr; } -void CraftingContainer::setItem(unsigned int slot, shared_ptr item) +void CraftingContainer::setItem(unsigned int slot, std::shared_ptr item) { (*items)[slot] = item; if(menu) menu->slotsChanged(); @@ -94,7 +94,7 @@ void CraftingContainer::setChanged() { } -bool CraftingContainer::stillValid(shared_ptr player) +bool CraftingContainer::stillValid(std::shared_ptr player) { return true; } \ No newline at end of file diff --git a/Minecraft.World/CraftingContainer.h b/Minecraft.World/CraftingContainer.h index 863249a2..d09d460a 100644 --- a/Minecraft.World/CraftingContainer.h +++ b/Minecraft.World/CraftingContainer.h @@ -16,15 +16,15 @@ public: ~CraftingContainer(); virtual unsigned int getContainerSize(); - virtual shared_ptr getItem(unsigned int slot); - shared_ptr getItem(unsigned int x, unsigned int y); + virtual std::shared_ptr getItem(unsigned int slot); + std::shared_ptr getItem(unsigned int x, unsigned int y); virtual int getName(); - virtual shared_ptr removeItemNoUpdate(int slot); - virtual shared_ptr removeItem(unsigned int slot, int count); - virtual void setItem(unsigned int slot, shared_ptr item); + virtual std::shared_ptr removeItemNoUpdate(int slot); + virtual std::shared_ptr removeItem(unsigned int slot, int count); + virtual void setItem(unsigned int slot, std::shared_ptr item); virtual int getMaxStackSize(); virtual void setChanged(); - bool stillValid(shared_ptr player); + bool stillValid(std::shared_ptr player); void startOpen() { } // TODO Auto-generated method stub void stopOpen() { } // TODO Auto-generated method stub diff --git a/Minecraft.World/CraftingMenu.cpp b/Minecraft.World/CraftingMenu.cpp index eeb2a6e3..3a144a5d 100644 --- a/Minecraft.World/CraftingMenu.cpp +++ b/Minecraft.World/CraftingMenu.cpp @@ -17,10 +17,10 @@ const int CraftingMenu::INV_SLOT_END = CraftingMenu::INV_SLOT_START + 9 * 3; const int CraftingMenu::USE_ROW_SLOT_START = CraftingMenu::INV_SLOT_END; const int CraftingMenu::USE_ROW_SLOT_END = CraftingMenu::USE_ROW_SLOT_START + 9; -CraftingMenu::CraftingMenu(shared_ptr inventory, Level *level, int xt, int yt, int zt) : AbstractContainerMenu() +CraftingMenu::CraftingMenu(std::shared_ptr inventory, Level *level, int xt, int yt, int zt) : AbstractContainerMenu() { - craftSlots = shared_ptr( new CraftingContainer(this, 3, 3) ); - resultSlots = shared_ptr( new ResultContainer() ); + craftSlots = std::shared_ptr( new CraftingContainer(this, 3, 3) ); + resultSlots = std::shared_ptr( new ResultContainer() ); this->level = level; this->x = xt; @@ -51,19 +51,19 @@ CraftingMenu::CraftingMenu(shared_ptr inventory, Level *level, int xt slotsChanged(); // 4J - removed craftSlots parameter, see comment below } -void CraftingMenu::slotsChanged() // 4J used to take a shared_ptr but wasn't using it, so removed to simplify things +void CraftingMenu::slotsChanged() // 4J used to take a std::shared_ptr but wasn't using it, so removed to simplify things { resultSlots->setItem(0, Recipes::getInstance()->getItemFor(craftSlots, level)); } -void CraftingMenu::removed(shared_ptr player) +void CraftingMenu::removed(std::shared_ptr player) { AbstractContainerMenu::removed(player); if (level->isClientSide) return; for (int i = 0; i < 9; i++) { - shared_ptr item = craftSlots->removeItemNoUpdate(i); + std::shared_ptr item = craftSlots->removeItemNoUpdate(i); if (item != NULL) { player->drop(item); @@ -71,20 +71,20 @@ void CraftingMenu::removed(shared_ptr player) } } -bool CraftingMenu::stillValid(shared_ptr player) +bool CraftingMenu::stillValid(std::shared_ptr player) { if (level->getTile(x, y, z) != Tile::workBench_Id) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; return true; } -shared_ptr CraftingMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr CraftingMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex == RESULT_SLOT) diff --git a/Minecraft.World/CraftingMenu.h b/Minecraft.World/CraftingMenu.h index 0452eccc..7ebba894 100644 --- a/Minecraft.World/CraftingMenu.h +++ b/Minecraft.World/CraftingMenu.h @@ -18,18 +18,18 @@ public: static const int USE_ROW_SLOT_END; public: - shared_ptr craftSlots; - shared_ptr resultSlots; + std::shared_ptr craftSlots; + std::shared_ptr resultSlots; private: Level *level; int x, y, z; public: - CraftingMenu(shared_ptr inventory, Level *level, int xt, int yt, int zt); + CraftingMenu(std::shared_ptr inventory, Level *level, int xt, int yt, int zt); - virtual void slotsChanged();// 4J used to take a shared_ptr but wasn't using it, so removed to simplify things - virtual void removed(shared_ptr player); - virtual bool stillValid(shared_ptr player); - virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); + virtual void slotsChanged();// 4J used to take a std::shared_ptr but wasn't using it, so removed to simplify things + virtual void removed(std::shared_ptr player); + virtual bool stillValid(std::shared_ptr player); + virtual std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); }; \ No newline at end of file diff --git a/Minecraft.World/Creeper.cpp b/Minecraft.World/Creeper.cpp index 3f6c66a7..2403d3a4 100644 --- a/Minecraft.World/Creeper.cpp +++ b/Minecraft.World/Creeper.cpp @@ -34,7 +34,7 @@ Creeper::Creeper(Level *level) : Monster( level ) health = getMaxHealth(); _init(); - + this->textureIdx = TN_MOB_CREEPER; // 4J was L"/mob/creeper.png"; goalSelector.addGoal(1, new FloatGoal(this)); @@ -125,14 +125,14 @@ void Creeper::die(DamageSource *source) spawnAtLocation(Item::record_01_Id + random->nextInt(12), 1); } - shared_ptr player = dynamic_pointer_cast(source->getEntity()); + std::shared_ptr player = dynamic_pointer_cast(source->getEntity()); if ( (dynamic_pointer_cast(source->getDirectEntity()) != NULL) && (player != NULL) ) { player->awardStat(GenericStats::archer(), GenericStats::param_archer()); } } -bool Creeper::doHurtTarget(shared_ptr target) +bool Creeper::doHurtTarget(std::shared_ptr target) { return true; } @@ -162,7 +162,7 @@ void Creeper::setSwellDir(int dir) entityData->set(DATA_SWELL_DIR, (byte) dir); } -void Creeper::thunderHit(const LightningBolt *lightningBolt) +void Creeper::thunderHit(const LightningBolt *lightningBolt) { Monster::thunderHit(lightningBolt); entityData->set(DATA_IS_POWERED, (byte) 1); diff --git a/Minecraft.World/Creeper.h b/Minecraft.World/Creeper.h index a5da0e10..ebd9fa78 100644 --- a/Minecraft.World/Creeper.h +++ b/Minecraft.World/Creeper.h @@ -45,7 +45,7 @@ protected: public: virtual void die(DamageSource *source); - virtual bool doHurtTarget(shared_ptr target); + virtual bool doHurtTarget(std::shared_ptr target); virtual bool isPowered(); float getSwelling(float a); diff --git a/Minecraft.World/CropTile.cpp b/Minecraft.World/CropTile.cpp index 0c19d889..80540b6a 100644 --- a/Minecraft.World/CropTile.cpp +++ b/Minecraft.World/CropTile.cpp @@ -133,7 +133,7 @@ void CropTile::spawnResources(Level *level, int x, int y, int z, int data, float for (int i = 0; i < count; i++) { if (level->random->nextInt(5 * 3) > data) continue; - popResource(level, x, y, z, shared_ptr(new ItemInstance(getBaseSeedId(), 1, 0))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(getBaseSeedId(), 1, 0))); } } } diff --git a/Minecraft.World/CustomPayloadPacket.h b/Minecraft.World/CustomPayloadPacket.h index 95c5e708..b794631b 100644 --- a/Minecraft.World/CustomPayloadPacket.h +++ b/Minecraft.World/CustomPayloadPacket.h @@ -30,6 +30,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new CustomPayloadPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new CustomPayloadPacket()); } virtual int getId() { return 250; } }; \ No newline at end of file diff --git a/Minecraft.World/DamageEnchantment.cpp b/Minecraft.World/DamageEnchantment.cpp index 686abc62..804e6908 100644 --- a/Minecraft.World/DamageEnchantment.cpp +++ b/Minecraft.World/DamageEnchantment.cpp @@ -27,7 +27,7 @@ int DamageEnchantment::getMaxLevel() return 5; } -int DamageEnchantment::getDamageBonus(int level, shared_ptr target) +int DamageEnchantment::getDamageBonus(int level, std::shared_ptr target) { if (type == ALL) { @@ -54,7 +54,7 @@ bool DamageEnchantment::isCompatibleWith(Enchantment *other) const return dynamic_cast(other) == NULL; } -bool DamageEnchantment::canEnchant(shared_ptr item) +bool DamageEnchantment::canEnchant(std::shared_ptr item) { HatchetItem *hatchet = dynamic_cast(item->getItem()); if (hatchet) return true; diff --git a/Minecraft.World/DamageEnchantment.h b/Minecraft.World/DamageEnchantment.h index 00f9b047..7d7a3fd9 100644 --- a/Minecraft.World/DamageEnchantment.h +++ b/Minecraft.World/DamageEnchantment.h @@ -23,8 +23,8 @@ public: virtual int getMinCost(int level); virtual int getMaxCost(int level); virtual int getMaxLevel(); - virtual int getDamageBonus(int level, shared_ptr target); + virtual int getDamageBonus(int level, std::shared_ptr target); virtual int getDescriptionId(); virtual bool isCompatibleWith(Enchantment *other) const; - virtual bool canEnchant(shared_ptr item); + virtual bool canEnchant(std::shared_ptr item); }; \ No newline at end of file diff --git a/Minecraft.World/DamageSource.cpp b/Minecraft.World/DamageSource.cpp index 29ea727e..2b075e0e 100644 --- a/Minecraft.World/DamageSource.cpp +++ b/Minecraft.World/DamageSource.cpp @@ -24,22 +24,22 @@ DamageSource *DamageSource::wither = (new DamageSource(ChatPacket::e_ChatDeathWi DamageSource *DamageSource::anvil = (new DamageSource(ChatPacket::e_ChatDeathAnvil)); DamageSource *DamageSource::fallingBlock = (new DamageSource(ChatPacket::e_ChatDeathFallingBlock)); -DamageSource *DamageSource::mobAttack(shared_ptr mob) +DamageSource *DamageSource::mobAttack(std::shared_ptr mob) { return new EntityDamageSource(ChatPacket::e_ChatDeathMob, mob); } -DamageSource *DamageSource::playerAttack(shared_ptr player) +DamageSource *DamageSource::playerAttack(std::shared_ptr player) { return new EntityDamageSource(ChatPacket::e_ChatDeathPlayer, player); } -DamageSource *DamageSource::arrow(shared_ptr arrow, shared_ptr owner) +DamageSource *DamageSource::arrow(std::shared_ptr arrow, std::shared_ptr owner) { return (new IndirectEntityDamageSource(ChatPacket::e_ChatDeathArrow, arrow, owner))->setProjectile(); } -DamageSource *DamageSource::fireball(shared_ptr fireball, shared_ptr owner) +DamageSource *DamageSource::fireball(std::shared_ptr fireball, std::shared_ptr owner) { if (owner == NULL) { @@ -48,17 +48,17 @@ DamageSource *DamageSource::fireball(shared_ptr fireball, shared_ptrsetIsFire()->setProjectile(); } -DamageSource *DamageSource::thrown(shared_ptr entity, shared_ptr owner) +DamageSource *DamageSource::thrown(std::shared_ptr entity, std::shared_ptr owner) { return (new IndirectEntityDamageSource(ChatPacket::e_ChatDeathThrown, entity, owner))->setProjectile(); } -DamageSource *DamageSource::indirectMagic(shared_ptr entity, shared_ptr owner) +DamageSource *DamageSource::indirectMagic(std::shared_ptr entity, std::shared_ptr owner) { return (new IndirectEntityDamageSource(ChatPacket::e_ChatDeathIndirectMagic, entity, owner) )->bypassArmor()->setMagic();; } -DamageSource *DamageSource::thorns(shared_ptr source) +DamageSource *DamageSource::thorns(std::shared_ptr source) { return (new EntityDamageSource(ChatPacket::e_ChatDeathThorns, source))->setMagic(); } @@ -106,14 +106,14 @@ DamageSource::DamageSource(ChatPacket::EChatPacketMessage msgId) m_msgId = msgId; } -shared_ptr DamageSource::getDirectEntity() +std::shared_ptr DamageSource::getDirectEntity() { return getEntity(); } -shared_ptr DamageSource::getEntity() +std::shared_ptr DamageSource::getEntity() { - return shared_ptr(); + return std::shared_ptr(); } DamageSource *DamageSource::bypassArmor() @@ -158,15 +158,15 @@ DamageSource *DamageSource::setMagic() return this; } -//wstring DamageSource::getLocalizedDeathMessage(shared_ptr player) +//wstring DamageSource::getLocalizedDeathMessage(std::shared_ptr player) //{ // return L"death." + msgId + player->name; // //return I18n.get(L"death." + msgId, player.name); //} -shared_ptr DamageSource::getDeathMessagePacket(shared_ptr player) +std::shared_ptr DamageSource::getDeathMessagePacket(std::shared_ptr player) { - return shared_ptr( new ChatPacket(player->name, m_msgId ) ); + return std::shared_ptr( new ChatPacket(player->name, m_msgId ) ); } bool DamageSource::isFire() diff --git a/Minecraft.World/DamageSource.h b/Minecraft.World/DamageSource.h index 2e1d249d..ecfc2423 100644 --- a/Minecraft.World/DamageSource.h +++ b/Minecraft.World/DamageSource.h @@ -30,13 +30,13 @@ public: static DamageSource *anvil; static DamageSource *fallingBlock; - static DamageSource *mobAttack(shared_ptr mob); - static DamageSource *playerAttack(shared_ptr player); - static DamageSource *arrow(shared_ptr arrow, shared_ptr owner); - static DamageSource *fireball(shared_ptr fireball, shared_ptr owner); - static DamageSource *thrown(shared_ptr entity, shared_ptr owner); - static DamageSource *indirectMagic(shared_ptr entity, shared_ptr owner); - static DamageSource *thorns(shared_ptr source); + static DamageSource *mobAttack(std::shared_ptr mob); + static DamageSource *playerAttack(std::shared_ptr player); + static DamageSource *arrow(std::shared_ptr arrow, std::shared_ptr owner); + static DamageSource *fireball(std::shared_ptr fireball, std::shared_ptr owner); + static DamageSource *thrown(std::shared_ptr entity, std::shared_ptr owner); + static DamageSource *indirectMagic(std::shared_ptr entity, std::shared_ptr owner); + static DamageSource *thorns(std::shared_ptr source); private: bool _bypassArmor; @@ -66,8 +66,8 @@ protected: public: virtual ~DamageSource() {} - virtual shared_ptr getDirectEntity(); - virtual shared_ptr getEntity(); + virtual std::shared_ptr getDirectEntity(); + virtual std::shared_ptr getEntity(); protected: DamageSource *bypassArmor(); @@ -82,8 +82,8 @@ public: DamageSource *setMagic(); // 4J Stu - Made return a packet - //virtual wstring getLocalizedDeathMessage(shared_ptr player); - virtual shared_ptr getDeathMessagePacket(shared_ptr player); + //virtual wstring getLocalizedDeathMessage(std::shared_ptr player); + virtual std::shared_ptr getDeathMessagePacket(std::shared_ptr player); bool isFire(); ChatPacket::EChatPacketMessage getMsgId(); // 4J Stu - Used to return String diff --git a/Minecraft.World/DeadBushTile.cpp b/Minecraft.World/DeadBushTile.cpp index 33fdfe6c..84b92817 100644 --- a/Minecraft.World/DeadBushTile.cpp +++ b/Minecraft.World/DeadBushTile.cpp @@ -27,7 +27,7 @@ int DeadBushTile::getResource(int data, Random *random, int playerBonusLevel) return -1; } -void DeadBushTile::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +void DeadBushTile::playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data) { if (!level->isClientSide && player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::shears_Id) { @@ -37,7 +37,7 @@ void DeadBushTile::playerDestroy(Level *level, shared_ptr player, int x, ); // drop leaf block instead of sapling - popResource(level, x, y, z, shared_ptr(new ItemInstance(Tile::deadBush, 1, data))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(Tile::deadBush, 1, data))); } else { diff --git a/Minecraft.World/DeadBushTile.h b/Minecraft.World/DeadBushTile.h index 2d74816e..b1953e3f 100644 --- a/Minecraft.World/DeadBushTile.h +++ b/Minecraft.World/DeadBushTile.h @@ -12,5 +12,5 @@ protected: public: virtual void updateDefaultShape(); // 4J Added override virtual int getResource(int data, Random *random, int playerBonusLevel); - virtual void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data); + virtual void playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data); }; diff --git a/Minecraft.World/DebugOptionsPacket.h b/Minecraft.World/DebugOptionsPacket.h index 9ac5ef2f..d731ebdd 100644 --- a/Minecraft.World/DebugOptionsPacket.h +++ b/Minecraft.World/DebugOptionsPacket.h @@ -21,6 +21,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new DebugOptionsPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new DebugOptionsPacket()); } virtual int getId() { return 152; } }; diff --git a/Minecraft.World/DefaultGameModeCommand.cpp b/Minecraft.World/DefaultGameModeCommand.cpp index 529733f7..3b64040d 100644 --- a/Minecraft.World/DefaultGameModeCommand.cpp +++ b/Minecraft.World/DefaultGameModeCommand.cpp @@ -7,7 +7,7 @@ EGameCommand DefaultGameModeCommand::getId() return eGameCommand_DefaultGameMode; } -void DefaultGameModeCommand::execute(shared_ptr source, byteArray commandData) +void DefaultGameModeCommand::execute(std::shared_ptr source, byteArray commandData) { //if (args.length > 0) //{ diff --git a/Minecraft.World/DefaultGameModeCommand.h b/Minecraft.World/DefaultGameModeCommand.h index 99d45a43..01a41331 100644 --- a/Minecraft.World/DefaultGameModeCommand.h +++ b/Minecraft.World/DefaultGameModeCommand.h @@ -8,7 +8,7 @@ class DefaultGameModeCommand : public GameModeCommand { public: virtual EGameCommand getId(); - virtual void execute(shared_ptr source, byteArray commandData); + virtual void execute(std::shared_ptr source, byteArray commandData); protected: void doSetGameType(GameType *newGameType); diff --git a/Minecraft.World/DefendVillageTargetGoal.cpp b/Minecraft.World/DefendVillageTargetGoal.cpp index ad6b3fd8..87cb5fe3 100644 --- a/Minecraft.World/DefendVillageTargetGoal.cpp +++ b/Minecraft.World/DefendVillageTargetGoal.cpp @@ -11,7 +11,7 @@ DefendVillageTargetGoal::DefendVillageTargetGoal(VillagerGolem *golem) : TargetG bool DefendVillageTargetGoal::canUse() { - shared_ptr village = golem->getVillage(); + std::shared_ptr village = golem->getVillage(); if (village == NULL) return false; potentialTarget = weak_ptr(village->getClosestAggressor(dynamic_pointer_cast(golem->shared_from_this()))); return canAttack(potentialTarget.lock(), false); diff --git a/Minecraft.World/DelayedRelease.cpp b/Minecraft.World/DelayedRelease.cpp index ebd0398f..c1f9a3da 100644 --- a/Minecraft.World/DelayedRelease.cpp +++ b/Minecraft.World/DelayedRelease.cpp @@ -4,7 +4,7 @@ -DelayedRelease::DelayedRelease(Level *level, shared_ptr toRelease, int delay) : Entity(level) +DelayedRelease::DelayedRelease(Level *level, std::shared_ptr toRelease, int delay) : Entity(level) { moveTo(toRelease->x, toRelease->y, toRelease->z, 0, 0); this->toRelease = toRelease; @@ -37,7 +37,7 @@ void DelayedRelease::defineSynchedData() { } -void DelayedRelease::readAdditionalSaveData(CompoundTag *tag) +void DelayedRelease::readAdditionalSaveData(CompoundTag *tag) { } diff --git a/Minecraft.World/DelayedRelease.h b/Minecraft.World/DelayedRelease.h index aaccc843..8ec6fcd2 100644 --- a/Minecraft.World/DelayedRelease.h +++ b/Minecraft.World/DelayedRelease.h @@ -10,11 +10,11 @@ public: virtual eINSTANCEOF GetType() { return eTYPE_DELAYEDRELEASE; } private: - shared_ptr toRelease; + std::shared_ptr toRelease; int delay; public: - DelayedRelease(Level *level, shared_ptr toRelease, int delay); + DelayedRelease(Level *level, std::shared_ptr toRelease, int delay); protected: virtual bool makeStepSound(); diff --git a/Minecraft.World/DerivedLevelData.cpp b/Minecraft.World/DerivedLevelData.cpp index da3d048d..276d1c6e 100644 --- a/Minecraft.World/DerivedLevelData.cpp +++ b/Minecraft.World/DerivedLevelData.cpp @@ -17,7 +17,7 @@ CompoundTag *DerivedLevelData::createTag() return wrapped->createTag(); } -CompoundTag *DerivedLevelData::createTag(vector > *players) +CompoundTag *DerivedLevelData::createTag(vector > *players) { return wrapped->createTag(players); } diff --git a/Minecraft.World/DerivedLevelData.h b/Minecraft.World/DerivedLevelData.h index db5a72d2..f5b263db 100644 --- a/Minecraft.World/DerivedLevelData.h +++ b/Minecraft.World/DerivedLevelData.h @@ -15,7 +15,7 @@ protected: public: CompoundTag *createTag(); - CompoundTag *createTag(vector > *players); + CompoundTag *createTag(vector > *players); int64_t getSeed(); int getXSpawn(); int getYSpawn(); diff --git a/Minecraft.World/DetectorRailTile.cpp b/Minecraft.World/DetectorRailTile.cpp index e01ec259..bec7b16c 100644 --- a/Minecraft.World/DetectorRailTile.cpp +++ b/Minecraft.World/DetectorRailTile.cpp @@ -23,7 +23,7 @@ bool DetectorRailTile::isSignalSource() return true; } -void DetectorRailTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void DetectorRailTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { if (level->isClientSide) { @@ -69,7 +69,7 @@ void DetectorRailTile::checkPressed(Level *level, int x, int y, int z, int curre bool shouldBePressed = false; float b = 2 / 16.0f; - vector > *entities = level->getEntitiesOfClass(typeid(Minecart), AABB::newTemp(x + b, y, z + b, x + 1 - b, y + 1 - b, z + 1 - b)); + vector > *entities = level->getEntitiesOfClass(typeid(Minecart), AABB::newTemp(x + b, y, z + b, x + 1 - b, y + 1 - b, z + 1 - b)); if (!entities->empty()) { shouldBePressed = true; diff --git a/Minecraft.World/DetectorRailTile.h b/Minecraft.World/DetectorRailTile.h index dd0e6374..1dcca19b 100644 --- a/Minecraft.World/DetectorRailTile.h +++ b/Minecraft.World/DetectorRailTile.h @@ -16,7 +16,7 @@ public: DetectorRailTile(int id); virtual int getTickDelay(); virtual bool isSignalSource(); - virtual void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + virtual void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); virtual void tick(Level *level, int x, int y, int z, Random *random); virtual bool getSignal(LevelSource *level, int x, int y, int z, int dir); virtual bool getDirectSignal(Level *level, int x, int y, int z, int facing); diff --git a/Minecraft.World/DigDurabilityEnchantment.cpp b/Minecraft.World/DigDurabilityEnchantment.cpp index f2ef1656..6670371b 100644 --- a/Minecraft.World/DigDurabilityEnchantment.cpp +++ b/Minecraft.World/DigDurabilityEnchantment.cpp @@ -22,13 +22,13 @@ int DigDurabilityEnchantment::getMaxLevel() return 3; } -bool DigDurabilityEnchantment::canEnchant(shared_ptr item) +bool DigDurabilityEnchantment::canEnchant(std::shared_ptr item) { if (item->isDamageableItem()) return true; return Enchantment::canEnchant(item); } -bool DigDurabilityEnchantment::shouldIgnoreDurabilityDrop(shared_ptr item, int level, Random *random) +bool DigDurabilityEnchantment::shouldIgnoreDurabilityDrop(std::shared_ptr item, int level, Random *random) { ArmorItem *armor = dynamic_cast(item->getItem()); if (armor && random->nextFloat() < 0.6f) return false; diff --git a/Minecraft.World/DigDurabilityEnchantment.h b/Minecraft.World/DigDurabilityEnchantment.h index 88f6447d..4751f3fe 100644 --- a/Minecraft.World/DigDurabilityEnchantment.h +++ b/Minecraft.World/DigDurabilityEnchantment.h @@ -10,6 +10,6 @@ public: virtual int getMinCost(int level); virtual int getMaxCost(int level); virtual int getMaxLevel(); - virtual bool canEnchant(shared_ptr item); - static bool shouldIgnoreDurabilityDrop(shared_ptr item, int level, Random *random); + virtual bool canEnchant(std::shared_ptr item); + static bool shouldIgnoreDurabilityDrop(std::shared_ptr item, int level, Random *random); }; \ No newline at end of file diff --git a/Minecraft.World/DiggerItem.cpp b/Minecraft.World/DiggerItem.cpp index 144b1a11..00d06b22 100644 --- a/Minecraft.World/DiggerItem.cpp +++ b/Minecraft.World/DiggerItem.cpp @@ -14,27 +14,27 @@ DiggerItem::DiggerItem(int id, int attackDamage, const Tier *tier, TileArray *ti this->attackDamage = attackDamage + tier->getAttackDamageBonus(); } -float DiggerItem::getDestroySpeed(shared_ptr itemInstance, Tile *tile) +float DiggerItem::getDestroySpeed(std::shared_ptr itemInstance, Tile *tile) { for (unsigned int i = 0; i < tiles->length; i++) if ( (*tiles)[i] == tile) return speed; return 1; } -bool DiggerItem::hurtEnemy(shared_ptr itemInstance, shared_ptr mob, shared_ptr attacker) +bool DiggerItem::hurtEnemy(std::shared_ptr itemInstance, std::shared_ptr mob, std::shared_ptr attacker) { itemInstance->hurt(2, attacker); return true; } -bool DiggerItem::mineBlock(shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr owner) +bool DiggerItem::mineBlock(std::shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, std::shared_ptr owner) { // Don't damage tools if the tile can be destroyed in one hit. if (Tile::tiles[tile]->getDestroySpeed(level, x, y, z) != 0.0) itemInstance->hurt(1, owner); return true; } -int DiggerItem::getAttackDamage(shared_ptr entity) +int DiggerItem::getAttackDamage(std::shared_ptr entity) { return attackDamage; } @@ -54,7 +54,7 @@ const Item::Tier *DiggerItem::getTier() return tier; } -bool DiggerItem::isValidRepairItem(shared_ptr source, shared_ptr repairItem) +bool DiggerItem::isValidRepairItem(std::shared_ptr source, std::shared_ptr repairItem) { if (tier->getTierItemId() == repairItem->id) { diff --git a/Minecraft.World/DiggerItem.h b/Minecraft.World/DiggerItem.h index 4a4eeb07..747c755f 100644 --- a/Minecraft.World/DiggerItem.h +++ b/Minecraft.World/DiggerItem.h @@ -19,13 +19,13 @@ protected: DiggerItem(int id, int attackDamage, const Tier *tier, TileArray *tiles); public: - virtual float getDestroySpeed(shared_ptr itemInstance, Tile *tile); - virtual bool hurtEnemy(shared_ptr itemInstance, shared_ptr mob, shared_ptr attacker); - virtual bool mineBlock(shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr owner); - virtual int getAttackDamage(shared_ptr entity); + virtual float getDestroySpeed(std::shared_ptr itemInstance, Tile *tile); + virtual bool hurtEnemy(std::shared_ptr itemInstance, std::shared_ptr mob, std::shared_ptr attacker); + virtual bool mineBlock(std::shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, std::shared_ptr owner); + virtual int getAttackDamage(std::shared_ptr entity); virtual bool isHandEquipped(); virtual int getEnchantmentValue(); const Tier *getTier(); - bool isValidRepairItem(shared_ptr source, shared_ptr repairItem); + bool isValidRepairItem(std::shared_ptr source, std::shared_ptr repairItem); }; \ No newline at end of file diff --git a/Minecraft.World/DiggingEnchantment.cpp b/Minecraft.World/DiggingEnchantment.cpp index b3775623..f6cbcad0 100644 --- a/Minecraft.World/DiggingEnchantment.cpp +++ b/Minecraft.World/DiggingEnchantment.cpp @@ -22,7 +22,7 @@ int DiggingEnchantment::getMaxLevel() return 5; } -bool DiggingEnchantment::canEnchant(shared_ptr item) +bool DiggingEnchantment::canEnchant(std::shared_ptr item) { if (item->getItem()->id == Item::shears_Id) return true; return Enchantment::canEnchant(item); diff --git a/Minecraft.World/DiggingEnchantment.h b/Minecraft.World/DiggingEnchantment.h index 324f5cdd..48b0fb0b 100644 --- a/Minecraft.World/DiggingEnchantment.h +++ b/Minecraft.World/DiggingEnchantment.h @@ -10,5 +10,5 @@ public: virtual int getMinCost(int level); virtual int getMaxCost(int level); virtual int getMaxLevel(); - virtual bool canEnchant(shared_ptr item); + virtual bool canEnchant(std::shared_ptr item); }; \ No newline at end of file diff --git a/Minecraft.World/DiodeTile.cpp b/Minecraft.World/DiodeTile.cpp index c28778d3..748e1a1d 100644 --- a/Minecraft.World/DiodeTile.cpp +++ b/Minecraft.World/DiodeTile.cpp @@ -163,7 +163,7 @@ bool DiodeTile::getSourceSignal(Level *level, int x, int y, int z, int data) case Direction::EAST: return level->getSignal(x + 1, y, z, Facing::EAST) || (level->getTile(x + 1, y, z) == Tile::redStoneDust_Id && level->getData(x + 1, y, z) > 0); case Direction::WEST: - return level->getSignal(x - 1, y, z, Facing::WEST) || (level->getTile(x - 1, y, z) == Tile::redStoneDust_Id && level->getData(x - 1, y, z) > 0); + return level->getSignal(x - 1, y, z, Facing::WEST) || (level->getTile(x - 1, y, z) == Tile::redStoneDust_Id && level->getData(x - 1, y, z) > 0); } return false; } @@ -174,7 +174,7 @@ bool DiodeTile::TestUse() return true; } -bool DiodeTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool DiodeTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly) return false; @@ -191,7 +191,7 @@ bool DiodeTile::isSignalSource() return true; } -void DiodeTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void DiodeTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int dir = (((Mth::floor(by->yRot * 4 / (360) + 0.5)) & 3) + 2) % 4; level->setData(x, y, z, dir); diff --git a/Minecraft.World/DiodeTile.h b/Minecraft.World/DiodeTile.h index 003b011f..ff3b7e88 100644 --- a/Minecraft.World/DiodeTile.h +++ b/Minecraft.World/DiodeTile.h @@ -38,9 +38,9 @@ private: virtual bool getSourceSignal(Level *level, int x, int y, int z, int data); public: virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param virtual bool isSignalSource(); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); virtual void onPlace(Level *level, int x, int y, int z); virtual void destroy(Level *level, int x, int y, int z, int data); virtual bool isSolidRender(bool isServerLevel = false); diff --git a/Minecraft.World/DirectoryLevelStorage.cpp b/Minecraft.World/DirectoryLevelStorage.cpp index 5a1dfc0a..210ddf87 100644 --- a/Minecraft.World/DirectoryLevelStorage.cpp +++ b/Minecraft.World/DirectoryLevelStorage.cpp @@ -347,7 +347,7 @@ LevelData *DirectoryLevelStorage::prepareLevel() return NULL; } -void DirectoryLevelStorage::saveLevelData(LevelData *levelData, vector > *players) +void DirectoryLevelStorage::saveLevelData(LevelData *levelData, vector > *players) { // 4J Jev, removed try/catch @@ -381,7 +381,7 @@ void DirectoryLevelStorage::saveLevelData(LevelData *levelData) delete root; } -void DirectoryLevelStorage::save(shared_ptr player) +void DirectoryLevelStorage::save(std::shared_ptr player) { // 4J Jev, removed try/catch. PlayerUID playerXuid = player->getXuid(); @@ -429,7 +429,7 @@ void DirectoryLevelStorage::save(shared_ptr player) } // 4J Changed return val to bool to check if new player or loaded player -bool DirectoryLevelStorage::load(shared_ptr player) +bool DirectoryLevelStorage::load(std::shared_ptr player) { bool newPlayer = true; CompoundTag *tag = loadPlayerDataTag( player->getXuid() ); @@ -738,7 +738,7 @@ void DirectoryLevelStorage::dontSaveMapMappingForPlayer(PlayerUID xuid) #endif } -void DirectoryLevelStorage::deleteMapFilesForPlayer(shared_ptr player) +void DirectoryLevelStorage::deleteMapFilesForPlayer(std::shared_ptr player) { PlayerUID playerXuid = player->getXuid(); if(playerXuid != INVALID_XUID) deleteMapFilesForPlayer(playerXuid); diff --git a/Minecraft.World/DirectoryLevelStorage.h b/Minecraft.World/DirectoryLevelStorage.h index e47769d9..335dc0a6 100644 --- a/Minecraft.World/DirectoryLevelStorage.h +++ b/Minecraft.World/DirectoryLevelStorage.h @@ -119,10 +119,10 @@ public: void checkSession(); virtual ChunkStorage *createChunkStorage(Dimension *dimension); LevelData *prepareLevel(); - virtual void saveLevelData(LevelData *levelData, vector > *players); + virtual void saveLevelData(LevelData *levelData, vector > *players); virtual void saveLevelData(LevelData *levelData); - virtual void save(shared_ptr player); - virtual bool load(shared_ptr player); // 4J Changed return val to bool to check if new player or loaded player + virtual void save(std::shared_ptr player); + virtual bool load(std::shared_ptr player); // 4J Changed return val to bool to check if new player or loaded player virtual CompoundTag *loadPlayerDataTag(PlayerUID xuid); virtual void clearOldPlayerFiles(); // 4J Added PlayerIO *getPlayerIO(); @@ -133,7 +133,7 @@ public: // 4J Added virtual int getAuxValueForMap(PlayerUID xuid, int dimension, int centreXC, int centreZC, int scale); virtual void saveMapIdLookup(); - virtual void deleteMapFilesForPlayer(shared_ptr player); + virtual void deleteMapFilesForPlayer(std::shared_ptr player); virtual void saveAllCachedData(); void resetNetherPlayerPositions(); // 4J Added static wstring getPlayerDir() { return sc_szPlayerDir; } diff --git a/Minecraft.World/DirectoryLevelStorageSource.cpp b/Minecraft.World/DirectoryLevelStorageSource.cpp index b4beb8b5..ecc49014 100644 --- a/Minecraft.World/DirectoryLevelStorageSource.cpp +++ b/Minecraft.World/DirectoryLevelStorageSource.cpp @@ -27,12 +27,12 @@ vector *DirectoryLevelStorageSource::getLevelList() // 4J Stu - We don't use directory list with the Xbox save locations vector *levels = new vector; #if 0 - for (int i = 0; i < 5; i++) + for (int i = 0; i < 5; i++) { wstring levelId = wstring(L"World").append( _toString( (i+1) ) ); LevelData *levelData = getDataTagFor(saveFile, levelId); - if (levelData != NULL) + if (levelData != NULL) { levels->push_back(new LevelSummary(levelId, L"", levelData->getLastPlayed(), levelData->getSizeOnDisk(), levelData.getGameType(), false, levelData->isHardcore())); } @@ -45,7 +45,7 @@ void DirectoryLevelStorageSource::clearAll() { } -LevelData *DirectoryLevelStorageSource::getDataTagFor(ConsoleSaveFile *saveFile, const wstring& levelId) +LevelData *DirectoryLevelStorageSource::getDataTagFor(ConsoleSaveFile *saveFile, const wstring& levelId) { //File dataFile(dir, L"level.dat"); ConsoleSavePath dataFile = ConsoleSavePath( wstring( L"level.dat" ) ); @@ -63,12 +63,12 @@ LevelData *DirectoryLevelStorageSource::getDataTagFor(ConsoleSaveFile *saveFile, } void DirectoryLevelStorageSource::renameLevel(const wstring& levelId, const wstring& newLevelName) -{ +{ ConsoleSaveFileOriginal tempSave(levelId); //File dataFile = File(dir, L"level.dat"); ConsoleSavePath dataFile = ConsoleSavePath( wstring( L"level.dat" ) ); - if ( tempSave.doesFileExist( dataFile ) ) + if ( tempSave.doesFileExist( dataFile ) ) { ConsoleSaveFileInputStream fis = ConsoleSaveFileInputStream(&tempSave, dataFile); CompoundTag *root = NbtIo::readCompressed(&fis); @@ -80,7 +80,7 @@ void DirectoryLevelStorageSource::renameLevel(const wstring& levelId, const wstr } } -bool DirectoryLevelStorageSource::isNewLevelIdAcceptable(const wstring& levelId) +bool DirectoryLevelStorageSource::isNewLevelIdAcceptable(const wstring& levelId) { // 4J Jev, removed try/catch. @@ -95,7 +95,7 @@ bool DirectoryLevelStorageSource::isNewLevelIdAcceptable(const wstring& levelId) return true; } -void DirectoryLevelStorageSource::deleteLevel(const wstring& levelId) +void DirectoryLevelStorageSource::deleteLevel(const wstring& levelId) { File dir = File(baseDir, levelId); if (!dir.exists()) return; @@ -110,7 +110,7 @@ void DirectoryLevelStorageSource::deleteRecursive(vector *files) for (AUTO_VAR(it, files->begin()); it != itEnd; it++) { File *file = *it; - if (file->isDirectory()) + if (file->isDirectory()) { deleteRecursive(file->listFiles()); } @@ -118,9 +118,9 @@ void DirectoryLevelStorageSource::deleteRecursive(vector *files) } } -shared_ptr DirectoryLevelStorageSource::selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir) +std::shared_ptr DirectoryLevelStorageSource::selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir) { - return shared_ptr (new DirectoryLevelStorage(saveFile, baseDir, levelId, createPlayerDir)); + return std::shared_ptr (new DirectoryLevelStorage(saveFile, baseDir, levelId, createPlayerDir)); } bool DirectoryLevelStorageSource::isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId) @@ -133,7 +133,7 @@ bool DirectoryLevelStorageSource::requiresConversion(ConsoleSaveFile *saveFile, return false; } -bool DirectoryLevelStorageSource::convertLevel(ConsoleSaveFile *saveFile, const wstring& levelId, ProgressListener *progress) +bool DirectoryLevelStorageSource::convertLevel(ConsoleSaveFile *saveFile, const wstring& levelId, ProgressListener *progress) { return false; } diff --git a/Minecraft.World/DirectoryLevelStorageSource.h b/Minecraft.World/DirectoryLevelStorageSource.h index 9f6069ab..e6aab76d 100644 --- a/Minecraft.World/DirectoryLevelStorageSource.h +++ b/Minecraft.World/DirectoryLevelStorageSource.h @@ -8,7 +8,7 @@ class ProgressListener; class LevelData; class ConsoleSaveFile; -class DirectoryLevelStorageSource : public LevelStorageSource +class DirectoryLevelStorageSource : public LevelStorageSource { protected: const File baseDir; @@ -27,7 +27,7 @@ protected: static void deleteRecursive(vector *files); public: - virtual shared_ptr selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir); + virtual std::shared_ptr selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir); virtual bool isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId); virtual bool requiresConversion(ConsoleSaveFile *saveFile, const wstring& levelId); virtual bool convertLevel(ConsoleSaveFile *saveFile, const wstring& levelId, ProgressListener *progress); diff --git a/Minecraft.World/DisconnectPacket.cpp b/Minecraft.World/DisconnectPacket.cpp index da20686a..cb018200 100644 --- a/Minecraft.World/DisconnectPacket.cpp +++ b/Minecraft.World/DisconnectPacket.cpp @@ -32,7 +32,7 @@ void DisconnectPacket::handle(PacketListener *listener) listener->handleDisconnect(shared_from_this()); } -int DisconnectPacket::getEstimatedSize() +int DisconnectPacket::getEstimatedSize() { return sizeof(eDisconnectReason); } @@ -42,7 +42,7 @@ bool DisconnectPacket::canBeInvalidated() return true; } -bool DisconnectPacket::isInvalidatedBy(shared_ptr packet) +bool DisconnectPacket::isInvalidatedBy(std::shared_ptr packet) { return true; } \ No newline at end of file diff --git a/Minecraft.World/DisconnectPacket.h b/Minecraft.World/DisconnectPacket.h index 34983754..e2815c2c 100644 --- a/Minecraft.World/DisconnectPacket.h +++ b/Minecraft.World/DisconnectPacket.h @@ -63,10 +63,10 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new DisconnectPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new DisconnectPacket()); } virtual int getId() { return 255; } }; diff --git a/Minecraft.World/DispenserTile.cpp b/Minecraft.World/DispenserTile.cpp index 286737c9..723aedc0 100644 --- a/Minecraft.World/DispenserTile.cpp +++ b/Minecraft.World/DispenserTile.cpp @@ -98,7 +98,7 @@ bool DispenserTile::TestUse() return true; } -bool DispenserTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool DispenserTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly) return false; @@ -107,7 +107,7 @@ bool DispenserTile::use(Level *level, int x, int y, int z, shared_ptr pl return true; } - shared_ptr trap = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr trap = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); player->openTrap(trap); return true; @@ -138,7 +138,7 @@ void DispenserTile::fireArrow(Level *level, int x, int y, int z, Random *random) xd = -1; } - shared_ptr trap = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr trap = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if(trap != NULL) { int slot=trap->getRandomSlot(); @@ -152,7 +152,7 @@ void DispenserTile::fireArrow(Level *level, int x, int y, int z, Random *random) double xp = x + xd * 0.6 + 0.5; double yp = y + 0.5; double zp = z + zd * 0.6 + 0.5; - shared_ptr item=trap->getItem(slot); + std::shared_ptr item=trap->getItem(slot); int result = dispenseItem(trap, level, item, random, x, y, z, xd, zd, xp, yp, zp); if (result == REMOVE_ITEM) { @@ -190,12 +190,12 @@ void DispenserTile::tick(Level *level, int x, int y, int z, Random *random) } } -shared_ptr DispenserTile::newTileEntity(Level *level) +std::shared_ptr DispenserTile::newTileEntity(Level *level) { - return shared_ptr( new DispenserTileEntity() ); + return std::shared_ptr( new DispenserTileEntity() ); } -void DispenserTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void DispenserTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int dir = (Mth::floor(by->yRot * 4 / (360) + 0.5)) & 3; @@ -207,12 +207,12 @@ void DispenserTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if (container != NULL ) { for (unsigned int i = 0; i < container->getContainerSize(); i++) { - shared_ptr item = container->getItem(i); + std::shared_ptr item = container->getItem(i); if (item != NULL) { float xo = random->nextFloat() * 0.8f + 0.1f; @@ -225,9 +225,9 @@ void DispenserTile::onRemove(Level *level, int x, int y, int z, int id, int data if (count > item->count) count = item->count; item->count -= count; - shared_ptr newItem = shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ); + std::shared_ptr newItem = std::shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ); newItem->set4JData( item->get4JData() ); - shared_ptr itemEntity = shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, newItem ) ); + std::shared_ptr itemEntity = std::shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, newItem ) ); float pow = 0.05f; itemEntity->xd = (float) random->nextGaussian() * pow; itemEntity->yd = (float) random->nextGaussian() * pow + 0.2f; @@ -247,9 +247,9 @@ void DispenserTile::onRemove(Level *level, int x, int y, int z, int id, int data EntityTile::onRemove(level, x, y, z, id, data); } -void DispenserTile::throwItem(Level *level, shared_ptr item, Random *random, int accuracy, int xd, int zd, double xp, double yp, double zp) +void DispenserTile::throwItem(Level *level, std::shared_ptr item, Random *random, int accuracy, int xd, int zd, double xp, double yp, double zp) { - shared_ptr itemEntity = shared_ptr(new ItemEntity(level, xp, yp - 0.3, zp, item)); + std::shared_ptr itemEntity = std::shared_ptr(new ItemEntity(level, xp, yp - 0.3, zp, item)); double pow = random->nextDouble() * 0.1 + 0.2; itemEntity->xd = xd * pow; @@ -263,7 +263,7 @@ void DispenserTile::throwItem(Level *level, shared_ptr item, Rando level->addEntity(itemEntity); } -int DispenserTile::dispenseItem(shared_ptr trap, Level *level, shared_ptr item, Random *random, int x, int y, int z, int xd, int zd, double xp, double yp, double zp) +int DispenserTile::dispenseItem(std::shared_ptr trap, Level *level, std::shared_ptr item, Random *random, int x, int y, int z, int xd, int zd, double xp, double yp, double zp) { float power = 1.1f; int accuracy = 6; @@ -276,7 +276,7 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev int currentProjectiles = level->countInstanceOf(eTYPE_PROJECTILE,false); if(currentProjectiles < Level::MAX_DISPENSABLE_PROJECTILES) // 4J - added limit { - shared_ptr arrow = shared_ptr( new Arrow(level, xp, yp, zp) ); + std::shared_ptr arrow = std::shared_ptr( new Arrow(level, xp, yp, zp) ); arrow->shoot(xd, .1f, zd, power, (float) accuracy); arrow->pickup = Arrow::PICKUP_ALLOWED; level->addEntity(arrow); @@ -291,14 +291,14 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev // not sending a message here, since we will probably get flooded with them when people have automatic dispensers for spawn eggs return LEAVE_ITEM; } - } + } break; case Item::egg_Id: { int currentProjectiles = level->countInstanceOf(eTYPE_PROJECTILE,false); if(currentProjectiles < Level::MAX_DISPENSABLE_PROJECTILES) // 4J - added limit { - shared_ptr egg = shared_ptr( new ThrownEgg(level, xp, yp, zp) ); + std::shared_ptr egg = std::shared_ptr( new ThrownEgg(level, xp, yp, zp) ); egg->shoot(xd, .1f, zd, power, (float) accuracy); level->addEntity(egg); level->levelEvent(LevelEvent::SOUND_LAUNCH, x, y, z, 0); @@ -319,7 +319,7 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev int currentProjectiles = level->countInstanceOf(eTYPE_PROJECTILE,false); if(currentProjectiles < Level::MAX_DISPENSABLE_PROJECTILES) // 4J - added limit { - shared_ptr snowball = shared_ptr( new Snowball(level, xp, yp, zp) ); + std::shared_ptr snowball = std::shared_ptr( new Snowball(level, xp, yp, zp) ); snowball->shoot(xd, .1f, zd, power, (float) accuracy); level->addEntity(snowball); level->levelEvent(LevelEvent::SOUND_LAUNCH, x, y, z, 0); @@ -342,14 +342,14 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev { if(PotionItem::isThrowable(item->getAuxValue())) { - shared_ptr potion = shared_ptr(new ThrownPotion(level, xp, yp, zp, item->getAuxValue())); + std::shared_ptr potion = std::shared_ptr(new ThrownPotion(level, xp, yp, zp, item->getAuxValue())); potion->shoot(xd, .1f, zd, power * 1.25f, accuracy * .5f); level->addEntity(potion); level->levelEvent(LevelEvent::SOUND_LAUNCH, x, y, z, 0); } else { - shared_ptr itemEntity = shared_ptr( new ItemEntity(level, xp, yp - 0.3, zp, item) ); + std::shared_ptr itemEntity = std::shared_ptr( new ItemEntity(level, xp, yp - 0.3, zp, item) ); double pow = random->nextDouble() * 0.1 + 0.2; itemEntity->xd = xd * pow; @@ -362,7 +362,7 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev level->addEntity(itemEntity); level->levelEvent(LevelEvent::SOUND_CLICK, x, y, z, 0); - } + } return REMOVE_ITEM; } else @@ -380,7 +380,7 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev int currentProjectiles = level->countInstanceOf(eTYPE_PROJECTILE,false); if(currentProjectiles < Level::MAX_DISPENSABLE_PROJECTILES) // 4J - added limit { - shared_ptr expBottle = shared_ptr( new ThrownExpBottle(level, xp, yp, zp) ); + std::shared_ptr expBottle = std::shared_ptr( new ThrownExpBottle(level, xp, yp, zp) ); expBottle->shoot(xd, .1f, zd, power * 1.25f, accuracy * .5f); level->addEntity(expBottle); level->levelEvent(LevelEvent::SOUND_LAUNCH, x, y, z, 0); @@ -394,14 +394,14 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev // not sending a message here, since we will probably get flooded with them when people have automatic dispensers for spawn eggs return LEAVE_ITEM; } - } + } break; case Item::fireball_Id: // TU9 { int currentFireballs = level->countInstanceOf(eTYPE_SMALL_FIREBALL,true); if(currentFireballs < Level::MAX_DISPENSABLE_FIREBALLS) // 4J - added limit { - shared_ptr fireball = shared_ptr( new SmallFireball(level, xp + xd * .3, yp, zp + zd * .3, xd + random->nextGaussian() * .05, random->nextGaussian() * .05, zd + random->nextGaussian() * .05)); + std::shared_ptr fireball = std::shared_ptr( new SmallFireball(level, xp + xd * .3, yp, zp + zd * .3, xd + random->nextGaussian() * .05, random->nextGaussian() * .05, zd + random->nextGaussian() * .05)); level->addEntity(fireball); level->levelEvent(LevelEvent::SOUND_BLAZE_FIREBALL, x, y, z, 0); return REMOVE_ITEM; @@ -414,21 +414,21 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev // not sending a message here, since we will probably get flooded with them when people have automatic dispensers for spawn eggs return LEAVE_ITEM; } - } + } break; case Item::monsterPlacer_Id: { int iResult=0; //MonsterPlacerItem *spawnEgg = (MonsterPlacerItem *)item->getItem(); - shared_ptr newEntity = MonsterPlacerItem::canSpawn(item->getAuxValue(), level,&iResult); - - shared_ptr mob = dynamic_pointer_cast(newEntity); + std::shared_ptr newEntity = MonsterPlacerItem::canSpawn(item->getAuxValue(), level,&iResult); + + std::shared_ptr mob = dynamic_pointer_cast(newEntity); if (mob != NULL) - { + { // 4J-PB - Changed the line below slightly since mobs were sticking to the dispenser rather than dropping down when fired mob->moveTo(xp + xd * 0.4, yp - 0.3, zp + zd * 0.4, level->random->nextFloat() * 360, 0); mob->finalizeMobSpawn(); - level->addEntity(mob); + level->addEntity(mob); level->levelEvent(LevelEvent::SOUND_LAUNCH, x, y, z, 0); return REMOVE_ITEM; } @@ -447,7 +447,7 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev { BucketItem *pBucket = (BucketItem *) item->getItem(); - if (pBucket->emptyBucket(level, x, y, z, x + xd, y, z + zd)) + if (pBucket->emptyBucket(level, x, y, z, x + xd, y, z + zd)) { item->id = Item::bucket_empty_Id; item->count = 1; @@ -472,9 +472,9 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev item->id = Item::bucket_water_Id; item->count = 1; } - else if (trap->addItem(shared_ptr(new ItemInstance(Item::bucket_water))) < 0) + else if (trap->addItem(std::shared_ptr(new ItemInstance(Item::bucket_water))) < 0) { - throwItem(level, shared_ptr(new ItemInstance(Item::bucket_water)), random, 6, xd, zd, xp, yp, zp); + throwItem(level, std::shared_ptr(new ItemInstance(Item::bucket_water)), random, 6, xd, zd, xp, yp, zp); } return LEAVE_ITEM; @@ -488,9 +488,9 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev item->id = Item::bucket_lava_Id; item->count = 1; } - else if (trap->addItem(shared_ptr(new ItemInstance(Item::bucket_lava))) < 0) + else if (trap->addItem(std::shared_ptr(new ItemInstance(Item::bucket_lava))) < 0) { - throwItem(level, shared_ptr(new ItemInstance(Item::bucket_lava)), random, 6, xd, zd, xp, yp, zp); + throwItem(level, std::shared_ptr(new ItemInstance(Item::bucket_lava)), random, 6, xd, zd, xp, yp, zp); } return LEAVE_ITEM; @@ -507,22 +507,22 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev xp = x + (xd < 0 ? xd * 0.8 : xd * 1.8f) + Mth::abs(zd) * 0.5f; zp = z + (zd < 0 ? zd * 0.8 : zd * 1.8f) + Mth::abs(xd) * 0.5f; - if (RailTile::isRail(level, x + xd, y, z + zd)) + if (RailTile::isRail(level, x + xd, y, z + zd)) { yp = y + 0.5f; - } - else if (level->isEmptyTile(x + xd, y, z + zd) && RailTile::isRail(level, x + xd, y - 1, z + zd)) + } + else if (level->isEmptyTile(x + xd, y, z + zd) && RailTile::isRail(level, x + xd, y - 1, z + zd)) { yp = y - 0.5f; - } - else + } + else { return DISPENSE_ITEM; } if( level->countInstanceOf(eTYPE_MINECART, true) < Level::MAX_CONSOLE_MINECARTS ) // 4J - added limit { - shared_ptr minecart = shared_ptr(new Minecart(level, xp, yp, zp, ((MinecartItem *) item->getItem())->type)); + std::shared_ptr minecart = std::shared_ptr(new Minecart(level, xp, yp, zp, ((MinecartItem *) item->getItem())->type)); level->addEntity(minecart); level->levelEvent(LevelEvent::SOUND_CLICK, x, y, z, 0); @@ -542,21 +542,21 @@ int DispenserTile::dispenseItem(shared_ptr trap, Level *lev xp = x + (xd < 0 ? xd * 0.8 : xd * 1.8f) + Mth::abs(zd) * 0.5f; zp = z + (zd < 0 ? zd * 0.8 : zd * 1.8f) + Mth::abs(xd) * 0.5f; - if (level->getMaterial(x + xd, y, z + zd) == Material::water) + if (level->getMaterial(x + xd, y, z + zd) == Material::water) { bLaunchBoat=true; yp = y + 1.0f; - } - else if (level->isEmptyTile(x + xd, y, z + zd) && level->getMaterial(x + xd, y - 1, z + zd) == Material::water) + } + else if (level->isEmptyTile(x + xd, y, z + zd) && level->getMaterial(x + xd, y - 1, z + zd) == Material::water) { bLaunchBoat=true; yp = y; - } + } // check the limit on boats if( bLaunchBoat && level->countInstanceOf(eTYPE_BOAT, true) < Level::MAX_XBOX_BOATS ) // 4J - added limit { - shared_ptr boat = shared_ptr(new Boat(level, xp, yp, zp)); + std::shared_ptr boat = std::shared_ptr(new Boat(level, xp, yp, zp)); level->addEntity(boat); level->levelEvent(LevelEvent::SOUND_CLICK, x, y, z, 0); return REMOVE_ITEM; diff --git a/Minecraft.World/DispenserTile.h b/Minecraft.World/DispenserTile.h index 5bc892aa..f693c5fa 100644 --- a/Minecraft.World/DispenserTile.h +++ b/Minecraft.World/DispenserTile.h @@ -40,7 +40,7 @@ public: //@Override void registerIcons(IconRegister *iconRegister); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param private: void fireArrow(Level *level, int x, int y, int z, Random *random); @@ -48,11 +48,11 @@ private: public: virtual void neighborChanged(Level *level, int x, int y, int z, int type); virtual void tick(Level *level, int x, int y, int z, Random *random); - virtual shared_ptr newTileEntity(Level *level); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + virtual std::shared_ptr newTileEntity(Level *level); + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); virtual void onRemove(Level *level, int x, int y, int z, int id, int data); private: - static void throwItem(Level *level, shared_ptr item, Random *random, int accuracy, int xd, int zd, double xp, double yp, double zp); - static int dispenseItem(shared_ptr trap, Level *level, shared_ptr item, Random *random, int x, int y, int z, int xd, int zd, double xp, double yp, double zp); + static void throwItem(Level *level, std::shared_ptr item, Random *random, int accuracy, int xd, int zd, double xp, double yp, double zp); + static int dispenseItem(std::shared_ptr trap, Level *level, std::shared_ptr item, Random *random, int x, int y, int z, int xd, int zd, double xp, double yp, double zp); }; \ No newline at end of file diff --git a/Minecraft.World/DispenserTileEntity.cpp b/Minecraft.World/DispenserTileEntity.cpp index 2c4705ea..f06bc4c2 100644 --- a/Minecraft.World/DispenserTileEntity.cpp +++ b/Minecraft.World/DispenserTileEntity.cpp @@ -25,32 +25,32 @@ DispenserTileEntity::~DispenserTileEntity() delete random; } -unsigned int DispenserTileEntity::getContainerSize() +unsigned int DispenserTileEntity::getContainerSize() { return 9; } -shared_ptr DispenserTileEntity::getItem(unsigned int slot) +std::shared_ptr DispenserTileEntity::getItem(unsigned int slot) { return items->data[slot]; } -shared_ptr DispenserTileEntity::removeItem(unsigned int slot, int count) +std::shared_ptr DispenserTileEntity::removeItem(unsigned int slot, int count) { if (items->data[slot] != NULL) { if (items->data[slot]->count <= count) { - shared_ptr item = items->data[slot]; + std::shared_ptr item = items->data[slot]; items->data[slot] = nullptr; this->setChanged(); // 4J Stu - Fix for duplication glitch if(item->count <= 0) return nullptr; return item; - } - else + } + else { - shared_ptr i = items->data[slot]->remove(count); + std::shared_ptr i = items->data[slot]->remove(count); if (items->data[slot]->count == 0) items->data[slot] = nullptr; this->setChanged(); // 4J Stu - Fix for duplication glitch @@ -61,11 +61,11 @@ shared_ptr DispenserTileEntity::removeItem(unsigned int slot, int return nullptr; } -shared_ptr DispenserTileEntity::removeItemNoUpdate(int slot) +std::shared_ptr DispenserTileEntity::removeItemNoUpdate(int slot) { if (items->data[slot] != NULL) { - shared_ptr item = items->data[slot]; + std::shared_ptr item = items->data[slot]; items->data[slot] = nullptr; return item; } @@ -73,7 +73,7 @@ shared_ptr DispenserTileEntity::removeItemNoUpdate(int slot) } // 4J-PB added for spawn eggs not being useable due to limits, so add them in again -void DispenserTileEntity::AddItemBack(shared_ptritem, unsigned int slot) +void DispenserTileEntity::AddItemBack(std::shared_ptritem, unsigned int slot) { if (items->data[slot] != NULL) { @@ -82,7 +82,7 @@ void DispenserTileEntity::AddItemBack(shared_ptritem, unsigned int { items->data[slot]->count++; this->setChanged(); - } + } } else { @@ -93,7 +93,7 @@ void DispenserTileEntity::AddItemBack(shared_ptritem, unsigned int } /** * Removes an item with the given id and returns true if one was found. -* +* * @param itemId * @return */ @@ -103,7 +103,7 @@ bool DispenserTileEntity::removeProjectile(int itemId) { if (items->data[i] != NULL && items->data[i]->id == itemId) { - shared_ptr removedItem = removeItem(i, 1); + std::shared_ptr removedItem = removeItem(i, 1); return removedItem != NULL; } } @@ -116,7 +116,7 @@ int DispenserTileEntity::getRandomSlot() int replaceOdds = 1; for (unsigned int i = 0; i < items->length; i++) { - if (items->data[i] != NULL && random->nextInt(replaceOdds++) == 0) + if (items->data[i] != NULL && random->nextInt(replaceOdds++) == 0) { replaceSlot = i; } @@ -125,14 +125,14 @@ int DispenserTileEntity::getRandomSlot() return replaceSlot; } -void DispenserTileEntity::setItem(unsigned int slot, shared_ptr item) +void DispenserTileEntity::setItem(unsigned int slot, std::shared_ptr item) { items->data[slot] = item; if (item != NULL && item->count > getMaxStackSize()) item->count = getMaxStackSize(); this->setChanged(); } -int DispenserTileEntity::addItem(shared_ptr item) +int DispenserTileEntity::addItem(std::shared_ptr item) { for (int i = 0; i < items->length; i++) { @@ -146,7 +146,7 @@ int DispenserTileEntity::addItem(shared_ptr item) return -1; } -int DispenserTileEntity::getName() +int DispenserTileEntity::getName() { return IDS_TILE_DISPENSER; } @@ -169,7 +169,7 @@ void DispenserTileEntity::save(CompoundTag *base) TileEntity::save(base); ListTag *listTag = new ListTag; - for (unsigned int i = 0; i < items->length; i++) + for (unsigned int i = 0; i < items->length; i++) { if (items->data[i] != NULL) { @@ -182,12 +182,12 @@ void DispenserTileEntity::save(CompoundTag *base) base->put(L"Items", listTag); } -int DispenserTileEntity::getMaxStackSize() +int DispenserTileEntity::getMaxStackSize() { return Container::LARGE_MAX_STACK_SIZE; } -bool DispenserTileEntity::stillValid(shared_ptr player) +bool DispenserTileEntity::stillValid(std::shared_ptr player) { if (level->getTileEntity(x, y, z) != shared_from_this() ) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; @@ -208,9 +208,9 @@ void DispenserTileEntity::stopOpen() } // 4J Added -shared_ptr DispenserTileEntity::clone() +std::shared_ptr DispenserTileEntity::clone() { - shared_ptr result = shared_ptr( new DispenserTileEntity() ); + std::shared_ptr result = std::shared_ptr( new DispenserTileEntity() ); TileEntity::clone(result); for (unsigned int i = 0; i < items->length; i++) diff --git a/Minecraft.World/DispenserTileEntity.h b/Minecraft.World/DispenserTileEntity.h index 8519ad54..d7c6385a 100644 --- a/Minecraft.World/DispenserTileEntity.h +++ b/Minecraft.World/DispenserTileEntity.h @@ -29,24 +29,24 @@ public: virtual ~DispenserTileEntity(); virtual unsigned int getContainerSize(); - virtual shared_ptr getItem(unsigned int slot); - virtual shared_ptr removeItem(unsigned int slot, int count); - shared_ptr removeItemNoUpdate(int slot); + virtual std::shared_ptr getItem(unsigned int slot); + virtual std::shared_ptr removeItem(unsigned int slot, int count); + std::shared_ptr removeItemNoUpdate(int slot); bool removeProjectile(int itemId); int getRandomSlot(); - virtual void setItem(unsigned int slot, shared_ptr item); - virtual int addItem(shared_ptr item); + virtual void setItem(unsigned int slot, std::shared_ptr item); + virtual int addItem(std::shared_ptr item); virtual int getName(); virtual void load(CompoundTag *base); virtual void save(CompoundTag *base); virtual int getMaxStackSize(); - virtual bool stillValid(shared_ptr player); + virtual bool stillValid(std::shared_ptr player); virtual void setChanged(); void startOpen(); void stopOpen(); // 4J Added - virtual shared_ptr clone(); - void AddItemBack(shared_ptritem, unsigned int slot); + virtual std::shared_ptr clone(); + void AddItemBack(std::shared_ptritem, unsigned int slot); }; \ No newline at end of file diff --git a/Minecraft.World/DoorItem.cpp b/Minecraft.World/DoorItem.cpp index d59ac8d9..122b7be1 100644 --- a/Minecraft.World/DoorItem.cpp +++ b/Minecraft.World/DoorItem.cpp @@ -18,7 +18,7 @@ DoorItem::DoorItem(int id, Material *material) : Item(id) maxStackSize = 1; } -bool DoorItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool DoorItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { if (face != Facing::UP) return false; y++; diff --git a/Minecraft.World/DoorItem.h b/Minecraft.World/DoorItem.h index 843c768b..be471714 100644 --- a/Minecraft.World/DoorItem.h +++ b/Minecraft.World/DoorItem.h @@ -7,7 +7,7 @@ class Player; class Material; class Level; -class DoorItem : public Item +class DoorItem : public Item { private: Material *material; @@ -15,6 +15,6 @@ private: public: DoorItem(int id, Material *material); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); static void place(Level *level, int x, int y, int z, int dir, Tile *tile); }; diff --git a/Minecraft.World/DoorTile.cpp b/Minecraft.World/DoorTile.cpp index be31be27..9b481269 100644 --- a/Minecraft.World/DoorTile.cpp +++ b/Minecraft.World/DoorTile.cpp @@ -107,7 +107,7 @@ AABB *DoorTile::getAABB(Level *level, int x, int y, int z) return retval; } -void DoorTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void DoorTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { setShape(getCompositeData(level,x, y, z)); } @@ -167,7 +167,7 @@ void DoorTile::setShape(int compositeData) } } -void DoorTile::attack(Level *level, int x, int y, int z, shared_ptr player) +void DoorTile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { // Fix for #92957 - TU11: Content: Multiplayer: Wooden Doors splits in half and glitch in open / close motion while being mined. // In lastest PC version this is commented out, so do that now to fix bug above @@ -180,7 +180,7 @@ bool DoorTile::TestUse() return true; } -bool DoorTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool DoorTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if(soundOnly) { diff --git a/Minecraft.World/DoorTile.h b/Minecraft.World/DoorTile.h index 59a8b414..7dffe612 100644 --- a/Minecraft.World/DoorTile.h +++ b/Minecraft.World/DoorTile.h @@ -38,16 +38,16 @@ public: virtual int getRenderShape(); virtual AABB *getTileAABB(Level *level, int x, int y, int z); virtual AABB *getAABB(Level *level, int x, int y, int z); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param int getDir(LevelSource *level, int x, int y, int z); bool isOpen(LevelSource *level, int x, int y, int z); private: using Tile::setShape; virtual void setShape(int compositeData); public: - virtual void attack(Level *level, int x, int y, int z, shared_ptr player); + virtual void attack(Level *level, int x, int y, int z, std::shared_ptr player); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param void setOpen(Level *level, int x, int y, int z, bool shouldOpen); virtual void neighborChanged(Level *level, int x, int y, int z, int type); virtual int getResource(int data, Random *random, int playerBonusLevel); diff --git a/Minecraft.World/DownfallLayer.cpp b/Minecraft.World/DownfallLayer.cpp index 30775218..6d345cb5 100644 --- a/Minecraft.World/DownfallLayer.cpp +++ b/Minecraft.World/DownfallLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -DownfallLayer::DownfallLayer(shared_ptrparent) : Layer(0) +DownfallLayer::DownfallLayer(std::shared_ptrparent) : Layer(0) { this->parent = parent; } diff --git a/Minecraft.World/DownfallLayer.h b/Minecraft.World/DownfallLayer.h index e708253c..ed191b17 100644 --- a/Minecraft.World/DownfallLayer.h +++ b/Minecraft.World/DownfallLayer.h @@ -5,6 +5,6 @@ class DownfallLayer : public Layer { public: - DownfallLayer(shared_ptrparent); + DownfallLayer(std::shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/DownfallMixerLayer.cpp b/Minecraft.World/DownfallMixerLayer.cpp index fcca5bdd..34e19b27 100644 --- a/Minecraft.World/DownfallMixerLayer.cpp +++ b/Minecraft.World/DownfallMixerLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -DownfallMixerLayer::DownfallMixerLayer(shared_ptrdownfall, shared_ptrparent, int layer) : Layer(0) +DownfallMixerLayer::DownfallMixerLayer(std::shared_ptrdownfall, std::shared_ptrparent, int layer) : Layer(0) { this->parent = parent; this->downfall = downfall; diff --git a/Minecraft.World/DownfallMixerLayer.h b/Minecraft.World/DownfallMixerLayer.h index 58e6151d..c0149dce 100644 --- a/Minecraft.World/DownfallMixerLayer.h +++ b/Minecraft.World/DownfallMixerLayer.h @@ -5,10 +5,10 @@ class DownfallMixerLayer : public Layer { private: - shared_ptr downfall; + std::shared_ptr downfall; int layer; public: - DownfallMixerLayer(shared_ptr downfall, shared_ptr parent, int layer); + DownfallMixerLayer(std::shared_ptr downfall, std::shared_ptr parent, int layer); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/DragonFireball.cpp b/Minecraft.World/DragonFireball.cpp index e3b5d579..6146b8a1 100644 --- a/Minecraft.World/DragonFireball.cpp +++ b/Minecraft.World/DragonFireball.cpp @@ -17,7 +17,7 @@ DragonFireball::DragonFireball(Level *level) : Fireball(level) setSize(5 / 16.0f, 5 / 16.0f); } -DragonFireball::DragonFireball(Level *level, shared_ptr mob, double xa, double ya, double za) : Fireball(level, mob, xa, ya, za) +DragonFireball::DragonFireball(Level *level, std::shared_ptr mob, double xa, double ya, double za) : Fireball(level, mob, xa, ya, za) { setSize(5 / 16.0f, 5 / 16.0f); } @@ -32,15 +32,15 @@ void DragonFireball::onHit(HitResult *res) if (!level->isClientSide) { AABB *aoe = bb->grow(SPLASH_RANGE, SPLASH_RANGE / 2, SPLASH_RANGE); - vector > *entitiesOfClass = level->getEntitiesOfClass(typeid(Mob), aoe); + vector > *entitiesOfClass = level->getEntitiesOfClass(typeid(Mob), aoe); if (entitiesOfClass != NULL && !entitiesOfClass->empty()) { //for (Entity e : entitiesOfClass) for( AUTO_VAR(it, entitiesOfClass->begin()); it != entitiesOfClass->end(); ++it) { - //shared_ptr e = *it; - shared_ptr e = dynamic_pointer_cast( *it ); + //std::shared_ptr e = *it; + std::shared_ptr e = dynamic_pointer_cast( *it ); double dist = distanceToSqr(e); if (dist < SPLASH_RANGE_SQ) { diff --git a/Minecraft.World/DragonFireball.h b/Minecraft.World/DragonFireball.h index 9ce199ed..96ab6d9f 100644 --- a/Minecraft.World/DragonFireball.h +++ b/Minecraft.World/DragonFireball.h @@ -18,7 +18,7 @@ private: public: DragonFireball(Level *level); - DragonFireball(Level *level, shared_ptr mob, double xa, double ya, double za); + DragonFireball(Level *level, std::shared_ptr mob, double xa, double ya, double za); DragonFireball(Level *level, double x, double y, double z, double xa, double ya, double za); protected: diff --git a/Minecraft.World/DurangoStats.cpp b/Minecraft.World/DurangoStats.cpp index c9b51c84..884adf39 100644 --- a/Minecraft.World/DurangoStats.cpp +++ b/Minecraft.World/DurangoStats.cpp @@ -54,9 +54,9 @@ bool DsItemEvent::onLeaderboard(ELeaderboardId leaderboard, eAcquisitionMethod m case eAcquisitionMethod_Mined: switch (param->itemId) { - case Tile::dirt_Id: + case Tile::dirt_Id: case Tile::stoneBrick_Id: - case Tile::sand_Id: + case Tile::sand_Id: case Tile::rock_Id: case Tile::gravel_Id: case Tile::clay_Id: @@ -102,7 +102,7 @@ int DsItemEvent::mergeIds(int itemId) } } -void DsItemEvent::handleParamBlob(shared_ptr player, byteArray paramBlob) +void DsItemEvent::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { if (paramBlob.length == sizeof(Param)) { @@ -170,7 +170,7 @@ void DsItemEvent::handleParamBlob(shared_ptr player, byteArray para else { EventWriteMcItemAcquired( - DurangoStats::getUserId(player), + DurangoStats::getUserId(player), 0, // TODO DurangoStats::getPlayerSession(), 0, @@ -205,7 +205,7 @@ byteArray DsItemEvent::createParamBlob(eAcquisitionMethod eMethod, int itemId, i DsMobKilled::DsMobKilled(int id, const wstring &name) : Stat(id,name) {} -void DsMobKilled::handleParamBlob(shared_ptr player, byteArray paramBlob) +void DsMobKilled::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { if (paramBlob.length == sizeof(Param)) { @@ -222,7 +222,7 @@ void DsMobKilled::handleParamBlob(shared_ptr player, byteArray para DurangoStats::getPlayerSession(), // ROUND ID 0, param->weaponId, - param->mobType, + param->mobType, param->isRanged?1:0, 0, 0, 0, // (x,y,z), 0, @@ -231,7 +231,7 @@ void DsMobKilled::handleParamBlob(shared_ptr player, byteArray para == 0) { app.DebugPrintf("<%ls>\t%s(%i:%i:%i:%i)\n", DurangoStats::getUserId(player), - (param->isRanged?"mobShotWithEntity":"mobKilledInMelee"), + (param->isRanged?"mobShotWithEntity":"mobKilledInMelee"), param->mobType, param->weaponId, param->distance, param->damage); } @@ -262,7 +262,7 @@ void DsMobKilled::handleParamBlob(shared_ptr player, byteArray para } } -byteArray DsMobKilled::createParamBlob(shared_ptr player, shared_ptr mob, DamageSource *dmgSrc) +byteArray DsMobKilled::createParamBlob(std::shared_ptr player, std::shared_ptr mob, DamageSource *dmgSrc) { // 4J-JEV: Get the id we use for Durango Server Stats. int mob_networking_id; @@ -286,25 +286,25 @@ byteArray DsMobKilled::createParamBlob(shared_ptr player, shared_ptrgetDirectEntity()->GetType()), - mob->distanceTo(player->x, player->y, player->z), + mob->distanceTo(player->x, player->y, player->z), 0/*not needed*/ }; output.data = (byte*) new Param(param); output.length = sizeof(Param); return output; } - + // Kill made in melee, use itemInHand as weapon. - shared_ptr item = player->getCarriedItem(); + std::shared_ptr item = player->getCarriedItem(); byteArray output; Param param = { - DsMobKilled::MELEE, - mob_networking_id, + DsMobKilled::MELEE, + mob_networking_id, (item != NULL ? item->getItem()->id : 0), - mob->distanceTo(player->x, player->y, player->z), + mob->distanceTo(player->x, player->y, player->z), 0/*not needed*/ }; output.data = (byte*) new Param(param); @@ -323,7 +323,7 @@ string DsMobInteract::nameInteract[] = { DsMobInteract::DsMobInteract(int id, const wstring &name) : Stat(id,name) {} -void DsMobInteract::handleParamBlob(shared_ptr player, byteArray paramBlob) +void DsMobInteract::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { if (paramBlob.length == sizeof(Param)) { @@ -336,8 +336,8 @@ void DsMobInteract::handleParamBlob(shared_ptr player, byteArray pa EventWriteMobInteract( DurangoStats::getUserId(player), - DurangoStats::getPlayerSession(), - param->mobId, + DurangoStats::getPlayerSession(), + param->mobId, param->interactionType ); } } @@ -368,7 +368,7 @@ unsigned int DsTravel::CACHE_SIZES[eMethod_MAX] = 0, // FALL - Meters? - Fall event naturally only sends on land, no caching necessary. 10, // CLIMB - Meters? 70, // CART - Meters? - 70, // BOAT - Meters? + 70, // BOAT - Meters? 10, // PIG - Meters? 20*60*5, // TIME - GameTicks (20*60*5 ~ 5 mins) }; @@ -378,7 +378,7 @@ DsTravel::DsTravel(int id, const wstring &name) : Stat(id,name) ZeroMemory(¶m_cache, sizeof(unsigned int)*eMethod_MAX*MAX_LOCAL_PLAYERS); } -void DsTravel::handleParamBlob(shared_ptr player, byteArray paramBlob) +void DsTravel::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { if (paramBlob.length == sizeof(Param)) { @@ -416,7 +416,7 @@ int DsTravel::cache(int iPad, Param ¶m) return 0; } -void DsTravel::flush(shared_ptr player) +void DsTravel::flush(std::shared_ptr player) { int iPad = player->GetXboxPad(); for (int i = 0; i < eMethod_MAX; i++) @@ -429,7 +429,7 @@ void DsTravel::flush(shared_ptr player) } } -void DsTravel::write(shared_ptr player, eMethod method, int distance) +void DsTravel::write(std::shared_ptr player, eMethod method, int distance) { if (player == nullptr) return; @@ -477,7 +477,7 @@ void DsTravel::write(shared_ptr player, eMethod method, int distanc DsItemUsed::DsItemUsed(int id, const wstring &name) : Stat(id,name) {} -void DsItemUsed::handleParamBlob(shared_ptr player, byteArray paramBlob) +void DsItemUsed::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { if (paramBlob.length == sizeof(Param)) { @@ -520,14 +520,14 @@ byteArray DsItemUsed::createParamBlob(int itemId, int aux, int count, int health DsAchievement::DsAchievement(int id, const wstring &name) : Stat(id,name) {} -void DsAchievement::handleParamBlob(shared_ptr player, byteArray paramBlob) +void DsAchievement::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { if (paramBlob.length == sizeof(SmallParam)) { SmallParam *paramS = (SmallParam*) paramBlob.data; assert( DurangoStats::binaryAchievement(paramS->award) ); app.DebugPrintf("<%ls>\tAchievement(%i)\n", DurangoStats::getUserId(player), paramS->award); - + bool canAward = true; if(paramS->award == eAward_stayinFrosty) { @@ -616,12 +616,12 @@ byteArray DsAchievement::createLargeParamBlob(eAward award, int count) DsChangedDimension::DsChangedDimension(int id, const wstring &name) : Stat(id,name) {} -void DsChangedDimension::handleParamBlob(shared_ptr player, byteArray paramBlob) +void DsChangedDimension::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { if (paramBlob.length == sizeof(Param)) { Param *param = (Param*) paramBlob.data; - app.DebugPrintf("<%ls>\tchangedDimension(%i:%i)\n", DurangoStats::getUserId(player), + app.DebugPrintf("<%ls>\tchangedDimension(%i:%i)\n", DurangoStats::getUserId(player), param->fromDimId, param->toDimId); // No longer used. @@ -644,7 +644,7 @@ byteArray DsChangedDimension::createParamBlob(int fromDimId, int toDimId) DsEnteredBiome::DsEnteredBiome(int id, const wstring &name) : Stat(id,name) {} -void DsEnteredBiome::handleParamBlob(shared_ptr player, byteArray paramBlob) +void DsEnteredBiome::handleParamBlob(std::shared_ptr player, byteArray paramBlob) { if (paramBlob.length == sizeof(Param)) { @@ -713,7 +713,7 @@ DurangoStats::~DurangoStats() Stat *DurangoStats::get_stat(int i) { - switch (i) + switch (i) { case itemsAcquired_Id: return (Stat*) itemsAcquired; case itemUsed_Id: return (Stat*) itemUsed; @@ -826,7 +826,7 @@ Stat* DurangoStats::get_itemsCrafted(int itemId) { switch (itemId) { - // 4J-JEV: These items can be crafted trivially to and from their block equivalents, + // 4J-JEV: These items can be crafted trivially to and from their block equivalents, // 'Acquire Hardware' also relies on 'Count_Crafted(IronIngot) == Count_Forged(IronIngot)" on the Stats server. case Item::ironIngot_Id: case Item::goldIngot_Id: @@ -839,7 +839,7 @@ Stat* DurangoStats::get_itemsCrafted(int itemId) default: return (Stat*) itemsAcquired; } - + } Stat* DurangoStats::get_itemsSmelted(int itemId) @@ -871,7 +871,7 @@ Stat* DurangoStats::get_enteredBiome(int biomeId) Stat* DurangoStats::get_achievement(eAward achievementId) { // Special case for 'binary' achievements. - if ( binaryAchievement(achievementId) + if ( binaryAchievement(achievementId) || enhancedAchievement(achievementId) ) { switch (achievementId) @@ -888,43 +888,43 @@ Stat* DurangoStats::get_achievement(eAward achievementId) { return get_curedEntity(eTYPE_ZOMBIE); } - + // Other achievements awarded through more detailed generic events. return NULL; } byteArray DurangoStats::getParam_walkOneM(int distance) -{ +{ return DsTravel::createParamBlob(DsTravel::eMethod_walk, distance); } byteArray DurangoStats::getParam_swimOneM(int distance) -{ +{ return DsTravel::createParamBlob(DsTravel::eMethod_swim,distance); } byteArray DurangoStats::getParam_fallOneM(int distance) -{ +{ return DsTravel::createParamBlob(DsTravel::eMethod_fall,distance); } byteArray DurangoStats::getParam_climbOneM(int distance) -{ +{ return DsTravel::createParamBlob(DsTravel::eMethod_climb,distance); } byteArray DurangoStats::getParam_minecartOneM(int distance) -{ +{ return DsTravel::createParamBlob(DsTravel::eMethod_minecart,distance); } byteArray DurangoStats::getParam_boatOneM(int distance) -{ +{ return DsTravel::createParamBlob(DsTravel::eMethod_boat,distance); } byteArray DurangoStats::getParam_pigOneM(int distance) -{ +{ return DsTravel::createParamBlob(DsTravel::eMethod_pig,distance); } @@ -953,10 +953,10 @@ byteArray DurangoStats::getParam_itemsCrafted(int id, int aux, int count) return DsItemEvent::createParamBlob(DsItemEvent::eAcquisitionMethod_Crafted, id, aux, count); } -byteArray DurangoStats::getParam_itemsUsed(shared_ptr player, shared_ptr itm) +byteArray DurangoStats::getParam_itemsUsed(std::shared_ptr player, std::shared_ptr itm) { return DsItemUsed::createParamBlob( - itm->getItem()->id, itm->getAuxValue(), itm->GetCount(), + itm->getItem()->id, itm->getAuxValue(), itm->GetCount(), player->getHealth(), player->getFoodData()->getFoodLevel() ); } @@ -966,7 +966,7 @@ byteArray DurangoStats::getParam_itemsBought(int id, int aux, int count) return DsItemEvent::createParamBlob(DsItemEvent::eAcquisitionMethod_Bought, id, aux, count); } -byteArray DurangoStats::getParam_mobKill(shared_ptr player, shared_ptr mob, DamageSource *dmgSrc) +byteArray DurangoStats::getParam_mobKill(std::shared_ptr player, std::shared_ptr mob, DamageSource *dmgSrc) { return DsMobKilled::createParamBlob(player,mob,dmgSrc); } @@ -993,7 +993,7 @@ byteArray DurangoStats::getParam_craftedEntity(eINSTANCEOF entityId) byteArray DurangoStats::getParam_shearedEntity(eINSTANCEOF entityId) { - return DsMobInteract::createParamBlob(DsMobInteract::eInteract_Sheared, entityId); + return DsMobInteract::createParamBlob(DsMobInteract::eInteract_Sheared, entityId); } byteArray DurangoStats::getParam_time(int timediff) @@ -1016,7 +1016,7 @@ byteArray DurangoStats::getParam_achievement(eAward id) if (binaryAchievement(id)) { return DsAchievement::createSmallParamBlob(id); - } + } else if (enhancedAchievement(id)) { assert(false); // Should be calling the appropriate getParam function. @@ -1071,7 +1071,7 @@ bool DurangoStats::binaryAchievement(eAward achievementId) } /** 4J-JEV, - Basically achievements with an inconsequential extra parameter + Basically achievements with an inconsequential extra parameter that I thought best not to / prefered not to / couldn't be bothered to make class handlers for. (Motivation: it would be nice for players to see how close they were/are to achieving these things). */ @@ -1114,7 +1114,7 @@ LPCWSTR DurangoStats::getMultiplayerCorrelationId() return ((DurangoStats*)GenericStats::getInstance())->multiplayerCorrelationId->Data(); } -LPCWSTR DurangoStats::getUserId(shared_ptr player) +LPCWSTR DurangoStats::getUserId(std::shared_ptr player) { return getUserId(player->GetXboxPad()); } @@ -1128,12 +1128,12 @@ LPCWSTR DurangoStats::getUserId(int iPad) return cache.c_str(); } -void DurangoStats::playerSessionStart(PlayerUID uid, shared_ptr plr) +void DurangoStats::playerSessionStart(PlayerUID uid, std::shared_ptr plr) { if (plr != NULL && plr->level != NULL && plr->level->getLevelData() != NULL) { //wprintf(uid.toString().c_str()); - + //EventWritePlayerSessionStart( app.DebugPrintf(">>>\tPlayerSessionStart(%ls,%s,%ls,%i,%i)\n", uid.toString(), @@ -1155,7 +1155,7 @@ void DurangoStats::playerSessionStart(PlayerUID uid, shared_ptr plr) void DurangoStats::playerSessionStart(int iPad) { - PlayerUID puid; shared_ptr plr; + PlayerUID puid; std::shared_ptr plr; ProfileManager.GetXUID(iPad, &puid, true); plr = Minecraft::GetInstance()->localplayers[iPad]; playerSessionStart(puid,plr); @@ -1163,7 +1163,7 @@ void DurangoStats::playerSessionStart(int iPad) void DurangoStats::playerSessionPause(int iPad) { - shared_ptr plr = Minecraft::GetInstance()->localplayers[iPad]; + std::shared_ptr plr = Minecraft::GetInstance()->localplayers[iPad]; if (plr != NULL && plr->level != NULL && plr->level->getLevelData() != NULL) { PlayerUID puid; @@ -1186,7 +1186,7 @@ void DurangoStats::playerSessionPause(int iPad) void DurangoStats::playerSessionResume(int iPad) { - shared_ptr plr = Minecraft::GetInstance()->localplayers[iPad]; + std::shared_ptr plr = Minecraft::GetInstance()->localplayers[iPad]; if (plr != NULL && plr->level != NULL && plr->level->getLevelData() != NULL) { PlayerUID puid; @@ -1213,7 +1213,7 @@ void DurangoStats::playerSessionResume(int iPad) void DurangoStats::playerSessionEnd(int iPad) { - shared_ptr plr = Minecraft::GetInstance()->localplayers[iPad]; + std::shared_ptr plr = Minecraft::GetInstance()->localplayers[iPad]; if (plr != NULL) { DurangoStats::getInstance()->travel->flush(plr); diff --git a/Minecraft.World/DurangoStats.h b/Minecraft.World/DurangoStats.h index 1b2f7723..7956b1aa 100644 --- a/Minecraft.World/DurangoStats.h +++ b/Minecraft.World/DurangoStats.h @@ -20,7 +20,7 @@ public: enum eAcquisitionMethod { eAcquisitionMethod_None = 0, - + eAcquisitionMethod_Pickedup, eAcquisitionMethod_Crafted, eAcquisitionMethod_TakenFromChest, @@ -30,7 +30,7 @@ public: eAcquisitionMethod_Mined, eAcquisitionMethod_Placed, - + eAcquisitionMethod_MAX }; @@ -44,7 +44,7 @@ public: bool onLeaderboard(ELeaderboardId leaderboard, eAcquisitionMethod methodId, Param *param); int mergeIds(int itemId); - virtual void handleParamBlob(shared_ptr plr, byteArray param); + virtual void handleParamBlob(std::shared_ptr plr, byteArray param); static byteArray createParamBlob(eAcquisitionMethod methodId, int itemId, int itemAux, int itemCount); }; @@ -59,8 +59,8 @@ public: DsMobKilled(int id, const wstring &name); typedef struct { bool isRanged; int mobType, weaponId, distance, damage; } Param; - virtual void handleParamBlob(shared_ptr plr, byteArray param); - static byteArray createParamBlob(shared_ptr plr, shared_ptr mob, DamageSource *dmgSrc); + virtual void handleParamBlob(std::shared_ptr plr, byteArray param); + static byteArray createParamBlob(std::shared_ptr plr, std::shared_ptr mob, DamageSource *dmgSrc); }; class DsMobInteract : public Stat @@ -82,7 +82,7 @@ public: DsMobInteract(int id, const wstring &name); typedef struct { int interactionType, mobId; } Param; - virtual void handleParamBlob(shared_ptr plr, byteArray param); + virtual void handleParamBlob(std::shared_ptr plr, byteArray param); static byteArray createParamBlob(eInteract interactionId, int entityId); }; @@ -100,7 +100,7 @@ public: eMethod_boat, eMethod_pig, - eMethod_time, // Time is a dimension too right... + eMethod_time, // Time is a dimension too right... eMethod_MAX }; @@ -110,15 +110,15 @@ public: DsTravel(int id, const wstring &name); typedef struct { eMethod method; int distance; } Param; - virtual void handleParamBlob(shared_ptr plr, byteArray paramBlob); + virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); static byteArray createParamBlob(eMethod method, int distance); - void flush(shared_ptr plr); + void flush(std::shared_ptr plr); protected: unsigned int param_cache[MAX_LOCAL_PLAYERS][eMethod_MAX]; int cache(int iPad, Param ¶m); - void write(shared_ptr plr, eMethod method, int distance); + void write(std::shared_ptr plr, eMethod method, int distance); }; class DsItemUsed : public Stat @@ -126,7 +126,7 @@ class DsItemUsed : public Stat public: DsItemUsed(int id, const wstring &name); typedef struct { int itemId, aux, count, health, hunger; } Param; - virtual void handleParamBlob(shared_ptr plr, byteArray paramBlob); + virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); static byteArray createParamBlob(int itemId, int aux, int count, int health, int hunger); }; @@ -134,8 +134,8 @@ class DsAchievement : public Stat { public: DsAchievement(int id, const wstring &name); - - virtual void handleParamBlob(shared_ptr plr, byteArray paramBlob); + + virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); typedef struct { eAward award; } SmallParam; static byteArray createSmallParamBlob(eAward id); @@ -149,7 +149,7 @@ class DsChangedDimension : public Stat public: DsChangedDimension(int id, const wstring &name); typedef struct { int fromDimId, toDimId; } Param; - virtual void handleParamBlob(shared_ptr plr, byteArray paramBlob); + virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); static byteArray createParamBlob(int fromDimId, int toDimId); }; @@ -158,7 +158,7 @@ class DsEnteredBiome : public Stat public: DsEnteredBiome(int id, const wstring &name); typedef struct { int biomeId; } Param; - virtual void handleParamBlob(shared_ptr plr, byteArray paramBlob); + virtual void handleParamBlob(std::shared_ptr plr, byteArray paramBlob); static byteArray createParamBlob(int biomeId); }; @@ -240,7 +240,7 @@ protected: virtual Stat* get_changedDimension(int from, int to); virtual Stat* get_enteredBiome(int biomeId); - // Achievements + // Achievements virtual Stat* get_achievement(eAward achievementId); @@ -261,10 +261,10 @@ protected: virtual byteArray getParam_blocksMined(int blockId, int data, int count); virtual byteArray getParam_itemsCollected(int id, int aux, int count); virtual byteArray getParam_itemsCrafted(int id, int aux, int count); - virtual byteArray getParam_itemsUsed(shared_ptr plr, shared_ptr itm); + virtual byteArray getParam_itemsUsed(std::shared_ptr plr, std::shared_ptr itm); virtual byteArray getParam_itemsBought(int id, int aux, int count); - virtual byteArray getParam_mobKill(shared_ptr plr, shared_ptr mob, DamageSource *dmgSrc); + virtual byteArray getParam_mobKill(std::shared_ptr plr, std::shared_ptr mob, DamageSource *dmgSrc); virtual byteArray getParam_breedEntity(eINSTANCEOF entityId); virtual byteArray getParam_tamedEntity(eINSTANCEOF entityId); @@ -300,10 +300,10 @@ public: static void setMultiplayerCorrelationId(Platform::String^ mpcId); static LPCWSTR getMultiplayerCorrelationId(); - static LPCWSTR getUserId(shared_ptr plr); + static LPCWSTR getUserId(std::shared_ptr plr); static LPCWSTR getUserId(int iPad); - static void playerSessionStart(PlayerUID,shared_ptr); + static void playerSessionStart(PlayerUID,std::shared_ptr); static void playerSessionStart(int iPad); static void playerSessionPause(int iPad); static void playerSessionResume(int iPad); diff --git a/Minecraft.World/DyePowderItem.cpp b/Minecraft.World/DyePowderItem.cpp index a05b8354..b92e7789 100644 --- a/Minecraft.World/DyePowderItem.cpp +++ b/Minecraft.World/DyePowderItem.cpp @@ -21,8 +21,8 @@ DyePowderItem::DyePowderItem(int id) : Item( id ) icons = NULL; } -const unsigned int DyePowderItem::COLOR_DESCS[] = -{ +const unsigned int DyePowderItem::COLOR_DESCS[] = +{ IDS_ITEM_DYE_POWDER_BLACK, IDS_ITEM_DYE_POWDER_RED, IDS_ITEM_DYE_POWDER_GREEN, @@ -41,8 +41,8 @@ const unsigned int DyePowderItem::COLOR_DESCS[] = IDS_ITEM_DYE_POWDER_WHITE }; -const unsigned int DyePowderItem::COLOR_USE_DESCS[] = -{ +const unsigned int DyePowderItem::COLOR_USE_DESCS[] = +{ IDS_DESC_DYE_BLACK, IDS_DESC_DYE_RED, IDS_DESC_DYE_GREEN, @@ -102,38 +102,38 @@ const int DyePowderItem::MAGENTA = 13; const int DyePowderItem::ORANGE = 14; const int DyePowderItem::WHITE = 15; -Icon *DyePowderItem::getIcon(int itemAuxValue) +Icon *DyePowderItem::getIcon(int itemAuxValue) { int colorValue = Mth::clamp(itemAuxValue, 0, 15); return icons[colorValue]; } -unsigned int DyePowderItem::getDescriptionId(shared_ptr itemInstance) +unsigned int DyePowderItem::getDescriptionId(std::shared_ptr itemInstance) { int colorValue = Mth::clamp(itemInstance->getAuxValue(), 0, 15); return COLOR_DESCS[colorValue]; } -unsigned int DyePowderItem::getUseDescriptionId(shared_ptr itemInstance) +unsigned int DyePowderItem::getUseDescriptionId(std::shared_ptr itemInstance) { return COLOR_USE_DESCS[itemInstance->getAuxValue()]; } -bool DyePowderItem::useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool DyePowderItem::useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { if (!player->mayBuild(x, y, z)) return false; // 4J-PB - Adding a test only version to allow tooltips to be displayed - if (itemInstance->getAuxValue() == WHITE) + if (itemInstance->getAuxValue() == WHITE) { // bone meal is a fertilizer, so instantly grow trees and stuff int tile = level->getTile(x, y, z); - if (tile == Tile::sapling_Id) + if (tile == Tile::sapling_Id) { if(!bTestUseOnOnly) - { - if (!level->isClientSide) + { + if (!level->isClientSide) { ((Sapling *) Tile::sapling)->growTree(level, x, y, z, level->random); itemInstance->count--; @@ -167,13 +167,13 @@ bool DyePowderItem::useOn(shared_ptr itemInstance, shared_ptrgetData(x, y, z) == 7) return false; if(!bTestUseOnOnly) { - if (!level->isClientSide) + if (!level->isClientSide) { ((CropTile *) Tile::tiles[tile])->growCropsToMax(level, x, y, z); itemInstance->count--; @@ -181,12 +181,12 @@ bool DyePowderItem::useOn(shared_ptr itemInstance, shared_ptrgetData(x, y, z) == 7) return false; if(!bTestUseOnOnly) - { - if (!level->isClientSide) + { + if (!level->isClientSide) { ((CropTile *) Tile::crops)->growCropsToMax(level, x, y, z); itemInstance->count--; @@ -205,42 +205,42 @@ bool DyePowderItem::useOn(shared_ptr itemInstance, shared_ptrisClientSide) + { + if (!level->isClientSide) { itemInstance->count--; - for (int j = 0; j < 128; j++) + for (int j = 0; j < 128; j++) { int xx = x; int yy = y + 1; int zz = z; - for (int i = 0; i < j / 16; i++) + for (int i = 0; i < j / 16; i++) { xx += random->nextInt(3) - 1; yy += (random->nextInt(3) - 1) * random->nextInt(3) / 2; zz += random->nextInt(3) - 1; - if (level->getTile(xx, yy - 1, zz) != Tile::grass_Id || level->isSolidBlockingTile(xx, yy, zz)) + if (level->getTile(xx, yy - 1, zz) != Tile::grass_Id || level->isSolidBlockingTile(xx, yy, zz)) { goto mainloop; } } - if (level->getTile(xx, yy, zz) == 0) + if (level->getTile(xx, yy, zz) == 0) { - if (random->nextInt(10) != 0) + if (random->nextInt(10) != 0) { if (Tile::tallgrass->canSurvive(level, xx, yy, zz)) level->setTileAndData(xx, yy, zz, Tile::tallgrass_Id, TallGrass::TALL_GRASS); - } - else if (random->nextInt(3) != 0) + } + else if (random->nextInt(3) != 0) { if (Tile::flower->canSurvive(level, xx, yy, zz)) level->setTile(xx, yy, zz, Tile::flower_Id); - } - else + } + else { if (Tile::rose->canSurvive(level, xx, yy, zz)) level->setTile(xx, yy, zz, Tile::rose_Id); } @@ -289,14 +289,14 @@ mainloop: continue; return false; } -bool DyePowderItem::interactEnemy(shared_ptr itemInstance, shared_ptr mob) +bool DyePowderItem::interactEnemy(std::shared_ptr itemInstance, std::shared_ptr mob) { - if (dynamic_pointer_cast( mob ) != NULL) + if (dynamic_pointer_cast( mob ) != NULL) { - shared_ptr sheep = dynamic_pointer_cast(mob); + std::shared_ptr sheep = dynamic_pointer_cast(mob); // convert to tile-based color value (0 is white instead of black) int newColor = ClothTile::getTileDataForItemAuxValue(itemInstance->getAuxValue()); - if (!sheep->isSheared() && sheep->getColor() != newColor) + if (!sheep->isSheared() && sheep->getColor() != newColor) { sheep->setColor(newColor); itemInstance->count--; diff --git a/Minecraft.World/DyePowderItem.h b/Minecraft.World/DyePowderItem.h index b96b4087..df6147b9 100644 --- a/Minecraft.World/DyePowderItem.h +++ b/Minecraft.World/DyePowderItem.h @@ -40,10 +40,10 @@ public: DyePowderItem(int id); virtual Icon *getIcon(int itemAuxValue); - virtual unsigned int getDescriptionId(shared_ptr itemInstance); - virtual unsigned int getUseDescriptionId(shared_ptr itemInstance); - virtual bool useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - virtual bool interactEnemy(shared_ptr itemInstance, shared_ptr mob); + virtual unsigned int getDescriptionId(std::shared_ptr itemInstance); + virtual unsigned int getUseDescriptionId(std::shared_ptr itemInstance); + virtual bool useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool interactEnemy(std::shared_ptr itemInstance, std::shared_ptr mob); //@Override void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/EggItem.cpp b/Minecraft.World/EggItem.cpp index b85dbcd6..90c7d931 100644 --- a/Minecraft.World/EggItem.cpp +++ b/Minecraft.World/EggItem.cpp @@ -19,13 +19,13 @@ EggItem::EggItem(int id) : Item( id ) this->maxStackSize = 16; } -shared_ptr EggItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr EggItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { if (!player->abilities.instabuild) { instance->count--; } level->playSound( dynamic_pointer_cast(player), eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f)); - if (!level->isClientSide) level->addEntity( shared_ptr( new ThrownEgg(level, dynamic_pointer_cast( player )) )); + if (!level->isClientSide) level->addEntity( std::shared_ptr( new ThrownEgg(level, dynamic_pointer_cast( player )) )); return instance; } diff --git a/Minecraft.World/EggItem.h b/Minecraft.World/EggItem.h index 83f09db5..a5763a5e 100644 --- a/Minecraft.World/EggItem.h +++ b/Minecraft.World/EggItem.h @@ -11,5 +11,5 @@ class EggItem : public Item public: EggItem(int id); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); }; diff --git a/Minecraft.World/EggTile.cpp b/Minecraft.World/EggTile.cpp index e6711a3f..64cc4377 100644 --- a/Minecraft.World/EggTile.cpp +++ b/Minecraft.World/EggTile.cpp @@ -40,13 +40,13 @@ void EggTile::checkSlide(Level *level, int x, int y, int z) } else { - shared_ptr e = shared_ptr(new FallingTile(level, x + 0.5f, y + 0.5f, z + 0.5f, id)); + std::shared_ptr e = std::shared_ptr(new FallingTile(level, x + 0.5f, y + 0.5f, z + 0.5f, id)); level->addEntity(e); } } } -bool EggTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool EggTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if(soundOnly) return false; @@ -54,7 +54,7 @@ bool EggTile::use(Level *level, int x, int y, int z, shared_ptr player, return true; } -void EggTile::attack(Level *level, int x, int y, int z, shared_ptr player) +void EggTile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { teleport(level, x, y, z); } @@ -167,7 +167,7 @@ void EggTile::generateTeleportParticles(Level *level,int xt,int yt, int zt,int d } } -bool EggTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face) +bool EggTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face) { return true; } \ No newline at end of file diff --git a/Minecraft.World/EggTile.h b/Minecraft.World/EggTile.h index c8929cbe..7102bd8d 100644 --- a/Minecraft.World/EggTile.h +++ b/Minecraft.World/EggTile.h @@ -11,8 +11,8 @@ public: private: void checkSlide(Level *level, int x, int y, int z); public: - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param - virtual void attack(Level *level, int x, int y, int z, shared_ptr player); + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual void attack(Level *level, int x, int y, int z, std::shared_ptr player); private: void teleport(Level *level, int x, int y, int z); public: diff --git a/Minecraft.World/EmptyLevelChunk.cpp b/Minecraft.World/EmptyLevelChunk.cpp index 4934ac96..5bc7be0a 100644 --- a/Minecraft.World/EmptyLevelChunk.cpp +++ b/Minecraft.World/EmptyLevelChunk.cpp @@ -94,15 +94,15 @@ int EmptyLevelChunk::getRawBrightness(int x, int y, int z, int skyDampen) return 0; } -void EmptyLevelChunk::addEntity(shared_ptr e) +void EmptyLevelChunk::addEntity(std::shared_ptr e) { } -void EmptyLevelChunk::removeEntity(shared_ptr e) +void EmptyLevelChunk::removeEntity(std::shared_ptr e) { } -void EmptyLevelChunk::removeEntity(shared_ptr e, int yc) +void EmptyLevelChunk::removeEntity(std::shared_ptr e, int yc) { } @@ -115,16 +115,16 @@ void EmptyLevelChunk::skyBrightnessChanged() { } -shared_ptr EmptyLevelChunk::getTileEntity(int x, int y, int z) +std::shared_ptr EmptyLevelChunk::getTileEntity(int x, int y, int z) { - return shared_ptr(); + return std::shared_ptr(); } -void EmptyLevelChunk::addTileEntity(shared_ptr te) +void EmptyLevelChunk::addTileEntity(std::shared_ptr te) { } -void EmptyLevelChunk::setTileEntity(int x, int y, int z, shared_ptr tileEntity) +void EmptyLevelChunk::setTileEntity(int x, int y, int z, std::shared_ptr tileEntity) { } @@ -144,11 +144,11 @@ void EmptyLevelChunk::markUnsaved() { } -void EmptyLevelChunk::getEntities(shared_ptr except, AABB bb, vector > &es) +void EmptyLevelChunk::getEntities(std::shared_ptr except, AABB bb, vector > &es) { } -void EmptyLevelChunk::getEntitiesOfClass(const type_info& ec, AABB bb, vector > &es) +void EmptyLevelChunk::getEntitiesOfClass(const type_info& ec, AABB bb, vector > &es) { } diff --git a/Minecraft.World/EmptyLevelChunk.h b/Minecraft.World/EmptyLevelChunk.h index a8ff27f9..07599723 100644 --- a/Minecraft.World/EmptyLevelChunk.h +++ b/Minecraft.World/EmptyLevelChunk.h @@ -28,20 +28,20 @@ public: void getNeighbourBrightnesses(int *brightnesses, LightLayer::variety layer, int x, int y, int z); // 4J added void setBrightness(LightLayer::variety layer, int x, int y, int z, int brightness); int getRawBrightness(int x, int y, int z, int skyDampen); - void addEntity(shared_ptr e); - void removeEntity(shared_ptr e); - void removeEntity(shared_ptr e, int yc); + void addEntity(std::shared_ptr e); + void removeEntity(std::shared_ptr e); + void removeEntity(std::shared_ptr e, int yc); bool isSkyLit(int x, int y, int z); void skyBrightnessChanged(); - shared_ptr getTileEntity(int x, int y, int z); - void addTileEntity(shared_ptr te); - void setTileEntity(int x, int y, int z, shared_ptr tileEntity); + std::shared_ptr getTileEntity(int x, int y, int z); + void addTileEntity(std::shared_ptr te); + void setTileEntity(int x, int y, int z, std::shared_ptr tileEntity); void removeTileEntity(int x, int y, int z); void load(); void unload(bool unloadTileEntities) ; // 4J - added parameter void markUnsaved(); - void getEntities(shared_ptr except, AABB bb, vector > &es); - void getEntitiesOfClass(const type_info& ec, AABB bb, vector > &es); + void getEntities(std::shared_ptr except, AABB bb, vector > &es); + void getEntitiesOfClass(const type_info& ec, AABB bb, vector > &es); int countEntities(); bool shouldSave(bool force); void setBlocks(byteArray newBlocks, int sub); diff --git a/Minecraft.World/EnchantItemCommand.cpp b/Minecraft.World/EnchantItemCommand.cpp index aa02b533..da5cd2bf 100644 --- a/Minecraft.World/EnchantItemCommand.cpp +++ b/Minecraft.World/EnchantItemCommand.cpp @@ -15,7 +15,7 @@ int EnchantItemCommand::getPermissionLevel() return 0; //aLEVEL_GAMEMASTERS; } -void EnchantItemCommand::execute(shared_ptr source, byteArray commandData) +void EnchantItemCommand::execute(std::shared_ptr source, byteArray commandData) { ByteArrayInputStream bais(commandData); DataInputStream dis(&bais); @@ -26,11 +26,11 @@ void EnchantItemCommand::execute(shared_ptr source, byteArray com bais.reset(); - shared_ptr player = getPlayer(uid); + std::shared_ptr player = getPlayer(uid); if(player == NULL) return; - shared_ptr selectedItem = player->getSelectedItem(); + std::shared_ptr selectedItem = player->getSelectedItem(); if(selectedItem == NULL) return; @@ -70,7 +70,7 @@ void EnchantItemCommand::execute(shared_ptr source, byteArray com logAdminAction(source, ChatPacket::e_ChatCustom, L"commands.enchant.success"); } -shared_ptr EnchantItemCommand::preparePacket(shared_ptr player, int enchantmentId, int enchantmentLevel) +std::shared_ptr EnchantItemCommand::preparePacket(std::shared_ptr player, int enchantmentId, int enchantmentLevel) { if(player == NULL) return nullptr; @@ -81,5 +81,5 @@ shared_ptr EnchantItemCommand::preparePacket(shared_ptr( new GameCommandPacket(eGameCommand_EnchantItem, baos.toByteArray() )); + return std::shared_ptr( new GameCommandPacket(eGameCommand_EnchantItem, baos.toByteArray() )); } \ No newline at end of file diff --git a/Minecraft.World/EnchantItemCommand.h b/Minecraft.World/EnchantItemCommand.h index 5fc6c648..6792da53 100644 --- a/Minecraft.World/EnchantItemCommand.h +++ b/Minecraft.World/EnchantItemCommand.h @@ -9,7 +9,7 @@ class EnchantItemCommand : public Command public: virtual EGameCommand getId(); int getPermissionLevel(); - virtual void execute(shared_ptr source, byteArray commandData); + virtual void execute(std::shared_ptr source, byteArray commandData); - static shared_ptr preparePacket(shared_ptr player, int enchantmentId, int enchantmentLevel = 1); + static std::shared_ptr preparePacket(std::shared_ptr player, int enchantmentId, int enchantmentLevel = 1); }; \ No newline at end of file diff --git a/Minecraft.World/EnchantedBookItem.cpp b/Minecraft.World/EnchantedBookItem.cpp index 59e7156b..41245b1d 100644 --- a/Minecraft.World/EnchantedBookItem.cpp +++ b/Minecraft.World/EnchantedBookItem.cpp @@ -10,17 +10,17 @@ EnchantedBookItem::EnchantedBookItem(int id) : Item(id) { } -bool EnchantedBookItem::isFoil(shared_ptr itemInstance) +bool EnchantedBookItem::isFoil(std::shared_ptr itemInstance) { return true; } -bool EnchantedBookItem::isEnchantable(shared_ptr itemInstance) +bool EnchantedBookItem::isEnchantable(std::shared_ptr itemInstance) { return false; } -const Rarity *EnchantedBookItem::getRarity(shared_ptr itemInstance) +const Rarity *EnchantedBookItem::getRarity(std::shared_ptr itemInstance) { ListTag *enchantments = getEnchantments(itemInstance); if (enchantments && enchantments->size() > 0) @@ -33,7 +33,7 @@ const Rarity *EnchantedBookItem::getRarity(shared_ptr itemInstance } } -ListTag *EnchantedBookItem::getEnchantments(shared_ptr item) +ListTag *EnchantedBookItem::getEnchantments(std::shared_ptr item) { if (item->tag == NULL || !item->tag->contains((wchar_t *)TAG_STORED_ENCHANTMENTS.c_str())) { @@ -43,7 +43,7 @@ ListTag *EnchantedBookItem::getEnchantments(shared_ptr *) item->tag->get((wchar_t *)TAG_STORED_ENCHANTMENTS.c_str()); } -void EnchantedBookItem::appendHoverText(shared_ptr itemInstance, shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) +void EnchantedBookItem::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) { Item::appendHoverText(itemInstance, player, lines, advanced, unformattedStrings); @@ -66,7 +66,7 @@ void EnchantedBookItem::appendHoverText(shared_ptr itemInstance, s } } -void EnchantedBookItem::addEnchantment(shared_ptr item, EnchantmentInstance *enchantment) +void EnchantedBookItem::addEnchantment(std::shared_ptr item, EnchantmentInstance *enchantment) { ListTag *enchantments = getEnchantments(item); bool add = true; @@ -101,14 +101,14 @@ void EnchantedBookItem::addEnchantment(shared_ptr item, Enchantmen item->getTag()->put((wchar_t *)TAG_STORED_ENCHANTMENTS.c_str(), enchantments); } -shared_ptr EnchantedBookItem::createForEnchantment(EnchantmentInstance *enchant) +std::shared_ptr EnchantedBookItem::createForEnchantment(EnchantmentInstance *enchant) { - shared_ptr item = shared_ptr(new ItemInstance(this)); + std::shared_ptr item = std::shared_ptr(new ItemInstance(this)); addEnchantment(item, enchant); return item; } -void EnchantedBookItem::createForEnchantment(Enchantment *enchant, vector > *items) +void EnchantedBookItem::createForEnchantment(Enchantment *enchant, vector > *items) { for (int i = enchant->getMinLevel(); i <= enchant->getMaxLevel(); i++) { @@ -116,10 +116,10 @@ void EnchantedBookItem::createForEnchantment(Enchantment *enchant, vector EnchantedBookItem::createForRandomLoot(Random *random) +std::shared_ptr EnchantedBookItem::createForRandomLoot(Random *random) { Enchantment *enchantment = Enchantment::validEnchantments[random->nextInt(Enchantment::validEnchantments.size())]; - shared_ptr book = shared_ptr(new ItemInstance(id, 1, 0)); + std::shared_ptr book = std::shared_ptr(new ItemInstance(id, 1, 0)); int level = Mth::nextInt(random, enchantment->getMinLevel(), enchantment->getMaxLevel()); addEnchantment(book, new EnchantmentInstance(enchantment, level)); @@ -135,7 +135,7 @@ WeighedTreasure *EnchantedBookItem::createForRandomTreasure(Random *random) WeighedTreasure *EnchantedBookItem::createForRandomTreasure(Random *random, int minCount, int maxCount, int weight) { Enchantment *enchantment = Enchantment::validEnchantments[random->nextInt(Enchantment::validEnchantments.size())]; - shared_ptr book = shared_ptr(new ItemInstance(id, 1, 0)); + std::shared_ptr book = std::shared_ptr(new ItemInstance(id, 1, 0)); int level = Mth::nextInt(random, enchantment->getMinLevel(), enchantment->getMaxLevel()); addEnchantment(book, new EnchantmentInstance(enchantment, level)); diff --git a/Minecraft.World/EnchantedBookItem.h b/Minecraft.World/EnchantedBookItem.h index c67f208f..5b642b72 100644 --- a/Minecraft.World/EnchantedBookItem.h +++ b/Minecraft.World/EnchantedBookItem.h @@ -11,15 +11,15 @@ public: EnchantedBookItem(int id); - bool isFoil(shared_ptr itemInstance); - bool isEnchantable(shared_ptr itemInstance); - const Rarity *getRarity(shared_ptr itemInstance); - ListTag *getEnchantments(shared_ptr item); - void appendHoverText(shared_ptr itemInstance, shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); - void addEnchantment(shared_ptr item, EnchantmentInstance *enchantment); - shared_ptr createForEnchantment(EnchantmentInstance *enchant); - void createForEnchantment(Enchantment *enchant, vector > *items); - shared_ptr createForRandomLoot(Random *random); + bool isFoil(std::shared_ptr itemInstance); + bool isEnchantable(std::shared_ptr itemInstance); + const Rarity *getRarity(std::shared_ptr itemInstance); + ListTag *getEnchantments(std::shared_ptr item); + void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); + void addEnchantment(std::shared_ptr item, EnchantmentInstance *enchantment); + std::shared_ptr createForEnchantment(EnchantmentInstance *enchant); + void createForEnchantment(Enchantment *enchant, vector > *items); + std::shared_ptr createForRandomLoot(Random *random); WeighedTreasure *createForRandomTreasure(Random *random); WeighedTreasure *createForRandomTreasure(Random *random, int minCount, int maxCount, int weight); }; \ No newline at end of file diff --git a/Minecraft.World/Enchantment.cpp b/Minecraft.World/Enchantment.cpp index 2ce1441a..74d44b3b 100644 --- a/Minecraft.World/Enchantment.cpp +++ b/Minecraft.World/Enchantment.cpp @@ -129,7 +129,7 @@ int Enchantment::getDamageProtection(int level, DamageSource *source) return 0; } -int Enchantment::getDamageBonus(int level, shared_ptr target) +int Enchantment::getDamageBonus(int level, std::shared_ptr target) { return 0; } @@ -154,12 +154,12 @@ wstring Enchantment::getFullname(int level,wstring &unformatted) { wchar_t formatted[256]; swprintf(formatted,256,L"%ls %ls",app.GetString( getDescriptionId() ), getLevelString(level).c_str()); - unformatted = formatted; + unformatted = formatted; swprintf(formatted,256,L"%ls",app.GetHTMLColour(eHTMLColor_f),unformatted.c_str()); return formatted; } -bool Enchantment::canEnchant(shared_ptr item) +bool Enchantment::canEnchant(std::shared_ptr item) { return category->canEnchant(item->getItem()); } diff --git a/Minecraft.World/Enchantment.h b/Minecraft.World/Enchantment.h index 794edf85..08c1ab0a 100644 --- a/Minecraft.World/Enchantment.h +++ b/Minecraft.World/Enchantment.h @@ -74,12 +74,12 @@ public: virtual int getMinCost(int level); virtual int getMaxCost(int level); virtual int getDamageProtection(int level, DamageSource *source); - virtual int getDamageBonus(int level, shared_ptr target); + virtual int getDamageBonus(int level, std::shared_ptr target); virtual bool isCompatibleWith(Enchantment *other) const; virtual Enchantment *setDescriptionId(int id); virtual int getDescriptionId(); virtual wstring getFullname(int level,wstring &unformatted); // 4J Stu added unformatted - virtual bool canEnchant(shared_ptr item); + virtual bool canEnchant(std::shared_ptr item); private: // 4J Added diff --git a/Minecraft.World/EnchantmentHelper.cpp b/Minecraft.World/EnchantmentHelper.cpp index f43ced01..0b744a25 100644 --- a/Minecraft.World/EnchantmentHelper.cpp +++ b/Minecraft.World/EnchantmentHelper.cpp @@ -9,7 +9,7 @@ Random EnchantmentHelper::random; -int EnchantmentHelper::getEnchantmentLevel(int enchantmentId, shared_ptr piece) +int EnchantmentHelper::getEnchantmentLevel(int enchantmentId, std::shared_ptr piece) { if (piece == NULL) { @@ -33,7 +33,7 @@ int EnchantmentHelper::getEnchantmentLevel(int enchantmentId, shared_ptr *EnchantmentHelper::getEnchantments(shared_ptr item) +unordered_map *EnchantmentHelper::getEnchantments(std::shared_ptr item) { unordered_map *result = new unordered_map(); ListTag *list = item->id == Item::enchantedBook_Id ? Item::enchantedBook->getEnchantments(item) : item->getEnchantmentTags(); @@ -52,7 +52,7 @@ unordered_map *EnchantmentHelper::getEnchantments(shared_ptr *enchantments, shared_ptr item) +void EnchantmentHelper::setEnchantments(unordered_map *enchantments, std::shared_ptr item) { ListTag *list = new ListTag(); @@ -101,7 +101,7 @@ int EnchantmentHelper::getEnchantmentLevel(int enchantmentId, ItemInstanceArray return bestLevel; } -void EnchantmentHelper::runIterationOnItem(EnchantmentIterationMethod &method, shared_ptr piece) +void EnchantmentHelper::runIterationOnItem(EnchantmentIterationMethod &method, std::shared_ptr piece) { if (piece == NULL) { @@ -142,12 +142,12 @@ EnchantmentHelper::GetDamageProtectionIteration EnchantmentHelper::getDamageProt /** * Fetches the protection value for enchanted items. -* +* * @param inventory * @param source * @return */ -int EnchantmentHelper::getDamageProtection(shared_ptr inventory, DamageSource *source) +int EnchantmentHelper::getDamageProtection(std::shared_ptr inventory, DamageSource *source) { getDamageProtectionIteration.sum = 0; getDamageProtectionIteration.source = source; @@ -172,12 +172,12 @@ void EnchantmentHelper::GetDamageBonusIteration::doEnchantment(Enchantment *ench EnchantmentHelper::GetDamageBonusIteration EnchantmentHelper::getDamageBonusIteration; /** -* +* * @param inventory * @param target * @return */ -int EnchantmentHelper::getDamageBonus(shared_ptr inventory, shared_ptr target) +int EnchantmentHelper::getDamageBonus(std::shared_ptr inventory, std::shared_ptr target) { getDamageBonusIteration.sum = 0; @@ -192,62 +192,62 @@ int EnchantmentHelper::getDamageBonus(shared_ptr inventory, shared_pt return 0; } -int EnchantmentHelper::getKnockbackBonus(shared_ptr inventory, shared_ptr target) +int EnchantmentHelper::getKnockbackBonus(std::shared_ptr inventory, std::shared_ptr target) { return getEnchantmentLevel(Enchantment::knockback->id, inventory->getSelected()); } -int EnchantmentHelper::getFireAspect(shared_ptr source) +int EnchantmentHelper::getFireAspect(std::shared_ptr source) { return getEnchantmentLevel(Enchantment::fireAspect->id, source->getCarriedItem()); } -int EnchantmentHelper::getOxygenBonus(shared_ptr inventory) +int EnchantmentHelper::getOxygenBonus(std::shared_ptr inventory) { return getEnchantmentLevel(Enchantment::drownProtection->id, inventory->armor); } -int EnchantmentHelper::getDiggingBonus(shared_ptr inventory) +int EnchantmentHelper::getDiggingBonus(std::shared_ptr inventory) { return getEnchantmentLevel(Enchantment::diggingBonus->id, inventory->getSelected()); } -int EnchantmentHelper::getDigDurability(shared_ptr inventory) +int EnchantmentHelper::getDigDurability(std::shared_ptr inventory) { return getEnchantmentLevel(Enchantment::digDurability->id, inventory->getSelected()); } -bool EnchantmentHelper::hasSilkTouch(shared_ptr inventory) +bool EnchantmentHelper::hasSilkTouch(std::shared_ptr inventory) { return getEnchantmentLevel(Enchantment::untouching->id, inventory->getSelected()) > 0; } -int EnchantmentHelper::getDiggingLootBonus(shared_ptr inventory) +int EnchantmentHelper::getDiggingLootBonus(std::shared_ptr inventory) { return getEnchantmentLevel(Enchantment::resourceBonus->id, inventory->getSelected()); } -int EnchantmentHelper::getKillingLootBonus(shared_ptr inventory) +int EnchantmentHelper::getKillingLootBonus(std::shared_ptr inventory) { return getEnchantmentLevel(Enchantment::lootBonus->id, inventory->getSelected()); } -bool EnchantmentHelper::hasWaterWorkerBonus(shared_ptr inventory) +bool EnchantmentHelper::hasWaterWorkerBonus(std::shared_ptr inventory) { return getEnchantmentLevel(Enchantment::waterWorker->id, inventory->armor) > 0; } -int EnchantmentHelper::getArmorThorns(shared_ptr source) +int EnchantmentHelper::getArmorThorns(std::shared_ptr source) { return getEnchantmentLevel(Enchantment::thorns->id, source->getEquipmentSlots()); } -shared_ptr EnchantmentHelper::getRandomItemWith(Enchantment *enchantment, shared_ptr source) +std::shared_ptr EnchantmentHelper::getRandomItemWith(Enchantment *enchantment, std::shared_ptr source) { ItemInstanceArray items = source->getEquipmentSlots(); for(unsigned int i = 0; i < items.length; ++i) { - shared_ptr item = items[i]; + std::shared_ptr item = items[i]; if (item != NULL && getEnchantmentLevel(enchantment->id, item) > 0) { return item; @@ -258,7 +258,7 @@ shared_ptr EnchantmentHelper::getRandomItemWith(Enchantment *encha } /** -* +* * @param random * @param slot * The table slot, 0-2 @@ -268,7 +268,7 @@ shared_ptr EnchantmentHelper::getRandomItemWith(Enchantment *encha * Which item that is being enchanted. * @return The enchantment cost, 0 means unchantable, 50 is max. */ -int EnchantmentHelper::getEnchantmentCost(Random *random, int slot, int bookcases, shared_ptr itemInstance) +int EnchantmentHelper::getEnchantmentCost(Random *random, int slot, int bookcases, std::shared_ptr itemInstance) { Item *item = itemInstance->getItem(); int itemValue = item->getEnchantmentValue(); @@ -297,7 +297,7 @@ int EnchantmentHelper::getEnchantmentCost(Random *random, int slot, int bookcase return selected; } -shared_ptr EnchantmentHelper::enchantItem(Random *random, shared_ptr itemInstance, int enchantmentCost) +std::shared_ptr EnchantmentHelper::enchantItem(Random *random, std::shared_ptr itemInstance, int enchantmentCost) { vector *newEnchantment = EnchantmentHelper::selectEnchantment(random, itemInstance, enchantmentCost); bool isBook = itemInstance->id == Item::book_Id; @@ -325,13 +325,13 @@ shared_ptr EnchantmentHelper::enchantItem(Random *random, shared_p } /** -* +* * @param random * @param itemInstance * @param enchantmentCost * @return */ -vector *EnchantmentHelper::selectEnchantment(Random *random, shared_ptr itemInstance, int enchantmentCost) +vector *EnchantmentHelper::selectEnchantment(Random *random, std::shared_ptr itemInstance, int enchantmentCost) { // withdraw bonus from item Item *item = itemInstance->getItem(); @@ -407,7 +407,7 @@ vector *EnchantmentHelper::selectEnchantment(Random *rand } if (!availableEnchantments->empty()) - { + { for(AUTO_VAR(it, availableEnchantments->begin()); it != availableEnchantments->end(); ++it) { values.push_back(it->second); @@ -433,7 +433,7 @@ vector *EnchantmentHelper::selectEnchantment(Random *rand return results; } -unordered_map *EnchantmentHelper::getAvailableEnchantmentResults(int value, shared_ptr itemInstance) +unordered_map *EnchantmentHelper::getAvailableEnchantmentResults(int value, std::shared_ptr itemInstance) { Item *item = itemInstance->getItem(); unordered_map *results = NULL; diff --git a/Minecraft.World/EnchantmentHelper.h b/Minecraft.World/EnchantmentHelper.h index 9f7de5c5..18cc7266 100644 --- a/Minecraft.World/EnchantmentHelper.h +++ b/Minecraft.World/EnchantmentHelper.h @@ -12,9 +12,9 @@ private: static Random random; public: - static int getEnchantmentLevel(int enchantmentId, shared_ptr piece); - static unordered_map *getEnchantments(shared_ptr item); - static void setEnchantments(unordered_map *enchantments, shared_ptr item); + static int getEnchantmentLevel(int enchantmentId, std::shared_ptr piece); + static unordered_map *getEnchantments(std::shared_ptr item); + static void setEnchantments(unordered_map *enchantments, std::shared_ptr item); static int getEnchantmentLevel(int enchantmentId, ItemInstanceArray inventory); @@ -27,7 +27,7 @@ private: virtual void doEnchantment(Enchantment *enchantment, int level) = 0; }; - static void runIterationOnItem(EnchantmentIterationMethod &method, shared_ptr piece); + static void runIterationOnItem(EnchantmentIterationMethod &method, std::shared_ptr piece); static void runIterationOnInventory(EnchantmentIterationMethod &method, ItemInstanceArray inventory); class GetDamageProtectionIteration : public EnchantmentIterationMethod @@ -43,20 +43,20 @@ private: /** * Fetches the protection value for enchanted items. - * + * * @param inventory * @param source * @return */ public: - static int getDamageProtection(shared_ptr inventory, DamageSource *source); + static int getDamageProtection(std::shared_ptr inventory, DamageSource *source); private: class GetDamageBonusIteration : public EnchantmentIterationMethod { public: int sum; - shared_ptr target; + std::shared_ptr target; virtual void doEnchantment(Enchantment *enchantment, int level); }; @@ -64,27 +64,27 @@ private: static GetDamageBonusIteration getDamageBonusIteration; /** - * + * * @param inventory * @param target * @return */ public: - static int getDamageBonus(shared_ptr inventory, shared_ptr target); - static int getKnockbackBonus(shared_ptr inventory, shared_ptr target); - static int getFireAspect(shared_ptr source); - static int getOxygenBonus(shared_ptr inventory); - static int getDiggingBonus(shared_ptr inventory); - static int getDigDurability(shared_ptr inventory); - static bool hasSilkTouch(shared_ptr inventory); - static int getDiggingLootBonus(shared_ptr inventory); - static int getKillingLootBonus(shared_ptr inventory); - static bool hasWaterWorkerBonus(shared_ptr inventory); - static int getArmorThorns(shared_ptr source); - static shared_ptr getRandomItemWith(Enchantment *enchantment, shared_ptr source); + static int getDamageBonus(std::shared_ptr inventory, std::shared_ptr target); + static int getKnockbackBonus(std::shared_ptr inventory, std::shared_ptr target); + static int getFireAspect(std::shared_ptr source); + static int getOxygenBonus(std::shared_ptr inventory); + static int getDiggingBonus(std::shared_ptr inventory); + static int getDigDurability(std::shared_ptr inventory); + static bool hasSilkTouch(std::shared_ptr inventory); + static int getDiggingLootBonus(std::shared_ptr inventory); + static int getKillingLootBonus(std::shared_ptr inventory); + static bool hasWaterWorkerBonus(std::shared_ptr inventory); + static int getArmorThorns(std::shared_ptr source); + static std::shared_ptr getRandomItemWith(Enchantment *enchantment, std::shared_ptr source); /** - * + * * @param random * @param slot * The table slot, 0-2 @@ -94,17 +94,17 @@ public: * Which item that is being enchanted. * @return The enchantment cost, 0 means unchantable, 50 is max. */ - static int getEnchantmentCost(Random *random, int slot, int bookcases, shared_ptr itemInstance); + static int getEnchantmentCost(Random *random, int slot, int bookcases, std::shared_ptr itemInstance); - static shared_ptr enchantItem(Random *random, shared_ptr itemInstance, int enchantmentCost); + static std::shared_ptr enchantItem(Random *random, std::shared_ptr itemInstance, int enchantmentCost); /** - * + * * @param random * @param itemInstance * @param enchantmentCost * @return */ - static vector *selectEnchantment(Random *random, shared_ptr itemInstance, int enchantmentCost); - static unordered_map *getAvailableEnchantmentResults(int value, shared_ptr itemInstance); + static vector *selectEnchantment(Random *random, std::shared_ptr itemInstance, int enchantmentCost); + static unordered_map *getAvailableEnchantmentResults(int value, std::shared_ptr itemInstance); }; \ No newline at end of file diff --git a/Minecraft.World/EnchantmentMenu.cpp b/Minecraft.World/EnchantmentMenu.cpp index 23b366ce..d64abc47 100644 --- a/Minecraft.World/EnchantmentMenu.cpp +++ b/Minecraft.World/EnchantmentMenu.cpp @@ -7,9 +7,9 @@ #include "net.minecraft.world.item.enchantment.h" #include "EnchantmentMenu.h" -EnchantmentMenu::EnchantmentMenu(shared_ptr inventory, Level *level, int xt, int yt, int zt) +EnchantmentMenu::EnchantmentMenu(std::shared_ptr inventory, Level *level, int xt, int yt, int zt) { - enchantSlots = shared_ptr( new EnchantmentContainer(this) ); + enchantSlots = std::shared_ptr( new EnchantmentContainer(this) ); for(int i = 0; i < 3; ++i) { @@ -77,9 +77,9 @@ void EnchantmentMenu::setData(int id, int value) } } -void EnchantmentMenu::slotsChanged() // 4J used to take a shared_ptr container but wasn't using it, so removed to simplify things +void EnchantmentMenu::slotsChanged() // 4J used to take a std::shared_ptr container but wasn't using it, so removed to simplify things { - shared_ptr item = enchantSlots->getItem(0); + std::shared_ptr item = enchantSlots->getItem(0); if (item == NULL || !item->isEnchantable()) { @@ -150,9 +150,9 @@ void EnchantmentMenu::slotsChanged() // 4J used to take a shared_ptr } } -bool EnchantmentMenu::clickMenuButton(shared_ptr player, int i) +bool EnchantmentMenu::clickMenuButton(std::shared_ptr player, int i) { - shared_ptr item = enchantSlots->getItem(0); + std::shared_ptr item = enchantSlots->getItem(0); if (costs[i] > 0 && item != NULL && (player->experienceLevel >= costs[i] || player->abilities.instabuild) ) { if (!level->isClientSide) @@ -194,34 +194,34 @@ bool EnchantmentMenu::clickMenuButton(shared_ptr player, int i) } -void EnchantmentMenu::removed(shared_ptr player) +void EnchantmentMenu::removed(std::shared_ptr player) { AbstractContainerMenu::removed(player); if (level->isClientSide) return; - shared_ptr item = enchantSlots->removeItemNoUpdate(0); + std::shared_ptr item = enchantSlots->removeItemNoUpdate(0); if (item != NULL) { player->drop(item); } } -bool EnchantmentMenu::stillValid(shared_ptr player) +bool EnchantmentMenu::stillValid(std::shared_ptr player) { if (level->getTile(x, y, z) != Tile::enchantTable_Id) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; return true; } -shared_ptr EnchantmentMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr EnchantmentMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); Slot *IngredientSlot = slots->at(INGREDIENT_SLOT); if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex == INGREDIENT_SLOT) @@ -238,8 +238,8 @@ shared_ptr EnchantmentMenu::quickMoveStack(shared_ptr play else if (slotIndex >= INV_SLOT_START && slotIndex < INV_SLOT_END) { // if the item is an enchantable tool - - if(stack->isEnchantable() && (!IngredientSlot->hasItem() ) ) + + if(stack->isEnchantable() && (!IngredientSlot->hasItem() ) ) { if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false)) { @@ -258,7 +258,7 @@ shared_ptr EnchantmentMenu::quickMoveStack(shared_ptr play { // if the item is an enchantable tool - if(stack->isEnchantable() && (!IngredientSlot->hasItem() ) ) + if(stack->isEnchantable() && (!IngredientSlot->hasItem() ) ) { if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false)) { diff --git a/Minecraft.World/EnchantmentMenu.h b/Minecraft.World/EnchantmentMenu.h index 62408f1d..97279dee 100644 --- a/Minecraft.World/EnchantmentMenu.h +++ b/Minecraft.World/EnchantmentMenu.h @@ -13,7 +13,7 @@ public: static const int USE_ROW_SLOT_END = EnchantmentMenu::USE_ROW_SLOT_START + 9; public: - shared_ptr enchantSlots; + std::shared_ptr enchantSlots; private: Level *level; @@ -28,14 +28,14 @@ public: public: int costs[3]; - EnchantmentMenu(shared_ptr inventory, Level *level, int xt, int yt, int zt); + EnchantmentMenu(std::shared_ptr inventory, Level *level, int xt, int yt, int zt); virtual void addSlotListener(ContainerListener *listener); virtual void broadcastChanges(); virtual void setData(int id, int value); - virtual void slotsChanged();// 4J used to take a shared_ptr container but wasn't using it, so removed to simplify things - virtual bool clickMenuButton(shared_ptr player, int i); - void removed(shared_ptr player); - virtual bool stillValid(shared_ptr player); - virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); + virtual void slotsChanged();// 4J used to take a std::shared_ptr container but wasn't using it, so removed to simplify things + virtual bool clickMenuButton(std::shared_ptr player, int i); + void removed(std::shared_ptr player); + virtual bool stillValid(std::shared_ptr player); + virtual std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); }; \ No newline at end of file diff --git a/Minecraft.World/EnchantmentSlot.h b/Minecraft.World/EnchantmentSlot.h index 590d9e31..c8615288 100644 --- a/Minecraft.World/EnchantmentSlot.h +++ b/Minecraft.World/EnchantmentSlot.h @@ -10,7 +10,7 @@ class Container; class EnchantmentSlot : public Slot { public: - EnchantmentSlot(shared_ptr container, int id, int x, int y) : Slot(container,id, x, y) {} - virtual bool mayPlace(shared_ptr item) {return true;} - virtual bool mayCombine(shared_ptr item) {return false;} // 4J Added + EnchantmentSlot(std::shared_ptr container, int id, int x, int y) : Slot(container,id, x, y) {} + virtual bool mayPlace(std::shared_ptr item) {return true;} + virtual bool mayCombine(std::shared_ptr item) {return false;} // 4J Added }; \ No newline at end of file diff --git a/Minecraft.World/EnchantmentTableEntity.cpp b/Minecraft.World/EnchantmentTableEntity.cpp index 31da3c49..ff52541b 100644 --- a/Minecraft.World/EnchantmentTableEntity.cpp +++ b/Minecraft.World/EnchantmentTableEntity.cpp @@ -32,7 +32,7 @@ void EnchantmentTableEntity::tick() oOpen = open; oRot = rot; - shared_ptr player = level->getNearestPlayer(x + 0.5f, y + 0.5f, z + 0.5f, 3); + std::shared_ptr player = level->getNearestPlayer(x + 0.5f, y + 0.5f, z + 0.5f, 3); if (player != NULL) { double xd = player->x - (x + 0.5f); @@ -89,9 +89,9 @@ void EnchantmentTableEntity::tick() flip = flip + flipA; } -shared_ptr EnchantmentTableEntity::clone() +std::shared_ptr EnchantmentTableEntity::clone() { - shared_ptr result = shared_ptr( new EnchantmentTableEntity() ); + std::shared_ptr result = std::shared_ptr( new EnchantmentTableEntity() ); TileEntity::clone(result); result->time = time; diff --git a/Minecraft.World/EnchantmentTableEntity.h b/Minecraft.World/EnchantmentTableEntity.h index aa54c812..c7cef9f7 100644 --- a/Minecraft.World/EnchantmentTableEntity.h +++ b/Minecraft.World/EnchantmentTableEntity.h @@ -21,5 +21,5 @@ public: virtual void tick(); // 4J Added - virtual shared_ptr clone(); + virtual std::shared_ptr clone(); }; \ No newline at end of file diff --git a/Minecraft.World/EnchantmentTableTile.cpp b/Minecraft.World/EnchantmentTableTile.cpp index 70c127ba..911d19cd 100644 --- a/Minecraft.World/EnchantmentTableTile.cpp +++ b/Minecraft.World/EnchantmentTableTile.cpp @@ -67,12 +67,12 @@ Icon *EnchantmentTableTile::getTexture(int face, int data) return icon; } -shared_ptr EnchantmentTableTile::newTileEntity(Level *level) +std::shared_ptr EnchantmentTableTile::newTileEntity(Level *level) { - return shared_ptr(new EnchantmentTableEntity()); + return std::shared_ptr(new EnchantmentTableEntity()); } -bool EnchantmentTableTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool EnchantmentTableTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if(soundOnly) return false; diff --git a/Minecraft.World/EnchantmentTableTile.h b/Minecraft.World/EnchantmentTableTile.h index 43816cec..03916274 100644 --- a/Minecraft.World/EnchantmentTableTile.h +++ b/Minecraft.World/EnchantmentTableTile.h @@ -16,14 +16,14 @@ private: public: EnchantmentTableTile(int id); - + virtual void updateDefaultShape(); // 4J Added override bool isCubeShaped(); void animateTick(Level *level, int x, int y, int z, Random *random); bool isSolidRender(bool isServerLevel = false); Icon *getTexture(int face, int data); - shared_ptr newTileEntity(Level *level); - bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + std::shared_ptr newTileEntity(Level *level); + bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param //@Override void registerIcons(IconRegister *iconRegister); }; diff --git a/Minecraft.World/EnderChestTile.cpp b/Minecraft.World/EnderChestTile.cpp index 7e50a933..2240a070 100644 --- a/Minecraft.World/EnderChestTile.cpp +++ b/Minecraft.World/EnderChestTile.cpp @@ -48,7 +48,7 @@ bool EnderChestTile::isSilkTouchable() return true; } -void EnderChestTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void EnderChestTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int facing = 0; int dir = (Mth::floor(by->yRot * 4 / (360) + 0.5f)) & 3; @@ -61,10 +61,10 @@ void EnderChestTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptrsetData(x, y, z, facing); } -bool EnderChestTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly) +bool EnderChestTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly) { - shared_ptr container = player->getEnderChestInventory(); - shared_ptr enderChest = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + std::shared_ptr container = player->getEnderChestInventory(); + std::shared_ptr enderChest = dynamic_pointer_cast(level->getTileEntity(x, y, z)); if (container == NULL || enderChest == NULL) return true; if (level->isSolidBlockingTile(x, y + 1, z)) return true; @@ -80,9 +80,9 @@ bool EnderChestTile::use(Level *level, int x, int y, int z, shared_ptr p return true; } -shared_ptr EnderChestTile::newTileEntity(Level *level) +std::shared_ptr EnderChestTile::newTileEntity(Level *level) { - return shared_ptr(new EnderChestTileEntity()); + return std::shared_ptr(new EnderChestTileEntity()); } void EnderChestTile::animateTick(Level *level, int xt, int yt, int zt, Random *random) diff --git a/Minecraft.World/EnderChestTile.h b/Minecraft.World/EnderChestTile.h index 96173f63..54cc1b75 100644 --- a/Minecraft.World/EnderChestTile.h +++ b/Minecraft.World/EnderChestTile.h @@ -21,9 +21,9 @@ protected: bool isSilkTouchable(); public: - void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); - bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); - shared_ptr newTileEntity(Level *level); + void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); + bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); + std::shared_ptr newTileEntity(Level *level); void animateTick(Level *level, int xt, int yt, int zt, Random *random); virtual void registerIcons(IconRegister *iconRegister); }; diff --git a/Minecraft.World/EnderChestTileEntity.cpp b/Minecraft.World/EnderChestTileEntity.cpp index dffa2bd5..25054c23 100644 --- a/Minecraft.World/EnderChestTileEntity.cpp +++ b/Minecraft.World/EnderChestTileEntity.cpp @@ -27,7 +27,7 @@ void EnderChestTileEntity::tick() double xc = x + 0.5; double zc = z + 0.5; - // 4J-PB - Seems the chest open volume is much louder than other sounds from user reports. We'll tone it down a bit + // 4J-PB - Seems the chest open volume is much louder than other sounds from user reports. We'll tone it down a bit level->playSound(xc, y + 0.5, zc, eSoundType_RANDOM_CHEST_OPEN, 0.2f, level->random->nextFloat() * 0.1f + 0.9f); } if ((openCount == 0 && openness > 0) || (openCount > 0 && openness < 1)) @@ -45,7 +45,7 @@ void EnderChestTileEntity::tick() double xc = x + 0.5; double zc = z + 0.5; - // 4J-PB - Seems the chest open volume is much louder than other sounds from user reports. We'll tone it down a bit + // 4J-PB - Seems the chest open volume is much louder than other sounds from user reports. We'll tone it down a bit level->playSound(xc, y + 0.5, zc, eSoundType_RANDOM_CHEST_CLOSE, 0.2f, level->random->nextFloat() * 0.1f + 0.9f); } if (openness < 0) @@ -81,7 +81,7 @@ void EnderChestTileEntity::stopOpen() level->tileEvent(x, y, z, Tile::enderChest_Id, ChestTile::EVENT_SET_OPEN_COUNT, openCount); } -bool EnderChestTileEntity::stillValid(shared_ptr player) +bool EnderChestTileEntity::stillValid(std::shared_ptr player) { if (level->getTileEntity(x, y, z) != shared_from_this()) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; @@ -90,9 +90,9 @@ bool EnderChestTileEntity::stillValid(shared_ptr player) } // 4J Added -shared_ptr EnderChestTileEntity::clone() +std::shared_ptr EnderChestTileEntity::clone() { - shared_ptr result = shared_ptr( new EnderChestTileEntity() ); + std::shared_ptr result = std::shared_ptr( new EnderChestTileEntity() ); TileEntity::clone(result); return result; diff --git a/Minecraft.World/EnderChestTileEntity.h b/Minecraft.World/EnderChestTileEntity.h index f6882980..e67b6bcc 100644 --- a/Minecraft.World/EnderChestTileEntity.h +++ b/Minecraft.World/EnderChestTileEntity.h @@ -23,8 +23,8 @@ public: void setRemoved(); void startOpen(); void stopOpen(); - bool stillValid(shared_ptr player); + bool stillValid(std::shared_ptr player); // 4J Added - virtual shared_ptr clone(); + virtual std::shared_ptr clone(); }; \ No newline at end of file diff --git a/Minecraft.World/EnderCrystal.cpp b/Minecraft.World/EnderCrystal.cpp index 719e9d96..7e43ef66 100644 --- a/Minecraft.World/EnderCrystal.cpp +++ b/Minecraft.World/EnderCrystal.cpp @@ -9,7 +9,7 @@ void EnderCrystal::_init(Level *level) -{ +{ // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that // the derived version of the function is called this->defineSynchedData(); @@ -91,7 +91,7 @@ bool EnderCrystal::isPickable() bool EnderCrystal::hurt(DamageSource *source, int damage) { // 4J-PB - if the owner of the source is the enderdragon, then ignore it (where the dragon's fireball hits an endercrystal) - shared_ptr sourceIsDragon = dynamic_pointer_cast(source->getEntity()); + std::shared_ptr sourceIsDragon = dynamic_pointer_cast(source->getEntity()); if(sourceIsDragon!=NULL) { @@ -108,12 +108,12 @@ bool EnderCrystal::hurt(DamageSource *source, int damage) { level->explode(nullptr, x, y, z, 6, true); - vector > entities = level->getAllEntities(); - shared_ptr dragon = nullptr; + vector > entities = level->getAllEntities(); + std::shared_ptr dragon = nullptr; AUTO_VAR(itEnd, entities.end()); for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { - shared_ptr e = *it; //entities->at(i); + std::shared_ptr e = *it; //entities->at(i); dragon = dynamic_pointer_cast(e); if(dragon != NULL) { diff --git a/Minecraft.World/EnderDragon.cpp b/Minecraft.World/EnderDragon.cpp index 2ccd453c..d93dc3bd 100644 --- a/Minecraft.World/EnderDragon.cpp +++ b/Minecraft.World/EnderDragon.cpp @@ -84,14 +84,14 @@ EnderDragon::EnderDragon(Level *level) : BossMob(level) { _init(); - head = shared_ptr( new BossMobPart(this, L"head", 6, 6) ); - neck = shared_ptr( new BossMobPart(this, L"neck", 6, 6) ); // 4J Added - body = shared_ptr( new BossMobPart(this, L"body", 8, 8) ); - tail1 = shared_ptr( new BossMobPart(this, L"tail", 4, 4) ); - tail2 = shared_ptr( new BossMobPart(this, L"tail", 4, 4) ); - tail3 = shared_ptr( new BossMobPart(this, L"tail", 4, 4) ); - wing1 = shared_ptr( new BossMobPart(this, L"wing", 4, 4) ); - wing2 = shared_ptr( new BossMobPart(this, L"wing", 4, 4) ); + head = std::shared_ptr( new BossMobPart(this, L"head", 6, 6) ); + neck = std::shared_ptr( new BossMobPart(this, L"neck", 6, 6) ); // 4J Added + body = std::shared_ptr( new BossMobPart(this, L"body", 8, 8) ); + tail1 = std::shared_ptr( new BossMobPart(this, L"tail", 4, 4) ); + tail2 = std::shared_ptr( new BossMobPart(this, L"tail", 4, 4) ); + tail3 = std::shared_ptr( new BossMobPart(this, L"tail", 4, 4) ); + wing1 = std::shared_ptr( new BossMobPart(this, L"wing", 4, 4) ); + wing2 = std::shared_ptr( new BossMobPart(this, L"wing", 4, 4) ); subEntities.push_back(head); subEntities.push_back(neck); // 4J Added @@ -185,7 +185,7 @@ void EnderDragon::aiStep() float flap = Mth::cos(flapTime * PI * 2); float oldFlap = Mth::cos(oFlapTime * PI * 2); - if (oldFlap <= -0.3f && flap >= -0.3f) + if (oldFlap <= -0.3f && flap >= -0.3f) { level->playLocalSound(x, y, z, eSoundType_MOB_ENDERDRAGON_MOVE, 1, 0.8f + random->nextFloat() * .3f, 100.0f); } @@ -352,7 +352,7 @@ void EnderDragon::aiStep() double zdd = zTarget - z; double dist = xdd * xdd + ydd * ydd + zdd * zdd; - + if( getSynchedAction() == e_EnderdragonAction_Sitting_Flaming ) { --m_actionTicks; @@ -379,7 +379,7 @@ void EnderDragon::aiStep() else if( getSynchedAction() == e_EnderdragonAction_Sitting_Scanning ) { attackTarget = level->getNearestPlayer( shared_from_this(), SITTING_ATTACK_VIEW_RANGE, SITTING_ATTACK_Y_VIEW_RANGE ); - + ++m_actionTicks; if( attackTarget != NULL ) { @@ -440,11 +440,11 @@ void EnderDragon::aiStep() { if( m_actionTicks < (FLAME_TICKS - 10) ) { - vector > *targets = level->getEntities(shared_from_this(), m_acidArea); + vector > *targets = level->getEntities(shared_from_this(), m_acidArea); for( AUTO_VAR(it, targets->begin() ); it != targets->end(); ++it) { - shared_ptr e = dynamic_pointer_cast( *it ); + std::shared_ptr e = dynamic_pointer_cast( *it ); if (e != NULL) { //app.DebugPrintf("Attacking entity with acid\n"); @@ -685,7 +685,7 @@ void EnderDragon::aiStep() // Curls/straightens the tail for (int i = 0; i < 3; i++) { - shared_ptr part = nullptr; + std::shared_ptr part = nullptr; if (i == 0) part = tail1; if (i == 1) part = tail2; @@ -710,7 +710,7 @@ void EnderDragon::aiStep() if (!level->isClientSide) { double maxDist = 64.0f; - if (getSynchedAction() == e_EnderdragonAction_StrafePlayer && attackTarget != NULL && attackTarget->distanceToSqr(shared_from_this()) < maxDist * maxDist) + if (getSynchedAction() == e_EnderdragonAction_StrafePlayer && attackTarget != NULL && attackTarget->distanceToSqr(shared_from_this()) < maxDist * maxDist) { if (this->canSee(attackTarget)) { @@ -734,14 +734,14 @@ void EnderDragon::aiStep() double zdd = attackTarget->z - startingZ; level->levelEvent(nullptr, LevelEvent::SOUND_GHAST_FIREBALL, (int) x, (int) y, (int) z, 0); - shared_ptr ie = shared_ptr( new DragonFireball(level, dynamic_pointer_cast( shared_from_this() ), xdd, ydd, zdd) ); + std::shared_ptr ie = std::shared_ptr( new DragonFireball(level, dynamic_pointer_cast( shared_from_this() ), xdd, ydd, zdd) ); ie->x = startingX; ie->y = startingY; ie->z = startingZ; level->addEntity(ie); m_fireballCharge = 0; - app.DebugPrintf("Finding new target due to having fired a fireball\n"); + app.DebugPrintf("Finding new target due to having fired a fireball\n"); if( m_currentPath != NULL ) { while(!m_currentPath->isDone()) @@ -752,8 +752,8 @@ void EnderDragon::aiStep() newTarget = true; findNewTarget(); } - } - else + } + else { if (m_fireballCharge > 0) m_fireballCharge--; } @@ -793,14 +793,14 @@ void EnderDragon::checkCrystals() if (random->nextInt(10) == 0) { float maxDist = 32; - vector > *crystals = level->getEntitiesOfClass(typeid(EnderCrystal), bb->grow(maxDist, maxDist, maxDist)); + vector > *crystals = level->getEntitiesOfClass(typeid(EnderCrystal), bb->grow(maxDist, maxDist, maxDist)); - shared_ptr crystal = nullptr; + std::shared_ptr crystal = nullptr; double nearest = Double::MAX_VALUE; //for (Entity ec : crystals) for(AUTO_VAR(it, crystals->begin()); it != crystals->end(); ++it) { - shared_ptr ec = dynamic_pointer_cast( *it ); + std::shared_ptr ec = dynamic_pointer_cast( *it ); double dist = ec->distanceToSqr(shared_from_this() ); if (dist < nearest) { @@ -809,7 +809,7 @@ void EnderDragon::checkCrystals() } } delete crystals; - + nearestCrystal = crystal; } @@ -831,7 +831,7 @@ void EnderDragon::checkAttack() } } -void EnderDragon::knockBack(vector > *entities) +void EnderDragon::knockBack(vector > *entities) { double xm = (body->bb->x0 + body->bb->x1) / 2; // double ym = (body.bb.y0 + body.bb.y1) / 2; @@ -840,7 +840,7 @@ void EnderDragon::knockBack(vector > *entities) //for (Entity e : entities) for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - shared_ptr e = dynamic_pointer_cast( *it ); + std::shared_ptr e = dynamic_pointer_cast( *it ); if (e != NULL)//(e instanceof Mob) { double xd = e->x - xm; @@ -851,12 +851,12 @@ void EnderDragon::knockBack(vector > *entities) } } -void EnderDragon::hurt(vector > *entities) +void EnderDragon::hurt(vector > *entities) { //for (int i = 0; i < entities->size(); i++) for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - shared_ptr e = dynamic_pointer_cast( *it );//entities.get(i); + std::shared_ptr e = dynamic_pointer_cast( *it );//entities.get(i); if (e != NULL) //(e instanceof Mob) { DamageSource *damageSource = DamageSource::mobAttack( dynamic_pointer_cast( shared_from_this() )); @@ -868,7 +868,7 @@ void EnderDragon::hurt(vector > *entities) void EnderDragon::findNewTarget() { - shared_ptr playerNearestToEgg = nullptr; + std::shared_ptr playerNearestToEgg = nullptr; // Update current action switch(getSynchedAction()) @@ -923,7 +923,7 @@ void EnderDragon::findNewTarget() // app.DebugPrintf("Dragon action is now: SittingFlaming\n"); //#endif // m_actionTicks = FLAME_TICKS; - + m_flameAttacks = 0; setSynchedAction(e_EnderdragonAction_Sitting_Scanning); attackTarget = level->getNearestPlayer( shared_from_this(), SITTING_ATTACK_VIEW_RANGE, SITTING_ATTACK_Y_VIEW_RANGE ); @@ -948,7 +948,7 @@ void EnderDragon::findNewTarget() if( m_currentPath == NULL || m_currentPath->isDone() ) { int currentNodeIndex = findClosestNode(); - + // To get the angle to the player correct when landing, head to a node diametrically opposite the player, then swoop in to 4,4 int eggHeight = max( level->seaLevel + 5, level->getTopSolidBlock(PODIUM_X_POS,PODIUM_Z_POS) ); //level->getHeightmap(4,4); playerNearestToEgg = level->getNearestPlayer(PODIUM_X_POS, eggHeight, PODIUM_Z_POS, 128.0); @@ -978,7 +978,7 @@ void EnderDragon::findNewTarget() navigateToNextPathNode(); if(m_currentPath != NULL && m_currentPath->isDone()) - { + { setSynchedAction(e_EnderdragonAction_Landing); #if PRINT_DRAGON_STATE_CHANGE_MESSAGES app.DebugPrintf("Dragon action is now: Landing\n"); @@ -1033,7 +1033,7 @@ void EnderDragon::findNewTarget() } if(m_currentPath != NULL) delete m_currentPath; - m_currentPath = findPath(currentNodeIndex,targetNodeIndex); + m_currentPath = findPath(currentNodeIndex,targetNodeIndex); // Always skip the first node (as that's where we are already) if(m_currentPath != NULL) m_currentPath->next(); @@ -1100,7 +1100,7 @@ bool EnderDragon::checkWalls(AABB *bb) return hitWall; } -bool EnderDragon::hurt(shared_ptr bossMobPart, DamageSource *source, int damage) +bool EnderDragon::hurt(std::shared_ptr bossMobPart, DamageSource *source, int damage) { if (bossMobPart != head) { @@ -1193,10 +1193,10 @@ void EnderDragon::tickDeath() { int newCount = ExperienceOrb::getExperienceValue(xpCount); xpCount -= newCount; - level->addEntity(shared_ptr( new ExperienceOrb(level, x, y, z, newCount) )); + level->addEntity(std::shared_ptr( new ExperienceOrb(level, x, y, z, newCount) )); } } - if (dragonDeathTime == 1) + if (dragonDeathTime == 1) { //level->globalLevelEvent(LevelEvent::SOUND_DRAGON_DEATH, (int) x, (int) y, (int) z, 0); level->levelEvent(LevelEvent::SOUND_DRAGON_DEATH, (int) x, (int) y, (int) z, 0); @@ -1214,7 +1214,7 @@ void EnderDragon::tickDeath() { int newCount = ExperienceOrb::getExperienceValue(xpCount); xpCount -= newCount; - level->addEntity(shared_ptr( new ExperienceOrb(level, x, y, z, newCount))); + level->addEntity(std::shared_ptr( new ExperienceOrb(level, x, y, z, newCount))); } int xo = 5 + random->nextInt(2) * 2 - 1; int zo = 5 + random->nextInt(2) * 2 - 1; @@ -1312,7 +1312,7 @@ void EnderDragon::checkDespawn() { } -vector > *EnderDragon::getSubEntities() +vector > *EnderDragon::getSubEntities() { return &subEntities; } @@ -1323,7 +1323,7 @@ bool EnderDragon::isPickable() } // Fix for TU9 Enderdragon sound hits being the player sound hits - moved this forward from later version -int EnderDragon::getHurtSound() +int EnderDragon::getHurtSound() { return eSoundType_MOB_ENDERDRAGON_HIT; } @@ -1435,7 +1435,7 @@ EnderDragon::EEnderdragonAction EnderDragon::getSynchedAction() void EnderDragon::handleCrystalDestroyed(DamageSource *source) { AABB *tempBB = AABB::newTemp(PODIUM_X_POS,84.0,PODIUM_Z_POS,PODIUM_X_POS+1.0,85.0,PODIUM_Z_POS+1.0); - vector > *crystals = level->getEntitiesOfClass(typeid(EnderCrystal), tempBB->grow(48, 40, 48)); + vector > *crystals = level->getEntitiesOfClass(typeid(EnderCrystal), tempBB->grow(48, 40, 48)); m_remainingCrystalsCount = (int)crystals->size() - 1; if(m_remainingCrystalsCount < 0) m_remainingCrystalsCount = 0; delete crystals; @@ -1751,7 +1751,7 @@ Path *EnderDragon::reconstruct_path(Node *from, Node *to) NodeArray nodes = NodeArray(count); n = to; nodes.data[--count] = n; - while (n->cameFrom != NULL) + while (n->cameFrom != NULL) { n = n->cameFrom; nodes.data[--count] = n; @@ -1761,7 +1761,7 @@ Path *EnderDragon::reconstruct_path(Node *from, Node *to) return ret; } -void EnderDragon::addAdditonalSaveData(CompoundTag *entityTag) +void EnderDragon::addAdditonalSaveData(CompoundTag *entityTag) { app.DebugPrintf("Adding EnderDragon additional save data\n"); entityTag->putShort(L"RemainingCrystals", m_remainingCrystalsCount); @@ -1770,7 +1770,7 @@ void EnderDragon::addAdditonalSaveData(CompoundTag *entityTag) BossMob::addAdditonalSaveData(entityTag); } -void EnderDragon::readAdditionalSaveData(CompoundTag *tag) +void EnderDragon::readAdditionalSaveData(CompoundTag *tag) { app.DebugPrintf("Reading EnderDragon additional save data\n"); m_remainingCrystalsCount = tag->getShort(L"RemainingCrystals"); @@ -1895,7 +1895,7 @@ double EnderDragon::getHeadPartYRotDiff(int partIndex, doubleArray bodyPos, doub Vec3 *EnderDragon::getHeadLookVector(float a) { Vec3 *result = NULL; - + if( getSynchedAction() == e_EnderdragonAction_Landing || getSynchedAction() == e_EnderdragonAction_Takeoff ) { int eggHeight = level->getTopSolidBlock(PODIUM_X_POS,PODIUM_Z_POS); //level->getHeightmap(4,4); @@ -1903,7 +1903,7 @@ Vec3 *EnderDragon::getHeadLookVector(float a) if( dist < 1.0f ) dist = 1.0f; // The 6.0f is dragon->getHeadPartYOffset(6, start, p) float yOffset = 6.0f / dist; - + double xRotTemp = xRot; double rotScale = 1.5f; xRot = -yOffset * rotScale * 5.0f; diff --git a/Minecraft.World/EnderDragon.h b/Minecraft.World/EnderDragon.h index 8a12c08c..93a352c5 100644 --- a/Minecraft.World/EnderDragon.h +++ b/Minecraft.World/EnderDragon.h @@ -16,7 +16,7 @@ public: private: static const int DATA_ID_SYNCHED_HEALTH = 16; - + // 4J Added for new behaviours static const int DATA_ID_SYNCHED_ACTION = 17; @@ -28,15 +28,15 @@ public: int posPointer; //BossMobPart[] subEntities; - vector > subEntities; - shared_ptr head; - shared_ptr neck; // 4J Added - shared_ptr body; - shared_ptr tail1; - shared_ptr tail2; - shared_ptr tail3; - shared_ptr wing1; - shared_ptr wing2; + vector > subEntities; + std::shared_ptr head; + std::shared_ptr neck; // 4J Added + std::shared_ptr body; + std::shared_ptr tail1; + std::shared_ptr tail2; + std::shared_ptr tail3; + std::shared_ptr wing1; + std::shared_ptr wing2; float oFlapTime; float flapTime; @@ -99,13 +99,13 @@ private: static const int PODIUM_Z_POS = 0; private: - shared_ptr attackTarget; + std::shared_ptr attackTarget; public: int dragonDeathTime; public: - shared_ptr nearestCrystal; + std::shared_ptr nearestCrystal; private: void _init(); @@ -126,14 +126,14 @@ private: void checkCrystals(); void checkAttack(); - void knockBack(vector > *entities); - void hurt(vector > *entities); + void knockBack(vector > *entities); + void hurt(vector > *entities); void findNewTarget(); float rotWrap(double d); bool checkWalls(AABB *bb); public: - virtual bool hurt(shared_ptr bossMobPart, DamageSource *source, int damage); + virtual bool hurt(std::shared_ptr bossMobPart, DamageSource *source, int damage); protected: virtual void tickDeath(); @@ -145,7 +145,7 @@ protected: virtual void checkDespawn(); virtual int getHurtSound(); public: - virtual vector > *getSubEntities(); + virtual vector > *getSubEntities(); virtual bool isPickable(); virtual int getSynchedHealth(); @@ -161,10 +161,10 @@ private: void strafeAttackTarget(); void navigateToNextPathNode(); -public: +public: virtual void addAdditonalSaveData(CompoundTag *entityTag); virtual void readAdditionalSaveData(CompoundTag *tag); - + public: void handleCrystalDestroyed(DamageSource *source); diff --git a/Minecraft.World/EnderEyeItem.cpp b/Minecraft.World/EnderEyeItem.cpp index a08c1f62..4e82597e 100644 --- a/Minecraft.World/EnderEyeItem.cpp +++ b/Minecraft.World/EnderEyeItem.cpp @@ -13,7 +13,7 @@ EnderEyeItem::EnderEyeItem(int id) : Item(id) { } -bool EnderEyeItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool EnderEyeItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { int targetType = level->getTile(x, y, z); int targetData = level->getData(x, y, z); @@ -132,7 +132,7 @@ bool EnderEyeItem::useOn(shared_ptr instance, shared_ptr p return false; } -bool EnderEyeItem::TestUse(Level *level, shared_ptr player) +bool EnderEyeItem::TestUse(Level *level, std::shared_ptr player) { HitResult *hr = getPlayerPOVHitResult(level, player, false); if (hr != NULL && hr->type == HitResult::TILE) @@ -157,15 +157,15 @@ bool EnderEyeItem::TestUse(Level *level, shared_ptr player) } else { -// int x,z; +// int x,z; // if(app.GetTerrainFeaturePosition(eTerrainFeature_Stronghold,&x,&z)) // { // level->getLevelData()->setXStronghold(x); // level->getLevelData()->setZStronghold(z); // level->getLevelData()->setHasStronghold(); -// +// // app.DebugPrintf("=== FOUND stronghold in terrain features list\n"); -// +// // app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_StrongholdPosition); // } // else @@ -185,7 +185,7 @@ bool EnderEyeItem::TestUse(Level *level, shared_ptr player) return false; } -shared_ptr EnderEyeItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr EnderEyeItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { HitResult *hr = getPlayerPOVHitResult(level, player, false); if (hr != NULL && hr->type == HitResult::TILE) @@ -206,7 +206,7 @@ shared_ptr EnderEyeItem::use(shared_ptr instance, Le { if((level->dimension->id==LevelData::DIMENSION_OVERWORLD) && level->getLevelData()->getHasStronghold()) { - shared_ptr eyeOfEnderSignal = shared_ptr( new EyeOfEnderSignal(level, player->x, player->y + 1.62 - player->heightOffset, player->z) ); + std::shared_ptr eyeOfEnderSignal = std::shared_ptr( new EyeOfEnderSignal(level, player->x, player->y + 1.62 - player->heightOffset, player->z) ); eyeOfEnderSignal->signalTo(level->getLevelData()->getXStronghold()<<4, player->y + 1.62 - player->heightOffset, level->getLevelData()->getZStronghold()<<4); level->addEntity(eyeOfEnderSignal); @@ -221,7 +221,7 @@ shared_ptr EnderEyeItem::use(shared_ptr instance, Le /*TilePos *nearestMapFeature = level->findNearestMapFeature(LargeFeature::STRONGHOLD, (int) player->x, (int) player->y, (int) player->z); if (nearestMapFeature != NULL) { - shared_ptr eyeOfEnderSignal = shared_ptr( new EyeOfEnderSignal(level, player->x, player->y + 1.62 - player->heightOffset, player->z) ); + std::shared_ptr eyeOfEnderSignal = std::shared_ptr( new EyeOfEnderSignal(level, player->x, player->y + 1.62 - player->heightOffset, player->z) ); eyeOfEnderSignal->signalTo(nearestMapFeature->x, nearestMapFeature->y, nearestMapFeature->z); delete nearestMapFeature; level->addEntity(eyeOfEnderSignal); diff --git a/Minecraft.World/EnderEyeItem.h b/Minecraft.World/EnderEyeItem.h index 72036aa5..cbe56cfb 100644 --- a/Minecraft.World/EnderEyeItem.h +++ b/Minecraft.World/EnderEyeItem.h @@ -7,7 +7,7 @@ class EnderEyeItem : public Item public: EnderEyeItem(int id); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - virtual bool TestUse(Level *level, shared_ptr player); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool TestUse(Level *level, std::shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/EnderMan.cpp b/Minecraft.World/EnderMan.cpp index abfc5cb5..e5995587 100644 --- a/Minecraft.World/EnderMan.cpp +++ b/Minecraft.World/EnderMan.cpp @@ -83,16 +83,16 @@ void EnderMan::readAdditionalSaveData(CompoundTag *tag) setCarryingData(tag->getShort(L"carryingData")); } -shared_ptr EnderMan::findAttackTarget() +std::shared_ptr EnderMan::findAttackTarget() { #ifndef _FINAL_BUILD if(app.GetMobsDontAttackEnabled()) { - return shared_ptr(); + return std::shared_ptr(); } #endif - shared_ptr player = level->getNearestAttackablePlayer(shared_from_this(), 64); + std::shared_ptr player = level->getNearestAttackablePlayer(shared_from_this(), 64); if (player != NULL) { if (isLookingAtMe(player)) @@ -112,9 +112,9 @@ shared_ptr EnderMan::findAttackTarget() return nullptr; } -bool EnderMan::isLookingAtMe(shared_ptr player) +bool EnderMan::isLookingAtMe(std::shared_ptr player) { - shared_ptr helmet = player->inventory->armor[3]; + std::shared_ptr helmet = player->inventory->armor[3]; if (helmet != NULL && helmet->id == Tile::pumpkin_Id) return false; Vec3 *look = player->getViewVector(1)->normalize(); @@ -250,7 +250,7 @@ bool EnderMan::teleport() return teleport(xx, yy, zz); } -bool EnderMan::teleportTowards(shared_ptr e) +bool EnderMan::teleportTowards(std::shared_ptr e) { Vec3 *dir = Vec3::newTemp(x - e->x, bb->y0 + bbHeight / 2 - e->y + e->getHeadHeight(), z - e->z); dir = dir->normalize(); diff --git a/Minecraft.World/EnderMan.h b/Minecraft.World/EnderMan.h index f5084532..3b2bda86 100644 --- a/Minecraft.World/EnderMan.h +++ b/Minecraft.World/EnderMan.h @@ -33,17 +33,17 @@ public: virtual void readAdditionalSaveData(CompoundTag *tag); protected: - virtual shared_ptr findAttackTarget(); + virtual std::shared_ptr findAttackTarget(); private: - bool isLookingAtMe(shared_ptr player); + bool isLookingAtMe(std::shared_ptr player); public: virtual void aiStep(); protected: bool teleport(); - bool teleportTowards(shared_ptr e); + bool teleportTowards(std::shared_ptr e); bool teleport(double xx, double yy, double zz); virtual int getAmbientSound(); diff --git a/Minecraft.World/EnderpearlItem.cpp b/Minecraft.World/EnderpearlItem.cpp index 7a9b6e52..e103b73b 100644 --- a/Minecraft.World/EnderpearlItem.cpp +++ b/Minecraft.World/EnderpearlItem.cpp @@ -10,12 +10,12 @@ EnderpearlItem::EnderpearlItem(int id) : Item(id) this->maxStackSize = 16; } -bool EnderpearlItem::TestUse(Level *level, shared_ptr player) +bool EnderpearlItem::TestUse(Level *level, std::shared_ptr player) { return true; } -shared_ptr EnderpearlItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr EnderpearlItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { // 4J-PB - Not sure why this was disabled for creative mode, so commenting out //if (player->abilities.instabuild) return instance; @@ -26,9 +26,9 @@ shared_ptr EnderpearlItem::use(shared_ptr instance, } level->playSound(player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f)); - if (!level->isClientSide) + if (!level->isClientSide) { - level->addEntity( shared_ptr( new ThrownEnderpearl(level, player) ) ); + level->addEntity( std::shared_ptr( new ThrownEnderpearl(level, player) ) ); } return instance; } \ No newline at end of file diff --git a/Minecraft.World/EnderpearlItem.h b/Minecraft.World/EnderpearlItem.h index 84913b9e..5dbcb619 100644 --- a/Minecraft.World/EnderpearlItem.h +++ b/Minecraft.World/EnderpearlItem.h @@ -7,7 +7,7 @@ class EnderpearlItem : public Item public: EnderpearlItem(int id); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); // 4J added - virtual bool TestUse(Level *level, shared_ptr player); + virtual bool TestUse(Level *level, std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/Entity.cpp b/Minecraft.World/Entity.cpp index 4c9d5cf6..6b602f6e 100644 --- a/Minecraft.World/Entity.cpp +++ b/Minecraft.World/Entity.cpp @@ -309,7 +309,7 @@ void Entity::_init(bool useSmallId) fireImmune = false; // values that need to be sent to clients in SMP - entityData = shared_ptr(new SynchedEntityData()); + entityData = std::shared_ptr(new SynchedEntityData()); xRideRotA = yRideRotA = 0.0; inChunk = false; @@ -350,7 +350,7 @@ Entity::~Entity() delete bb; } -shared_ptr Entity::getEntityData() +std::shared_ptr Entity::getEntityData() { return entityData; } @@ -372,7 +372,7 @@ void Entity::resetPos() { if (level == NULL) return; - shared_ptr sharedThis = shared_from_this(); + std::shared_ptr sharedThis = shared_from_this(); while (true && y > 0) { setPos(x, y, z); @@ -392,7 +392,7 @@ void Entity::remove() void Entity::setSize(float w, float h) { - if (w != bbWidth || h != bbHeight) + if (w != bbWidth || h != bbHeight) { float oldW = bbWidth; @@ -403,7 +403,7 @@ void Entity::setSize(float w, float h) bb->z1 = bb->z0 + bbWidth; bb->y1 = bb->y0 + bbHeight; - if (bbWidth > oldW && !firstTick && !level->isClientSide) + if (bbWidth > oldW && !firstTick && !level->isClientSide) { move(oldW - bbWidth, 0, oldW - bbWidth); } @@ -421,7 +421,7 @@ void Entity::setPos(EntityPos *pos) void Entity::setRot(float yRot, float xRot) { - /* JAVA: + /* JAVA: this->yRot = yRot % 360.0f; this->xRot = xRot % 360.0f; @@ -531,7 +531,7 @@ void Entity::baseTick() fallDistance = 0; wasInWater = true; onFire = 0; - } + } else { wasInWater = false; @@ -541,7 +541,7 @@ void Entity::baseTick() { onFire = 0; } - else + else { if (onFire > 0) { @@ -958,7 +958,7 @@ void Entity::playStepSound(int xt, int yt, int zt, int t) } } else - { + { if (level->getTile(xt, yt + 1, zt) == Tile::topSnow_Id) { soundType = Tile::topSnow->soundType; @@ -1020,7 +1020,7 @@ void Entity::checkFallDamage(double ya, bool onGround) causeFallDamage(fallDistance); fallDistance = 0; } - } + } else { if (ya < 0) fallDistance -= (float) ya; @@ -1169,7 +1169,7 @@ void Entity::moveTo(double x, double y, double z, float yRot, float xRot) this->setPos(this->x, this->y, this->z); } -float Entity::distanceTo(shared_ptr e) +float Entity::distanceTo(std::shared_ptr e) { float xd = (float) (x - e->x); float yd = (float) (y - e->y); @@ -1193,7 +1193,7 @@ double Entity::distanceTo(double x2, double y2, double z2) return sqrt(xd * xd + yd * yd + zd * zd); } -double Entity::distanceToSqr(shared_ptr e) +double Entity::distanceToSqr(std::shared_ptr e) { double xd = x - e->x; double yd = y - e->y; @@ -1201,11 +1201,11 @@ double Entity::distanceToSqr(shared_ptr e) return xd * xd + yd * yd + zd * zd; } -void Entity::playerTouch(shared_ptr player) +void Entity::playerTouch(std::shared_ptr player) { } -void Entity::push(shared_ptr e) +void Entity::push(std::shared_ptr e) { if (e->rider.lock().get() == this || e->riding.get() == this) return; @@ -1277,7 +1277,7 @@ bool Entity::isShootable() return false; } -void Entity::awardKillScore(shared_ptr victim, int score) +void Entity::awardKillScore(std::shared_ptr victim, int score) { } @@ -1437,19 +1437,19 @@ float Entity::getShadowHeightOffs() return bbHeight / 2; } -shared_ptr Entity::spawnAtLocation(int resource, int count) +std::shared_ptr Entity::spawnAtLocation(int resource, int count) { return spawnAtLocation(resource, count, 0); } -shared_ptr Entity::spawnAtLocation(int resource, int count, float yOffs) +std::shared_ptr Entity::spawnAtLocation(int resource, int count, float yOffs) { - return spawnAtLocation(shared_ptr( new ItemInstance(resource, count, 0) ), yOffs); + return spawnAtLocation(std::shared_ptr( new ItemInstance(resource, count, 0) ), yOffs); } -shared_ptr Entity::spawnAtLocation(shared_ptr itemInstance, float yOffs) +std::shared_ptr Entity::spawnAtLocation(std::shared_ptr itemInstance, float yOffs) { - shared_ptr ie = shared_ptr( new ItemEntity(level, x, y + yOffs, z, itemInstance) ); + std::shared_ptr ie = std::shared_ptr( new ItemEntity(level, x, y + yOffs, z, itemInstance) ); ie->throwTime = 10; level->addEntity(ie); return ie; @@ -1478,12 +1478,12 @@ bool Entity::isInWall() return false; } -bool Entity::interact(shared_ptr player) +bool Entity::interact(std::shared_ptr player) { return false; } -AABB *Entity::getCollideAgainstBox(shared_ptr entity) +AABB *Entity::getCollideAgainstBox(std::shared_ptr entity) { return NULL; } @@ -1531,10 +1531,10 @@ void Entity::rideTick() void Entity::positionRider() { - shared_ptr lockedRider = rider.lock(); + std::shared_ptr lockedRider = rider.lock(); if( lockedRider ) { - shared_ptr player = dynamic_pointer_cast(lockedRider); + std::shared_ptr player = dynamic_pointer_cast(lockedRider); if (!(player && player->isLocalPlayer())) { lockedRider->xOld = xOld; @@ -1555,7 +1555,7 @@ double Entity::getRideHeight() return bbHeight * .75; } -void Entity::ride(shared_ptr e) +void Entity::ride(std::shared_ptr e) { xRideRotA = 0; yRideRotA = 0; @@ -1580,7 +1580,7 @@ void Entity::ride(shared_ptr e) } // 4J Stu - Brought forward from 12w36 to fix #46282 - TU5: Gameplay: Exiting the minecart in a tight corridor damages the player -void Entity::findStandUpPosition(shared_ptr vehicle) +void Entity::findStandUpPosition(std::shared_ptr vehicle) { AABB *boundingBox; double fallbackX = vehicle->x; @@ -1690,7 +1690,7 @@ ItemInstanceArray Entity::getEquipmentSlots() // ItemInstance[] } // 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game -void Entity::setEquippedSlot(int slot, shared_ptr item) +void Entity::setEquippedSlot(int slot, std::shared_ptr item) { } @@ -1739,7 +1739,7 @@ bool Entity::isInvisible() return getSharedFlag(FLAG_INVISIBLE); } -bool Entity::isInvisibleTo(shared_ptr plr) +bool Entity::isInvisibleTo(std::shared_ptr plr) { return isInvisible(); } @@ -1777,7 +1777,7 @@ bool Entity::getSharedFlag(int flag) void Entity::setSharedFlag(int flag, bool value) { byte currentValue = entityData->getByte(DATA_SHARED_FLAGS_ID); - if (value) + if (value) { entityData->set(DATA_SHARED_FLAGS_ID, (byte) (currentValue | (1 << flag))); } @@ -1806,7 +1806,7 @@ void Entity::thunderHit(const LightningBolt *lightningBolt) if (onFire == 0) setOnFire(8); } -void Entity::killed(shared_ptr mob) +void Entity::killed(std::shared_ptr mob) { } @@ -1892,12 +1892,12 @@ wstring Entity::getAName() //return I18n.get("entity." + id + ".name"); } -vector > *Entity::getSubEntities() +vector > *Entity::getSubEntities() { return NULL; } -bool Entity::is(shared_ptr other) +bool Entity::is(std::shared_ptr other) { return shared_from_this() == other; } @@ -1921,18 +1921,18 @@ bool Entity::isInvulnerable() return false; } -void Entity::copyPosition(shared_ptr target) +void Entity::copyPosition(std::shared_ptr target) { moveTo(target->x, target->y, target->z, target->yRot, target->xRot); } -void Entity::setAnimOverrideBitmask(unsigned int uiBitmask) +void Entity::setAnimOverrideBitmask(unsigned int uiBitmask) { m_uiAnimOverrideBitmask=uiBitmask; app.DebugPrintf("!!! Setting anim override bitmask to %d\n",uiBitmask); } -unsigned int Entity::getAnimOverrideBitmask() -{ +unsigned int Entity::getAnimOverrideBitmask() +{ if(app.GetGameSettings(eGameSetting_CustomSkinAnim)==0 ) { // We have a force animation for some skins (claptrap) diff --git a/Minecraft.World/Entity.h b/Minecraft.World/Entity.h index bde83e30..2b8b167b 100644 --- a/Minecraft.World/Entity.h +++ b/Minecraft.World/Entity.h @@ -52,7 +52,7 @@ public: bool blocksBuilding; weak_ptr rider; // Changed to weak to avoid circular dependency between rider/riding entity - shared_ptr riding; + std::shared_ptr riding; Level *level; double xo, yo, zo; @@ -118,7 +118,7 @@ protected: bool fireImmune; // values that need to be sent to clients in SMP - shared_ptr entityData; + std::shared_ptr entityData; private: // shared flags that are sent to clients (max 8) @@ -159,7 +159,7 @@ protected: virtual void defineSynchedData() = 0; public: - shared_ptr getEntityData(); + std::shared_ptr getEntityData(); /* public bool equals(Object obj) { @@ -243,12 +243,12 @@ public: virtual void setLevel(Level *level); void absMoveTo(double x, double y, double z, float yRot, float xRot); void moveTo(double x, double y, double z, float yRot, float xRot); - float distanceTo(shared_ptr e); + float distanceTo(std::shared_ptr e); double distanceToSqr(double x2, double y2, double z2); double distanceTo(double x2, double y2, double z2); - double distanceToSqr(shared_ptr e); - virtual void playerTouch(shared_ptr player); - virtual void push(shared_ptr e); + double distanceToSqr(std::shared_ptr e); + virtual void playerTouch(std::shared_ptr player); + virtual void push(std::shared_ptr e); virtual void push(double xa, double ya, double za); protected: @@ -261,7 +261,7 @@ public: virtual bool isPickable(); virtual bool isPushable(); virtual bool isShootable(); - virtual void awardKillScore(shared_ptr victim, int score); + virtual void awardKillScore(std::shared_ptr victim, int score); virtual bool shouldRender(Vec3 *c); virtual bool shouldRenderAtSqrDistance(double distance); virtual int getTexture(); // 4J - changed from wstring to int @@ -283,20 +283,20 @@ protected: public: virtual float getShadowHeightOffs(); - shared_ptr spawnAtLocation(int resource, int count); - shared_ptr spawnAtLocation(int resource, int count, float yOffs); - shared_ptr spawnAtLocation(shared_ptr itemInstance, float yOffs); + std::shared_ptr spawnAtLocation(int resource, int count); + std::shared_ptr spawnAtLocation(int resource, int count, float yOffs); + std::shared_ptr spawnAtLocation(std::shared_ptr itemInstance, float yOffs); virtual bool isAlive(); virtual bool isInWall(); - virtual bool interact(shared_ptr player); - virtual AABB *getCollideAgainstBox(shared_ptr entity); + virtual bool interact(std::shared_ptr player); + virtual AABB *getCollideAgainstBox(std::shared_ptr entity); virtual void rideTick(); virtual void positionRider(); virtual double getRidingHeight(); virtual double getRideHeight(); - virtual void ride(shared_ptr e); - virtual void findStandUpPosition(shared_ptr vehicle); // 4J Stu - Brought forward from 12w36 to fix #46282 - TU5: Gameplay: Exiting the minecart in a tight corridor damages the player + virtual void ride(std::shared_ptr e); + virtual void findStandUpPosition(std::shared_ptr vehicle); // 4J Stu - Brought forward from 12w36 to fix #46282 - TU5: Gameplay: Exiting the minecart in a tight corridor damages the player virtual void lerpTo(double x, double y, double z, float yRot, float xRot, int steps); virtual float getPickRadius(); virtual Vec3 *getLookAngle(); @@ -306,7 +306,7 @@ public: virtual void animateHurt(); virtual void prepareCustomTextures(); virtual ItemInstanceArray getEquipmentSlots(); // ItemInstance[] - virtual void setEquippedSlot(int slot, shared_ptr item); // 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game + virtual void setEquippedSlot(int slot, std::shared_ptr item); // 4J Stu - Brought forward change from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game virtual bool isOnFire(); virtual bool isRiding(); virtual bool isSneaking(); @@ -316,7 +316,7 @@ public: virtual bool isSprinting(); virtual void setSprinting(bool value); virtual bool isInvisible(); - virtual bool isInvisibleTo(shared_ptr plr); + virtual bool isInvisibleTo(std::shared_ptr plr); virtual void setInvisible(bool value); virtual bool isUsingItemFlag(); virtual void setUsingItemFlag(bool value); @@ -336,7 +336,7 @@ public: void setAirSupply(int supply); virtual void thunderHit(const LightningBolt *lightningBolt); - virtual void killed(shared_ptr mob); + virtual void killed(std::shared_ptr mob); protected: bool checkInTile(double x, double y, double z); @@ -347,7 +347,7 @@ public: virtual wstring getAName(); // TU9 - bool skipAttackInteraction(shared_ptr source) {return false;} + bool skipAttackInteraction(std::shared_ptr source) {return false;} // 4J - added to manage allocation of small ids private: @@ -374,14 +374,14 @@ public: void considerForExtraWandering(bool enable); bool isExtraWanderingEnabled(); int getWanderingQuadrant(); - - virtual vector > *getSubEntities(); - virtual bool is(shared_ptr other); + + virtual vector > *getSubEntities(); + virtual bool is(std::shared_ptr other); virtual float getYHeadRot(); virtual void setYHeadRot(float yHeadRot); virtual bool isAttackable(); virtual bool isInvulnerable(); - virtual void copyPosition(shared_ptr target); + virtual void copyPosition(std::shared_ptr target); private: unsigned int m_uiAnimOverrideBitmask; diff --git a/Minecraft.World/EntityActionAtPositionPacket.cpp b/Minecraft.World/EntityActionAtPositionPacket.cpp index 7353f932..af7ee82d 100644 --- a/Minecraft.World/EntityActionAtPositionPacket.cpp +++ b/Minecraft.World/EntityActionAtPositionPacket.cpp @@ -18,7 +18,7 @@ EntityActionAtPositionPacket::EntityActionAtPositionPacket() action = 0; } -EntityActionAtPositionPacket::EntityActionAtPositionPacket(shared_ptr e, int action, int x, int y, int z) +EntityActionAtPositionPacket::EntityActionAtPositionPacket(std::shared_ptr e, int action, int x, int y, int z) { this->action = action; this->x = x; @@ -27,7 +27,7 @@ EntityActionAtPositionPacket::EntityActionAtPositionPacket(shared_ptr e, this->id = e->entityId; } -void EntityActionAtPositionPacket::read(DataInputStream *dis) //throws IOException +void EntityActionAtPositionPacket::read(DataInputStream *dis) //throws IOException { id = dis->readInt(); action = dis->readByte(); diff --git a/Minecraft.World/EntityActionAtPositionPacket.h b/Minecraft.World/EntityActionAtPositionPacket.h index 35202017..57a730d9 100644 --- a/Minecraft.World/EntityActionAtPositionPacket.h +++ b/Minecraft.World/EntityActionAtPositionPacket.h @@ -10,7 +10,7 @@ public: int id, x, y, z, action; EntityActionAtPositionPacket(); - EntityActionAtPositionPacket(shared_ptr e, int action, int x, int y, int z); + EntityActionAtPositionPacket(std::shared_ptr e, int action, int x, int y, int z); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); @@ -18,6 +18,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new EntityActionAtPositionPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new EntityActionAtPositionPacket()); } virtual int getId() { return 17; } }; \ No newline at end of file diff --git a/Minecraft.World/EntityDamageSource.cpp b/Minecraft.World/EntityDamageSource.cpp index 8c7a5ee1..266c867f 100644 --- a/Minecraft.World/EntityDamageSource.cpp +++ b/Minecraft.World/EntityDamageSource.cpp @@ -4,32 +4,32 @@ #include "net.minecraft.world.damagesource.h" #include "net.minecraft.network.packet.h" -//EntityDamageSource::EntityDamageSource(const wstring &msgId, shared_ptr entity) : DamageSource(msgId) -EntityDamageSource::EntityDamageSource(ChatPacket::EChatPacketMessage msgId, shared_ptr entity) : DamageSource(msgId) +//EntityDamageSource::EntityDamageSource(const wstring &msgId, std::shared_ptr entity) : DamageSource(msgId) +EntityDamageSource::EntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr entity) : DamageSource(msgId) { this->entity = entity; } -shared_ptr EntityDamageSource::getEntity() +std::shared_ptr EntityDamageSource::getEntity() { return entity; } -//wstring EntityDamageSource::getLocalizedDeathMessage(shared_ptr player) +//wstring EntityDamageSource::getLocalizedDeathMessage(std::shared_ptr player) //{ // return L"death." + msgId + player->name + entity->getAName(); // //return I18n.get("death." + msgId, player.name, entity.getAName()); //} -shared_ptr EntityDamageSource::getDeathMessagePacket(shared_ptr player) +std::shared_ptr EntityDamageSource::getDeathMessagePacket(std::shared_ptr player) { wstring additional = L""; if(entity->GetType() == eTYPE_SERVERPLAYER) { - shared_ptr sourcePlayer = dynamic_pointer_cast(entity); + std::shared_ptr sourcePlayer = dynamic_pointer_cast(entity); if(sourcePlayer != NULL) additional = sourcePlayer->name; } - return shared_ptr( new ChatPacket(player->name, m_msgId, entity->GetType(), additional ) ); + return std::shared_ptr( new ChatPacket(player->name, m_msgId, entity->GetType(), additional ) ); } bool EntityDamageSource::scalesWithDifficulty() diff --git a/Minecraft.World/EntityDamageSource.h b/Minecraft.World/EntityDamageSource.h index bdbe36e7..a8a8ffbb 100644 --- a/Minecraft.World/EntityDamageSource.h +++ b/Minecraft.World/EntityDamageSource.h @@ -9,18 +9,18 @@ class Player; class EntityDamageSource : public DamageSource { protected: - shared_ptr entity; + std::shared_ptr entity; public: - //EntityDamageSource(const wstring &msgId, shared_ptr entity); - EntityDamageSource(ChatPacket::EChatPacketMessage msgId, shared_ptr entity); + //EntityDamageSource(const wstring &msgId, std::shared_ptr entity); + EntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr entity); virtual ~EntityDamageSource() { } - shared_ptr getEntity(); + std::shared_ptr getEntity(); // 4J Stu - Made return a packet - //virtual wstring getLocalizedDeathMessage(shared_ptr player); - virtual shared_ptr getDeathMessagePacket(shared_ptr player); + //virtual wstring getLocalizedDeathMessage(std::shared_ptr player); + virtual std::shared_ptr getDeathMessagePacket(std::shared_ptr player); virtual bool scalesWithDifficulty(); }; \ No newline at end of file diff --git a/Minecraft.World/EntityEventPacket.h b/Minecraft.World/EntityEventPacket.h index a151dbdb..264e504c 100644 --- a/Minecraft.World/EntityEventPacket.h +++ b/Minecraft.World/EntityEventPacket.h @@ -18,7 +18,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new EntityEventPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new EntityEventPacket()); } virtual int getId() { return 38; } }; diff --git a/Minecraft.World/EntityIO.cpp b/Minecraft.World/EntityIO.cpp index d0677d38..123d4ba5 100644 --- a/Minecraft.World/EntityIO.cpp +++ b/Minecraft.World/EntityIO.cpp @@ -43,7 +43,7 @@ void EntityIO::staticCtor() { setId(ItemEntity::create, eTYPE_ITEMENTITY, L"Item", 1); setId(ExperienceOrb::create, eTYPE_EXPERIENCEORB, L"XPOrb", 2); - + setId(Painting::create, eTYPE_PAINTING, L"Painting", 9); setId(Arrow::create, eTYPE_ARROW, L"Arrow", 10); setId(Snowball::create, eTYPE_SNOWBALL, L"Snowball", 11); @@ -98,29 +98,29 @@ void EntityIO::staticCtor() setId(DragonFireball::create, eTYPE_DRAGON_FIREBALL, L"DragonFireball", 1000); } -shared_ptr EntityIO::newEntity(const wstring& id, Level *level) +std::shared_ptr EntityIO::newEntity(const wstring& id, Level *level) { - shared_ptr entity; + std::shared_ptr entity; AUTO_VAR(it, idCreateMap->find(id)); if(it != idCreateMap->end() ) { entityCreateFn create = it->second; - if (create != NULL) entity = shared_ptr(create(level)); + if (create != NULL) entity = std::shared_ptr(create(level)); } return entity; } -shared_ptr EntityIO::loadStatic(CompoundTag *tag, Level *level) +std::shared_ptr EntityIO::loadStatic(CompoundTag *tag, Level *level) { - shared_ptr entity; + std::shared_ptr entity; AUTO_VAR(it, idCreateMap->find(tag->getString(L"id"))); if(it != idCreateMap->end() ) { entityCreateFn create = it->second; - if (create != NULL) entity = shared_ptr(create(level)); + if (create != NULL) entity = std::shared_ptr(create(level)); } if (entity != NULL) @@ -136,15 +136,15 @@ shared_ptr EntityIO::loadStatic(CompoundTag *tag, Level *level) return entity; } -shared_ptr EntityIO::newById(int id, Level *level) +std::shared_ptr EntityIO::newById(int id, Level *level) { - shared_ptr entity; + std::shared_ptr entity; AUTO_VAR(it, numCreateMap->find(id)); if(it != numCreateMap->end() ) { entityCreateFn create = it->second; - if (create != NULL) entity = shared_ptr(create(level)); + if (create != NULL) entity = std::shared_ptr(create(level)); } if (entity != NULL) @@ -157,9 +157,9 @@ shared_ptr EntityIO::newById(int id, Level *level) return entity; } -shared_ptr EntityIO::newByEnumType(eINSTANCEOF eType, Level *level) +std::shared_ptr EntityIO::newByEnumType(eINSTANCEOF eType, Level *level) { - shared_ptr entity; + std::shared_ptr entity; unordered_map::iterator it = classNumMap->find( eType ); if( it != classNumMap->end() ) @@ -168,20 +168,20 @@ shared_ptr EntityIO::newByEnumType(eINSTANCEOF eType, Level *level) if(it2 != numCreateMap->end() ) { entityCreateFn create = it2->second; - if (create != NULL) entity = shared_ptr(create(level)); + if (create != NULL) entity = std::shared_ptr(create(level)); } } return entity; } -int EntityIO::getId(shared_ptr entity) +int EntityIO::getId(std::shared_ptr entity) { unordered_map::iterator it = classNumMap->find( entity->GetType() ); return (*it).second; } -wstring EntityIO::getEncodeId(shared_ptr entity) +wstring EntityIO::getEncodeId(std::shared_ptr entity) { unordered_map::iterator it = classIdMap->find( entity->GetType() ); if( it != classIdMap->end() ) @@ -208,7 +208,7 @@ wstring EntityIO::getEncodeId(int entityIoValue) //{ //return classIdMap.get(class1); //} - + AUTO_VAR(it, numClassMap->find(entityIoValue)); if(it != numClassMap->end() ) { diff --git a/Minecraft.World/EntityIO.h b/Minecraft.World/EntityIO.h index c9aa9f65..be233d1d 100644 --- a/Minecraft.World/EntityIO.h +++ b/Minecraft.World/EntityIO.h @@ -44,12 +44,12 @@ private: public: static void staticCtor(); - static shared_ptr newEntity(const wstring& id, Level *level); - static shared_ptr loadStatic(CompoundTag *tag, Level *level); - static shared_ptr newById(int id, Level *level); - static shared_ptr newByEnumType(eINSTANCEOF eType, Level *level); - static int getId(shared_ptr entity); - static wstring getEncodeId(shared_ptr entity); + static std::shared_ptr newEntity(const wstring& id, Level *level); + static std::shared_ptr loadStatic(CompoundTag *tag, Level *level); + static std::shared_ptr newById(int id, Level *level); + static std::shared_ptr newByEnumType(eINSTANCEOF eType, Level *level); + static int getId(std::shared_ptr entity); + static wstring getEncodeId(std::shared_ptr entity); static int getId(const wstring &encodeId); static wstring getEncodeId(int entityIoValue); static int getNameId(int entityIoValue); diff --git a/Minecraft.World/EntityPos.cpp b/Minecraft.World/EntityPos.cpp index 38b50573..8968ef80 100644 --- a/Minecraft.World/EntityPos.cpp +++ b/Minecraft.World/EntityPos.cpp @@ -34,7 +34,7 @@ EntityPos::EntityPos(float yRot, float xRot) move = false; } -EntityPos *EntityPos::lerp(shared_ptr e, float f) +EntityPos *EntityPos::lerp(std::shared_ptr e, float f) { double xd = e->x+(x-e->x)*f; double yd = e->y+(y-e->y)*f; diff --git a/Minecraft.World/EntityPos.h b/Minecraft.World/EntityPos.h index 5b064901..6b82af01 100644 --- a/Minecraft.World/EntityPos.h +++ b/Minecraft.World/EntityPos.h @@ -11,5 +11,5 @@ public: EntityPos(double x, double y, double z, float yRot, float xRot); EntityPos(double x, double y, double z); EntityPos(float yRot, float xRot); - EntityPos *lerp(shared_ptr e, float f); + EntityPos *lerp(std::shared_ptr e, float f); }; \ No newline at end of file diff --git a/Minecraft.World/EntityTile.cpp b/Minecraft.World/EntityTile.cpp index 8dd68ff2..107742f3 100644 --- a/Minecraft.World/EntityTile.cpp +++ b/Minecraft.World/EntityTile.cpp @@ -24,7 +24,7 @@ void EntityTile::onRemove(Level *level, int x, int y, int z, int id, int data) void EntityTile::triggerEvent(Level *level, int x, int y, int z, int b0, int b1) { Tile::triggerEvent(level, x, y, z, b0, b1); - shared_ptr te = level->getTileEntity(x, y, z); + std::shared_ptr te = level->getTileEntity(x, y, z); if (te != NULL) { te->triggerEvent(b0, b1); diff --git a/Minecraft.World/EntityTile.h b/Minecraft.World/EntityTile.h index 7f781c19..584fd1d4 100644 --- a/Minecraft.World/EntityTile.h +++ b/Minecraft.World/EntityTile.h @@ -10,6 +10,6 @@ protected: public: virtual void onPlace(Level *level, int x, int y, int z); virtual void onRemove(Level *level, int x, int y, int z, int id, int data); - virtual shared_ptr newTileEntity(Level *level) = 0; + virtual std::shared_ptr newTileEntity(Level *level) = 0; virtual void triggerEvent(Level *level, int x, int y, int z, int b0, int b1); }; \ No newline at end of file diff --git a/Minecraft.World/ExperienceCommand.cpp b/Minecraft.World/ExperienceCommand.cpp index b8ac2efc..7959212c 100644 --- a/Minecraft.World/ExperienceCommand.cpp +++ b/Minecraft.World/ExperienceCommand.cpp @@ -9,7 +9,7 @@ EGameCommand ExperienceCommand::getId() return eGameCommand_Experience; } -void ExperienceCommand::execute(shared_ptr source, byteArray commandData) +void ExperienceCommand::execute(std::shared_ptr source, byteArray commandData) { //if (args.length > 0) //{ @@ -27,10 +27,10 @@ void ExperienceCommand::execute(shared_ptr source, byteArray comm //} } -shared_ptr ExperienceCommand::getPlayer(PlayerUID playerId) +std::shared_ptr ExperienceCommand::getPlayer(PlayerUID playerId) { return nullptr; - //shared_ptr player = MinecraftServer::getInstance()->getPlayers()->getPlayer(playerId); + //std::shared_ptr player = MinecraftServer::getInstance()->getPlayers()->getPlayer(playerId); //if (player == null) //{ diff --git a/Minecraft.World/ExperienceCommand.h b/Minecraft.World/ExperienceCommand.h index b1dd2cbe..5165428f 100644 --- a/Minecraft.World/ExperienceCommand.h +++ b/Minecraft.World/ExperienceCommand.h @@ -8,8 +8,8 @@ class ExperienceCommand : public Command { public: virtual EGameCommand getId(); - virtual void execute(shared_ptr source, byteArray commandData); + virtual void execute(std::shared_ptr source, byteArray commandData); protected: - shared_ptr getPlayer(PlayerUID playerId); + std::shared_ptr getPlayer(PlayerUID playerId); }; \ No newline at end of file diff --git a/Minecraft.World/ExperienceItem.cpp b/Minecraft.World/ExperienceItem.cpp index 497c2385..d2d5b896 100644 --- a/Minecraft.World/ExperienceItem.cpp +++ b/Minecraft.World/ExperienceItem.cpp @@ -10,23 +10,23 @@ ExperienceItem::ExperienceItem(int id) : Item(id) { } -bool ExperienceItem::isFoil(shared_ptr itemInstance) +bool ExperienceItem::isFoil(std::shared_ptr itemInstance) { return true; } -bool ExperienceItem::TestUse(Level *level, shared_ptr player) +bool ExperienceItem::TestUse(Level *level, std::shared_ptr player) { return true; } -shared_ptr ExperienceItem::use(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr ExperienceItem::use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { if (!player->abilities.instabuild) { itemInstance->count--; } level->playSound(player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f)); - if (!level->isClientSide) level->addEntity( shared_ptr( new ThrownExpBottle(level, player) )); + if (!level->isClientSide) level->addEntity( std::shared_ptr( new ThrownExpBottle(level, player) )); return itemInstance; } \ No newline at end of file diff --git a/Minecraft.World/ExperienceItem.h b/Minecraft.World/ExperienceItem.h index c8e95925..c0d18dcf 100644 --- a/Minecraft.World/ExperienceItem.h +++ b/Minecraft.World/ExperienceItem.h @@ -9,7 +9,7 @@ class ExperienceItem : public Item public: ExperienceItem(int id); - virtual bool isFoil(shared_ptr itemInstance); - virtual shared_ptr use(shared_ptr itemInstance, Level *level, shared_ptr player); - virtual bool TestUse(Level *level, shared_ptr player); + virtual bool isFoil(std::shared_ptr itemInstance); + virtual std::shared_ptr use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); + virtual bool TestUse(Level *level, std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/ExperienceOrb.cpp b/Minecraft.World/ExperienceOrb.cpp index 76f2a9ae..a8ae4da4 100644 --- a/Minecraft.World/ExperienceOrb.cpp +++ b/Minecraft.World/ExperienceOrb.cpp @@ -187,7 +187,7 @@ void ExperienceOrb::readAdditionalSaveData(CompoundTag *tag) value = tag->getShort(L"Value"); } -void ExperienceOrb::playerTouch(shared_ptr player) +void ExperienceOrb::playerTouch(std::shared_ptr player) { if (level->isClientSide) return; @@ -258,7 +258,7 @@ int ExperienceOrb::getIcon() * Fetches the biggest possible experience orb value based on a maximum * value. The current algorithm is next prime which is at least twice more * than the previous one. -* +* * @param maxValue * @return */ diff --git a/Minecraft.World/ExperienceOrb.h b/Minecraft.World/ExperienceOrb.h index 524ae52a..d506de93 100644 --- a/Minecraft.World/ExperienceOrb.h +++ b/Minecraft.World/ExperienceOrb.h @@ -20,7 +20,7 @@ public: private: int health; int value; - shared_ptr followingPlayer; + std::shared_ptr followingPlayer; int followingTime; void _init(); @@ -49,7 +49,7 @@ public: virtual bool hurt(DamageSource *source, int damage); virtual void addAdditonalSaveData(CompoundTag *entityTag); virtual void readAdditionalSaveData(CompoundTag *tag); - virtual void playerTouch(shared_ptr player); + virtual void playerTouch(std::shared_ptr player); int getValue(); int getIcon(); diff --git a/Minecraft.World/ExplodePacket.h b/Minecraft.World/ExplodePacket.h index d4d8b3f9..7f2f0e1b 100644 --- a/Minecraft.World/ExplodePacket.h +++ b/Minecraft.World/ExplodePacket.h @@ -11,7 +11,7 @@ public: float r; vector toBlow; // 4J - was an unorderedset but doesn't require any features of that apart from making it match the ctor toBlow type bool m_bKnockbackOnly; - + private: float knockbackX; float knockbackY; @@ -32,6 +32,6 @@ public: float getKnockbackZ(); public: - static shared_ptr create() { return shared_ptr(new ExplodePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ExplodePacket()); } virtual int getId() { return 60; } }; \ No newline at end of file diff --git a/Minecraft.World/Explosion.cpp b/Minecraft.World/Explosion.cpp index 604813b7..c3facfe7 100644 --- a/Minecraft.World/Explosion.cpp +++ b/Minecraft.World/Explosion.cpp @@ -8,7 +8,7 @@ #include "Explosion.h" #include "SoundTypes.h" -Explosion::Explosion(Level *level, shared_ptr source, double x, double y, double z, float r) +Explosion::Explosion(Level *level, std::shared_ptr source, double x, double y, double z, float r) { fire = false; random = new Random(); @@ -97,14 +97,14 @@ void Explosion::explode() // Fix for 360 #123866 - [CRASH] TU13: Code: Compliance: Placing the TNT next to Ender Crystals will crash the title after a certain amount of time. // If we explode something next to an EnderCrystal then it creates a new explosion that overwrites the shared vector in the level // So copy it here instead of directly using the shared one - vector > *levelEntities = level->getEntities(source, AABB::newTemp(x0, y0, z0, x1, y1, z1)); - vector > entities(levelEntities->begin(), levelEntities->end() ); + vector > *levelEntities = level->getEntities(source, AABB::newTemp(x0, y0, z0, x1, y1, z1)); + vector > entities(levelEntities->begin(), levelEntities->end() ); Vec3 *center = Vec3::newTemp(x, y, z); AUTO_VAR(itEnd, entities.end()); for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { - shared_ptr e = *it; //entities->at(i); + std::shared_ptr e = *it; //entities->at(i); // 4J Stu - If the entity is not in a block that would be blown up, then they should not be damaged // Fix for #46606 - TU5: Content: Gameplay: The player can be damaged and killed by explosions behind obsidian walls @@ -147,9 +147,9 @@ void Explosion::explode() double push = pow; e->xd += xa * push; e->yd += ya * push; - e->zd += za * push; + e->zd += za * push; - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); if (player != NULL) { //app.DebugPrintf("Adding player knockback (%f,%f,%f)\n", xa * pow, ya * pow, za * pow); @@ -255,7 +255,7 @@ Explosion::playerVec3Map *Explosion::getHitPlayers() return &hitPlayers; } -Vec3 *Explosion::getHitPlayerKnockback( shared_ptr player ) +Vec3 *Explosion::getHitPlayerKnockback( std::shared_ptr player ) { AUTO_VAR(it, hitPlayers.find(player)); diff --git a/Minecraft.World/Explosion.h b/Minecraft.World/Explosion.h index c06960d2..f98c9e53 100644 --- a/Minecraft.World/Explosion.h +++ b/Minecraft.World/Explosion.h @@ -19,17 +19,17 @@ private: public: double x, y, z; - shared_ptr source; + std::shared_ptr source; float r; unordered_set toBlow; - + private: - typedef unordered_map, Vec3 * , PlayerKeyHash, PlayerKeyEq> playerVec3Map; + typedef unordered_map, Vec3 * , PlayerKeyHash, PlayerKeyEq> playerVec3Map; playerVec3Map hitPlayers; public: - Explosion(Level *level, shared_ptr source, double x, double y, double z, float r); + Explosion(Level *level, std::shared_ptr source, double x, double y, double z, float r); ~Explosion(); public: @@ -38,5 +38,5 @@ public: public: void finalizeExplosion(bool generateParticles, vector *toBlowDirect = NULL); // 4J - added toBlow parameter playerVec3Map *getHitPlayers(); - Vec3 *getHitPlayerKnockback( shared_ptr player ); + Vec3 *getHitPlayerKnockback( std::shared_ptr player ); }; \ No newline at end of file diff --git a/Minecraft.World/EyeOfEnderSignal.cpp b/Minecraft.World/EyeOfEnderSignal.cpp index 39d9f82e..14e19307 100644 --- a/Minecraft.World/EyeOfEnderSignal.cpp +++ b/Minecraft.World/EyeOfEnderSignal.cpp @@ -167,7 +167,7 @@ void EyeOfEnderSignal::tick() remove(); if (surviveAfterDeath) { - level->addEntity(shared_ptr( new ItemEntity(level, x, y, z, shared_ptr(new ItemInstance(Item::eyeOfEnder))))); + level->addEntity(std::shared_ptr( new ItemEntity(level, x, y, z, std::shared_ptr(new ItemInstance(Item::eyeOfEnder))))); } else { diff --git a/Minecraft.World/FallingTile.cpp b/Minecraft.World/FallingTile.cpp index 254631ff..e7cf8f0e 100644 --- a/Minecraft.World/FallingTile.cpp +++ b/Minecraft.World/FallingTile.cpp @@ -19,7 +19,7 @@ void FallingTile::_init() data = 0; time = 0; dropItem = true; - + cancelDrop = false; hurtEntities = false; fallDamageMax = 40; @@ -134,7 +134,7 @@ void FallingTile::tick() } else { - if(dropItem && !cancelDrop) spawnAtLocation( shared_ptr(new ItemInstance(tile, 1, Tile::tiles[tile]->getSpawnResourcesAuxValue(data))), 0); + if(dropItem && !cancelDrop) spawnAtLocation( std::shared_ptr(new ItemInstance(tile, 1, Tile::tiles[tile]->getSpawnResourcesAuxValue(data))), 0); } } } @@ -153,7 +153,7 @@ void FallingTile::causeFallDamage(float distance) int dmg = Mth::ceil(distance - 1); if (dmg > 0) { - vector > *entities = level->getEntities(shared_from_this(), bb); + vector > *entities = level->getEntities(shared_from_this(), bb); DamageSource *source = tile == Tile::anvil_Id ? DamageSource::anvil : DamageSource::fallingBlock; //for (Entity entity : entities) diff --git a/Minecraft.World/FarmTile.cpp b/Minecraft.World/FarmTile.cpp index ecfaf44b..72d428bb 100644 --- a/Minecraft.World/FarmTile.cpp +++ b/Minecraft.World/FarmTile.cpp @@ -74,14 +74,14 @@ void FarmTile::tick(Level *level, int x, int y, int z, Random *random) } } -void FarmTile::fallOn(Level *level, int x, int y, int z, shared_ptr entity, float fallDistance) +void FarmTile::fallOn(Level *level, int x, int y, int z, std::shared_ptr entity, float fallDistance) { // 4J Stu - Fix for #86148 - Code: Gameplay: Jumping on Farmland does not always result in turning to Dirt Block // We should not be setting tiles on the client based on random values! if (!level->isClientSide && level->random->nextFloat() < (fallDistance - .5f)) { // Fix for #60547 - TU7: Content: Gameplay: Players joining a game can destroy crops even with Trust Players option disabled. - shared_ptr player = dynamic_pointer_cast(entity); + std::shared_ptr player = dynamic_pointer_cast(entity); if(player == NULL || player->isAllowedToMine()) level->setTile(x, y, z, Tile::dirt_Id); } } diff --git a/Minecraft.World/FarmTile.h b/Minecraft.World/FarmTile.h index f9b4b031..3c227c2c 100644 --- a/Minecraft.World/FarmTile.h +++ b/Minecraft.World/FarmTile.h @@ -22,7 +22,7 @@ public: virtual bool isCubeShaped(); virtual Icon *getTexture(int face, int data); virtual void tick(Level *level, int x, int y, int z, Random *random); - virtual void fallOn(Level *level, int x, int y, int z, shared_ptr entity, float fallDistance); + virtual void fallOn(Level *level, int x, int y, int z, std::shared_ptr entity, float fallDistance); private: virtual bool isUnderCrops(Level *level, int x, int y, int z); virtual bool isNearWater(Level *level, int x, int y, int z); diff --git a/Minecraft.World/FenceGateTile.cpp b/Minecraft.World/FenceGateTile.cpp index 6b0243ed..561cdf41 100644 --- a/Minecraft.World/FenceGateTile.cpp +++ b/Minecraft.World/FenceGateTile.cpp @@ -37,7 +37,7 @@ AABB *FenceGateTile::getAABB(Level *level, int x, int y, int z) } // 4J - Brought forward from 1.2.3 to fix hit box rotation -void FenceGateTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void FenceGateTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { int data = getDirection(level->getData(x, y, z)); if (data == Direction::NORTH || data == Direction::SOUTH) @@ -75,13 +75,13 @@ int FenceGateTile::getRenderShape() return Tile::SHAPE_FENCE_GATE; } -void FenceGateTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void FenceGateTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int dir = (((Mth::floor(by->yRot * 4 / (360) + 0.5)) & 3)) % 4; level->setData(x, y, z, dir); } -bool FenceGateTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool FenceGateTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly ) { diff --git a/Minecraft.World/FenceGateTile.h b/Minecraft.World/FenceGateTile.h index 277fcd4d..83cc378b 100644 --- a/Minecraft.World/FenceGateTile.h +++ b/Minecraft.World/FenceGateTile.h @@ -11,15 +11,15 @@ public: Icon *getTexture(int face, int data); virtual bool mayPlace(Level *level, int x, int y, int z); virtual AABB *getAABB(Level *level, int x, int y, int z); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param // Brought forward from 1.2.3 + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param // Brought forward from 1.2.3 virtual bool blocksLight(); virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); virtual bool isPathfindable(LevelSource *level, int x, int y, int z); virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face); virtual int getRenderShape(); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param virtual void neighborChanged(Level *level, int x, int y, int z, int type); static bool isOpen(int data); void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/FenceTile.cpp b/Minecraft.World/FenceTile.cpp index 0d1f9bc4..a0c685c6 100644 --- a/Minecraft.World/FenceTile.cpp +++ b/Minecraft.World/FenceTile.cpp @@ -41,7 +41,7 @@ AABB *FenceTile::getAABB(Level *level, int x, int y, int z) return AABB::newTemp(x + west, y, z + north, x + east, y + 1.5f, z + south); } -void FenceTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void FenceTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { bool n = connectsTo(level, x, y, z - 1); bool s = connectsTo(level, x, y, z + 1); diff --git a/Minecraft.World/FenceTile.h b/Minecraft.World/FenceTile.h index 5b61fca4..a08af338 100644 --- a/Minecraft.World/FenceTile.h +++ b/Minecraft.World/FenceTile.h @@ -10,7 +10,7 @@ private: public: FenceTile(int id, const wstring &texture, Material *material); virtual AABB *getAABB(Level *level, int x, int y, int z); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual bool blocksLight(); virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); diff --git a/Minecraft.World/FireChargeItem.cpp b/Minecraft.World/FireChargeItem.cpp index c4e47b0c..435c4663 100644 --- a/Minecraft.World/FireChargeItem.cpp +++ b/Minecraft.World/FireChargeItem.cpp @@ -13,9 +13,9 @@ FireChargeItem::FireChargeItem(int id) : Item(id) m_dragonFireballIcon = NULL; } -bool FireChargeItem::useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool FireChargeItem::useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { - if (level->isClientSide) + if (level->isClientSide) { return true; } @@ -27,7 +27,7 @@ bool FireChargeItem::useOn(shared_ptr itemInstance, shared_ptrmayBuild(x, y, z)) + if (!player->mayBuild(x, y, z)) { return false; } @@ -40,13 +40,13 @@ bool FireChargeItem::useOn(shared_ptr itemInstance, shared_ptrgetTile(x, y, z); - if (targetType == 0) + if (targetType == 0) { level->playSound( x + 0.5, y + 0.5, z + 0.5,eSoundType_FIRE_IGNITE, 1, random->nextFloat() * 0.4f + 0.8f); level->setTile(x, y, z, Tile::fire_Id); } - if (!player->abilities.instabuild) + if (!player->abilities.instabuild) { itemInstance->count--; } diff --git a/Minecraft.World/FireChargeItem.h b/Minecraft.World/FireChargeItem.h index c0890a46..440222b4 100644 --- a/Minecraft.World/FireChargeItem.h +++ b/Minecraft.World/FireChargeItem.h @@ -13,7 +13,7 @@ private: public: FireChargeItem(int id); - virtual bool useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly); + virtual bool useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly); virtual Icon *getIcon(int itemAuxValue); virtual void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/Fireball.cpp b/Minecraft.World/Fireball.cpp index 46be68f7..4f2b53a0 100644 --- a/Minecraft.World/Fireball.cpp +++ b/Minecraft.World/Fireball.cpp @@ -28,7 +28,7 @@ void Fireball::_init() zPower = 0.0; } -Fireball::Fireball(Level *level) : Entity( level ) +Fireball::Fireball(Level *level) : Entity( level ) { // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that // the derived version of the function is called @@ -84,7 +84,7 @@ Fireball::Fireball(Level *level, double x, double y, double z, double xa, double } } -Fireball::Fireball(Level *level, shared_ptr mob, double xa, double ya, double za) : Entity ( level ) +Fireball::Fireball(Level *level, std::shared_ptr mob, double xa, double ya, double za) : Entity ( level ) { // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that // the derived version of the function is called @@ -142,7 +142,7 @@ void Fireball::tick() int minXZ = - (level->dimension->getXZSize() * 16 ) / 2; int maxXZ = (level->dimension->getXZSize() * 16 ) / 2 - 1; - if ((x<=minXZ) || (x>=maxXZ) || (z<=minXZ) || (z>=maxXZ)) + if ((x<=minXZ) || (x>=maxXZ) || (z<=minXZ) || (z>=maxXZ)) { remove(); app.DebugPrintf("Fireball removed - end of world\n"); @@ -163,7 +163,7 @@ void Fireball::tick() if (tile == lastTile) { life++; - if (life == SharedConstants::TICKS_PER_SECOND * 30) + if (life == SharedConstants::TICKS_PER_SECOND * 30) { remove(); app.DebugPrintf("Fireball removed - life is 20*60\n"); @@ -181,7 +181,7 @@ void Fireball::tick() flightTime = 0; } } - else + else { flightTime++; } @@ -197,13 +197,13 @@ void Fireball::tick() { to = Vec3::newTemp(res->pos->x, res->pos->y, res->pos->z); } - shared_ptr hitEntity = nullptr; - vector > *objects = level->getEntities(shared_from_this(), this->bb->expand(xd, yd, zd)->grow(1, 1, 1)); + std::shared_ptr hitEntity = nullptr; + vector > *objects = level->getEntities(shared_from_this(), this->bb->expand(xd, yd, zd)->grow(1, 1, 1)); double nearest = 0; AUTO_VAR(itEnd, objects->end()); for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) { - shared_ptr e = *it; //objects->at(i); + std::shared_ptr e = *it; //objects->at(i); if (!e->isPickable() || (e->is(owner) )) continue; //4J Stu - Never collide with the owner (Enderdragon) // && flightTime < 25)) continue; float rr = 0.3f; @@ -217,7 +217,7 @@ void Fireball::tick() hitEntity = e; nearest = dd; } - delete p; + delete p; } } @@ -259,7 +259,7 @@ void Fireball::tick() float inertia = 0.95f; if (isInWater()) { - for (int i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { float s = 1 / 4.0f; level->addParticle(eParticleType_bubble, x - xd * s, y - yd * s, z - zd * s, xd, yd, zd); @@ -374,7 +374,7 @@ bool Fireball::hurt(DamageSource *source, int damage) yPower = yd * 0.1; zPower = zd * 0.1; } - shared_ptr mob = dynamic_pointer_cast( source->getEntity() ); + std::shared_ptr mob = dynamic_pointer_cast( source->getEntity() ); if (mob != NULL) { owner = mob; @@ -384,7 +384,7 @@ bool Fireball::hurt(DamageSource *source, int damage) return false; } -float Fireball::getShadowHeightOffs() +float Fireball::getShadowHeightOffs() { return 0; } diff --git a/Minecraft.World/Fireball.h b/Minecraft.World/Fireball.h index c9471625..a54f6083 100644 --- a/Minecraft.World/Fireball.h +++ b/Minecraft.World/Fireball.h @@ -22,7 +22,7 @@ private: bool inGround; public: - shared_ptr owner; + std::shared_ptr owner; private: int life; @@ -43,7 +43,7 @@ public: virtual bool shouldRenderAtSqrDistance(double distance); Fireball(Level *level, double x, double y, double z, double xa, double ya, double za); - Fireball(Level *level, shared_ptr mob, double xa, double ya, double za); + Fireball(Level *level, std::shared_ptr mob, double xa, double ya, double za); public: virtual void tick(); diff --git a/Minecraft.World/FishingHook.cpp b/Minecraft.World/FishingHook.cpp index efa2dbc6..d1fd5bb6 100644 --- a/Minecraft.World/FishingHook.cpp +++ b/Minecraft.World/FishingHook.cpp @@ -38,7 +38,7 @@ void FishingHook::_init() lyr = 0.0; lxr = 0.0; lxd = 0.0; - lyd = 0.0; + lyd = 0.0; lzd = 0.0; owner = nullptr; life = 0; @@ -52,7 +52,7 @@ FishingHook::FishingHook(Level *level) : Entity( level ) _init(); } -FishingHook::FishingHook(Level *level, double x, double y, double z, shared_ptr owner) : Entity( level ) +FishingHook::FishingHook(Level *level, double x, double y, double z, std::shared_ptr owner) : Entity( level ) { _init(); @@ -63,7 +63,7 @@ FishingHook::FishingHook(Level *level, double x, double y, double z, shared_ptr< setPos(x, y, z); } -FishingHook::FishingHook(Level *level, shared_ptr mob) : Entity( level ) +FishingHook::FishingHook(Level *level, std::shared_ptr mob) : Entity( level ) { _init(); @@ -172,7 +172,7 @@ void FishingHook::tick() if (!level->isClientSide) { - shared_ptr selectedItem = owner->getSelectedItem(); + std::shared_ptr selectedItem = owner->getSelectedItem(); if (owner->removed || !owner->isAlive() || selectedItem == NULL || selectedItem->getItem() != Item::fishingRod || this->distanceToSqr(owner) > 32 * 32) { remove(); @@ -195,7 +195,7 @@ void FishingHook::tick() if (shakeTime > 0) shakeTime--; - if (inGround) + if (inGround) { int tile = level->getTile(xTile, yTile, zTile); if (tile != lastTile) @@ -226,17 +226,17 @@ void FishingHook::tick() from = Vec3::newTemp(x, y, z); to = Vec3::newTemp(x + xd, y + yd, z + zd); - if (res != NULL) + if (res != NULL) { to = Vec3::newTemp(res->pos->x, res->pos->y, res->pos->z); } - shared_ptr hitEntity = nullptr; - vector > *objects = level->getEntities(shared_from_this(), this->bb->expand(xd, yd, zd)->grow(1, 1, 1)); + std::shared_ptr hitEntity = nullptr; + vector > *objects = level->getEntities(shared_from_this(), this->bb->expand(xd, yd, zd)->grow(1, 1, 1)); double nearest = 0; AUTO_VAR(itEnd, objects->end()); for (AUTO_VAR(it, objects->begin()); it != itEnd; it++) { - shared_ptr e = *it; // objects->at(i); + std::shared_ptr e = *it; // objects->at(i); if (!e->isPickable() || (e == owner && flightTime < 5)) continue; float rr = 0.3f; @@ -262,7 +262,7 @@ void FishingHook::tick() if (res != NULL) { - if (res->entity != NULL) + if (res->entity != NULL) { // 4J Stu Move fix for : fix for #48587 - CRASH: Code: Gameplay: Hitting another player with the fishing bobber crashes the game. [Fishing pole, line] // Incorrect dynamic_pointer_cast used around the shared_from_this() @@ -327,7 +327,7 @@ void FishingHook::tick() if (nibble > 0) { nibble--; - } + } else { int nibbleOdds = 500; @@ -356,7 +356,7 @@ void FishingHook::tick() } - if (nibble > 0) + if (nibble > 0) { yd -= random->nextFloat() * random->nextFloat() * random->nextFloat() * 0.2; } @@ -421,7 +421,7 @@ int FishingHook::retrieve() } else if (nibble > 0) { - shared_ptr ie = shared_ptr( new ItemEntity(this->Entity::level, x, y, z, shared_ptr( new ItemInstance(Item::fish_raw) ) ) ); + std::shared_ptr ie = std::shared_ptr( new ItemEntity(this->Entity::level, x, y, z, std::shared_ptr( new ItemInstance(Item::fish_raw) ) ) ); double xa = owner->x - x; double ya = owner->y - y; double za = owner->z - z; @@ -432,7 +432,7 @@ int FishingHook::retrieve() ie->Entity::yd = ya * speed + sqrt(dist) * 0.08; ie->Entity::zd = za * speed; level->addEntity(ie); - owner->level->addEntity( shared_ptr( new ExperienceOrb(owner->level, owner->x, owner->y + 0.5f, owner->z + 0.5f, random->nextInt(3) + 1) ) ); // 4J Stu brought forward from 1.4 + owner->level->addEntity( std::shared_ptr( new ExperienceOrb(owner->level, owner->x, owner->y + 0.5f, owner->z + 0.5f, random->nextInt(3) + 1) ) ); // 4J Stu brought forward from 1.4 dmg = 1; } if (inGround) dmg = 2; diff --git a/Minecraft.World/FishingHook.h b/Minecraft.World/FishingHook.h index ec91e630..809cec75 100644 --- a/Minecraft.World/FishingHook.h +++ b/Minecraft.World/FishingHook.h @@ -19,7 +19,7 @@ private: public: int shakeTime; - shared_ptr owner; + std::shared_ptr owner; private: int life; @@ -27,15 +27,15 @@ private: int nibble; public: - shared_ptr hookedIn; + std::shared_ptr hookedIn; private: void _init(); public: FishingHook(Level *level); - FishingHook(Level *level, double x, double y, double z, shared_ptr owner); - FishingHook(Level *level, shared_ptr mob); + FishingHook(Level *level, double x, double y, double z, std::shared_ptr owner); + FishingHook(Level *level, std::shared_ptr mob); protected: virtual void defineSynchedData(); diff --git a/Minecraft.World/FishingRodItem.cpp b/Minecraft.World/FishingRodItem.cpp index 858005e0..418bc625 100644 --- a/Minecraft.World/FishingRodItem.cpp +++ b/Minecraft.World/FishingRodItem.cpp @@ -22,33 +22,33 @@ FishingRodItem::FishingRodItem(int id) : Item(id) emptyIcon = NULL; } -bool FishingRodItem::isHandEquipped() +bool FishingRodItem::isHandEquipped() { return true; } -bool FishingRodItem::isMirroredArt() +bool FishingRodItem::isMirroredArt() { return true; } -shared_ptr FishingRodItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr FishingRodItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { - if (player->fishing != NULL) + if (player->fishing != NULL) { int dmg = player->fishing->retrieve(); instance->hurt(dmg, player); player->swing(); - } - else + } + else { level->playSound(player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f)); - if (!level->isClientSide) + if (!level->isClientSide) { // 4J Stu - Move the player->fishing out of the ctor as we cannot reference 'this' - shared_ptr hook = shared_ptr( new FishingHook(level, player) ); + std::shared_ptr hook = std::shared_ptr( new FishingHook(level, player) ); player->fishing = hook; - level->addEntity( shared_ptr( hook ) ); + level->addEntity( std::shared_ptr( hook ) ); } player->swing(); } diff --git a/Minecraft.World/FishingRodItem.h b/Minecraft.World/FishingRodItem.h index a6df606d..718469dc 100644 --- a/Minecraft.World/FishingRodItem.h +++ b/Minecraft.World/FishingRodItem.h @@ -19,7 +19,7 @@ public: virtual bool isHandEquipped(); virtual bool isMirroredArt(); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); //@Override void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/FlintAndSteelItem.cpp b/Minecraft.World/FlintAndSteelItem.cpp index 5ebdad2b..a13431a2 100644 --- a/Minecraft.World/FlintAndSteelItem.cpp +++ b/Minecraft.World/FlintAndSteelItem.cpp @@ -15,7 +15,7 @@ FlintAndSteelItem::FlintAndSteelItem(int id) : Item( id ) setMaxDamage(64); } -bool FlintAndSteelItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool FlintAndSteelItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { // 4J-PB - Adding a test only version to allow tooltips to be displayed if (face == 0) y--; @@ -24,14 +24,14 @@ bool FlintAndSteelItem::useOn(shared_ptr instance, shared_ptrmayBuild(x, y, z)) return false; int targetType = level->getTile(x, y, z); if(!bTestUseOnOnly) - { - if (targetType == 0) + { + if (targetType == 0) { if( level->getTile(x, y-1, z) == Tile::obsidian_Id ) { diff --git a/Minecraft.World/FlintAndSteelItem.h b/Minecraft.World/FlintAndSteelItem.h index 4456330a..d8ddce65 100644 --- a/Minecraft.World/FlintAndSteelItem.h +++ b/Minecraft.World/FlintAndSteelItem.h @@ -10,5 +10,5 @@ class FlintAndSteelItem : public Item public: FlintAndSteelItem(int id); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); }; diff --git a/Minecraft.World/FlowerPotTile.cpp b/Minecraft.World/FlowerPotTile.cpp index b245e56d..28f5c8e0 100644 --- a/Minecraft.World/FlowerPotTile.cpp +++ b/Minecraft.World/FlowerPotTile.cpp @@ -33,9 +33,9 @@ bool FlowerPotTile::isCubeShaped() return false; } -bool FlowerPotTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly) +bool FlowerPotTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly) { - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); if (item == NULL) return false; if (level->getData(x, y, z) != 0) return false; int type = getTypeFromItem(item); @@ -60,7 +60,7 @@ bool FlowerPotTile::use(Level *level, int x, int y, int z, shared_ptr pl int FlowerPotTile::cloneTileId(Level *level, int x, int y, int z) { - shared_ptr item = getItemFromType(level->getData(x, y, z)); + std::shared_ptr item = getItemFromType(level->getData(x, y, z)); if (item == NULL) { @@ -74,7 +74,7 @@ int FlowerPotTile::cloneTileId(Level *level, int x, int y, int z) int FlowerPotTile::cloneTileData(Level *level, int x, int y, int z) { - shared_ptr item = getItemFromType(level->getData(x, y, z)); + std::shared_ptr item = getItemFromType(level->getData(x, y, z)); if (item == NULL) { @@ -112,7 +112,7 @@ void FlowerPotTile::spawnResources(Level *level, int x, int y, int z, int data, if (data > 0) { - shared_ptr item = getItemFromType(data); + std::shared_ptr item = getItemFromType(data); if (item != NULL) popResource(level, x, y, z, item); } } @@ -122,38 +122,38 @@ int FlowerPotTile::getResource(int data, Random *random, int playerBonusLevel) return Item::flowerPot_Id; } -shared_ptr FlowerPotTile::getItemFromType(int type) +std::shared_ptr FlowerPotTile::getItemFromType(int type) { switch (type) { case TYPE_FLOWER_RED: - return shared_ptr( new ItemInstance(Tile::rose) ); + return std::shared_ptr( new ItemInstance(Tile::rose) ); case TYPE_FLOWER_YELLOW: - return shared_ptr( new ItemInstance(Tile::flower) ); + return std::shared_ptr( new ItemInstance(Tile::flower) ); case TYPE_CACTUS: - return shared_ptr( new ItemInstance(Tile::cactus) ); + return std::shared_ptr( new ItemInstance(Tile::cactus) ); case TYPE_MUSHROOM_BROWN: - return shared_ptr( new ItemInstance(Tile::mushroom1) ); + return std::shared_ptr( new ItemInstance(Tile::mushroom1) ); case TYPE_MUSHROOM_RED: - return shared_ptr( new ItemInstance(Tile::mushroom2) ); + return std::shared_ptr( new ItemInstance(Tile::mushroom2) ); case TYPE_DEAD_BUSH: - return shared_ptr( new ItemInstance(Tile::deadBush) ); + return std::shared_ptr( new ItemInstance(Tile::deadBush) ); case TYPE_SAPLING_DEFAULT: - return shared_ptr( new ItemInstance(Tile::sapling, 1, Sapling::TYPE_DEFAULT) ); + return std::shared_ptr( new ItemInstance(Tile::sapling, 1, Sapling::TYPE_DEFAULT) ); case TYPE_SAPLING_BIRCH: - return shared_ptr( new ItemInstance(Tile::sapling, 1, Sapling::TYPE_BIRCH) ); + return std::shared_ptr( new ItemInstance(Tile::sapling, 1, Sapling::TYPE_BIRCH) ); case TYPE_SAPLING_EVERGREEN: - return shared_ptr( new ItemInstance(Tile::sapling, 1, Sapling::TYPE_EVERGREEN) ); + return std::shared_ptr( new ItemInstance(Tile::sapling, 1, Sapling::TYPE_EVERGREEN) ); case TYPE_SAPLING_JUNGLE: - return shared_ptr( new ItemInstance(Tile::sapling, 1, Sapling::TYPE_JUNGLE) ); + return std::shared_ptr( new ItemInstance(Tile::sapling, 1, Sapling::TYPE_JUNGLE) ); case TYPE_FERN: - return shared_ptr( new ItemInstance(Tile::tallgrass, 1, TallGrass::FERN) ); + return std::shared_ptr( new ItemInstance(Tile::tallgrass, 1, TallGrass::FERN) ); } return nullptr; } -int FlowerPotTile::getTypeFromItem(shared_ptr item) +int FlowerPotTile::getTypeFromItem(std::shared_ptr item) { int id = item->getItem()->id; diff --git a/Minecraft.World/FlowerPotTile.h b/Minecraft.World/FlowerPotTile.h index 50dc18c4..5a615c07 100644 --- a/Minecraft.World/FlowerPotTile.h +++ b/Minecraft.World/FlowerPotTile.h @@ -23,7 +23,7 @@ public: bool isSolidRender(bool isServerLevel = false); int getRenderShape(); bool isCubeShaped(); - bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); + bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); int cloneTileId(Level *level, int x, int y, int z); int cloneTileData(Level *level, int x, int y, int z); bool useOwnCloneData(); @@ -32,6 +32,6 @@ public: using Tile::spawnResources; void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel); int getResource(int data, Random *random, int playerBonusLevel); - static shared_ptr getItemFromType(int type); - static int getTypeFromItem(shared_ptr item); + static std::shared_ptr getItemFromType(int type); + static int getTypeFromItem(std::shared_ptr item); }; \ No newline at end of file diff --git a/Minecraft.World/FollowOwnerGoal.cpp b/Minecraft.World/FollowOwnerGoal.cpp index faba2226..4014771a 100644 --- a/Minecraft.World/FollowOwnerGoal.cpp +++ b/Minecraft.World/FollowOwnerGoal.cpp @@ -24,7 +24,7 @@ FollowOwnerGoal::FollowOwnerGoal(TamableAnimal *tamable, float speed, float star bool FollowOwnerGoal::canUse() { - shared_ptr owner = tamable->getOwner(); + std::shared_ptr owner = tamable->getOwner(); if (owner == NULL) return false; if (tamable->isSitting()) return false; if (tamable->distanceToSqr(owner) < startDistance * startDistance) return false; diff --git a/Minecraft.World/FollowParentGoal.cpp b/Minecraft.World/FollowParentGoal.cpp index 3e347d62..99224d08 100644 --- a/Minecraft.World/FollowParentGoal.cpp +++ b/Minecraft.World/FollowParentGoal.cpp @@ -18,13 +18,13 @@ bool FollowParentGoal::canUse() { if (animal->getAge() >= 0) return false; - vector > *parents = animal->level->getEntitiesOfClass(typeid(*animal), animal->bb->grow(8, 4, 8)); + vector > *parents = animal->level->getEntitiesOfClass(typeid(*animal), animal->bb->grow(8, 4, 8)); - shared_ptr closest = nullptr; + std::shared_ptr closest = nullptr; double closestDistSqr = Double::MAX_VALUE; for(AUTO_VAR(it, parents->begin()); it != parents->end(); ++it) { - shared_ptr parent = dynamic_pointer_cast(*it); + std::shared_ptr parent = dynamic_pointer_cast(*it); if (parent->getAge() < 0) continue; double distSqr = animal->distanceToSqr(parent); if (distSqr > closestDistSqr) continue; diff --git a/Minecraft.World/FoodData.cpp b/Minecraft.World/FoodData.cpp index 79ef0fc1..a3c2d34b 100644 --- a/Minecraft.World/FoodData.cpp +++ b/Minecraft.World/FoodData.cpp @@ -29,7 +29,7 @@ void FoodData::eat(FoodItem *item) eat(item->getNutrition(), item->getSaturationModifier()); } -void FoodData::tick(shared_ptr player) +void FoodData::tick(std::shared_ptr player) { int difficulty = player->level->difficulty; diff --git a/Minecraft.World/FoodData.h b/Minecraft.World/FoodData.h index 3416a44a..9d847454 100644 --- a/Minecraft.World/FoodData.h +++ b/Minecraft.World/FoodData.h @@ -19,7 +19,7 @@ public: void eat(int food, float saturationModifier); void eat(FoodItem *item); - void tick(shared_ptr player); + void tick(std::shared_ptr player); void readAdditionalSaveData(CompoundTag *entityTag); void addAdditonalSaveData(CompoundTag *entityTag); int getFoodLevel(); diff --git a/Minecraft.World/FoodItem.cpp b/Minecraft.World/FoodItem.cpp index f5304cb9..e617490a 100644 --- a/Minecraft.World/FoodItem.cpp +++ b/Minecraft.World/FoodItem.cpp @@ -33,7 +33,7 @@ FoodItem::FoodItem(int id, int nutrition, bool isMeat) _init(); } -shared_ptr FoodItem::useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr FoodItem::useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player) { instance->count--; player->getFoodData()->eat(this); @@ -45,7 +45,7 @@ shared_ptr FoodItem::useTimeDepleted(shared_ptr inst return instance; } -void FoodItem::addEatEffect(shared_ptr instance, Level *level, shared_ptr player) +void FoodItem::addEatEffect(std::shared_ptr instance, Level *level, std::shared_ptr player) { if (!level->isClientSide && effectId > 0 && level->random->nextFloat() < effectProbability) { @@ -54,17 +54,17 @@ void FoodItem::addEatEffect(shared_ptr instance, Level *level, sha } -int FoodItem::getUseDuration(shared_ptr itemInstance) +int FoodItem::getUseDuration(std::shared_ptr itemInstance) { return EAT_DURATION; } -UseAnim FoodItem::getUseAnimation(shared_ptr itemInstance) +UseAnim FoodItem::getUseAnimation(std::shared_ptr itemInstance) { return UseAnim_eat; } -shared_ptr FoodItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr FoodItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { if (player->canEat(canAlwaysEat)) { @@ -73,7 +73,7 @@ shared_ptr FoodItem::use(shared_ptr instance, Level // 4J : WESTY : Other award ... eating cooked pork chop. // 4J-JEV: This is just for an avatar award on the xbox. -#ifdef _XBOX +#ifdef _XBOX if ( instance->getItem() == Item::porkChop_cooked ) { player->awardStat(GenericStats::eatPorkChop(),GenericStats::param_eatPorkChop()); @@ -114,7 +114,7 @@ FoodItem *FoodItem::setCanAlwaysEat() } // 4J Added -bool FoodItem::canEat(shared_ptr player) +bool FoodItem::canEat(std::shared_ptr player) { return player->canEat(canAlwaysEat); } diff --git a/Minecraft.World/FoodItem.h b/Minecraft.World/FoodItem.h index 16e6ce3f..2100a3b3 100644 --- a/Minecraft.World/FoodItem.h +++ b/Minecraft.World/FoodItem.h @@ -26,16 +26,16 @@ public: FoodItem(int id, int nutrition, float saturationMod, bool isMeat); FoodItem(int id, int nutrition, bool isMeat); - virtual shared_ptr useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player); + virtual std::shared_ptr useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player); protected: - virtual void addEatEffect(shared_ptr instance, Level *level, shared_ptr player); + virtual void addEatEffect(std::shared_ptr instance, Level *level, std::shared_ptr player); public: - virtual int getUseDuration(shared_ptr itemInstance); - virtual UseAnim getUseAnimation(shared_ptr itemInstance); + virtual int getUseDuration(std::shared_ptr itemInstance); + virtual UseAnim getUseAnimation(std::shared_ptr itemInstance); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); int getNutrition(); float getSaturationModifier(); @@ -45,5 +45,5 @@ public: FoodItem *setCanAlwaysEat(); // 4J Added - bool canEat(shared_ptr player); + bool canEat(std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/FurnaceMenu.cpp b/Minecraft.World/FurnaceMenu.cpp index dca02231..58f3b77d 100644 --- a/Minecraft.World/FurnaceMenu.cpp +++ b/Minecraft.World/FurnaceMenu.cpp @@ -8,7 +8,7 @@ #include "FurnaceMenu.h" #include "FurnaceRecipes.h" -FurnaceMenu::FurnaceMenu(shared_ptr inventory, shared_ptr furnace) : AbstractContainerMenu() +FurnaceMenu::FurnaceMenu(std::shared_ptr inventory, std::shared_ptr furnace) : AbstractContainerMenu() { tc = 0; lt = 0; @@ -44,12 +44,12 @@ void FurnaceMenu::addSlotListener(ContainerListener *listener) void FurnaceMenu::broadcastChanges() { AbstractContainerMenu::broadcastChanges(); - + AUTO_VAR(itEnd, containerListeners->end()); for (AUTO_VAR(it, containerListeners->begin()); it != itEnd; it++) { ContainerListener *listener = *it; //containerListeners->at(i); - if (tc != furnace->tickCount) + if (tc != furnace->tickCount) { listener->setContainerData(this, 0, furnace->tickCount); } @@ -57,7 +57,7 @@ void FurnaceMenu::broadcastChanges() { listener->setContainerData(this, 1, furnace->litTime); } - if (ld != furnace->litDuration) + if (ld != furnace->litDuration) { listener->setContainerData(this, 2, furnace->litDuration); } @@ -75,14 +75,14 @@ void FurnaceMenu::setData(int id, int value) if (id == 2) furnace->litDuration = value; } -bool FurnaceMenu::stillValid(shared_ptr player) +bool FurnaceMenu::stillValid(std::shared_ptr player) { return furnace->stillValid(player); } -shared_ptr FurnaceMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr FurnaceMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); //Slot *IngredientSlot = slots->at(INGREDIENT_SLOT); @@ -90,7 +90,7 @@ shared_ptr FurnaceMenu::quickMoveStack(shared_ptr player, if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex == RESULT_SLOT) @@ -160,11 +160,11 @@ shared_ptr FurnaceMenu::quickMoveStack(shared_ptr player, return clicked; } -shared_ptr FurnaceMenu::clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player) +std::shared_ptr FurnaceMenu::clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr player) { bool charcoalUsed = furnace->wasCharcoalUsed(); - shared_ptr out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); + std::shared_ptr out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); #ifdef _EXTENDED_ACHIEVEMENTS if ( charcoalUsed && (out!=nullptr) && (buttonNum==0 || buttonNum==1) && clickType==CLICK_PICKUP diff --git a/Minecraft.World/FurnaceMenu.h b/Minecraft.World/FurnaceMenu.h index 72b264d3..576a0fa2 100644 --- a/Minecraft.World/FurnaceMenu.h +++ b/Minecraft.World/FurnaceMenu.h @@ -17,10 +17,10 @@ public: static const int USE_ROW_SLOT_END = FurnaceMenu::USE_ROW_SLOT_START + 9; private: - shared_ptr furnace; + std::shared_ptr furnace; public: - FurnaceMenu(shared_ptr inventory, shared_ptr furnace); + FurnaceMenu(std::shared_ptr inventory, std::shared_ptr furnace); private: int tc; @@ -31,8 +31,8 @@ public: virtual void addSlotListener(ContainerListener *listener); virtual void broadcastChanges(); virtual void setData(int id, int value); - virtual bool stillValid(shared_ptr player); - virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); + virtual bool stillValid(std::shared_ptr player); + virtual std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); - virtual shared_ptr clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player); + virtual std::shared_ptr clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr player); }; diff --git a/Minecraft.World/FurnaceResultSlot.cpp b/Minecraft.World/FurnaceResultSlot.cpp index d845dada..c7347ebe 100644 --- a/Minecraft.World/FurnaceResultSlot.cpp +++ b/Minecraft.World/FurnaceResultSlot.cpp @@ -9,18 +9,18 @@ #include "FurnaceResultSlot.h" -FurnaceResultSlot::FurnaceResultSlot(shared_ptr player, shared_ptr container, int slot, int x, int y) : Slot( container, slot, x, y ) +FurnaceResultSlot::FurnaceResultSlot(std::shared_ptr player, std::shared_ptr container, int slot, int x, int y) : Slot( container, slot, x, y ) { this->player = player; removeCount = 0; } -bool FurnaceResultSlot::mayPlace(shared_ptr item) +bool FurnaceResultSlot::mayPlace(std::shared_ptr item) { return false; } -shared_ptr FurnaceResultSlot::remove(int c) +std::shared_ptr FurnaceResultSlot::remove(int c) { if (hasItem()) { @@ -29,24 +29,24 @@ shared_ptr FurnaceResultSlot::remove(int c) return Slot::remove(c); } -void FurnaceResultSlot::onTake(shared_ptr player, shared_ptr carried) +void FurnaceResultSlot::onTake(std::shared_ptr player, std::shared_ptr carried) { checkTakeAchievements(carried); Slot::onTake(player, carried); } -void FurnaceResultSlot::onQuickCraft(shared_ptr picked, int count) +void FurnaceResultSlot::onQuickCraft(std::shared_ptr picked, int count) { removeCount += count; checkTakeAchievements(picked); } -bool FurnaceResultSlot::mayCombine(shared_ptr second) +bool FurnaceResultSlot::mayCombine(std::shared_ptr second) { return false; } -void FurnaceResultSlot::checkTakeAchievements(shared_ptr carried) +void FurnaceResultSlot::checkTakeAchievements(std::shared_ptr carried) { carried->onCraftedBy(player->level, player, removeCount); // spawn xp right on top of the player @@ -73,7 +73,7 @@ void FurnaceResultSlot::checkTakeAchievements(shared_ptr carried) { int newCount = ExperienceOrb::getExperienceValue(amount); amount -= newCount; - player->level->addEntity(shared_ptr( new ExperienceOrb(player->level, player->x, player->y + .5, player->z + .5, newCount) )); + player->level->addEntity(std::shared_ptr( new ExperienceOrb(player->level, player->x, player->y + .5, player->z + .5, newCount) )); } } diff --git a/Minecraft.World/FurnaceResultSlot.h b/Minecraft.World/FurnaceResultSlot.h index bc770fab..00967f31 100644 --- a/Minecraft.World/FurnaceResultSlot.h +++ b/Minecraft.World/FurnaceResultSlot.h @@ -5,19 +5,19 @@ class FurnaceResultSlot : public Slot { private: - shared_ptr player; + std::shared_ptr player; int removeCount; public: - FurnaceResultSlot(shared_ptr player, shared_ptr container, int slot, int x, int y); + FurnaceResultSlot(std::shared_ptr player, std::shared_ptr container, int slot, int x, int y); virtual ~FurnaceResultSlot() {} - virtual bool mayPlace(shared_ptr item); - virtual shared_ptr remove(int c); - virtual void onTake(shared_ptr player, shared_ptr carried); - virtual bool mayCombine(shared_ptr item); // 4J Added + virtual bool mayPlace(std::shared_ptr item); + virtual std::shared_ptr remove(int c); + virtual void onTake(std::shared_ptr player, std::shared_ptr carried); + virtual bool mayCombine(std::shared_ptr item); // 4J Added protected: - virtual void onQuickCraft(shared_ptr picked, int count); - virtual void checkTakeAchievements(shared_ptr carried); + virtual void onQuickCraft(std::shared_ptr picked, int count); + virtual void checkTakeAchievements(std::shared_ptr carried); }; \ No newline at end of file diff --git a/Minecraft.World/FurnaceTile.cpp b/Minecraft.World/FurnaceTile.cpp index ea0f84e8..23270eee 100644 --- a/Minecraft.World/FurnaceTile.cpp +++ b/Minecraft.World/FurnaceTile.cpp @@ -15,7 +15,7 @@ FurnaceTile::FurnaceTile(int id, bool lit) : EntityTile(id, Material::stone) { random = new Random(); this->lit = lit; - + iconTop = NULL; iconFront = NULL; } @@ -104,7 +104,7 @@ bool FurnaceTile::TestUse() return true; } -bool FurnaceTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool FurnaceTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly) return false; @@ -112,7 +112,7 @@ bool FurnaceTile::use(Level *level, int x, int y, int z, shared_ptr play { return true; } - shared_ptr furnace = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr furnace = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if (furnace != NULL ) player->openFurnace(furnace); return true; } @@ -120,7 +120,7 @@ bool FurnaceTile::use(Level *level, int x, int y, int z, shared_ptr play void FurnaceTile::setLit(bool lit, Level *level, int x, int y, int z) { int data = level->getData(x, y, z); - shared_ptr te = level->getTileEntity(x, y, z); + std::shared_ptr te = level->getTileEntity(x, y, z); noDrop = true; if (lit) level->setTile(x, y, z, Tile::furnace_lit_Id); @@ -135,12 +135,12 @@ void FurnaceTile::setLit(bool lit, Level *level, int x, int y, int z) } } -shared_ptr FurnaceTile::newTileEntity(Level *level) +std::shared_ptr FurnaceTile::newTileEntity(Level *level) { - return shared_ptr( new FurnaceTileEntity() ); + return std::shared_ptr( new FurnaceTileEntity() ); } -void FurnaceTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void FurnaceTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int dir = (Mth::floor(by->yRot * 4 / (360) + 0.5)) & 3; @@ -154,12 +154,12 @@ void FurnaceTile::onRemove(Level *level, int x, int y, int z, int id, int data) { if (!noDrop) { - shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr container = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if( container != NULL ) { for (unsigned int i = 0; i < container->getContainerSize(); i++) { - shared_ptr item = container->getItem(i); + std::shared_ptr item = container->getItem(i); if (item != NULL) { float xo = random->nextFloat() * 0.8f + 0.1f; @@ -182,10 +182,10 @@ void FurnaceTile::onRemove(Level *level, int x, int y, int z, int id, int data) printf("Server furnace dropping %d of %d/%d\n", count, item->id, item->getAuxValue() ); } #endif - - shared_ptr newItem = shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ); + + std::shared_ptr newItem = std::shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ); newItem->set4JData( item->get4JData() ); - shared_ptr itemEntity = shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, newItem) ); + std::shared_ptr itemEntity = std::shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, newItem) ); float pow = 0.05f; itemEntity->xd = (float) random->nextGaussian() * pow; itemEntity->yd = (float) random->nextGaussian() * pow + 0.2f; diff --git a/Minecraft.World/FurnaceTile.h b/Minecraft.World/FurnaceTile.h index c192f94d..62106150 100644 --- a/Minecraft.World/FurnaceTile.h +++ b/Minecraft.World/FurnaceTile.h @@ -29,11 +29,11 @@ public: void registerIcons(IconRegister *iconRegister); virtual void animateTick(Level *level, int xt, int yt, int zt, Random *random); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param static void setLit(bool lit, Level *level, int x, int y, int z); protected: - virtual shared_ptr newTileEntity(Level *level); + virtual std::shared_ptr newTileEntity(Level *level); public: - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); virtual void onRemove(Level *level, int x, int y, int z, int id, int data); }; \ No newline at end of file diff --git a/Minecraft.World/FurnaceTileEntity.cpp b/Minecraft.World/FurnaceTileEntity.cpp index 0f18528c..a75b7344 100644 --- a/Minecraft.World/FurnaceTileEntity.cpp +++ b/Minecraft.World/FurnaceTileEntity.cpp @@ -39,13 +39,13 @@ unsigned int FurnaceTileEntity::getContainerSize() } -shared_ptr FurnaceTileEntity::getItem(unsigned int slot) +std::shared_ptr FurnaceTileEntity::getItem(unsigned int slot) { return (*items)[slot]; } -shared_ptr FurnaceTileEntity::removeItem(unsigned int slot, int count) +std::shared_ptr FurnaceTileEntity::removeItem(unsigned int slot, int count) { m_charcoalUsed = false; @@ -53,7 +53,7 @@ shared_ptr FurnaceTileEntity::removeItem(unsigned int slot, int co { if ((*items)[slot]->count <= count) { - shared_ptr item = (*items)[slot]; + std::shared_ptr item = (*items)[slot]; (*items)[slot] = nullptr; // 4J Stu - Fix for duplication glitch if(item->count <= 0) return nullptr; @@ -61,7 +61,7 @@ shared_ptr FurnaceTileEntity::removeItem(unsigned int slot, int co } else { - shared_ptr i = (*items)[slot]->remove(count); + std::shared_ptr i = (*items)[slot]->remove(count); if ((*items)[slot]->count == 0) (*items)[slot] = nullptr; // 4J Stu - Fix for duplication glitch if(i->count <= 0) return nullptr; @@ -71,13 +71,13 @@ shared_ptr FurnaceTileEntity::removeItem(unsigned int slot, int co return nullptr; } -shared_ptr FurnaceTileEntity::removeItemNoUpdate(int slot) +std::shared_ptr FurnaceTileEntity::removeItemNoUpdate(int slot) { m_charcoalUsed = false; if (items->data[slot] != NULL) { - shared_ptr item = items->data[slot]; + std::shared_ptr item = items->data[slot]; items->data[slot] = nullptr; return item; } @@ -85,7 +85,7 @@ shared_ptr FurnaceTileEntity::removeItemNoUpdate(int slot) } -void FurnaceTileEntity::setItem(unsigned int slot, shared_ptr item) +void FurnaceTileEntity::setItem(unsigned int slot, std::shared_ptr item) { (*items)[slot] = item; if (item != NULL && item->count > getMaxStackSize()) item->count = getMaxStackSize(); @@ -185,7 +185,7 @@ void FurnaceTileEntity::tick() if ((*items)[FUEL_SLOT] != NULL) { // 4J Added: Keep track of whether charcoal was used in production of current stack. - if ( (*items)[FUEL_SLOT]->getItem()->id == Item::coal_Id + if ( (*items)[FUEL_SLOT]->getItem()->id == Item::coal_Id && (*items)[FUEL_SLOT]->getAuxValue() == CoalItem::CHAR_COAL) { m_charcoalUsed = true; @@ -195,7 +195,7 @@ void FurnaceTileEntity::tick() if ((*items)[FUEL_SLOT]->count == 0) { Item *remaining = (*items)[FUEL_SLOT]->getItem()->getCraftingRemainingItem(); - (*items)[FUEL_SLOT] = remaining != NULL ? shared_ptr(new ItemInstance(remaining)) : nullptr; + (*items)[FUEL_SLOT] = remaining != NULL ? std::shared_ptr(new ItemInstance(remaining)) : nullptr; } } } @@ -253,7 +253,7 @@ void FurnaceTileEntity::burn() } -int FurnaceTileEntity::getBurnDuration(shared_ptr itemInstance) +int FurnaceTileEntity::getBurnDuration(std::shared_ptr itemInstance) { if (itemInstance == NULL) return 0; int id = itemInstance->getItem()->id; @@ -304,12 +304,12 @@ int FurnaceTileEntity::getBurnDuration(shared_ptr itemInstance) return 0; } -bool FurnaceTileEntity::isFuel(shared_ptr item) +bool FurnaceTileEntity::isFuel(std::shared_ptr item) { return getBurnDuration(item) > 0; } -bool FurnaceTileEntity::stillValid(shared_ptr player) +bool FurnaceTileEntity::stillValid(std::shared_ptr player) { if (level->getTileEntity(x, y, z) != shared_from_this() ) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; @@ -330,9 +330,9 @@ void FurnaceTileEntity::stopOpen() } // 4J Added -shared_ptr FurnaceTileEntity::clone() +std::shared_ptr FurnaceTileEntity::clone() { - shared_ptr result = shared_ptr( new FurnaceTileEntity() ); + std::shared_ptr result = std::shared_ptr( new FurnaceTileEntity() ); TileEntity::clone(result); result->litTime = litTime; diff --git a/Minecraft.World/FurnaceTileEntity.h b/Minecraft.World/FurnaceTileEntity.h index db39452e..29267de9 100644 --- a/Minecraft.World/FurnaceTileEntity.h +++ b/Minecraft.World/FurnaceTileEntity.h @@ -41,10 +41,10 @@ public: virtual ~FurnaceTileEntity(); virtual unsigned int getContainerSize(); - virtual shared_ptr getItem(unsigned int slot); - virtual shared_ptr removeItem(unsigned int slot, int count); - virtual shared_ptr removeItemNoUpdate(int slot); - virtual void setItem(unsigned int slot, shared_ptr item); + virtual std::shared_ptr getItem(unsigned int slot); + virtual std::shared_ptr removeItem(unsigned int slot, int count); + virtual std::shared_ptr removeItemNoUpdate(int slot); + virtual void setItem(unsigned int slot, std::shared_ptr item); virtual int getName(); virtual void load(CompoundTag *base); virtual void save(CompoundTag *base); @@ -60,18 +60,18 @@ private: public: void burn(); - static int getBurnDuration(shared_ptr itemInstance); - static bool isFuel(shared_ptr item); + static int getBurnDuration(std::shared_ptr itemInstance); + static bool isFuel(std::shared_ptr item); public: - virtual bool stillValid(shared_ptr player); + virtual bool stillValid(std::shared_ptr player); virtual void setChanged(); void startOpen(); void stopOpen(); // 4J Added - virtual shared_ptr clone(); + virtual std::shared_ptr clone(); // 4J-JEV: Added for 'Renewable Energy' achievement. bool wasCharcoalUsed() { return m_charcoalUsed; } diff --git a/Minecraft.World/FuzzyZoomLayer.cpp b/Minecraft.World/FuzzyZoomLayer.cpp index 54155ff5..1e4c872a 100644 --- a/Minecraft.World/FuzzyZoomLayer.cpp +++ b/Minecraft.World/FuzzyZoomLayer.cpp @@ -2,7 +2,7 @@ #include "System.h" #include "net.minecraft.world.level.newbiome.layer.h" -FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) +FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, std::shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -61,12 +61,12 @@ int FuzzyZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrFuzzyZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) +std::shared_ptrFuzzyZoomLayer::zoom(int64_t seed, std::shared_ptrsup, int count) { - shared_ptr result = sup; + std::shared_ptr result = sup; for (int i = 0; i < count; i++) { - result = shared_ptr(new FuzzyZoomLayer(seed + i, result)); + result = std::shared_ptr(new FuzzyZoomLayer(seed + i, result)); } return result; } \ No newline at end of file diff --git a/Minecraft.World/FuzzyZoomLayer.h b/Minecraft.World/FuzzyZoomLayer.h index 19526931..3c82e6be 100644 --- a/Minecraft.World/FuzzyZoomLayer.h +++ b/Minecraft.World/FuzzyZoomLayer.h @@ -5,7 +5,7 @@ class FuzzyZoomLayer : public Layer { public: - FuzzyZoomLayer(int64_t seedMixup, shared_ptrparent); + FuzzyZoomLayer(int64_t seedMixup, std::shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); protected: @@ -13,5 +13,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); + static std::shared_ptrzoom(int64_t seed, std::shared_ptrsup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/GameCommandPacket.h b/Minecraft.World/GameCommandPacket.h index 1f63e950..deb2659c 100644 --- a/Minecraft.World/GameCommandPacket.h +++ b/Minecraft.World/GameCommandPacket.h @@ -21,6 +21,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new GameCommandPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new GameCommandPacket()); } virtual int getId() { return 167; } }; \ No newline at end of file diff --git a/Minecraft.World/GameEventPacket.h b/Minecraft.World/GameEventPacket.h index 93ea911c..8f54a91e 100644 --- a/Minecraft.World/GameEventPacket.h +++ b/Minecraft.World/GameEventPacket.h @@ -40,6 +40,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new GameEventPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new GameEventPacket()); } virtual int getId() { return 70; } }; \ No newline at end of file diff --git a/Minecraft.World/GameModeCommand.cpp b/Minecraft.World/GameModeCommand.cpp index 86d4c5a5..94252881 100644 --- a/Minecraft.World/GameModeCommand.cpp +++ b/Minecraft.World/GameModeCommand.cpp @@ -7,7 +7,7 @@ EGameCommand GameModeCommand::getId() return eGameCommand_GameMode; } -void GameModeCommand::execute(shared_ptr source, byteArray commandData) +void GameModeCommand::execute(std::shared_ptr source, byteArray commandData) { //if (args.length > 0) //{ @@ -26,7 +26,7 @@ void GameModeCommand::execute(shared_ptr source, byteArray comman //} } -GameType *GameModeCommand::getModeForString(shared_ptr source, const wstring &name) +GameType *GameModeCommand::getModeForString(std::shared_ptr source, const wstring &name) { return NULL; //if (name.equalsIgnoreCase(GameType.SURVIVAL.getName()) || name.equalsIgnoreCase("s")) { @@ -40,7 +40,7 @@ GameType *GameModeCommand::getModeForString(shared_ptr source, co //} } -shared_ptr GameModeCommand::getPlayer(PlayerUID playerId) +std::shared_ptr GameModeCommand::getPlayer(PlayerUID playerId) { return nullptr; //Player player = MinecraftServer.getInstance().getPlayers().getPlayer(name); diff --git a/Minecraft.World/GameModeCommand.h b/Minecraft.World/GameModeCommand.h index 66401587..7c08caab 100644 --- a/Minecraft.World/GameModeCommand.h +++ b/Minecraft.World/GameModeCommand.h @@ -8,9 +8,9 @@ class GameModeCommand : public Command { public: virtual EGameCommand getId(); - virtual void execute(shared_ptr source, byteArray commandData); + virtual void execute(std::shared_ptr source, byteArray commandData); protected: - GameType *getModeForString(shared_ptr source, const wstring &name); - shared_ptr getPlayer(PlayerUID playerId); + GameType *getModeForString(std::shared_ptr source, const wstring &name); + std::shared_ptr getPlayer(PlayerUID playerId); }; \ No newline at end of file diff --git a/Minecraft.World/GenericStats.cpp b/Minecraft.World/GenericStats.cpp index 1fa90151..e765fc0c 100644 --- a/Minecraft.World/GenericStats.cpp +++ b/Minecraft.World/GenericStats.cpp @@ -58,51 +58,51 @@ Stat* GenericStats::get_netherLavaCollected() Stat* GenericStats::get_killMob() { - return NULL; + return NULL; } Stat* GenericStats::get_killsZombie() -{ - return NULL; -} - -Stat* GenericStats::get_killsSkeleton() -{ - return NULL; -} - -Stat* GenericStats::get_killsCreeper() -{ +{ return NULL; } -Stat* GenericStats::get_killsSpider() -{ - return NULL; -} - -Stat* GenericStats::get_killsSpiderJockey() -{ +Stat* GenericStats::get_killsSkeleton() +{ return NULL; } -Stat* GenericStats::get_killsZombiePigman() -{ - return NULL; -} - -Stat* GenericStats::get_killsSlime() -{ +Stat* GenericStats::get_killsCreeper() +{ return NULL; } -Stat* GenericStats::get_killsGhast() -{ +Stat* GenericStats::get_killsSpider() +{ return NULL; } -Stat* GenericStats::get_killsNetherZombiePigman() -{ +Stat* GenericStats::get_killsSpiderJockey() +{ + return NULL; +} + +Stat* GenericStats::get_killsZombiePigman() +{ + return NULL; +} + +Stat* GenericStats::get_killsSlime() +{ + return NULL; +} + +Stat* GenericStats::get_killsGhast() +{ + return NULL; +} + +Stat* GenericStats::get_killsNetherZombiePigman() +{ return NULL; } @@ -173,7 +173,7 @@ Stat* GenericStats::get_itemsUsed(int itemId) Stat *GenericStats::get_itemsBought(int itemId) { - return NULL; + return NULL; } Stat* GenericStats::get_killsEnderdragon() @@ -201,87 +201,87 @@ Stat* GenericStats::get_achievement(eAward achievementId) return NULL; } -Stat* GenericStats::openInventory() +Stat* GenericStats::openInventory() { - return instance->get_achievement( eAward_TakingInventory ); + return instance->get_achievement( eAward_TakingInventory ); } -Stat* GenericStats::mineWood() +Stat* GenericStats::mineWood() { - return instance->get_achievement( eAward_GettingWood ); + return instance->get_achievement( eAward_GettingWood ); } -Stat* GenericStats::buildWorkbench() +Stat* GenericStats::buildWorkbench() { - return instance->get_achievement( eAward_Benchmarking ); + return instance->get_achievement( eAward_Benchmarking ); } -Stat* GenericStats::buildPickaxe() +Stat* GenericStats::buildPickaxe() { - return instance->get_achievement( eAward_TimeToMine); + return instance->get_achievement( eAward_TimeToMine); } -Stat* GenericStats::buildFurnace() +Stat* GenericStats::buildFurnace() { - return instance->get_achievement( eAward_HotTopic ); + return instance->get_achievement( eAward_HotTopic ); } -Stat* GenericStats::acquireIron() +Stat* GenericStats::acquireIron() { - return instance->get_achievement( eAward_AquireHardware ); + return instance->get_achievement( eAward_AquireHardware ); } -Stat* GenericStats::buildHoe() +Stat* GenericStats::buildHoe() { - return instance->get_achievement( eAward_TimeToFarm ); + return instance->get_achievement( eAward_TimeToFarm ); } -Stat* GenericStats::makeBread() +Stat* GenericStats::makeBread() { - return instance->get_achievement( eAward_BakeBread ); + return instance->get_achievement( eAward_BakeBread ); } -Stat* GenericStats::bakeCake() +Stat* GenericStats::bakeCake() { - return instance->get_achievement( eAward_TheLie ); + return instance->get_achievement( eAward_TheLie ); } -Stat* GenericStats::buildBetterPickaxe() +Stat* GenericStats::buildBetterPickaxe() { - return instance->get_achievement( eAward_GettingAnUpgrade ); + return instance->get_achievement( eAward_GettingAnUpgrade ); } -Stat* GenericStats::cookFish() +Stat* GenericStats::cookFish() { return instance->get_achievement( eAward_DeliciousFish ); } -Stat* GenericStats::onARail() +Stat* GenericStats::onARail() { return instance->get_achievement( eAward_OnARail ); } -Stat* GenericStats::buildSword() +Stat* GenericStats::buildSword() { return instance->get_achievement( eAward_TimeToStrike ); } -Stat* GenericStats::killEnemy() +Stat* GenericStats::killEnemy() { return instance->get_achievement( eAward_MonsterHunter ); } -Stat* GenericStats::killCow() +Stat* GenericStats::killCow() { return instance->get_achievement( eAward_CowTipper ); } -Stat* GenericStats::flyPig() +Stat* GenericStats::flyPig() { return instance->get_achievement( eAward_WhenPigsFly ); } -Stat* GenericStats::snipeSkeleton() +Stat* GenericStats::snipeSkeleton() { #ifndef _XBOX return instance->get_achievement( eAward_snipeSkeleton ); @@ -290,7 +290,7 @@ Stat* GenericStats::snipeSkeleton() #endif } -Stat* GenericStats::diamonds() +Stat* GenericStats::diamonds() { #ifndef _XBOX return instance->get_achievement( eAward_diamonds ); @@ -299,7 +299,7 @@ Stat* GenericStats::diamonds() #endif } -Stat* GenericStats::ghast() +Stat* GenericStats::ghast() { #ifndef _XBOX return instance->get_achievement( eAward_ghast ); @@ -308,7 +308,7 @@ Stat* GenericStats::ghast() #endif } -Stat* GenericStats::blazeRod() +Stat* GenericStats::blazeRod() { #ifndef _XBOX return instance->get_achievement( eAward_blazeRod ); @@ -317,7 +317,7 @@ Stat* GenericStats::blazeRod() #endif } -Stat* GenericStats::potion() +Stat* GenericStats::potion() { #ifndef _XBOX return instance->get_achievement( eAward_potion ); @@ -326,7 +326,7 @@ Stat* GenericStats::potion() #endif } -Stat* GenericStats::theEnd() +Stat* GenericStats::theEnd() { #ifndef _XBOX return instance->get_achievement( eAward_theEnd ); @@ -335,7 +335,7 @@ Stat* GenericStats::theEnd() #endif } -Stat* GenericStats::winGame() +Stat* GenericStats::winGame() { #ifndef _XBOX return instance->get_achievement( eAward_winGame ); @@ -344,7 +344,7 @@ Stat* GenericStats::winGame() #endif } -Stat* GenericStats::enchantments() +Stat* GenericStats::enchantments() { #ifndef _XBOX return instance->get_achievement( eAward_enchantments ); @@ -353,7 +353,7 @@ Stat* GenericStats::enchantments() #endif } -Stat* GenericStats::overkill() +Stat* GenericStats::overkill() { #ifdef _EXTENDED_ACHIEVEMENTS return instance->get_achievement( eAward_overkill ); @@ -371,52 +371,52 @@ Stat* GenericStats::bookcase() #endif } -Stat* GenericStats::leaderOfThePack() +Stat* GenericStats::leaderOfThePack() { return instance->get_achievement( eAward_LeaderOfThePack ); } -Stat* GenericStats::MOARTools() +Stat* GenericStats::MOARTools() { return instance->get_achievement( eAward_MOARTools ); } -Stat* GenericStats::dispenseWithThis() +Stat* GenericStats::dispenseWithThis() { return instance->get_achievement( eAward_DispenseWithThis ); } -Stat* GenericStats::InToTheNether() +Stat* GenericStats::InToTheNether() { return instance->get_achievement( eAward_InToTheNether ); } -Stat* GenericStats::socialPost() +Stat* GenericStats::socialPost() { return instance->get_achievement( eAward_socialPost ); } -Stat* GenericStats::eatPorkChop() +Stat* GenericStats::eatPorkChop() { return instance->get_achievement( eAward_eatPorkChop ); } -Stat* GenericStats::play100Days() +Stat* GenericStats::play100Days() { return instance->get_achievement( eAward_play100Days ); } -Stat* GenericStats::arrowKillCreeper() +Stat* GenericStats::arrowKillCreeper() { return instance->get_achievement( eAward_arrowKillCreeper ); } -Stat* GenericStats::mine100Blocks() +Stat* GenericStats::mine100Blocks() { return instance->get_achievement( eAward_mine100Blocks ); } -Stat* GenericStats::kill10Creepers() +Stat* GenericStats::kill10Creepers() { return instance->get_achievement( eAward_kill10Creepers ); } @@ -666,7 +666,7 @@ byteArray GenericStats::getParam_itemsSmelted(int id, int aux, int count) return this->getParam_itemsCrafted(id,aux,count); } -byteArray GenericStats::getParam_itemsUsed(shared_ptr plr, shared_ptr itm) +byteArray GenericStats::getParam_itemsUsed(std::shared_ptr plr, std::shared_ptr itm) { return getParam_noArgs(); // Really just a count on most platforms. } @@ -676,7 +676,7 @@ byteArray GenericStats::getParam_itemsBought(int id, int aux, int count) return getParam_noArgs(); } -byteArray GenericStats::getParam_mobKill(shared_ptr plr, shared_ptr mob, DamageSource *dmgSrc) +byteArray GenericStats::getParam_mobKill(std::shared_ptr plr, std::shared_ptr mob, DamageSource *dmgSrc) { return getParam_noArgs(); // Really just a count on most platforms. } @@ -819,13 +819,13 @@ byteArray GenericStats::param_blocksMined(int id, int data, int count) } byteArray GenericStats::param_itemsCollected(int id, int aux, int count) -{ - return instance->getParam_itemsCollected(id,aux,count); +{ + return instance->getParam_itemsCollected(id,aux,count); } byteArray GenericStats::param_itemsCrafted(int id, int aux, int count) -{ - return instance->getParam_itemsCrafted(id,aux,count); +{ + return instance->getParam_itemsCrafted(id,aux,count); } byteArray GenericStats::param_itemsSmelted(int id, int aux, int count) @@ -833,7 +833,7 @@ byteArray GenericStats::param_itemsSmelted(int id, int aux, int count) return instance->getParam_itemsSmelted(id,aux,count); } -byteArray GenericStats::param_itemsUsed(shared_ptr plr, shared_ptr itm) +byteArray GenericStats::param_itemsUsed(std::shared_ptr plr, std::shared_ptr itm) { if ( (plr != NULL) && (itm != NULL) ) return instance->getParam_itemsUsed(plr, itm); else return instance->getParam_noArgs(); @@ -844,9 +844,9 @@ byteArray GenericStats::param_itemsBought(int id, int aux, int count) return instance->getParam_itemsBought(id,aux,count); } -byteArray GenericStats::param_mobKill(shared_ptr plr, shared_ptr mob, DamageSource *dmgSrc) +byteArray GenericStats::param_mobKill(std::shared_ptr plr, std::shared_ptr mob, DamageSource *dmgSrc) { - if ( (plr != NULL) && (mob != NULL) ) return instance->getParam_mobKill(plr, mob, dmgSrc); + if ( (plr != NULL) && (mob != NULL) ) return instance->getParam_mobKill(plr, mob, dmgSrc); else return instance->getParam_noArgs(); } @@ -891,8 +891,8 @@ byteArray GenericStats::param_enteredBiome(int biomeId) } byteArray GenericStats::param_noArgs() -{ - return instance->getParam_noArgs(); +{ + return instance->getParam_noArgs(); } byteArray GenericStats::param_openInventory() diff --git a/Minecraft.World/GenericStats.h b/Minecraft.World/GenericStats.h index 541424db..82c201cf 100644 --- a/Minecraft.World/GenericStats.h +++ b/Minecraft.World/GenericStats.h @@ -122,15 +122,15 @@ public: static Stat* kill10Creepers(); static Stat* adventuringTime(); // Requires new Stat - static Stat* repopulation(); + static Stat* repopulation(); static Stat* diamondsToYou(); // +Durango static Stat* porkChop(); // Req Stat? static Stat* passingTheTime(); // Req Stat - static Stat* archer(); + static Stat* archer(); static Stat* theHaggler(); // Req Stat static Stat* potPlanter(); // Req Stat static Stat* itsASign(); // Req Stat - static Stat* ironBelly(); + static Stat* ironBelly(); static Stat* haveAShearfulDay(); static Stat* rainbowCollection(); // Requires new Stat static Stat* stayinFrosty(); // +Durango @@ -159,10 +159,10 @@ public: static byteArray param_itemsCollected(int id, int aux, int count); static byteArray param_itemsCrafted(int id, int aux, int count); static byteArray param_itemsSmelted(int id, int aux, int cound); - static byteArray param_itemsUsed(shared_ptr plr, shared_ptr itm); + static byteArray param_itemsUsed(std::shared_ptr plr, std::shared_ptr itm); static byteArray param_itemsBought(int id, int aux, int count); - static byteArray param_mobKill(shared_ptr plr, shared_ptr mob, DamageSource *dmgSrc); + static byteArray param_mobKill(std::shared_ptr plr, std::shared_ptr mob, DamageSource *dmgSrc); static byteArray param_breedEntity(eINSTANCEOF mobType); static byteArray param_tamedEntity(eINSTANCEOF mobType); @@ -249,7 +249,7 @@ public: protected: // ACHIEVEMENTS - VIRTUAL // - + virtual Stat* get_achievement(eAward achievementId); @@ -318,10 +318,10 @@ protected: virtual byteArray getParam_itemsCollected(int id, int aux, int count); virtual byteArray getParam_itemsCrafted(int id, int aux, int count); virtual byteArray getParam_itemsSmelted(int id, int aux, int count); - virtual byteArray getParam_itemsUsed(shared_ptr plr, shared_ptr itm); + virtual byteArray getParam_itemsUsed(std::shared_ptr plr, std::shared_ptr itm); virtual byteArray getParam_itemsBought(int id, int aux, int count); - virtual byteArray getParam_mobKill(shared_ptr plr, shared_ptr mob, DamageSource *dmgSrc); + virtual byteArray getParam_mobKill(std::shared_ptr plr, std::shared_ptr mob, DamageSource *dmgSrc); virtual byteArray getParam_breedEntity(eINSTANCEOF entityId); virtual byteArray getParam_tamedEntity(eINSTANCEOF entityId); diff --git a/Minecraft.World/GetInfoPacket.h b/Minecraft.World/GetInfoPacket.h index 90688f3e..cdeb5170 100644 --- a/Minecraft.World/GetInfoPacket.h +++ b/Minecraft.World/GetInfoPacket.h @@ -11,6 +11,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new GetInfoPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new GetInfoPacket()); } virtual int getId() { return 254; } }; \ No newline at end of file diff --git a/Minecraft.World/Ghast.cpp b/Minecraft.World/Ghast.cpp index fcf0b705..9e66830d 100644 --- a/Minecraft.World/Ghast.cpp +++ b/Minecraft.World/Ghast.cpp @@ -49,7 +49,7 @@ bool Ghast::hurt(DamageSource *source, int dmg) { if (source->getMsgId() == ChatPacket::e_ChatDeathFireball) { - shared_ptr player = dynamic_pointer_cast( source->getEntity() ); + std::shared_ptr player = dynamic_pointer_cast( source->getEntity() ); if (player != NULL) { // reflected fireball, kill the ghast @@ -62,7 +62,7 @@ bool Ghast::hurt(DamageSource *source, int dmg) return FlyingMob::hurt(source, dmg); } -void Ghast::defineSynchedData() +void Ghast::defineSynchedData() { FlyingMob::defineSynchedData(); @@ -82,7 +82,7 @@ void Ghast::tick() this->textureIdx = current == 1 ? TN_MOB_GHAST_FIRE : TN_MOB_GHAST; } -void Ghast::serverAiStep() +void Ghast::serverAiStep() { if (!level->isClientSide && level->difficulty == Difficulty::PEACEFUL) remove(); checkDespawn(); @@ -107,7 +107,7 @@ void Ghast::serverAiStep() dd = sqrt(dd); - if (canReach(xTarget, yTarget, zTarget, dd)) + if (canReach(xTarget, yTarget, zTarget, dd)) { this->xd += xd / dd * 0.1; this->yd += yd / dd * 0.1; @@ -125,14 +125,14 @@ void Ghast::serverAiStep() if (target == NULL || retargetTime-- <= 0) { target = level->getNearestAttackablePlayer(shared_from_this(), 100); - if (target != NULL) + if (target != NULL) { retargetTime = 20; } } double maxDist = 64.0f; - if (target != NULL && target->distanceToSqr(shared_from_this()) < maxDist * maxDist) + if (target != NULL && target->distanceToSqr(shared_from_this()) < maxDist * maxDist) { double xdd = target->x - x; double ydd = (target->bb->y0 + target->bbHeight / 2) - (y + bbHeight / 2); @@ -151,7 +151,7 @@ void Ghast::serverAiStep() { // 4J - change brought forward from 1.2.3 level->levelEvent(nullptr, LevelEvent::SOUND_GHAST_FIREBALL, (int) x, (int) y, (int) z, 0); - shared_ptr ie = shared_ptr( new Fireball(level, dynamic_pointer_cast( shared_from_this() ), xdd, ydd, zdd) ); + std::shared_ptr ie = std::shared_ptr( new Fireball(level, dynamic_pointer_cast( shared_from_this() ), xdd, ydd, zdd) ); double d = 4; Vec3 *v = getViewVector(1); ie->x = x + v->x * d; @@ -160,8 +160,8 @@ void Ghast::serverAiStep() level->addEntity(ie); charge = -40; } - } - else + } + else { if (charge > 0) charge--; } @@ -172,7 +172,7 @@ void Ghast::serverAiStep() if (charge > 0) charge--; } - if (!level->isClientSide) + if (!level->isClientSide) { byte old = entityData->getByte(DATA_IS_CHARGING); byte current = (byte) (charge > 10 ? 1 : 0); @@ -183,7 +183,7 @@ void Ghast::serverAiStep() } } -bool Ghast::canReach(double xt, double yt, double zt, double dist) +bool Ghast::canReach(double xt, double yt, double zt, double dist) { double xd = (xTarget - x) / dist; double yd = (yTarget - y) / dist; @@ -214,7 +214,7 @@ int Ghast::getDeathSound() return eSoundType_MOB_GHAST_DEATH; } -int Ghast::getDeathLoot() +int Ghast::getDeathLoot() { return Item::sulphur->id; } diff --git a/Minecraft.World/Ghast.h b/Minecraft.World/Ghast.h index cdb44b61..f9738625 100644 --- a/Minecraft.World/Ghast.h +++ b/Minecraft.World/Ghast.h @@ -20,8 +20,8 @@ public: int floatDuration; double xTarget, yTarget, zTarget; -private: - shared_ptr target; +private: + std::shared_ptr target; int retargetTime; public: diff --git a/Minecraft.World/GiveItemCommand.cpp b/Minecraft.World/GiveItemCommand.cpp index 1d13592f..076c3ade 100644 --- a/Minecraft.World/GiveItemCommand.cpp +++ b/Minecraft.World/GiveItemCommand.cpp @@ -10,7 +10,7 @@ EGameCommand GiveItemCommand::getId() return eGameCommand_Give; } -void GiveItemCommand::execute(shared_ptr source, byteArray commandData) +void GiveItemCommand::execute(std::shared_ptr source, byteArray commandData) { ByteArrayInputStream bais(commandData); DataInputStream dis(&bais); @@ -20,20 +20,20 @@ void GiveItemCommand::execute(shared_ptr source, byteArray comman int amount = dis.readInt(); int aux = dis.readInt(); wstring tag = dis.readUTF(); - + bais.reset(); - shared_ptr player = getPlayer(uid); + std::shared_ptr player = getPlayer(uid); if(player != NULL && item > 0 && Item::items[item] != NULL) { - shared_ptr itemInstance = shared_ptr(new ItemInstance(item, amount, aux)); + std::shared_ptr itemInstance = std::shared_ptr(new ItemInstance(item, amount, aux)); player->drop(itemInstance); //logAdminAction(source, L"commands.give.success", ChatPacket::e_ChatCustom, Item::items[item]->getName(itemInstance), item, amount, player->getAName()); logAdminAction(source, ChatPacket::e_ChatCustom, L"commands.give.success", item, player->getAName()); } } -shared_ptr GiveItemCommand::preparePacket(shared_ptr player, int item, int amount, int aux, const wstring &tag) +std::shared_ptr GiveItemCommand::preparePacket(std::shared_ptr player, int item, int amount, int aux, const wstring &tag) { if(player == NULL) return nullptr; @@ -46,5 +46,5 @@ shared_ptr GiveItemCommand::preparePacket(shared_ptr dos.writeInt(aux); dos.writeUTF(tag); - return shared_ptr( new GameCommandPacket(eGameCommand_Give, baos.toByteArray() )); + return std::shared_ptr( new GameCommandPacket(eGameCommand_Give, baos.toByteArray() )); } \ No newline at end of file diff --git a/Minecraft.World/GiveItemCommand.h b/Minecraft.World/GiveItemCommand.h index 532070a6..0881d9f6 100644 --- a/Minecraft.World/GiveItemCommand.h +++ b/Minecraft.World/GiveItemCommand.h @@ -8,8 +8,8 @@ class GiveItemCommand : public Command { public: virtual EGameCommand getId(); - virtual void execute(shared_ptr source, byteArray commandData); + virtual void execute(std::shared_ptr source, byteArray commandData); public: - static shared_ptr preparePacket(shared_ptr player, int item, int amount = 1, int aux = 0, const wstring &tag = L""); + static std::shared_ptr preparePacket(std::shared_ptr player, int item, int amount = 1, int aux = 0, const wstring &tag = L""); }; \ No newline at end of file diff --git a/Minecraft.World/GoldenAppleItem.cpp b/Minecraft.World/GoldenAppleItem.cpp index 6c99d201..8ed422a7 100644 --- a/Minecraft.World/GoldenAppleItem.cpp +++ b/Minecraft.World/GoldenAppleItem.cpp @@ -10,12 +10,12 @@ GoldenAppleItem::GoldenAppleItem(int id, int nutrition, float saturationMod, boo setStackedByData(true); } -bool GoldenAppleItem::isFoil(shared_ptr itemInstance) +bool GoldenAppleItem::isFoil(std::shared_ptr itemInstance) { return itemInstance->getAuxValue() > 0; } -const Rarity *GoldenAppleItem::getRarity(shared_ptr itemInstance) +const Rarity *GoldenAppleItem::getRarity(std::shared_ptr itemInstance) { if (itemInstance->getAuxValue() == 0) { @@ -24,7 +24,7 @@ const Rarity *GoldenAppleItem::getRarity(shared_ptr itemInstance) return Rarity::epic; } -void GoldenAppleItem::addEatEffect(shared_ptr instance, Level *level, shared_ptr player) +void GoldenAppleItem::addEatEffect(std::shared_ptr instance, Level *level, std::shared_ptr player) { if (instance->getAuxValue() > 0) { @@ -47,7 +47,7 @@ unsigned int GoldenAppleItem::getUseDescriptionId(int iData /*= -1*/) else return IDS_DESC_ENCHANTED_GOLDENAPPLE; } -unsigned int GoldenAppleItem::getUseDescriptionId(shared_ptr instance) +unsigned int GoldenAppleItem::getUseDescriptionId(std::shared_ptr instance) { return this->getUseDescriptionId(instance->getAuxValue()); } \ No newline at end of file diff --git a/Minecraft.World/GoldenAppleItem.h b/Minecraft.World/GoldenAppleItem.h index 722bb2a9..052fcb49 100644 --- a/Minecraft.World/GoldenAppleItem.h +++ b/Minecraft.World/GoldenAppleItem.h @@ -9,13 +9,13 @@ public: GoldenAppleItem(int id, int nutrition, float saturationMod, bool isMeat); - virtual bool isFoil(shared_ptr itemInstance); - virtual const Rarity *getRarity(shared_ptr itemInstance); + virtual bool isFoil(std::shared_ptr itemInstance); + virtual const Rarity *getRarity(std::shared_ptr itemInstance); // 4J-JEV: Enchanted goldenapples and goldenapples each require their own tooltips. virtual unsigned int getUseDescriptionId(int iData /*= -1*/); - virtual unsigned int getUseDescriptionId(shared_ptr instance); + virtual unsigned int getUseDescriptionId(std::shared_ptr instance); protected: - void addEatEffect(shared_ptr instance, Level *level, shared_ptr player); + void addEatEffect(std::shared_ptr instance, Level *level, std::shared_ptr player); }; diff --git a/Minecraft.World/GrowMushroomIslandLayer.cpp b/Minecraft.World/GrowMushroomIslandLayer.cpp index d204502d..a5e9f6aa 100644 --- a/Minecraft.World/GrowMushroomIslandLayer.cpp +++ b/Minecraft.World/GrowMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -GrowMushroomIslandLayer::GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) +GrowMushroomIslandLayer::GrowMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/GrowMushroomIslandLayer.h b/Minecraft.World/GrowMushroomIslandLayer.h index 6b0860f7..7c340ede 100644 --- a/Minecraft.World/GrowMushroomIslandLayer.h +++ b/Minecraft.World/GrowMushroomIslandLayer.h @@ -4,6 +4,6 @@ class GrowMushroomIslandLayer : public Layer { public: - GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr parent); + GrowMushroomIslandLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/HalfSlabTile.cpp b/Minecraft.World/HalfSlabTile.cpp index ed3969c1..9bbcbedb 100644 --- a/Minecraft.World/HalfSlabTile.cpp +++ b/Minecraft.World/HalfSlabTile.cpp @@ -22,56 +22,56 @@ HalfSlabTile::HalfSlabTile(int id, bool fullSize, Material *material) : Tile(id, { this->fullSize = fullSize; - if (fullSize) + if (fullSize) { solid[id] = true; - } - else + } + else { setShape(0, 0, 0, 1, 0.5f, 1); } setLightBlock(255); } -void HalfSlabTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void HalfSlabTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { - if (fullSize) + if (fullSize) { setShape(0, 0, 0, 1, 1, 1); - } - else + } + else { bool upper = (level->getData(x, y, z) & TOP_SLOT_BIT) != 0; - if (upper) + if (upper) { setShape(0, 0.5f, 0, 1, 1, 1); - } - else + } + else { setShape(0, 0, 0, 1, 0.5f, 1); } } } -void HalfSlabTile::updateDefaultShape() +void HalfSlabTile::updateDefaultShape() { - if (fullSize) + if (fullSize) { setShape(0, 0, 0, 1, 1, 1); - } - else + } + else { setShape(0, 0, 0, 1, 0.5f, 1); } } -void HalfSlabTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void HalfSlabTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { updateShape(level, x, y, z); Tile::addAABBs(level, x, y, z, box, boxes, source); } -bool HalfSlabTile::isSolidRender(bool isServerLevel) +bool HalfSlabTile::isSolidRender(bool isServerLevel) { return fullSize; } @@ -87,30 +87,30 @@ int HalfSlabTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, in return itemValue; } -int HalfSlabTile::getResourceCount(Random *random) +int HalfSlabTile::getResourceCount(Random *random) { - if (fullSize) + if (fullSize) { return 2; } return 1; } -int HalfSlabTile::getSpawnResourcesAuxValue(int data) +int HalfSlabTile::getSpawnResourcesAuxValue(int data) { return data & TYPE_MASK; } -bool HalfSlabTile::isCubeShaped() +bool HalfSlabTile::isCubeShaped() { return fullSize; } -bool HalfSlabTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face) +bool HalfSlabTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face) { if (fullSize) return Tile::shouldRenderFace(level, x, y, z, face); - if (face != Facing::UP && face != Facing::DOWN && !Tile::shouldRenderFace(level, x, y, z, face)) + if (face != Facing::UP && face != Facing::DOWN && !Tile::shouldRenderFace(level, x, y, z, face)) { return false; } @@ -121,13 +121,13 @@ bool HalfSlabTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int oz += Facing::STEP_Z[Facing::OPPOSITE_FACING[face]]; boolean isUpper = (level->getData(ox, oy, oz) & TOP_SLOT_BIT) != 0; - if (isUpper) + if (isUpper) { if (face == Facing::DOWN) return true; if (face == Facing::UP && Tile::shouldRenderFace(level, x, y, z, face)) return true; return !(isHalfSlab(level->getTile(x, y, z)) && (level->getData(x, y, z) & TOP_SLOT_BIT) != 0); - } - else + } + else { if (face == Facing::UP) return true; if (face == Facing::DOWN && Tile::shouldRenderFace(level, x, y, z, face)) return true; @@ -135,7 +135,7 @@ bool HalfSlabTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int } } -bool HalfSlabTile::isHalfSlab(int tileId) +bool HalfSlabTile::isHalfSlab(int tileId) { return tileId == Tile::stoneSlabHalf_Id || tileId == Tile::woodSlabHalf_Id; } diff --git a/Minecraft.World/HalfSlabTile.h b/Minecraft.World/HalfSlabTile.h index 183a4add..4d1e8ecd 100644 --- a/Minecraft.World/HalfSlabTile.h +++ b/Minecraft.World/HalfSlabTile.h @@ -3,7 +3,7 @@ #include "Tile.h" -class HalfSlabTile : public Tile +class HalfSlabTile : public Tile { @@ -16,9 +16,9 @@ protected: public: HalfSlabTile(int id, bool fullSize, Material *material); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual void updateDefaultShape(); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); virtual bool isSolidRender(bool isServerLevel); virtual int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue); virtual int getResourceCount(Random *random); diff --git a/Minecraft.World/HangingEntity.cpp b/Minecraft.World/HangingEntity.cpp index 6256a381..fcf80e07 100644 --- a/Minecraft.World/HangingEntity.cpp +++ b/Minecraft.World/HangingEntity.cpp @@ -10,7 +10,7 @@ void HangingEntity::_init(Level *level) -{ +{ checkInterval = 0; dir = 0; xTile = yTile = zTile = 0; @@ -35,7 +35,7 @@ HangingEntity::HangingEntity(Level *level, int xTile, int yTile, int zTile, int this->zTile = zTile; } -void HangingEntity::setDir(int dir) +void HangingEntity::setDir(int dir) { this->dir = dir; this->yRotO = this->yRot = (float)(dir * 90); @@ -44,12 +44,12 @@ void HangingEntity::setDir(int dir) float h = (float)getHeight(); float d = (float)getWidth(); - if (dir == Direction::NORTH || dir == Direction::SOUTH) + if (dir == Direction::NORTH || dir == Direction::SOUTH) { d = 0.5f; yRot = yRotO = (float)(Direction::DIRECTION_OPPOSITE[dir] * 90); - } - else + } + else { w = 0.5f; } @@ -89,19 +89,19 @@ void HangingEntity::setDir(int dir) bb->set(min(x0,x1), min(y0,y1), min(z0,z1), max(x0,x1), max(y0,y1), max(z0,z1)); } -float HangingEntity::offs(int w) +float HangingEntity::offs(int w) { if (w == 32) return 0.5f; if (w == 64) return 0.5f; return 0.0f; } -void HangingEntity::tick() +void HangingEntity::tick() { - if (checkInterval++ == 20 * 5 && !level->isClientSide)//isClientSide) + if (checkInterval++ == 20 * 5 && !level->isClientSide)//isClientSide) { checkInterval = 0; - if (!removed && !survives()) + if (!removed && !survives()) { remove(); dropItem(); @@ -109,13 +109,13 @@ void HangingEntity::tick() } } -bool HangingEntity::survives() +bool HangingEntity::survives() { - if (level->getCubes(shared_from_this(), bb)->size()!=0)//isEmpty()) + if (level->getCubes(shared_from_this(), bb)->size()!=0)//isEmpty()) { return false; - } - else + } + else { int ws = max(1, getWidth() / 16); int hs = max(1, getHeight() / 16); @@ -131,31 +131,31 @@ bool HangingEntity::survives() for (int ss = 0; ss < ws; ss++) { - for (int yy = 0; yy < hs; yy++) + for (int yy = 0; yy < hs; yy++) { Material *m; - if (dir == Direction::NORTH || dir == Direction::SOUTH) + if (dir == Direction::NORTH || dir == Direction::SOUTH) { m = level->getMaterial(xt + ss, yt + yy, zTile); - } - else + } + else { m = level->getMaterial(xTile, yt + yy, zt + ss); } - if (!m->isSolid()) + if (!m->isSolid()) { return false; } } - vector > *entities = level->getEntities(shared_from_this(), bb); + vector > *entities = level->getEntities(shared_from_this(), bb); if (entities != NULL && entities->size() > 0) { AUTO_VAR(itEnd, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { - shared_ptr e = (*it); + std::shared_ptr e = (*it); if(dynamic_pointer_cast(e) != NULL) { return false; @@ -167,12 +167,12 @@ bool HangingEntity::survives() return true; } -bool HangingEntity::isPickable() +bool HangingEntity::isPickable() { return true; } -bool HangingEntity::skipAttackInteraction(shared_ptr source) +bool HangingEntity::skipAttackInteraction(std::shared_ptr source) { if(source->GetType()==eTYPE_PLAYER) { @@ -181,13 +181,13 @@ bool HangingEntity::skipAttackInteraction(shared_ptr source) return false; } -bool HangingEntity::hurt(DamageSource *source, int damage) +bool HangingEntity::hurt(DamageSource *source, int damage) { - if (!removed && !level->isClientSide) + if (!removed && !level->isClientSide) { if (dynamic_cast(source) != NULL) { - shared_ptr sourceEntity = source->getDirectEntity(); + std::shared_ptr sourceEntity = source->getDirectEntity(); if (dynamic_pointer_cast(sourceEntity) != NULL && !dynamic_pointer_cast(sourceEntity)->isAllowedToHurtEntity(shared_from_this()) ) { @@ -198,14 +198,14 @@ bool HangingEntity::hurt(DamageSource *source, int damage) remove(); markHurt(); - shared_ptr player = nullptr; - shared_ptr e = source->getEntity(); + std::shared_ptr player = nullptr; + std::shared_ptr e = source->getEntity(); if (e!=NULL && ((e->GetType() & eTYPE_PLAYER)!=0) ) // check if it's serverplayer or player { player = dynamic_pointer_cast( e ); } - if (player != NULL && player->abilities.instabuild) + if (player != NULL && player->abilities.instabuild) { return true; } @@ -216,25 +216,25 @@ bool HangingEntity::hurt(DamageSource *source, int damage) } // 4J - added noEntityCubes parameter -void HangingEntity::move(double xa, double ya, double za, bool noEntityCubes) +void HangingEntity::move(double xa, double ya, double za, bool noEntityCubes) { - if (!level->isClientSide && !removed && (xa * xa + ya * ya + za * za) > 0) + if (!level->isClientSide && !removed && (xa * xa + ya * ya + za * za) > 0) { remove(); dropItem(); } } -void HangingEntity::push(double xa, double ya, double za) +void HangingEntity::push(double xa, double ya, double za) { - if (!level->isClientSide && !removed && (xa * xa + ya * ya + za * za) > 0) + if (!level->isClientSide && !removed && (xa * xa + ya * ya + za * za) > 0) { remove(); dropItem(); } } -void HangingEntity::addAdditonalSaveData(CompoundTag *tag) +void HangingEntity::addAdditonalSaveData(CompoundTag *tag) { tag->putByte(L"Direction", (byte) dir); tag->putInt(L"TileX", xTile); @@ -242,7 +242,7 @@ void HangingEntity::addAdditonalSaveData(CompoundTag *tag) tag->putInt(L"TileZ", zTile); // Back compat - switch (dir) + switch (dir) { case Direction::NORTH: tag->putByte(L"Dir", (byte) 0); @@ -259,15 +259,15 @@ void HangingEntity::addAdditonalSaveData(CompoundTag *tag) } } -void HangingEntity::readAdditionalSaveData(CompoundTag *tag) +void HangingEntity::readAdditionalSaveData(CompoundTag *tag) { - if (tag->contains(L"Direction")) + if (tag->contains(L"Direction")) { dir = tag->getByte(L"Direction"); - } - else + } + else { - switch (tag->getByte(L"Dir")) + switch (tag->getByte(L"Dir")) { case 0: dir = Direction::NORTH; diff --git a/Minecraft.World/HangingEntity.h b/Minecraft.World/HangingEntity.h index b87915e4..0736728b 100644 --- a/Minecraft.World/HangingEntity.h +++ b/Minecraft.World/HangingEntity.h @@ -15,7 +15,7 @@ private: int checkInterval; //eINSTANCEOF eType; -protected: +protected: virtual void defineSynchedData() {}; public: @@ -29,7 +29,7 @@ public: virtual void tick(); virtual bool isPickable(); - virtual bool skipAttackInteraction(shared_ptr source); + virtual bool skipAttackInteraction(std::shared_ptr source); virtual bool hurt(DamageSource *source, int damage); virtual void move(double xa, double ya, double za, bool noEntityCubes=false); // 4J - added noEntityCubes parameter virtual void push(double xa, double ya, double za); diff --git a/Minecraft.World/HangingEntityItem.cpp b/Minecraft.World/HangingEntityItem.cpp index 505dce4d..2e299b73 100644 --- a/Minecraft.World/HangingEntityItem.cpp +++ b/Minecraft.World/HangingEntityItem.cpp @@ -19,7 +19,7 @@ HangingEntityItem::HangingEntityItem(int id, eINSTANCEOF eClassType) : Item(id) // setItemCategory(CreativeModeTab.TAB_DECORATIONS); } -bool HangingEntityItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int xt, int yt, int zt, int face, float clickX, float clickY, float clickZ, bool bTestOnly) +bool HangingEntityItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int xt, int yt, int zt, int face, float clickX, float clickY, float clickZ, bool bTestOnly) { if (face == Facing::DOWN) return false; if (face == Facing::UP) return false; @@ -33,14 +33,14 @@ bool HangingEntityItem::useOn(shared_ptr instance, shared_ptr entity = createEntity(level, xt, yt, zt, dir); + std::shared_ptr entity = createEntity(level, xt, yt, zt, dir); //if (!player->mayUseItemAt(xt, yt, zt, face, instance)) return false; if (!player->mayBuild(xt, yt, zt)) return false; - if (entity != NULL && entity->survives()) + if (entity != NULL && entity->survives()) { - if (!level->isClientSide) + if (!level->isClientSide) { if(level->addEntity(entity)==TRUE) { @@ -65,22 +65,22 @@ bool HangingEntityItem::useOn(shared_ptr instance, shared_ptr HangingEntityItem::createEntity(Level *level, int x, int y, int z, int dir) +std::shared_ptr HangingEntityItem::createEntity(Level *level, int x, int y, int z, int dir) { - if (eType == eTYPE_PAINTING) + if (eType == eTYPE_PAINTING) { - shared_ptr painting = shared_ptr(new Painting(level, x, y, z, dir)); + std::shared_ptr painting = std::shared_ptr(new Painting(level, x, y, z, dir)); painting->PaintingPostConstructor(dir); - + return dynamic_pointer_cast (painting); - } - else if (eType == eTYPE_ITEM_FRAME) + } + else if (eType == eTYPE_ITEM_FRAME) { - shared_ptr itemFrame = shared_ptr(new ItemFrame(level, x, y, z, dir)); + std::shared_ptr itemFrame = std::shared_ptr(new ItemFrame(level, x, y, z, dir)); return dynamic_pointer_cast (itemFrame); - } - else + } + else { return nullptr; } diff --git a/Minecraft.World/HangingEntityItem.h b/Minecraft.World/HangingEntityItem.h index 51bd8b23..52983a95 100644 --- a/Minecraft.World/HangingEntityItem.h +++ b/Minecraft.World/HangingEntityItem.h @@ -4,7 +4,7 @@ class HangingEntity; -class HangingEntityItem : public Item +class HangingEntityItem : public Item { private: //final Class clazz; @@ -13,9 +13,9 @@ private: public: HangingEntityItem(int id, eINSTANCEOF eClassType); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int xt, int yt, int zt, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly);//, float clickX, float clickY, float clickZ); - + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int xt, int yt, int zt, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly);//, float clickX, float clickY, float clickZ); + private: - shared_ptr createEntity(Level *level, int x, int y, int z, int dir) ; + std::shared_ptr createEntity(Level *level, int x, int y, int z, int dir) ; }; diff --git a/Minecraft.World/HashExtension.h b/Minecraft.World/HashExtension.h index 7ec9a909..85eec19a 100644 --- a/Minecraft.World/HashExtension.h +++ b/Minecraft.World/HashExtension.h @@ -7,10 +7,10 @@ namespace std { template - class hash< shared_ptr > + class hash< std::shared_ptr > { public: - size_t operator()(const shared_ptr& key) const + size_t operator()(const std::shared_ptr& key) const { return (size_t)key.get(); } diff --git a/Minecraft.World/HatchetItem.cpp b/Minecraft.World/HatchetItem.cpp index 16bf89bf..e0123bf9 100644 --- a/Minecraft.World/HatchetItem.cpp +++ b/Minecraft.World/HatchetItem.cpp @@ -23,7 +23,7 @@ HatchetItem::HatchetItem(int id, const Tier *tier) : DiggerItem (id, 3, tier, di } // 4J - brought forward from 1.2.3 -float HatchetItem::getDestroySpeed(shared_ptr itemInstance, Tile *tile) +float HatchetItem::getDestroySpeed(std::shared_ptr itemInstance, Tile *tile) { if (tile != NULL && tile->material == Material::wood) { diff --git a/Minecraft.World/HatchetItem.h b/Minecraft.World/HatchetItem.h index afb6dfc0..2959e38b 100644 --- a/Minecraft.World/HatchetItem.h +++ b/Minecraft.World/HatchetItem.h @@ -11,5 +11,5 @@ private: public: static void staticCtor(); HatchetItem(int id, const Tier *tier); - virtual float getDestroySpeed(shared_ptr itemInstance, Tile *tile); // 4J - brought forward from 1.2.3 + virtual float getDestroySpeed(std::shared_ptr itemInstance, Tile *tile); // 4J - brought forward from 1.2.3 }; diff --git a/Minecraft.World/HeavyTile.cpp b/Minecraft.World/HeavyTile.cpp index 18460f2f..23614a42 100644 --- a/Minecraft.World/HeavyTile.cpp +++ b/Minecraft.World/HeavyTile.cpp @@ -59,14 +59,14 @@ void HeavyTile::checkSlide(Level *level, int x, int y, int z) return; } - shared_ptr e = shared_ptr( new FallingTile(level, x + 0.5f, y + 0.5f, z + 0.5f, id, level->getData(x, y, z)) ); + std::shared_ptr e = std::shared_ptr( new FallingTile(level, x + 0.5f, y + 0.5f, z + 0.5f, id, level->getData(x, y, z)) ); falling(e); level->addEntity(e); } } } -void HeavyTile::falling(shared_ptr entity) +void HeavyTile::falling(std::shared_ptr entity) { } diff --git a/Minecraft.World/HeavyTile.h b/Minecraft.World/HeavyTile.h index a9186eae..739d3ea0 100644 --- a/Minecraft.World/HeavyTile.h +++ b/Minecraft.World/HeavyTile.h @@ -18,7 +18,7 @@ public: private: void checkSlide(Level *level, int x, int y, int z); protected: - virtual void falling(shared_ptr entity); + virtual void falling(std::shared_ptr entity); public: virtual int getTickDelay(); static bool isFree(Level *level, int x, int y, int z); diff --git a/Minecraft.World/HellSandTile.cpp b/Minecraft.World/HellSandTile.cpp index dbaa6012..71faa279 100644 --- a/Minecraft.World/HellSandTile.cpp +++ b/Minecraft.World/HellSandTile.cpp @@ -14,7 +14,7 @@ AABB *HellSandTile::getAABB(Level *level, int x, int y, int z) return AABB::newTemp(x, y, z, x + 1, y + 1 - r, z + 1); } -void HellSandTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void HellSandTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { entity->xd*=0.4; entity->zd*=0.4; diff --git a/Minecraft.World/HellSandTile.h b/Minecraft.World/HellSandTile.h index 9d8d004e..ef8df044 100644 --- a/Minecraft.World/HellSandTile.h +++ b/Minecraft.World/HellSandTile.h @@ -7,5 +7,5 @@ class HellSandTile : public Tile public: HellSandTile(int id); virtual AABB *getAABB(Level *level, int x, int y, int z); - virtual void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + virtual void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); }; \ No newline at end of file diff --git a/Minecraft.World/HitResult.cpp b/Minecraft.World/HitResult.cpp index ffa93541..1406d08c 100644 --- a/Minecraft.World/HitResult.cpp +++ b/Minecraft.World/HitResult.cpp @@ -15,7 +15,7 @@ HitResult::HitResult(int x, int y, int z, int f, Vec3 *pos) this->entity = nullptr; } -HitResult::HitResult(shared_ptr entity) +HitResult::HitResult(std::shared_ptr entity) { this->type = ENTITY; this->entity = entity; @@ -24,7 +24,7 @@ HitResult::HitResult(shared_ptr entity) x = y = z = f = 0; } -double HitResult::distanceTo(shared_ptr e) +double HitResult::distanceTo(std::shared_ptr e) { double xd = pos->x - e->x; double yd = pos->y - e->y; diff --git a/Minecraft.World/HitResult.h b/Minecraft.World/HitResult.h index efcfa75a..7721a0ff 100644 --- a/Minecraft.World/HitResult.h +++ b/Minecraft.World/HitResult.h @@ -12,11 +12,11 @@ public: Type type; int x, y, z, f; Vec3 *pos; - shared_ptr entity; + std::shared_ptr entity; HitResult(int x, int y, int z, int f, Vec3 *pos); - HitResult(shared_ptr entity); + HitResult(std::shared_ptr entity); - double distanceTo(shared_ptr e); + double distanceTo(std::shared_ptr e); }; \ No newline at end of file diff --git a/Minecraft.World/HoeItem.cpp b/Minecraft.World/HoeItem.cpp index 50dde305..11d09b9e 100644 --- a/Minecraft.World/HoeItem.cpp +++ b/Minecraft.World/HoeItem.cpp @@ -12,7 +12,7 @@ HoeItem::HoeItem(int id, const Tier *tier) : Item(id) setMaxDamage(tier->getUses()); } -bool HoeItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool HoeItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { if (!player->mayBuild(x, y, z)) return false; @@ -23,7 +23,7 @@ bool HoeItem::useOn(shared_ptr instance, shared_ptr player int above = level->getTile(x, y + 1, z); // 4J-PB - missing parentheses - if (face != 0 && above == 0 && (targetType == Tile::grass_Id || targetType == Tile::dirt_Id)) + if (face != 0 && above == 0 && (targetType == Tile::grass_Id || targetType == Tile::dirt_Id)) { if(!bTestUseOnOnly) { @@ -40,7 +40,7 @@ bool HoeItem::useOn(shared_ptr instance, shared_ptr player return false; } -bool HoeItem::isHandEquipped() +bool HoeItem::isHandEquipped() { return true; } diff --git a/Minecraft.World/HoeItem.h b/Minecraft.World/HoeItem.h index a4d015ac..e353d6cb 100644 --- a/Minecraft.World/HoeItem.h +++ b/Minecraft.World/HoeItem.h @@ -12,7 +12,7 @@ protected: public: HoeItem(int id, const Tier *tier); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); virtual bool isHandEquipped(); const Tier *getTier(); diff --git a/Minecraft.World/HouseFeature.cpp b/Minecraft.World/HouseFeature.cpp index f8c5d173..25c4841d 100644 --- a/Minecraft.World/HouseFeature.cpp +++ b/Minecraft.World/HouseFeature.cpp @@ -184,7 +184,7 @@ bool HouseFeature::place(Level *level, Random *random, int x, int y, int z) } } - shared_ptr(pz) = shared_ptr(new PigZombie(level)); + std::shared_ptr(pz) = std::shared_ptr(new PigZombie(level)); pz->moveTo(x0 + w / 2.0 + 0.5, y0 + 0.5, z0 + d / 2.0 + 0.5, 0, 0); level->addEntity(pz); diff --git a/Minecraft.World/HurtByTargetGoal.cpp b/Minecraft.World/HurtByTargetGoal.cpp index a146c47d..5570e37a 100644 --- a/Minecraft.World/HurtByTargetGoal.cpp +++ b/Minecraft.World/HurtByTargetGoal.cpp @@ -22,10 +22,10 @@ void HurtByTargetGoal::start() if (alertSameType) { - vector > *nearby = mob->level->getEntitiesOfClass(typeid(*mob), AABB::newTemp(mob->x, mob->y, mob->z, mob->x + 1, mob->y + 1, mob->z + 1)->grow(within, 4, within)); + vector > *nearby = mob->level->getEntitiesOfClass(typeid(*mob), AABB::newTemp(mob->x, mob->y, mob->z, mob->x + 1, mob->y + 1, mob->z + 1)->grow(within, 4, within)); for(AUTO_VAR(it, nearby->begin()); it != nearby->end(); ++it) { - shared_ptr other = dynamic_pointer_cast(*it); + std::shared_ptr other = dynamic_pointer_cast(*it); if (this->mob->shared_from_this() == other) continue; if (other->getTarget() != NULL) continue; other->setTarget(mob->getLastHurtByMob()); diff --git a/Minecraft.World/HurtByTargetGoal.h b/Minecraft.World/HurtByTargetGoal.h index 4c6ee5fe..b731fc39 100644 --- a/Minecraft.World/HurtByTargetGoal.h +++ b/Minecraft.World/HurtByTargetGoal.h @@ -6,7 +6,7 @@ class HurtByTargetGoal : public TargetGoal { private: bool alertSameType; - shared_ptr oldHurtByMob; + std::shared_ptr oldHurtByMob; public: HurtByTargetGoal(Mob *mob, bool alertSameType); diff --git a/Minecraft.World/IceTile.cpp b/Minecraft.World/IceTile.cpp index 6ca9cc80..c0338fd5 100644 --- a/Minecraft.World/IceTile.cpp +++ b/Minecraft.World/IceTile.cpp @@ -22,14 +22,14 @@ bool IceTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face return HalfTransparentTile::shouldRenderFace(level, x, y, z, 1 - face); } -void IceTile::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +void IceTile::playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data) { player->awardStat(GenericStats::blocksMined(id), GenericStats::param_blocksMined(id,data,1) ); player->causeFoodExhaustion(FoodConstants::EXHAUSTION_MINE); if (isSilkTouchable() && EnchantmentHelper::hasSilkTouch(player->inventory)) { - shared_ptr item = getSilkTouchItemInstance(data); + std::shared_ptr item = getSilkTouchItemInstance(data); if (item != NULL) { popResource(level, x, y, z, item); diff --git a/Minecraft.World/IceTile.h b/Minecraft.World/IceTile.h index b3f1a5e6..3fa9d6d6 100644 --- a/Minecraft.World/IceTile.h +++ b/Minecraft.World/IceTile.h @@ -9,7 +9,7 @@ public: IceTile(int id); virtual int getRenderLayer(); virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face); - virtual void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data); + virtual void playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data); virtual int getResourceCount(Random *random); virtual void tick(Level *level, int x, int y, int z, Random *random); virtual int getPistonPushReaction(); diff --git a/Minecraft.World/IndirectEntityDamageSource.cpp b/Minecraft.World/IndirectEntityDamageSource.cpp index 01c54ed6..009af37e 100644 --- a/Minecraft.World/IndirectEntityDamageSource.cpp +++ b/Minecraft.World/IndirectEntityDamageSource.cpp @@ -4,30 +4,30 @@ #include "net.minecraft.world.damagesource.h" #include "net.minecraft.network.packet.h" -//IndirectEntityDamageSource::IndirectEntityDamageSource(const wstring &msgId, shared_ptr entity, shared_ptr owner) : EntityDamageSource(msgId, entity) -IndirectEntityDamageSource::IndirectEntityDamageSource(ChatPacket::EChatPacketMessage msgId, shared_ptr entity, shared_ptr owner) : EntityDamageSource(msgId, entity) +//IndirectEntityDamageSource::IndirectEntityDamageSource(const wstring &msgId, std::shared_ptr entity, std::shared_ptr owner) : EntityDamageSource(msgId, entity) +IndirectEntityDamageSource::IndirectEntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr entity, std::shared_ptr owner) : EntityDamageSource(msgId, entity) { this->owner = owner; } // 4J Stu - Brought forward from 1.2.3 to fix #46422 -shared_ptr IndirectEntityDamageSource::getDirectEntity() +std::shared_ptr IndirectEntityDamageSource::getDirectEntity() { return entity; } -shared_ptr IndirectEntityDamageSource::getEntity() +std::shared_ptr IndirectEntityDamageSource::getEntity() { return owner; } -//wstring IndirectEntityDamageSource::getLocalizedDeathMessage(shared_ptr player) +//wstring IndirectEntityDamageSource::getLocalizedDeathMessage(std::shared_ptr player) //{ // return L"death." + msgId + player->name + owner->getAName(); // //return I18n.get("death." + msgId, player.name, owner.getAName()); //} -shared_ptr IndirectEntityDamageSource::getDeathMessagePacket(shared_ptr player) +std::shared_ptr IndirectEntityDamageSource::getDeathMessagePacket(std::shared_ptr player) { wstring additional = L""; int type; @@ -36,7 +36,7 @@ shared_ptr IndirectEntityDamageSource::getDeathMessagePacket(shared_ type = owner->GetType(); if(type == eTYPE_SERVERPLAYER) { - shared_ptr sourcePlayer = dynamic_pointer_cast(owner); + std::shared_ptr sourcePlayer = dynamic_pointer_cast(owner); if(sourcePlayer != NULL) additional = sourcePlayer->name; } } @@ -44,5 +44,5 @@ shared_ptr IndirectEntityDamageSource::getDeathMessagePacket(shared_ { type = entity->GetType(); } - return shared_ptr( new ChatPacket(player->name, m_msgId, type, additional ) ); + return std::shared_ptr( new ChatPacket(player->name, m_msgId, type, additional ) ); } \ No newline at end of file diff --git a/Minecraft.World/IndirectEntityDamageSource.h b/Minecraft.World/IndirectEntityDamageSource.h index b7aec18c..52848de1 100644 --- a/Minecraft.World/IndirectEntityDamageSource.h +++ b/Minecraft.World/IndirectEntityDamageSource.h @@ -9,17 +9,17 @@ class Player; class IndirectEntityDamageSource : public EntityDamageSource { private: - shared_ptr owner; + std::shared_ptr owner; public: - //IndirectEntityDamageSource(const wstring &msgId, shared_ptr entity, shared_ptr owner); - IndirectEntityDamageSource(ChatPacket::EChatPacketMessage msgId, shared_ptr entity, shared_ptr owner); + //IndirectEntityDamageSource(const wstring &msgId, std::shared_ptr entity, std::shared_ptr owner); + IndirectEntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr entity, std::shared_ptr owner); virtual ~IndirectEntityDamageSource() { } - virtual shared_ptr getDirectEntity(); // 4J Stu - Brought forward from 1.2.3 to fix #46422 - virtual shared_ptr getEntity(); + virtual std::shared_ptr getDirectEntity(); // 4J Stu - Brought forward from 1.2.3 to fix #46422 + virtual std::shared_ptr getEntity(); // 4J Stu - Made return a packet - //virtual wstring getLocalizedDeathMessage(shared_ptr player); - virtual shared_ptr getDeathMessagePacket(shared_ptr player); + //virtual wstring getLocalizedDeathMessage(std::shared_ptr player); + virtual std::shared_ptr getDeathMessagePacket(std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/InteractPacket.h b/Minecraft.World/InteractPacket.h index 0141038d..97b40fa0 100644 --- a/Minecraft.World/InteractPacket.h +++ b/Minecraft.World/InteractPacket.h @@ -20,6 +20,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new InteractPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new InteractPacket()); } virtual int getId() { return 7; } }; \ No newline at end of file diff --git a/Minecraft.World/Inventory.cpp b/Minecraft.World/Inventory.cpp index 8ef3f085..7218e14c 100644 --- a/Minecraft.World/Inventory.cpp +++ b/Minecraft.World/Inventory.cpp @@ -14,7 +14,7 @@ const int Inventory::INVENTORY_SIZE = 4 * 9; const int Inventory::SELECTION_SIZE = 9; // 4J Stu - The Pllayer is managed by shared_ptrs elsewhere, but it owns us so we don't want to also -// keep a shared_ptr of it. If we pass it on we should use shared_from_this() though +// keep a std::shared_ptr of it. If we pass it on we should use shared_from_this() though Inventory::Inventory(Player *player) { items = ItemInstanceArray( INVENTORY_SIZE ); @@ -35,7 +35,7 @@ Inventory::~Inventory() delete [] armor.data; } -shared_ptr Inventory::getSelected() +std::shared_ptr Inventory::getSelected() { // sanity checking to prevent exploits if (selected < SELECTION_SIZE && selected >= 0) @@ -83,11 +83,11 @@ int Inventory::getSlot(int tileId, int data) return -1; } -int Inventory::getSlotWithRemainingSpace(shared_ptr item) +int Inventory::getSlotWithRemainingSpace(std::shared_ptr item) { for (unsigned int i = 0; i < items.length; i++) { - if (items[i] != NULL && items[i]->id == item->id && items[i]->isStackable() + if (items[i] != NULL && items[i]->id == item->id && items[i]->isStackable() && items[i]->count < items[i]->getMaxStackSize() && items[i]->count < getMaxStackSize() && (!items[i]->isStackedByData() || items[i]->getAuxValue() == item->getAuxValue()) && ItemInstance::tagMatches(items[i], item)) @@ -182,12 +182,12 @@ void Inventory::replaceSlot(Item *item, int data) { return; } - items[selected] = shared_ptr(new ItemInstance(Item::items[item->id], 1, data)); + items[selected] = std::shared_ptr(new ItemInstance(Item::items[item->id], 1, data)); } } -int Inventory::addResource(shared_ptr itemInstance) +int Inventory::addResource(std::shared_ptr itemInstance) { int type = itemInstance->id; @@ -200,7 +200,7 @@ int Inventory::addResource(shared_ptr itemInstance) if (slot < 0) return count; if (items[slot] == NULL) { - items[slot] = ItemInstance::clone(itemInstance); + items[slot] = ItemInstance::clone(itemInstance); player->handleCollectItem(itemInstance); } return 0; @@ -211,7 +211,7 @@ int Inventory::addResource(shared_ptr itemInstance) if (slot < 0) return count; if (items[slot] == NULL) { - items[slot] = shared_ptr( new ItemInstance(type, 0, itemInstance->getAuxValue()) ); + items[slot] = std::shared_ptr( new ItemInstance(type, 0, itemInstance->getAuxValue()) ); // 4J Stu - Brought forward from 1.2 if (itemInstance->hasTag()) { @@ -269,16 +269,16 @@ bool Inventory::removeResource(int type,int iAuxVal) return true; } -void Inventory::removeResources(shared_ptr item) +void Inventory::removeResources(std::shared_ptr item) { - if(item == NULL) return; + if(item == NULL) return; int countToRemove = item->count; for (unsigned int i = 0; i < items.length; i++) { if (items[i] != NULL && items[i]->sameItemWithTags(item)) { - int slotCount = items[i]->count; + int slotCount = items[i]->count; items[i]->count -= countToRemove; if(slotCount < countToRemove) { @@ -293,14 +293,14 @@ void Inventory::removeResources(shared_ptr item) } } -shared_ptr Inventory::getResourceItem(int type) +std::shared_ptr Inventory::getResourceItem(int type) { int slot = getSlot(type); if (slot < 0) return nullptr; return getItem( slot ); } -shared_ptr Inventory::getResourceItem(int type,int iAuxVal) +std::shared_ptr Inventory::getResourceItem(int type,int iAuxVal) { int slot = getSlot(type,iAuxVal); if (slot < 0) return nullptr; @@ -317,12 +317,12 @@ bool Inventory::hasResource(int type) void Inventory::swapSlots(int from, int to) { - shared_ptr tmp = items[to]; + std::shared_ptr tmp = items[to]; items[to] = items[from]; items[from] = tmp; } -bool Inventory::add(shared_ptr item) +bool Inventory::add(std::shared_ptr item) { // 4J Stu - Fix for duplication glitch if(item->count <= 0) return true; @@ -359,7 +359,7 @@ bool Inventory::add(shared_ptr item) { player->handleCollectItem(item); - player->awardStat( + player->awardStat( GenericStats::itemsCollected(item->id, item->getAuxValue()), GenericStats::param_itemsCollected(item->id, item->getAuxValue(), item->GetCount())); @@ -377,7 +377,7 @@ bool Inventory::add(shared_ptr item) return false; } -shared_ptr Inventory::removeItem(unsigned int slot, int count) +std::shared_ptr Inventory::removeItem(unsigned int slot, int count) { ItemInstanceArray pile = items; @@ -391,13 +391,13 @@ shared_ptr Inventory::removeItem(unsigned int slot, int count) { if (pile[slot]->count <= count) { - shared_ptr item = pile[slot]; + std::shared_ptr item = pile[slot]; pile[slot] = nullptr; return item; } else { - shared_ptr i = pile[slot]->remove(count); + std::shared_ptr i = pile[slot]->remove(count); if (pile[slot]->count == 0) pile[slot] = nullptr; return i; } @@ -405,7 +405,7 @@ shared_ptr Inventory::removeItem(unsigned int slot, int count) return nullptr; } -shared_ptr Inventory::removeItemNoUpdate(int slot) +std::shared_ptr Inventory::removeItemNoUpdate(int slot) { ItemInstanceArray pile = items; if (slot >= items.length) @@ -416,14 +416,14 @@ shared_ptr Inventory::removeItemNoUpdate(int slot) if (pile[slot] != NULL) { - shared_ptr item = pile[slot]; + std::shared_ptr item = pile[slot]; pile[slot] = nullptr; return item; } return nullptr; } -void Inventory::setItem(unsigned int slot, shared_ptr item) +void Inventory::setItem(unsigned int slot, std::shared_ptr item) { #ifdef _DEBUG if(item!=NULL) @@ -447,7 +447,7 @@ void Inventory::setItem(unsigned int slot, shared_ptr item) else { items[slot] = item; - } + } player->handleCollectItem(item); /* ItemInstanceArray& pile = items; @@ -512,7 +512,7 @@ void Inventory::load(ListTag *inventoryList) { CompoundTag *tag = inventoryList->get(i); unsigned int slot = tag->getByte(L"Slot") & 0xff; - shared_ptr item = shared_ptr( ItemInstance::fromTag(tag) ); + std::shared_ptr item = std::shared_ptr( ItemInstance::fromTag(tag) ); if (item != NULL) { if (slot >= 0 && slot < items.length) items[slot] = item; @@ -526,7 +526,7 @@ unsigned int Inventory::getContainerSize() return items.length + 4; } -shared_ptr Inventory::getItem(unsigned int slot) +std::shared_ptr Inventory::getItem(unsigned int slot) { // 4J Stu - Changed this a little from the Java so it's less funny if( slot >= items.length ) @@ -559,9 +559,9 @@ int Inventory::getMaxStackSize() return MAX_INVENTORY_STACK_SIZE; } -int Inventory::getAttackDamage(shared_ptr entity) +int Inventory::getAttackDamage(std::shared_ptr entity) { - shared_ptr item = getItem(selected); + std::shared_ptr item = getItem(selected); if (item != NULL) return item->getAttackDamage(entity); return 1; } @@ -570,12 +570,12 @@ bool Inventory::canDestroy(Tile *tile) { if (tile->material->isAlwaysDestroyable()) return true; - shared_ptr item = getItem(selected); + std::shared_ptr item = getItem(selected); if (item != NULL) return item->canDestroySpecial(tile); return false; } -shared_ptr Inventory::getArmor(int layer) +std::shared_ptr Inventory::getArmor(int layer) { return armor[layer]; } @@ -640,7 +640,7 @@ void Inventory::setChanged() changed = true; } -bool Inventory::isSame(shared_ptr copy) +bool Inventory::isSame(std::shared_ptr copy) { for (unsigned int i = 0; i < items.length; i++) { @@ -654,7 +654,7 @@ bool Inventory::isSame(shared_ptr copy) } -bool Inventory::isSame(shared_ptr a, shared_ptr b) +bool Inventory::isSame(std::shared_ptr a, std::shared_ptr b) { if (a == NULL && b == NULL) return true; if (a == NULL || b == NULL) return false; @@ -663,9 +663,9 @@ bool Inventory::isSame(shared_ptr a, shared_ptr b) } -shared_ptr Inventory::copy() +std::shared_ptr Inventory::copy() { - shared_ptr copy = shared_ptr( new Inventory(NULL) ); + std::shared_ptr copy = std::shared_ptr( new Inventory(NULL) ); for (unsigned int i = 0; i < items.length; i++) { copy->items[i] = items[i] != NULL ? items[i]->copy() : nullptr; @@ -677,25 +677,25 @@ shared_ptr Inventory::copy() return copy; } -void Inventory::setCarried(shared_ptr carried) +void Inventory::setCarried(std::shared_ptr carried) { this->carried = carried; player->handleCollectItem(carried); } -shared_ptr Inventory::getCarried() +std::shared_ptr Inventory::getCarried() { return carried; } -bool Inventory::stillValid(shared_ptr player) +bool Inventory::stillValid(std::shared_ptr player) { if (this->player->removed) return false; if (player->distanceToSqr(this->player->shared_from_this()) > 8 * 8) return false; return true; } -bool Inventory::contains(shared_ptr itemInstance) +bool Inventory::contains(std::shared_ptr itemInstance) { for (unsigned int i = 0; i < armor.length; i++) { @@ -718,7 +718,7 @@ void Inventory::stopOpen() // TODO Auto-generated method stub } -void Inventory::replaceWith(shared_ptr other) +void Inventory::replaceWith(std::shared_ptr other) { for (int i = 0; i < items.length; i++) { @@ -730,7 +730,7 @@ void Inventory::replaceWith(shared_ptr other) } } -int Inventory::countMatches(shared_ptr itemInstance) +int Inventory::countMatches(std::shared_ptr itemInstance) { if(itemInstance == NULL) return 0; int count = 0; diff --git a/Minecraft.World/Inventory.h b/Minecraft.World/Inventory.h index 9d1aa7e0..ca4f6e79 100644 --- a/Minecraft.World/Inventory.h +++ b/Minecraft.World/Inventory.h @@ -25,8 +25,8 @@ public: Player *player; // This is owned by shared_ptrs, but we are owned by it private: - shared_ptr heldItem; - shared_ptr carried; + std::shared_ptr heldItem; + std::shared_ptr carried; public: bool changed; @@ -34,7 +34,7 @@ public: Inventory(Player *player); ~Inventory(); - shared_ptr getSelected(); + std::shared_ptr getSelected(); // 4J-PB - Added for the in-game tooltips bool IsHeldItem(); @@ -44,8 +44,8 @@ private: int getSlot(int tileId); int getSlot(int tileId, int data); - int getSlotWithRemainingSpace(shared_ptr item); - + int getSlotWithRemainingSpace(std::shared_ptr item); + public: int getFreeSlot(); @@ -58,7 +58,7 @@ public: void replaceSlot(Item *item, int data); private: - int addResource(shared_ptr itemInstance); + int addResource(std::shared_ptr itemInstance); public: void tick(); @@ -67,22 +67,22 @@ public: // 4J-PB added to get the right resource from the inventory for removal bool removeResource(int type,int iAuxVal); - void removeResources(shared_ptr item); // 4J Added for trading - + void removeResources(std::shared_ptr item); // 4J Added for trading + // 4J-Stu added to the get the item that would be affected by the removeResource functions - shared_ptr getResourceItem(int type); - shared_ptr getResourceItem(int type,int iAuxVal); + std::shared_ptr getResourceItem(int type); + std::shared_ptr getResourceItem(int type,int iAuxVal); bool hasResource(int type); void swapSlots(int from, int to); - bool add(shared_ptr item); + bool add(std::shared_ptr item); - shared_ptr removeItem(unsigned int slot, int count); - virtual shared_ptr removeItemNoUpdate(int slot); + std::shared_ptr removeItem(unsigned int slot, int count); + virtual std::shared_ptr removeItemNoUpdate(int slot); - void setItem(unsigned int slot, shared_ptr item); + void setItem(unsigned int slot, std::shared_ptr item); float getDestroySpeed(Tile *tile); @@ -92,17 +92,17 @@ public: unsigned int getContainerSize(); - shared_ptr getItem(unsigned int slot); + std::shared_ptr getItem(unsigned int slot); int getName(); int getMaxStackSize(); - int getAttackDamage(shared_ptr entity); + int getAttackDamage(std::shared_ptr entity); bool canDestroy(Tile *tile); - shared_ptr getArmor(int layer); + std::shared_ptr getArmor(int layer); int getArmorValue(); @@ -112,25 +112,25 @@ public: void setChanged(); - bool isSame(shared_ptr copy); + bool isSame(std::shared_ptr copy); private: - bool isSame(shared_ptr a, shared_ptr b); + bool isSame(std::shared_ptr a, std::shared_ptr b); public: - shared_ptr copy(); + std::shared_ptr copy(); - void setCarried(shared_ptr carried); + void setCarried(std::shared_ptr carried); - shared_ptr getCarried(); + std::shared_ptr getCarried(); - bool stillValid(shared_ptr player); + bool stillValid(std::shared_ptr player); - bool contains(shared_ptr itemInstance); + bool contains(std::shared_ptr itemInstance); virtual void startOpen(); virtual void stopOpen(); - void replaceWith(shared_ptr other); + void replaceWith(std::shared_ptr other); - int countMatches(shared_ptr itemInstance); // 4J Added + int countMatches(std::shared_ptr itemInstance); // 4J Added }; \ No newline at end of file diff --git a/Minecraft.World/InventoryMenu.cpp b/Minecraft.World/InventoryMenu.cpp index 979243c1..32370af9 100644 --- a/Minecraft.World/InventoryMenu.cpp +++ b/Minecraft.World/InventoryMenu.cpp @@ -20,16 +20,16 @@ const int InventoryMenu::INV_SLOT_END = InventoryMenu::INV_SLOT_START + 9 * 3; const int InventoryMenu::USE_ROW_SLOT_START = InventoryMenu::INV_SLOT_END; const int InventoryMenu::USE_ROW_SLOT_END = InventoryMenu::USE_ROW_SLOT_START + 9; -InventoryMenu::InventoryMenu(shared_ptr inventory, bool active, Player *player) : AbstractContainerMenu() +InventoryMenu::InventoryMenu(std::shared_ptr inventory, bool active, Player *player) : AbstractContainerMenu() { owner = player; _init( inventory, active ); } -void InventoryMenu::_init(shared_ptr inventory, bool active) +void InventoryMenu::_init(std::shared_ptr inventory, bool active) { - craftSlots = shared_ptr( new CraftingContainer(this, 2, 2) ); - resultSlots = shared_ptr( new ResultContainer() ); + craftSlots = std::shared_ptr( new CraftingContainer(this, 2, 2) ); + resultSlots = std::shared_ptr( new ResultContainer() ); this->active = active; addSlot(new ResultSlot( inventory->player, craftSlots, resultSlots, 0, 144, 36)); @@ -64,19 +64,19 @@ void InventoryMenu::_init(shared_ptr inventory, bool active) slotsChanged(); // 4J removed craftSlots parameter, see comment below } -void InventoryMenu::slotsChanged() // 4J used to take a shared_ptr but wasn't using it, so removed to simplify things +void InventoryMenu::slotsChanged() // 4J used to take a std::shared_ptr but wasn't using it, so removed to simplify things { MemSect(23); resultSlots->setItem(0, Recipes::getInstance()->getItemFor(craftSlots, owner->level) ); MemSect(0); } -void InventoryMenu::removed(shared_ptr player) +void InventoryMenu::removed(std::shared_ptr player) { AbstractContainerMenu::removed(player); for (int i = 0; i < 4; i++) { - shared_ptr item = craftSlots->removeItemNoUpdate(i); + std::shared_ptr item = craftSlots->removeItemNoUpdate(i); if (item != NULL) { player->drop(item); @@ -86,16 +86,16 @@ void InventoryMenu::removed(shared_ptr player) resultSlots->setItem(0, nullptr); } -bool InventoryMenu::stillValid(shared_ptr player) +bool InventoryMenu::stillValid(std::shared_ptr player) { return true; } -shared_ptr InventoryMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr InventoryMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); - + Slot *HelmetSlot = slots->at(ARMOR_SLOT_START); Slot *ChestplateSlot = slots->at(ARMOR_SLOT_START+1); Slot *LeggingsSlot = slots->at(ARMOR_SLOT_START+2); @@ -104,7 +104,7 @@ shared_ptr InventoryMenu::quickMoveStack(shared_ptr player if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex == RESULT_SLOT) @@ -119,28 +119,28 @@ shared_ptr InventoryMenu::quickMoveStack(shared_ptr player else if (slotIndex >= INV_SLOT_START && slotIndex < INV_SLOT_END) { // 4J-PB - added for quick equip - if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Helmet && (!HelmetSlot->hasItem() ) ) + if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Helmet && (!HelmetSlot->hasItem() ) ) { if(!moveItemStackTo(stack, ARMOR_SLOT_START, ARMOR_SLOT_START+1, false)) { return nullptr; } } - else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Chestplate && (!ChestplateSlot->hasItem() ) ) + else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Chestplate && (!ChestplateSlot->hasItem() ) ) { if(!moveItemStackTo(stack, ARMOR_SLOT_START+1, ARMOR_SLOT_START+2, false)) { return nullptr; } } - else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Leggings && (!LeggingsSlot->hasItem() ) ) + else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Leggings && (!LeggingsSlot->hasItem() ) ) { if(!moveItemStackTo(stack, ARMOR_SLOT_START+2, ARMOR_SLOT_START+3, false)) { return nullptr; } } - else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Boots && (!BootsSlot->hasItem() ) ) + else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Boots && (!BootsSlot->hasItem() ) ) { if(!moveItemStackTo(stack, ARMOR_SLOT_START+3, ARMOR_SLOT_START+4, false)) { @@ -157,28 +157,28 @@ shared_ptr InventoryMenu::quickMoveStack(shared_ptr player { //ArmorRecipes::_eArmorType eArmourType=ArmorRecipes::GetArmorType(stack->id); - if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Helmet && (!HelmetSlot->hasItem() ) ) + if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Helmet && (!HelmetSlot->hasItem() ) ) { if(!moveItemStackTo(stack, ARMOR_SLOT_START, ARMOR_SLOT_START+1, false)) { return nullptr; } } - else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Chestplate && (!ChestplateSlot->hasItem() ) ) + else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Chestplate && (!ChestplateSlot->hasItem() ) ) { if(!moveItemStackTo(stack, ARMOR_SLOT_START+1, ARMOR_SLOT_START+2, false)) { return nullptr; } } - else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Leggings && (!LeggingsSlot->hasItem() ) ) + else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Leggings && (!LeggingsSlot->hasItem() ) ) { if(!moveItemStackTo(stack, ARMOR_SLOT_START+2, ARMOR_SLOT_START+3, false)) { return nullptr; } } - else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Boots && (!BootsSlot->hasItem() ) ) + else if(ArmorRecipes::GetArmorType(stack->id)==ArmorRecipes::eArmorType_Boots && (!BootsSlot->hasItem() ) ) { if(!moveItemStackTo(stack, ARMOR_SLOT_START+3, ARMOR_SLOT_START+4, false)) { @@ -220,15 +220,15 @@ shared_ptr InventoryMenu::quickMoveStack(shared_ptr player return clicked; } -bool InventoryMenu::mayCombine(Slot *slot, shared_ptr item) +bool InventoryMenu::mayCombine(Slot *slot, std::shared_ptr item) { return slot->mayCombine(item); } // 4J-JEV: Added for achievement 'Iron Man'. -shared_ptr InventoryMenu::clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player) +std::shared_ptr InventoryMenu::clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr player) { - shared_ptr out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); + std::shared_ptr out = AbstractContainerMenu::clicked(slotIndex, buttonNum, clickType, player); #ifdef _EXTENDED_ACHIEVEMENTS static int ironItems[4] = {Item::helmet_iron_Id,Item::chestplate_iron_Id,Item::leggings_iron_Id,Item::boots_iron_Id}; diff --git a/Minecraft.World/InventoryMenu.h b/Minecraft.World/InventoryMenu.h index b37a4be9..cd18f95f 100644 --- a/Minecraft.World/InventoryMenu.h +++ b/Minecraft.World/InventoryMenu.h @@ -23,22 +23,22 @@ public: static const int USE_ROW_SLOT_END; public: - shared_ptr craftSlots; - shared_ptr resultSlots; + std::shared_ptr craftSlots; + std::shared_ptr resultSlots; bool active; - InventoryMenu(shared_ptr inventory, bool active, Player *player); + InventoryMenu(std::shared_ptr inventory, bool active, Player *player); private: - void _init(shared_ptr inventory, bool active); + void _init(std::shared_ptr inventory, bool active); public: - virtual void slotsChanged(); // 4J used to take a shared_ptr but wasn't using it, so removed to simplify things - virtual void removed(shared_ptr player); - virtual bool stillValid(shared_ptr player); - virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); - virtual bool mayCombine(Slot *slot, shared_ptr item); + virtual void slotsChanged(); // 4J used to take a std::shared_ptr but wasn't using it, so removed to simplify things + virtual void removed(std::shared_ptr player); + virtual bool stillValid(std::shared_ptr player); + virtual std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); + virtual bool mayCombine(Slot *slot, std::shared_ptr item); // 4J ADDED, - virtual shared_ptr clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player); + virtual std::shared_ptr clicked(int slotIndex, int buttonNum, int clickType, std::shared_ptr player); }; diff --git a/Minecraft.World/Item.cpp b/Minecraft.World/Item.cpp index 5d723ec5..85a5f1bd 100644 --- a/Minecraft.World/Item.cpp +++ b/Minecraft.World/Item.cpp @@ -275,12 +275,12 @@ void Item::staticCtor() Item::helmet_iron = (ArmorItem *) ( ( new ArmorItem(50, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_iron) ->setTextureName(L"helmetIron")->setDescriptionId(IDS_ITEM_HELMET_IRON)->setUseDescriptionId(IDS_DESC_HELMET_IRON) ); Item::helmet_diamond = (ArmorItem *) ( ( new ArmorItem(54, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_diamond) ->setTextureName(L"helmetDiamond")->setDescriptionId(IDS_ITEM_HELMET_DIAMOND)->setUseDescriptionId(IDS_DESC_HELMET_DIAMOND) ); Item::helmet_gold = (ArmorItem *) ( ( new ArmorItem(58, ArmorItem::ArmorMaterial::GOLD, 4, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_gold) ->setTextureName(L"helmetGold")->setDescriptionId(IDS_ITEM_HELMET_GOLD)->setUseDescriptionId(IDS_DESC_HELMET_GOLD) ); - + Item::chestplate_cloth = (ArmorItem *) ( ( new ArmorItem(43, ArmorItem::ArmorMaterial::CLOTH, 0, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_cloth) ->setTextureName(L"chestplateCloth")->setDescriptionId(IDS_ITEM_CHESTPLATE_CLOTH)->setUseDescriptionId(IDS_DESC_CHESTPLATE_LEATHER) ); Item::chestplate_iron = (ArmorItem *) ( ( new ArmorItem(51, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_iron) ->setTextureName(L"chestplateIron")->setDescriptionId(IDS_ITEM_CHESTPLATE_IRON)->setUseDescriptionId(IDS_DESC_CHESTPLATE_IRON) ); Item::chestplate_diamond = (ArmorItem *) ( ( new ArmorItem(55, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_diamond) ->setTextureName(L"chestplateDiamond")->setDescriptionId(IDS_ITEM_CHESTPLATE_DIAMOND)->setUseDescriptionId(IDS_DESC_CHESTPLATE_DIAMOND) ); Item::chestplate_gold = (ArmorItem *) ( ( new ArmorItem(59, ArmorItem::ArmorMaterial::GOLD, 4, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_gold) ->setTextureName(L"chestplateGold")->setDescriptionId(IDS_ITEM_CHESTPLATE_GOLD)->setUseDescriptionId(IDS_DESC_CHESTPLATE_GOLD) ); - + Item::leggings_cloth = (ArmorItem *) ( ( new ArmorItem(44, ArmorItem::ArmorMaterial::CLOTH, 0, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_cloth) ->setTextureName(L"leggingsCloth")->setDescriptionId(IDS_ITEM_LEGGINGS_CLOTH)->setUseDescriptionId(IDS_DESC_LEGGINGS_LEATHER) ); Item::leggings_iron = (ArmorItem *) ( ( new ArmorItem(52, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_iron) ->setTextureName(L"leggingsIron")->setDescriptionId(IDS_ITEM_LEGGINGS_IRON)->setUseDescriptionId(IDS_DESC_LEGGINGS_IRON) ); Item::leggings_diamond = (ArmorItem *) ( ( new ArmorItem(56, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_diamond) ->setTextureName(L"leggingsDiamond")->setDescriptionId(IDS_ITEM_LEGGINGS_DIAMOND)->setUseDescriptionId(IDS_DESC_LEGGINGS_DIAMOND) ); @@ -303,14 +303,14 @@ void Item::staticCtor() // 4J-PB - todo - add materials and base types to the ones below Item::bucket_empty = ( new BucketItem(69, 0) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_water)->setTextureName(L"bucket")->setDescriptionId(IDS_ITEM_BUCKET)->setUseDescriptionId(IDS_DESC_BUCKET)->setMaxStackSize(16); Item::bowl = ( new Item(25) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_wood)->setTextureName(L"bowl")->setDescriptionId(IDS_ITEM_BOWL)->setUseDescriptionId(IDS_DESC_BOWL)->setMaxStackSize(64); - + Item::bucket_water = ( new BucketItem(70, Tile::water_Id) ) ->setTextureName(L"bucketWater")->setDescriptionId(IDS_ITEM_BUCKET_WATER)->setCraftingRemainingItem(Item::bucket_empty)->setUseDescriptionId(IDS_DESC_BUCKET_WATER); Item::bucket_lava = ( new BucketItem(71, Tile::lava_Id) ) ->setTextureName(L"bucketLava")->setDescriptionId(IDS_ITEM_BUCKET_LAVA)->setCraftingRemainingItem(Item::bucket_empty)->setUseDescriptionId(IDS_DESC_BUCKET_LAVA); Item::milk = ( new MilkBucketItem(79) )->setTextureName(L"milk")->setDescriptionId(IDS_ITEM_BUCKET_MILK)->setCraftingRemainingItem(Item::bucket_empty)->setUseDescriptionId(IDS_DESC_BUCKET_MILK); Item::bow = (BowItem *)( new BowItem(5) ) ->setTextureName(L"bow")->setBaseItemTypeAndMaterial(eBaseItemType_bow, eMaterial_bow) ->setDescriptionId(IDS_ITEM_BOW)->setUseDescriptionId(IDS_DESC_BOW); Item::arrow = ( new Item(6) ) ->setTextureName(L"arrow")->setBaseItemTypeAndMaterial(eBaseItemType_bow, eMaterial_arrow) ->setDescriptionId(IDS_ITEM_ARROW)->setUseDescriptionId(IDS_DESC_ARROW); - + Item::compass = ( new CompassItem(89) ) ->setTextureName(L"compass")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_compass) ->setDescriptionId(IDS_ITEM_COMPASS)->setUseDescriptionId(IDS_DESC_COMPASS); Item::clock = ( new ClockItem(91) ) ->setTextureName(L"clock")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_clock) ->setDescriptionId(IDS_ITEM_CLOCK)->setUseDescriptionId(IDS_DESC_CLOCK); Item::map = (MapItem *) ( new MapItem(102) ) ->setTextureName(L"map")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_map) ->setDescriptionId(IDS_ITEM_MAP)->setUseDescriptionId(IDS_DESC_MAP); @@ -341,7 +341,7 @@ void Item::staticCtor() ->setBaseItemTypeAndMaterial(eBaseItemType_giltFruit,eMaterial_apple)->setTextureName(L"appleGold")->setDescriptionId(IDS_ITEM_APPLE_GOLD);//->setUseDescriptionId(IDS_DESC_GOLDENAPPLE); Item::sign = ( new SignItem(67) ) ->setBaseItemTypeAndMaterial(eBaseItemType_HangingItem, eMaterial_wood)->setTextureName(L"sign")->setDescriptionId(IDS_ITEM_SIGN)->setUseDescriptionId(IDS_DESC_SIGN); - + Item::minecart = ( new MinecartItem(72, Minecart::RIDEABLE) ) ->setTextureName(L"minecart")->setDescriptionId(IDS_ITEM_MINECART)->setUseDescriptionId(IDS_DESC_MINECART); @@ -380,7 +380,7 @@ void Item::staticCtor() Item::cookie = ( new FoodItem(101, 2, FoodConstants::FOOD_SATURATION_POOR, false) ) ->setTextureName(L"cookie")->setDescriptionId(IDS_ITEM_COOKIE)->setUseDescriptionId(IDS_DESC_COOKIE); - Item::shears = (ShearsItem *)( new ShearsItem(103) ) ->setTextureName(L"shears")->setBaseItemTypeAndMaterial(eBaseItemType_devicetool, eMaterial_shears)->setDescriptionId(IDS_ITEM_SHEARS)->setUseDescriptionId(IDS_DESC_SHEARS); + Item::shears = (ShearsItem *)( new ShearsItem(103) ) ->setTextureName(L"shears")->setBaseItemTypeAndMaterial(eBaseItemType_devicetool, eMaterial_shears)->setDescriptionId(IDS_ITEM_SHEARS)->setUseDescriptionId(IDS_DESC_SHEARS); Item::melon = (new FoodItem(104, 2, FoodConstants::FOOD_SATURATION_LOW, false)) ->setTextureName(L"melon")->setDescriptionId(IDS_ITEM_MELON_SLICE)->setUseDescriptionId(IDS_DESC_MELON_SLICE); @@ -473,7 +473,7 @@ void Item::staticCtor() void Item::staticInit() { Stats::buildItemStats(); -} +} _Tier::Tier(int level, int uses, float speed, int damage, int enchantmentValue) : @@ -605,37 +605,37 @@ Icon *Item::getIcon(int auxValue) return icon; } -Icon *Item::getIcon(shared_ptr itemInstance) +Icon *Item::getIcon(std::shared_ptr itemInstance) { return getIcon(itemInstance->getAuxValue()); } -const bool Item::useOn(shared_ptr itemInstance, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly) +const bool Item::useOn(std::shared_ptr itemInstance, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly) { return false; } -bool Item::useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool Item::useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { return false; } -float Item::getDestroySpeed(shared_ptr itemInstance, Tile *tile) +float Item::getDestroySpeed(std::shared_ptr itemInstance, Tile *tile) { return 1; } -bool Item::TestUse(Level *level, shared_ptr player) +bool Item::TestUse(Level *level, std::shared_ptr player) { return false; } -shared_ptr Item::use(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr Item::use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { return itemInstance; } -shared_ptr Item::useTimeDepleted(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr Item::useTimeDepleted(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { return itemInstance; } @@ -683,20 +683,20 @@ bool Item::canBeDepleted() /** * Returns true when the item was used to deal more than default damage -* +* * @param itemInstance * @param mob * @param attacker * @return */ -bool Item::hurtEnemy(shared_ptr itemInstance, shared_ptr mob, shared_ptr attacker) +bool Item::hurtEnemy(std::shared_ptr itemInstance, std::shared_ptr mob, std::shared_ptr attacker) { return false; } /** * Returns true when the item was used to mine more efficiently -* +* * @param itemInstance * @param tile * @param x @@ -705,12 +705,12 @@ bool Item::hurtEnemy(shared_ptr itemInstance, shared_ptr mob, * @param owner * @return */ -bool Item::mineBlock(shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr owner) +bool Item::mineBlock(std::shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, std::shared_ptr owner) { return false; } -int Item::getAttackDamage(shared_ptr entity) +int Item::getAttackDamage(std::shared_ptr entity) { return 1; } @@ -720,7 +720,7 @@ bool Item::canDestroySpecial(Tile *tile) return false; } -bool Item::interactEnemy(shared_ptr itemInstance, shared_ptr mob) +bool Item::interactEnemy(std::shared_ptr itemInstance, std::shared_ptr mob) { return false; } @@ -753,7 +753,7 @@ LPCWSTR Item::getDescription() //return I18n::get(getDescriptionId()); } -LPCWSTR Item::getDescription(shared_ptr instance) +LPCWSTR Item::getDescription(std::shared_ptr instance) { return app.GetString(getDescriptionId(instance)); //return I18n::get(getDescriptionId(instance)); @@ -764,7 +764,7 @@ unsigned int Item::getDescriptionId(int iData /*= -1*/) return descriptionId; } -unsigned int Item::getDescriptionId(shared_ptr instance) +unsigned int Item::getDescriptionId(std::shared_ptr instance) { return descriptionId; } @@ -780,7 +780,7 @@ unsigned int Item::getUseDescriptionId() return useDescriptionId; } -unsigned int Item::getUseDescriptionId(shared_ptr instance) +unsigned int Item::getUseDescriptionId(std::shared_ptr instance) { return useDescriptionId; } @@ -791,7 +791,7 @@ Item *Item::setCraftingRemainingItem(Item *craftingRemainingItem) return this; } -bool Item::shouldMoveCraftingResultToInventory(shared_ptr instance) +bool Item::shouldMoveCraftingResultToInventory(std::shared_ptr instance) { // Default is good for the vast majority of items return true; @@ -817,15 +817,15 @@ wstring Item::getName() return L"";//I18n::get(getDescriptionId() + L".name"); } -int Item::getColor(shared_ptr item, int spriteLayer) +int Item::getColor(std::shared_ptr item, int spriteLayer) { return 0xffffff; } -void Item::inventoryTick(shared_ptr itemInstance, Level *level, shared_ptr owner, int slot, bool selected) { +void Item::inventoryTick(std::shared_ptr itemInstance, Level *level, std::shared_ptr owner, int slot, bool selected) { } -void Item::onCraftedBy(shared_ptr itemInstance, Level *level, shared_ptr player) +void Item::onCraftedBy(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { } @@ -834,17 +834,17 @@ bool Item::isComplex() return false; } -UseAnim Item::getUseAnimation(shared_ptr itemInstance) +UseAnim Item::getUseAnimation(std::shared_ptr itemInstance) { return UseAnim_none; } -int Item::getUseDuration(shared_ptr itemInstance) +int Item::getUseDuration(std::shared_ptr itemInstance) { return 0; } -void Item::releaseUsing(shared_ptr itemInstance, Level *level, shared_ptr player, int durationLeft) +void Item::releaseUsing(std::shared_ptr itemInstance, Level *level, std::shared_ptr player, int durationLeft) { } @@ -864,35 +864,35 @@ bool Item::hasPotionBrewingFormula() return !potionBrewingFormula.empty(); } -void Item::appendHoverText(shared_ptr itemInstance, shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) +void Item::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) { } -wstring Item::getHoverName(shared_ptr itemInstance) +wstring Item::getHoverName(std::shared_ptr itemInstance) { //String elementName = ("" + Language.getInstance().getElementName(getDescription(itemInstance))).trim(); //return elementName; return app.GetString(getDescriptionId(itemInstance)); } -bool Item::isFoil(shared_ptr itemInstance) +bool Item::isFoil(std::shared_ptr itemInstance) { if (itemInstance->isEnchanted()) return true; return false; } -const Rarity *Item::getRarity(shared_ptr itemInstance) +const Rarity *Item::getRarity(std::shared_ptr itemInstance) { if (itemInstance->isEnchanted()) return Rarity::rare; return Rarity::common; } -bool Item::isEnchantable(shared_ptr itemInstance) +bool Item::isEnchantable(std::shared_ptr itemInstance) { return getMaxStackSize() == 1 && canBeDepleted(); } -HitResult *Item::getPlayerPOVHitResult(Level *level, shared_ptr player, bool alsoPickLiquid) +HitResult *Item::getPlayerPOVHitResult(Level *level, std::shared_ptr player, bool alsoPickLiquid) { float a = 1; @@ -935,7 +935,7 @@ Icon *Item::getLayerIcon(int auxValue, int spriteLayer) return getIcon(auxValue); } -bool Item::isValidRepairItem(shared_ptr source, shared_ptr repairItem) +bool Item::isValidRepairItem(std::shared_ptr source, std::shared_ptr repairItem) { return false; } diff --git a/Minecraft.World/Item.h b/Minecraft.World/Item.h index 727fc661..3e3f7e27 100644 --- a/Minecraft.World/Item.h +++ b/Minecraft.World/Item.h @@ -68,8 +68,8 @@ public: eMaterial_stoneSmooth, eMaterial_netherbrick, eMaterial_ender, - eMaterial_glass, - eMaterial_blaze, + eMaterial_glass, + eMaterial_blaze, eMaterial_magic, eMaterial_melon, eMaterial_setfire, @@ -394,13 +394,13 @@ public: static const int bow_Id = 261; static const int arrow_Id = 262; static const int coal_Id = 263; - static const int diamond_Id = 264; + static const int diamond_Id = 264; static const int ironIngot_Id = 265; static const int goldIngot_Id = 266; static const int sword_iron_Id = 267; - static const int sword_wood_Id = 268; + static const int sword_wood_Id = 268; static const int shovel_wood_Id = 269; - static const int pickAxe_wood_Id = 270; + static const int pickAxe_wood_Id = 270; static const int hatchet_wood_Id = 271; static const int sword_stone_Id = 272; static const int shovel_stone_Id = 273; @@ -410,7 +410,7 @@ public: static const int shovel_diamond_Id = 277; static const int pickAxe_diamond_Id = 278; static const int hatchet_diamond_Id = 279; - static const int stick_Id = 280; + static const int stick_Id = 280; static const int bowl_Id = 281; static const int mushroomStew_Id = 282; static const int sword_gold_Id = 283; @@ -425,7 +425,7 @@ public: static const int hoe_iron_Id = 292; static const int hoe_diamond_Id = 293; static const int hoe_gold_Id = 294; - static const int seeds_wheat_Id = 295; + static const int seeds_wheat_Id = 295; static const int wheat_Id = 296; static const int bread_Id = 297; @@ -458,7 +458,7 @@ public: static const int porkChop_raw_Id = 319; static const int porkChop_cooked_Id = 320; static const int painting_Id = 321; - static const int apple_gold_Id = 322; + static const int apple_gold_Id = 322; static const int sign_Id = 323; static const int door_wood_Id = 324; static const int bucket_empty_Id = 325; @@ -474,7 +474,7 @@ public: static const int milk_Id = 335; static const int brick_Id = 336; static const int clay_Id = 337; - static const int reeds_Id = 338; + static const int reeds_Id = 338; static const int paper_Id = 339; static const int book_Id = 340; static const int slimeBall_Id = 341; @@ -487,7 +487,7 @@ public: static const int yellowDust_Id = 348; static const int fish_raw_Id = 349; static const int fish_cooked_Id = 350; - static const int dye_powder_Id = 351; + static const int dye_powder_Id = 351; static const int bone_Id = 352; static const int sugar_Id = 353; static const int cake_Id = 354; @@ -547,7 +547,7 @@ public: static const int record_12_Id = 2266; // 4J-PB - this one isn't playable in the PC game, but is fine in ours - static const int record_08_Id = 2267; + static const int record_08_Id = 2267; // TU9 static const int fireball_Id = 385; @@ -618,15 +618,15 @@ public: virtual int getIconType(); virtual Icon *getIcon(int auxValue); - Icon *getIcon(shared_ptr itemInstance); + Icon *getIcon(std::shared_ptr itemInstance); - const bool useOn(shared_ptr itemInstance, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly=false); + const bool useOn(std::shared_ptr itemInstance, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly=false); - virtual bool useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - virtual float getDestroySpeed(shared_ptr itemInstance, Tile *tile); - virtual bool TestUse(Level *level, shared_ptr player); - virtual shared_ptr use(shared_ptr itemInstance, Level *level, shared_ptr player); - virtual shared_ptr useTimeDepleted(shared_ptr itemInstance, Level *level, shared_ptr player); + virtual bool useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual float getDestroySpeed(std::shared_ptr itemInstance, Tile *tile); + virtual bool TestUse(Level *level, std::shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); + virtual std::shared_ptr useTimeDepleted(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); virtual int getMaxStackSize(); virtual int getLevelDataForAuxValue(int auxValue); bool isStackedByData(); @@ -645,17 +645,17 @@ public: /** * Returns true when the item was used to deal more than default damage - * + * * @param itemInstance * @param mob * @param attacker * @return */ - virtual bool hurtEnemy(shared_ptr itemInstance, shared_ptr mob, shared_ptr attacker); + virtual bool hurtEnemy(std::shared_ptr itemInstance, std::shared_ptr mob, std::shared_ptr attacker); /** * Returns true when the item was used to mine more efficiently - * + * * @param itemInstance * @param tile * @param x @@ -664,35 +664,35 @@ public: * @param owner * @return */ - virtual bool mineBlock(shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr owner); - virtual int getAttackDamage(shared_ptr entity); + virtual bool mineBlock(std::shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, std::shared_ptr owner); + virtual int getAttackDamage(std::shared_ptr entity); virtual bool canDestroySpecial(Tile *tile); - virtual bool interactEnemy(shared_ptr itemInstance, shared_ptr mob); + virtual bool interactEnemy(std::shared_ptr itemInstance, std::shared_ptr mob); Item *handEquipped(); virtual bool isHandEquipped(); virtual bool isMirroredArt(); Item *setDescriptionId(unsigned int id); LPCWSTR getDescription(); - LPCWSTR getDescription(shared_ptr instance); + LPCWSTR getDescription(std::shared_ptr instance); virtual unsigned int getDescriptionId(int iData = -1); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); Item *setUseDescriptionId(unsigned int id); virtual unsigned int getUseDescriptionId(); - virtual unsigned int getUseDescriptionId(shared_ptr instance); + virtual unsigned int getUseDescriptionId(std::shared_ptr instance); Item *setCraftingRemainingItem(Item *craftingRemainingItem); - virtual bool shouldMoveCraftingResultToInventory(shared_ptr instance); + virtual bool shouldMoveCraftingResultToInventory(std::shared_ptr instance); virtual bool shouldOverrideMultiplayerNBT(); Item *getCraftingRemainingItem(); bool hasCraftingRemainingItem(); std::wstring getName(); - virtual int getColor(shared_ptr item, int spriteLayer); - virtual void inventoryTick(shared_ptr itemInstance, Level *level, shared_ptr owner, int slot, bool selected); - virtual void onCraftedBy(shared_ptr itemInstance, Level *level, shared_ptr player); + virtual int getColor(std::shared_ptr item, int spriteLayer); + virtual void inventoryTick(std::shared_ptr itemInstance, Level *level, std::shared_ptr owner, int slot, bool selected); + virtual void onCraftedBy(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); virtual bool isComplex(); - virtual UseAnim getUseAnimation(shared_ptr itemInstance); - virtual int getUseDuration(shared_ptr itemInstance); - virtual void releaseUsing(shared_ptr itemInstance, Level *level, shared_ptr player, int durationLeft); + virtual UseAnim getUseAnimation(std::shared_ptr itemInstance); + virtual int getUseDuration(std::shared_ptr itemInstance); + virtual void releaseUsing(std::shared_ptr itemInstance, Level *level, std::shared_ptr player, int durationLeft); protected: virtual Item *setPotionBrewingFormula(const wstring &potionBrewingFormula); @@ -700,19 +700,19 @@ protected: public: virtual wstring getPotionBrewingFormula(); virtual bool hasPotionBrewingFormula(); - virtual void appendHoverText(shared_ptr itemInstance, shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); // 4J Added unformattedStrings - virtual wstring getHoverName(shared_ptr itemInstance); - virtual bool isFoil(shared_ptr itemInstance); - virtual const Rarity *getRarity(shared_ptr itemInstance); - virtual bool isEnchantable(shared_ptr itemInstance); + virtual void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); // 4J Added unformattedStrings + virtual wstring getHoverName(std::shared_ptr itemInstance); + virtual bool isFoil(std::shared_ptr itemInstance); + virtual const Rarity *getRarity(std::shared_ptr itemInstance); + virtual bool isEnchantable(std::shared_ptr itemInstance); protected: - HitResult *getPlayerPOVHitResult(Level *level, shared_ptr player, bool alsoPickLiquid); + HitResult *getPlayerPOVHitResult(Level *level, std::shared_ptr player, bool alsoPickLiquid); public: virtual int getEnchantmentValue(); virtual bool hasMultipleSpriteLayers(); virtual Icon *getLayerIcon(int auxValue, int spriteLayer); - virtual bool isValidRepairItem(shared_ptr source, shared_ptr repairItem); + virtual bool isValidRepairItem(std::shared_ptr source, std::shared_ptr repairItem); virtual void registerIcons(IconRegister *iconRegister); }; diff --git a/Minecraft.World/ItemEntity.cpp b/Minecraft.World/ItemEntity.cpp index eb7684a6..5c3a4515 100644 --- a/Minecraft.World/ItemEntity.cpp +++ b/Minecraft.World/ItemEntity.cpp @@ -48,7 +48,7 @@ ItemEntity::ItemEntity(Level *level, double x, double y, double z) : Entity(leve _init(level,x,y,z); } -ItemEntity::ItemEntity(Level *level, double x, double y, double z, shared_ptr item) : Entity( level ) +ItemEntity::ItemEntity(Level *level, double x, double y, double z, std::shared_ptr item) : Entity( level ) { _init(level,x,y,z); setItem(item); @@ -72,7 +72,7 @@ void ItemEntity::defineSynchedData() void ItemEntity::tick() { Entity::tick(); - + if (throwTime > 0) throwTime--; xo = x; yo = y; @@ -80,7 +80,7 @@ void ItemEntity::tick() yd -= 0.04f; noPhysics = checkInTile(x, (bb->y0 + bb->y1) / 2, z); - + // 4J - added parameter here so that these don't care about colliding with other entities move(xd, yd, zd, true); @@ -133,22 +133,22 @@ void ItemEntity::tick() } void ItemEntity::mergeWithNeighbours() -{ - vector > *neighbours = level->getEntitiesOfClass(typeid(*this), bb->grow(0.5, 0, 0.5)); +{ + vector > *neighbours = level->getEntitiesOfClass(typeid(*this), bb->grow(0.5, 0, 0.5)); for(AUTO_VAR(it, neighbours->begin()); it != neighbours->end(); ++it) { - shared_ptr entity = dynamic_pointer_cast(*it); + std::shared_ptr entity = dynamic_pointer_cast(*it); merge(entity); } delete neighbours; } -bool ItemEntity::merge(shared_ptr target) +bool ItemEntity::merge(std::shared_ptr target) { if (target == shared_from_this()) return false; if (!target->isAlive() || !this->isAlive()) return false; - shared_ptr myItem = this->getItem(); - shared_ptr targetItem = target->getItem(); + std::shared_ptr myItem = this->getItem(); + std::shared_ptr targetItem = target->getItem(); if (targetItem->getItem() != myItem->getItem()) return false; if (targetItem->hasTag() ^ myItem->hasTag()) return false; @@ -189,7 +189,7 @@ bool ItemEntity::hurt(DamageSource *source, int damage) // 4J - added next line: found whilst debugging an issue with item entities getting into a bad state when being created by a cactus, since entities insides cactuses get hurt // and therefore depending on the timing of things they could get removed from the client when they weren't supposed to be. Are there really any cases were we would want // an itemEntity to be locally hurt? - if (level->isClientSide ) return false; + if (level->isClientSide ) return false; markHurt(); health -= damage; @@ -216,11 +216,11 @@ void ItemEntity::readAdditionalSaveData(CompoundTag *tag) if (getItem() == NULL) remove(); } -void ItemEntity::playerTouch(shared_ptr player) +void ItemEntity::playerTouch(std::shared_ptr player) { if (level->isClientSide) return; - shared_ptr item = getItem(); + std::shared_ptr item = getItem(); // 4J Stu - Fix for duplication glitch if(item->count <= 0) @@ -243,7 +243,7 @@ void ItemEntity::playerTouch(shared_ptr player) #ifdef _EXTENDED_ACHIEVEMENTS if ( getItem()->getItem()->id ) { - shared_ptr pThrower = level->getPlayerByName(getThrower()); + std::shared_ptr pThrower = level->getPlayerByName(getThrower()); if ( (pThrower != nullptr) && (pThrower != player) ) { pThrower->awardStat(GenericStats::diamondsToYou(), GenericStats::param_diamondsToYou()); @@ -251,7 +251,7 @@ void ItemEntity::playerTouch(shared_ptr player) } #endif } - if (item->id == Item::blazeRod_Id) + if (item->id == Item::blazeRod_Id) player->awardStat(GenericStats::blazeRod(), GenericStats::param_blazeRod()); level->playSound(shared_from_this(), eSoundType_RANDOM_POP, 0.2f, ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f); @@ -267,9 +267,9 @@ wstring ItemEntity::getAName() //return I18n.get("item." + item.getDescriptionId()); } -shared_ptr ItemEntity::getItem() +std::shared_ptr ItemEntity::getItem() { - shared_ptr result = getEntityData()->getItemInstance(DATA_ITEM); + std::shared_ptr result = getEntityData()->getItemInstance(DATA_ITEM); if (result == NULL) { @@ -278,13 +278,13 @@ shared_ptr ItemEntity::getItem() app.DebugPrintf("Item entity %d has no item?!\n", entityId); //level.getLogger().severe("Item entity " + entityId + " has no item?!"); } - return shared_ptr(new ItemInstance(Tile::rock)); + return std::shared_ptr(new ItemInstance(Tile::rock)); } return result; } -void ItemEntity::setItem(shared_ptr item) +void ItemEntity::setItem(std::shared_ptr item) { getEntityData()->set(DATA_ITEM, item); getEntityData()->markDirty(DATA_ITEM); diff --git a/Minecraft.World/ItemEntity.h b/Minecraft.World/ItemEntity.h index 1f42bc21..456a7441 100644 --- a/Minecraft.World/ItemEntity.h +++ b/Minecraft.World/ItemEntity.h @@ -30,9 +30,9 @@ private: public: float bobOffs; - + ItemEntity(Level *level, double x, double y, double z); - ItemEntity(Level *level, double x, double y, double z, shared_ptr item); + ItemEntity(Level *level, double x, double y, double z, std::shared_ptr item); protected: virtual bool makeStepSound(); @@ -50,7 +50,7 @@ private: void mergeWithNeighbours(); public: - bool merge(shared_ptr target); + bool merge(std::shared_ptr target); void setShortLifeTime(); virtual bool updateInWaterState(); @@ -61,12 +61,12 @@ public: virtual bool hurt(DamageSource *source, int damage); virtual void addAdditonalSaveData(CompoundTag *entityTag); virtual void readAdditionalSaveData(CompoundTag *tag); - virtual void playerTouch(shared_ptr player); + virtual void playerTouch(std::shared_ptr player); virtual wstring getAName(); - shared_ptr getItem(); - void setItem(shared_ptr item); + std::shared_ptr getItem(); + void setItem(std::shared_ptr item); virtual bool isAttackable(); void setThrower(const wstring &thrower); diff --git a/Minecraft.World/ItemFrame.cpp b/Minecraft.World/ItemFrame.cpp index 141f0630..ec412b33 100644 --- a/Minecraft.World/ItemFrame.cpp +++ b/Minecraft.World/ItemFrame.cpp @@ -33,33 +33,33 @@ ItemFrame::ItemFrame(Level *level, int xTile, int yTile, int zTile, int dir) : H setDir(dir); } -void ItemFrame::defineSynchedData() +void ItemFrame::defineSynchedData() { getEntityData()->defineNULL(DATA_ITEM, NULL); getEntityData()->define(DATA_ROTATION, (byte) 0); } -void ItemFrame::dropItem() +void ItemFrame::dropItem() { - spawnAtLocation(shared_ptr(new ItemInstance(Item::frame)), 0.0f); - shared_ptr item = getItem(); - if (item != NULL) + spawnAtLocation(std::shared_ptr(new ItemInstance(Item::frame)), 0.0f); + std::shared_ptr item = getItem(); + if (item != NULL) { - shared_ptr data = Item::map->getSavedData(item, level); + std::shared_ptr data = Item::map->getSavedData(item, level); data->removeItemFrameDecoration(item); - shared_ptr itemToDrop = item->copy(); + std::shared_ptr itemToDrop = item->copy(); itemToDrop->setFramed(nullptr); spawnAtLocation(itemToDrop, 0.0f); } } -shared_ptr ItemFrame::getItem() +std::shared_ptr ItemFrame::getItem() { return getEntityData()->getItemInstance(DATA_ITEM); } -void ItemFrame::setItem(shared_ptr item) +void ItemFrame::setItem(std::shared_ptr item) { if(item != NULL) { @@ -72,19 +72,19 @@ void ItemFrame::setItem(shared_ptr item) getEntityData()->markDirty(DATA_ITEM); } -int ItemFrame::getRotation() +int ItemFrame::getRotation() { return getEntityData()->getByte(DATA_ROTATION); } -void ItemFrame::setRotation(int rotation) +void ItemFrame::setRotation(int rotation) { getEntityData()->set(DATA_ROTATION, (byte) (rotation % 4)); } -void ItemFrame::addAdditonalSaveData(CompoundTag *tag) +void ItemFrame::addAdditonalSaveData(CompoundTag *tag) { - if (getItem() != NULL) + if (getItem() != NULL) { tag->putCompound(L"Item", getItem()->save(new CompoundTag())); tag->putByte(L"ItemRotation", (byte) getRotation()); @@ -93,10 +93,10 @@ void ItemFrame::addAdditonalSaveData(CompoundTag *tag) HangingEntity::addAdditonalSaveData(tag); } -void ItemFrame::readAdditionalSaveData(CompoundTag *tag) +void ItemFrame::readAdditionalSaveData(CompoundTag *tag) { CompoundTag *itemTag = tag->getCompound(L"Item"); - if (itemTag != NULL && !itemTag->isEmpty()) + if (itemTag != NULL && !itemTag->isEmpty()) { setItem(ItemInstance::fromTag(itemTag)); setRotation(tag->getByte(L"ItemRotation")); @@ -106,36 +106,36 @@ void ItemFrame::readAdditionalSaveData(CompoundTag *tag) HangingEntity::readAdditionalSaveData(tag); } -bool ItemFrame::interact(shared_ptr player) +bool ItemFrame::interact(std::shared_ptr player) { if(!player->isAllowedToInteract(shared_from_this())) { return false; } - if (getItem() == NULL) + if (getItem() == NULL) { - shared_ptr item = player->getCarriedItem(); + std::shared_ptr item = player->getCarriedItem(); - if (item != NULL) + if (item != NULL) { - if (!level->isClientSide)//isClientSide) + if (!level->isClientSide)//isClientSide) { setItem(item); - if (!player->abilities.instabuild) + if (!player->abilities.instabuild) { - if (--item->count <= 0) + if (--item->count <= 0) { player->inventory->setItem(player->inventory->selected, nullptr); } } } } - } - else + } + else { - if (!level->isClientSide)//isClientSide) + if (!level->isClientSide)//isClientSide) { setRotation(getRotation() + 1); } diff --git a/Minecraft.World/ItemFrame.h b/Minecraft.World/ItemFrame.h index 1af5c2e9..d39c6cc8 100644 --- a/Minecraft.World/ItemFrame.h +++ b/Minecraft.World/ItemFrame.h @@ -30,12 +30,12 @@ protected: public: - shared_ptr getItem(); - void setItem(shared_ptr item); + std::shared_ptr getItem(); + void setItem(std::shared_ptr item); int getRotation(); void setRotation(int rotation); virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); - virtual bool interact(shared_ptr player); + virtual bool interact(std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/ItemInstance.cpp b/Minecraft.World/ItemInstance.cpp index ab042af0..99b9fb74 100644 --- a/Minecraft.World/ItemInstance.cpp +++ b/Minecraft.World/ItemInstance.cpp @@ -28,17 +28,17 @@ void ItemInstance::_init(int id, int count, int auxValue) this->m_bForceNumberDisplay=false; } -ItemInstance::ItemInstance(Tile *tile) +ItemInstance::ItemInstance(Tile *tile) { _init(tile->id, 1, 0); } -ItemInstance::ItemInstance(Tile *tile, int count) +ItemInstance::ItemInstance(Tile *tile, int count) { _init(tile->id, count, 0); } // 4J-PB - added -ItemInstance::ItemInstance(MapItem *item, int count) +ItemInstance::ItemInstance(MapItem *item, int count) { _init(item->id, count, 0); } @@ -48,19 +48,19 @@ ItemInstance::ItemInstance(Tile *tile, int count, int auxValue) _init(tile->id, count, auxValue); } -ItemInstance::ItemInstance(Item *item) +ItemInstance::ItemInstance(Item *item) { _init(item->id, 1, 0); } -ItemInstance::ItemInstance(Item *item, int count) +ItemInstance::ItemInstance(Item *item, int count) { _init(item->id, count, 0); } -ItemInstance::ItemInstance(Item *item, int count, int auxValue) +ItemInstance::ItemInstance(Item *item, int count, int auxValue) { _init(item->id, count, auxValue); } @@ -70,9 +70,9 @@ ItemInstance::ItemInstance(int id, int count, int damage) _init(id,count,damage); } -shared_ptr ItemInstance::fromTag(CompoundTag *itemTag) +std::shared_ptr ItemInstance::fromTag(CompoundTag *itemTag) { - shared_ptr itemInstance = shared_ptr(new ItemInstance()); + std::shared_ptr itemInstance = std::shared_ptr(new ItemInstance()); itemInstance->load(itemTag); return itemInstance->getItem() != NULL ? itemInstance : nullptr; } @@ -82,9 +82,9 @@ ItemInstance::~ItemInstance() if(tag != NULL) delete tag; } -shared_ptr ItemInstance::remove(int count) +std::shared_ptr ItemInstance::remove(int count) { - shared_ptr ii = shared_ptr( new ItemInstance(id, count, auxValue) ); + std::shared_ptr ii = std::shared_ptr( new ItemInstance(id, count, auxValue) ); if (tag != NULL) ii->tag = (CompoundTag *) tag->copy(); this->count -= count; @@ -111,32 +111,32 @@ int ItemInstance::getIconType() return getItem()->getIconType(); } -bool ItemInstance::useOn(shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool ItemInstance::useOn(std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { return getItem()->useOn(shared_from_this(), player, level, x, y, z, face, clickX, clickY, clickZ, bTestUseOnOnly); } -float ItemInstance::getDestroySpeed(Tile *tile) +float ItemInstance::getDestroySpeed(Tile *tile) { return getItem()->getDestroySpeed(shared_from_this(), tile); } -bool ItemInstance::TestUse(Level *level, shared_ptr player) +bool ItemInstance::TestUse(Level *level, std::shared_ptr player) { return getItem()->TestUse( level, player); } -shared_ptr ItemInstance::use(Level *level, shared_ptr player) +std::shared_ptr ItemInstance::use(Level *level, std::shared_ptr player) { return getItem()->use(shared_from_this(), level, player); } -shared_ptr ItemInstance::useTimeDepleted(Level *level, shared_ptr player) +std::shared_ptr ItemInstance::useTimeDepleted(Level *level, std::shared_ptr player) { return getItem()->useTimeDepleted(shared_from_this(), level, player); } -CompoundTag *ItemInstance::save(CompoundTag *compoundTag) +CompoundTag *ItemInstance::save(CompoundTag *compoundTag) { compoundTag->putShort(L"id", (short) id); compoundTag->putByte(L"Count", (byte) count); @@ -167,7 +167,7 @@ bool ItemInstance::isStackable() return getMaxStackSize() > 1 && (!isDamageableItem() || !isDamaged()); } -bool ItemInstance::isDamageableItem() +bool ItemInstance::isDamageableItem() { return Item::items[id]->getMaxDamage() > 0; } @@ -175,7 +175,7 @@ bool ItemInstance::isDamageableItem() /** * Returns true if this item type only can be stacked with items that have * the same auxValue data. - * + * * @return */ @@ -184,7 +184,7 @@ bool ItemInstance::isStackedByData() return Item::items[id]->isStackedByData(); } -bool ItemInstance::isDamaged() +bool ItemInstance::isDamaged() { return isDamageableItem() && auxValue > 0; } @@ -209,14 +209,14 @@ int ItemInstance::getMaxDamage() return Item::items[id]->getMaxDamage(); } -void ItemInstance::hurt(int i, shared_ptr owner) +void ItemInstance::hurt(int i, std::shared_ptr owner) { if (!isDamageableItem()) { return; } - shared_ptr player = dynamic_pointer_cast(owner); + std::shared_ptr player = dynamic_pointer_cast(owner); if (i > 0 && player != NULL) { int enchanted = EnchantmentHelper::getDigDurability(player->inventory); @@ -232,7 +232,7 @@ void ItemInstance::hurt(int i, shared_ptr owner) // 4J Stu - Changed in TU6 to not damage items in creative mode if (!(owner != NULL && player->abilities.instabuild)) auxValue += i; - + if (auxValue > getMaxDamage()) { owner->breakItem(shared_from_this()); @@ -242,19 +242,19 @@ void ItemInstance::hurt(int i, shared_ptr owner) } } -void ItemInstance::hurtEnemy(shared_ptr mob, shared_ptr attacker) +void ItemInstance::hurtEnemy(std::shared_ptr mob, std::shared_ptr attacker) { - //bool used = + //bool used = Item::items[id]->hurtEnemy(shared_from_this(), mob, attacker); } -void ItemInstance::mineBlock(Level *level, int tile, int x, int y, int z, shared_ptr owner) +void ItemInstance::mineBlock(Level *level, int tile, int x, int y, int z, std::shared_ptr owner) { - //bool used = + //bool used = Item::items[id]->mineBlock( shared_from_this(), level, tile, x, y, z, owner); } -int ItemInstance::getAttackDamage(shared_ptr entity) +int ItemInstance::getAttackDamage(std::shared_ptr entity) { return Item::items[id]->getAttackDamage(entity); } @@ -264,14 +264,14 @@ bool ItemInstance::canDestroySpecial(Tile *tile) return Item::items[id]->canDestroySpecial(tile); } -bool ItemInstance::interactEnemy(shared_ptr mob) +bool ItemInstance::interactEnemy(std::shared_ptr mob) { return Item::items[id]->interactEnemy(shared_from_this(), mob); } -shared_ptr ItemInstance::copy() const +std::shared_ptr ItemInstance::copy() const { - shared_ptr copy = shared_ptr( new ItemInstance(id, count, auxValue) ); + std::shared_ptr copy = std::shared_ptr( new ItemInstance(id, count, auxValue) ); if (tag != NULL) { copy->tag = (CompoundTag *) tag->copy(); @@ -295,7 +295,7 @@ ItemInstance *ItemInstance::copy_not_shared() const } // 4J Brought forward from 1.2 -bool ItemInstance::tagMatches(shared_ptr a, shared_ptr b) +bool ItemInstance::tagMatches(std::shared_ptr a, std::shared_ptr b) { if (a == NULL && b == NULL) return true; if (a == NULL || b == NULL) return false; @@ -311,14 +311,14 @@ bool ItemInstance::tagMatches(shared_ptr a, shared_ptr a, shared_ptr b) +bool ItemInstance::matches(std::shared_ptr a, std::shared_ptr b) { if (a == NULL && b == NULL) return true; if (a == NULL || b == NULL) return false; return a->matches(b); } -bool ItemInstance::matches(shared_ptr b) +bool ItemInstance::matches(std::shared_ptr b) { if (count != b->count) return false; if (id != b->id) return false; @@ -337,16 +337,16 @@ bool ItemInstance::matches(shared_ptr b) /** * Checks if this item is the same item as the other one, disregarding the * 'count' value. - * + * * @param b * @return */ -bool ItemInstance::sameItem(shared_ptr b) +bool ItemInstance::sameItem(std::shared_ptr b) { return id == b->id && auxValue == b->auxValue; } -bool ItemInstance::sameItemWithTags(shared_ptr b) +bool ItemInstance::sameItemWithTags(std::shared_ptr b) { if (id != b->id) return false; if (auxValue != b->auxValue) return false; @@ -367,12 +367,12 @@ bool ItemInstance::sameItem_not_shared(ItemInstance *b) return id == b->id && auxValue == b->auxValue; } -unsigned int ItemInstance::getUseDescriptionId() +unsigned int ItemInstance::getUseDescriptionId() { return Item::items[id]->getUseDescriptionId(shared_from_this()); } -unsigned int ItemInstance::getDescriptionId(int iData /*= -1*/) +unsigned int ItemInstance::getDescriptionId(int iData /*= -1*/) { return Item::items[id]->getDescriptionId(shared_from_this()); } @@ -384,15 +384,15 @@ ItemInstance *ItemInstance::setDescriptionId(unsigned int id) return this; } -shared_ptr ItemInstance::clone(shared_ptr item) +std::shared_ptr ItemInstance::clone(std::shared_ptr item) { return item == NULL ? nullptr : item->copy(); } -wstring ItemInstance::toString() +wstring ItemInstance::toString() { //return count + "x" + Item::items[id]->getDescriptionId() + "@" + auxValue; - + std::wostringstream oss; // 4J-PB - TODO - temp fix until ore recipe issue is fixed if(Item::items[id]==NULL) @@ -406,13 +406,13 @@ wstring ItemInstance::toString() return oss.str(); } -void ItemInstance::inventoryTick(Level *level, shared_ptr owner, int slot, bool selected) +void ItemInstance::inventoryTick(Level *level, std::shared_ptr owner, int slot, bool selected) { if (popTime > 0) popTime--; Item::items[id]->inventoryTick(shared_from_this(), level, owner, slot, selected); } -void ItemInstance::onCraftedBy(Level *level, shared_ptr player, int craftCount) +void ItemInstance::onCraftedBy(Level *level, std::shared_ptr player, int craftCount) { // 4J Stu Added for tutorial callback player->onCrafted(shared_from_this()); @@ -425,7 +425,7 @@ void ItemInstance::onCraftedBy(Level *level, shared_ptr player, int craf Item::items[id]->onCraftedBy(shared_from_this(), level, player); } -bool ItemInstance::equals(shared_ptr ii) +bool ItemInstance::equals(std::shared_ptr ii) { return id == ii->id && count == ii->count && auxValue == ii->auxValue; } @@ -440,7 +440,7 @@ UseAnim ItemInstance::getUseAnimation() return getItem()->getUseAnimation(shared_from_this()); } -void ItemInstance::releaseUsing(Level *level, shared_ptr player, int durationLeft) +void ItemInstance::releaseUsing(Level *level, std::shared_ptr player, int durationLeft) { getItem()->releaseUsing(shared_from_this(), level, player, durationLeft); } @@ -501,7 +501,7 @@ bool ItemInstance::hasCustomHoverName() return tag->getCompound(L"display")->contains(L"Name"); } -vector *ItemInstance::getHoverText(shared_ptr player, bool advanced, vector &unformattedStrings) +vector *ItemInstance::getHoverText(std::shared_ptr player, bool advanced, vector &unformattedStrings) { vector *lines = new vector(); Item *item = Item::items[id]; @@ -568,7 +568,7 @@ vector *ItemInstance::getHoverText(shared_ptr player, bool adva } // 4J Added -vector *ItemInstance::getHoverTextOnly(shared_ptr player, bool advanced, vector &unformattedStrings) +vector *ItemInstance::getHoverTextOnly(std::shared_ptr player, bool advanced, vector &unformattedStrings) { vector *lines = new vector(); Item *item = Item::items[id]; @@ -667,7 +667,7 @@ int ItemInstance::get4JData() } } // 4J Added - to show strength on potions -bool ItemInstance::hasPotionStrengthBar() +bool ItemInstance::hasPotionStrengthBar() { // exclude a bottle of water from this if((id==Item::potion_Id) && (auxValue !=0))// && (!MACRO_POTION_IS_AKWARD(auxValue))) 4J-PB leaving the bar on an awkward potion so we can differentiate it from a water bottle @@ -678,7 +678,7 @@ bool ItemInstance::hasPotionStrengthBar() return false; } -int ItemInstance::GetPotionStrength() +int ItemInstance::GetPotionStrength() { if(MACRO_POTION_IS_INSTANTDAMAGE(auxValue) || MACRO_POTION_IS_INSTANTHEALTH(auxValue) ) { @@ -693,17 +693,17 @@ int ItemInstance::GetPotionStrength() // TU9 -bool ItemInstance::isFramed() +bool ItemInstance::isFramed() { return frame != NULL; } -void ItemInstance::setFramed(shared_ptr frame) +void ItemInstance::setFramed(std::shared_ptr frame) { this->frame = frame; } -shared_ptr ItemInstance::getFrame() +std::shared_ptr ItemInstance::getFrame() { return frame; } diff --git a/Minecraft.World/ItemInstance.h b/Minecraft.World/ItemInstance.h index c1e52177..dd3509ec 100644 --- a/Minecraft.World/ItemInstance.h +++ b/Minecraft.World/ItemInstance.h @@ -44,7 +44,7 @@ private: void _init(int id, int count, int auxValue); // TU9 - shared_ptr frame; + std::shared_ptr frame; public: ItemInstance(Tile *tile); @@ -58,22 +58,22 @@ public: ItemInstance(Item *item, int count, int auxValue); ItemInstance(int id, int count, int damage); - static shared_ptr fromTag(CompoundTag *itemTag); + static std::shared_ptr fromTag(CompoundTag *itemTag); private: ItemInstance() { _init(-1,0,0); } public: ~ItemInstance(); - shared_ptr remove(int count); + std::shared_ptr remove(int count); Item *getItem() const; Icon *getIcon(); int getIconType(); - bool useOn(shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + bool useOn(std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); float getDestroySpeed(Tile *tile); - bool TestUse(Level *level, shared_ptr player); - shared_ptr use(Level *level, shared_ptr player); - shared_ptr useTimeDepleted(Level *level, shared_ptr player); + bool TestUse(Level *level, std::shared_ptr player); + std::shared_ptr use(Level *level, std::shared_ptr player); + std::shared_ptr useTimeDepleted(Level *level, std::shared_ptr player); CompoundTag *save(CompoundTag *compoundTag); void load(CompoundTag *compoundTag); int getMaxStackSize(); @@ -85,16 +85,16 @@ public: int getAuxValue() const; void setAuxValue(int value); int getMaxDamage(); - void hurt(int i, shared_ptr owner); - void hurtEnemy(shared_ptr mob, shared_ptr attacker); - void mineBlock(Level *level, int tile, int x, int y, int z, shared_ptr owner); - int getAttackDamage(shared_ptr entity); + void hurt(int i, std::shared_ptr owner); + void hurtEnemy(std::shared_ptr mob, std::shared_ptr attacker); + void mineBlock(Level *level, int tile, int x, int y, int z, std::shared_ptr owner); + int getAttackDamage(std::shared_ptr entity); bool canDestroySpecial(Tile *tile); - bool interactEnemy(shared_ptr mob); - shared_ptr copy() const; + bool interactEnemy(std::shared_ptr mob); + std::shared_ptr copy() const; ItemInstance *copy_not_shared() const; // 4J Stu - Added for use in recipes - static bool tagMatches(shared_ptr a, shared_ptr b); // 4J Brought forward from 1.2 - static bool matches(shared_ptr a, shared_ptr b); + static bool tagMatches(std::shared_ptr a, std::shared_ptr b); // 4J Brought forward from 1.2 + static bool matches(std::shared_ptr a, std::shared_ptr b); // 4J-PB int GetCount() {return count;} @@ -102,24 +102,24 @@ public: bool GetForceNumberDisplay() {return m_bForceNumberDisplay;} // to force the display of 0 and 1 on the required trading items when you have o or 1 of the item private: - bool matches(shared_ptr b); + bool matches(std::shared_ptr b); public: - bool sameItem(shared_ptr b); - bool sameItemWithTags(shared_ptr b); //4J Added + bool sameItem(std::shared_ptr b); + bool sameItemWithTags(std::shared_ptr b); //4J Added bool sameItem_not_shared(ItemInstance *b); // 4J Stu - Added this for the one time I need it virtual unsigned int getUseDescriptionId(); // 4J Added virtual unsigned int getDescriptionId(int iData = -1); virtual ItemInstance *setDescriptionId(unsigned int id); - static shared_ptr clone(shared_ptr item); + static std::shared_ptr clone(std::shared_ptr item); wstring toString(); - void inventoryTick(Level *level, shared_ptr owner, int slot, bool selected); - void onCraftedBy(Level *level, shared_ptr player, int craftCount); - bool equals(shared_ptr ii); + void inventoryTick(Level *level, std::shared_ptr owner, int slot, bool selected); + void onCraftedBy(Level *level, std::shared_ptr player, int craftCount); + bool equals(std::shared_ptr ii); int getUseDuration(); UseAnim getUseAnimation(); - void releaseUsing(Level *level, shared_ptr player, int durationLeft); + void releaseUsing(Level *level, std::shared_ptr player, int durationLeft); // 4J Stu - Brought forward these functions for enchanting/game rules bool hasTag(); @@ -129,8 +129,8 @@ public: wstring getHoverName(); void setHoverName(const wstring &name); bool hasCustomHoverName(); - vector *getHoverText(shared_ptr player, bool advanced, vector &unformattedStrings); - vector *getHoverTextOnly(shared_ptr player, bool advanced, vector &unformattedStrings); // 4J Added + vector *getHoverText(std::shared_ptr player, bool advanced, vector &unformattedStrings); + vector *getHoverTextOnly(std::shared_ptr player, bool advanced, vector &unformattedStrings); // 4J Added bool isFoil(); const Rarity *getRarity(); bool isEnchantable(); @@ -146,8 +146,8 @@ public: // TU9 bool isFramed(); - void setFramed(shared_ptr frame); - shared_ptr getFrame(); + void setFramed(std::shared_ptr frame); + std::shared_ptr getFrame(); int getBaseRepairCost(); void setRepairCost(int cost); diff --git a/Minecraft.World/KeepAlivePacket.cpp b/Minecraft.World/KeepAlivePacket.cpp index fee97910..88fd4fdb 100644 --- a/Minecraft.World/KeepAlivePacket.cpp +++ b/Minecraft.World/KeepAlivePacket.cpp @@ -21,7 +21,7 @@ void KeepAlivePacket::handle(PacketListener *listener) listener->handleKeepAlive(shared_from_this()); } -void KeepAlivePacket::read(DataInputStream *dis) //throws IOException +void KeepAlivePacket::read(DataInputStream *dis) //throws IOException { id = dis->readInt(); } @@ -31,7 +31,7 @@ void KeepAlivePacket::write(DataOutputStream *dos) //throws IOException dos->writeInt(id); } -int KeepAlivePacket::getEstimatedSize() +int KeepAlivePacket::getEstimatedSize() { return 4; } @@ -41,7 +41,7 @@ bool KeepAlivePacket::canBeInvalidated() return true; } -bool KeepAlivePacket::isInvalidatedBy(shared_ptr packet) +bool KeepAlivePacket::isInvalidatedBy(std::shared_ptr packet) { return true; } diff --git a/Minecraft.World/KeepAlivePacket.h b/Minecraft.World/KeepAlivePacket.h index a44d8745..d05e76d4 100644 --- a/Minecraft.World/KeepAlivePacket.h +++ b/Minecraft.World/KeepAlivePacket.h @@ -16,10 +16,10 @@ public: virtual void write(DataOutputStream *dos); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); virtual bool isAync(); public: - static shared_ptr create() { return shared_ptr(new KeepAlivePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new KeepAlivePacket()); } virtual int getId() { return 0; } }; \ No newline at end of file diff --git a/Minecraft.World/KickPlayerPacket.h b/Minecraft.World/KickPlayerPacket.h index b9a6ce3e..62dd0dd1 100644 --- a/Minecraft.World/KickPlayerPacket.h +++ b/Minecraft.World/KickPlayerPacket.h @@ -17,6 +17,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new KickPlayerPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new KickPlayerPacket()); } virtual int getId() { return 159; } }; \ No newline at end of file diff --git a/Minecraft.World/KillCommand.cpp b/Minecraft.World/KillCommand.cpp index 30a7880e..3a82378b 100644 --- a/Minecraft.World/KillCommand.cpp +++ b/Minecraft.World/KillCommand.cpp @@ -9,9 +9,9 @@ EGameCommand KillCommand::getId() return eGameCommand_Kill; } -void KillCommand::execute(shared_ptr source, byteArray commandData) +void KillCommand::execute(std::shared_ptr source, byteArray commandData) { - shared_ptr player = dynamic_pointer_cast(source); + std::shared_ptr player = dynamic_pointer_cast(source); player->hurt(DamageSource::outOfWorld, 1000); diff --git a/Minecraft.World/KillCommand.h b/Minecraft.World/KillCommand.h index a88b2069..21155b6f 100644 --- a/Minecraft.World/KillCommand.h +++ b/Minecraft.World/KillCommand.h @@ -6,5 +6,5 @@ class KillCommand : public Command { public: virtual EGameCommand getId(); - virtual void execute(shared_ptr source, byteArray commandData); + virtual void execute(std::shared_ptr source, byteArray commandData); }; \ No newline at end of file diff --git a/Minecraft.World/LadderTile.cpp b/Minecraft.World/LadderTile.cpp index 32f35ed8..4f0dfb14 100644 --- a/Minecraft.World/LadderTile.cpp +++ b/Minecraft.World/LadderTile.cpp @@ -19,7 +19,7 @@ AABB *LadderTile::getTileAABB(Level *level, int x, int y, int z) return Tile::getTileAABB(level, x, y, z); } -void LadderTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void LadderTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { setShape(level->getData(x, y, z)); } diff --git a/Minecraft.World/LadderTile.h b/Minecraft.World/LadderTile.h index 823f35a7..97e4efc8 100644 --- a/Minecraft.World/LadderTile.h +++ b/Minecraft.World/LadderTile.h @@ -12,7 +12,7 @@ protected: public: virtual AABB *getAABB(Level *level, int x, int y, int z); virtual AABB *getTileAABB(Level *level, int x, int y, int z); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param using Tile::setShape; virtual void setShape(int data); virtual bool blocksLight(); diff --git a/Minecraft.World/LavaSlime.cpp b/Minecraft.World/LavaSlime.cpp index 3ab32d90..2131c24a 100644 --- a/Minecraft.World/LavaSlime.cpp +++ b/Minecraft.World/LavaSlime.cpp @@ -48,9 +48,9 @@ ePARTICLE_TYPE LavaSlime::getParticleName() return eParticleType_flame; } -shared_ptr LavaSlime::createChild() +std::shared_ptr LavaSlime::createChild() { - return shared_ptr( new LavaSlime(level) ); + return std::shared_ptr( new LavaSlime(level) ); } int LavaSlime::getDeathLoot() diff --git a/Minecraft.World/LavaSlime.h b/Minecraft.World/LavaSlime.h index 08857ca9..8a2e5db9 100644 --- a/Minecraft.World/LavaSlime.h +++ b/Minecraft.World/LavaSlime.h @@ -20,7 +20,7 @@ public: protected: virtual ePARTICLE_TYPE getParticleName(); - virtual shared_ptr createChild(); + virtual std::shared_ptr createChild(); virtual int getDeathLoot(); virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel); diff --git a/Minecraft.World/Layer.cpp b/Minecraft.World/Layer.cpp index ca805912..8ac5972b 100644 --- a/Minecraft.World/Layer.cpp +++ b/Minecraft.World/Layer.cpp @@ -21,17 +21,17 @@ LayerArray Layer::getDefaultLayers(int64_t seed, LevelType *levelType) // 4J - Some changes moved here from 1.2.3. Temperature & downfall layers are no longer created & returned, and a debug layer is isn't. // For reference with regard to future merging, things NOT brought forward from the 1.2.3 version are new layer types that we // don't have yet (shores, swamprivers, region hills etc.) - shared_ptrislandLayer = shared_ptr(new IslandLayer(1)); - islandLayer = shared_ptr(new FuzzyZoomLayer(2000, islandLayer)); - islandLayer = shared_ptr(new AddIslandLayer(1, islandLayer)); - islandLayer = shared_ptr(new ZoomLayer(2001, islandLayer)); - islandLayer = shared_ptr(new AddIslandLayer(2, islandLayer)); - islandLayer = shared_ptr(new AddSnowLayer(2, islandLayer)); - islandLayer = shared_ptr(new ZoomLayer(2002, islandLayer)); - islandLayer = shared_ptr(new AddIslandLayer(3, islandLayer)); - islandLayer = shared_ptr(new ZoomLayer(2003, islandLayer)); - islandLayer = shared_ptr(new AddIslandLayer(4, islandLayer)); -// islandLayer = shared_ptr(new AddMushroomIslandLayer(5, islandLayer)); // 4J - old position of mushroom island layer + std::shared_ptrislandLayer = std::shared_ptr(new IslandLayer(1)); + islandLayer = std::shared_ptr(new FuzzyZoomLayer(2000, islandLayer)); + islandLayer = std::shared_ptr(new AddIslandLayer(1, islandLayer)); + islandLayer = std::shared_ptr(new ZoomLayer(2001, islandLayer)); + islandLayer = std::shared_ptr(new AddIslandLayer(2, islandLayer)); + islandLayer = std::shared_ptr(new AddSnowLayer(2, islandLayer)); + islandLayer = std::shared_ptr(new ZoomLayer(2002, islandLayer)); + islandLayer = std::shared_ptr(new AddIslandLayer(3, islandLayer)); + islandLayer = std::shared_ptr(new ZoomLayer(2003, islandLayer)); + islandLayer = std::shared_ptr(new AddIslandLayer(4, islandLayer)); +// islandLayer = std::shared_ptr(new AddMushroomIslandLayer(5, islandLayer)); // 4J - old position of mushroom island layer int zoomLevel = 4; if (levelType == LevelType::lvl_largeBiomes) @@ -39,32 +39,32 @@ LayerArray Layer::getDefaultLayers(int64_t seed, LevelType *levelType) zoomLevel = 6; } - shared_ptr riverLayer = islandLayer; + std::shared_ptr riverLayer = islandLayer; riverLayer = ZoomLayer::zoom(1000, riverLayer, 0); - riverLayer = shared_ptr(new RiverInitLayer(100, riverLayer)); + riverLayer = std::shared_ptr(new RiverInitLayer(100, riverLayer)); riverLayer = ZoomLayer::zoom(1000, riverLayer, zoomLevel + 2); - riverLayer = shared_ptr(new RiverLayer(1, riverLayer)); - riverLayer = shared_ptr(new SmoothLayer(1000, riverLayer)); + riverLayer = std::shared_ptr(new RiverLayer(1, riverLayer)); + riverLayer = std::shared_ptr(new SmoothLayer(1000, riverLayer)); - shared_ptr biomeLayer = islandLayer; + std::shared_ptr biomeLayer = islandLayer; biomeLayer = ZoomLayer::zoom(1000, biomeLayer, 0); - biomeLayer = shared_ptr(new BiomeInitLayer(200, biomeLayer, levelType)); + biomeLayer = std::shared_ptr(new BiomeInitLayer(200, biomeLayer, levelType)); biomeLayer = ZoomLayer::zoom(1000, biomeLayer, 2); - biomeLayer = shared_ptr(new RegionHillsLayer(1000, biomeLayer)); + biomeLayer = std::shared_ptr(new RegionHillsLayer(1000, biomeLayer)); for (int i = 0; i < zoomLevel; i++) { - biomeLayer = shared_ptr(new ZoomLayer(1000 + i, biomeLayer)); + biomeLayer = std::shared_ptr(new ZoomLayer(1000 + i, biomeLayer)); - if (i == 0) biomeLayer = shared_ptr(new AddIslandLayer(3, biomeLayer)); + if (i == 0) biomeLayer = std::shared_ptr(new AddIslandLayer(3, biomeLayer)); if (i == 0) { // 4J - moved mushroom islands to here. This skips 3 zooms that the old location of the add was, making them about 1/8 of the original size. Adding // them at this scale actually lets us place them near enough other land, if we add them at the same scale as java then they have to be too far out to see for // the scale of our maps - biomeLayer = shared_ptr(new AddMushroomIslandLayer(5, biomeLayer)); + biomeLayer = std::shared_ptr(new AddMushroomIslandLayer(5, biomeLayer)); } if (i == 1 ) @@ -72,30 +72,30 @@ LayerArray Layer::getDefaultLayers(int64_t seed, LevelType *levelType) // 4J - now expand mushroom islands up again. This does a simple region grow to add a new mushroom island element when any of the neighbours are also mushroom islands. // This helps make the islands into nice compact shapes of the type that are actually likely to be able to make an island out of the sea in a small space. Also // helps the shore layer from doing too much damage in shrinking the islands we are making - biomeLayer = shared_ptr(new GrowMushroomIslandLayer(5, biomeLayer)); + biomeLayer = std::shared_ptr(new GrowMushroomIslandLayer(5, biomeLayer)); // Note - this reduces the size of mushroom islands by turning their edges into shores. We are doing this at i == 1 rather than i == 0 as the original does - biomeLayer = shared_ptr(new ShoreLayer(1000, biomeLayer)); + biomeLayer = std::shared_ptr(new ShoreLayer(1000, biomeLayer)); - biomeLayer = shared_ptr(new SwampRiversLayer(1000, biomeLayer)); + biomeLayer = std::shared_ptr(new SwampRiversLayer(1000, biomeLayer)); } } - biomeLayer = shared_ptr(new SmoothLayer(1000, biomeLayer)); + biomeLayer = std::shared_ptr(new SmoothLayer(1000, biomeLayer)); - biomeLayer = shared_ptr(new RiverMixerLayer(100, biomeLayer, riverLayer)); + biomeLayer = std::shared_ptr(new RiverMixerLayer(100, biomeLayer, riverLayer)); #ifndef _CONTENT_PACKAGE #ifdef _BIOME_OVERRIDE if(app.DebugSettingsOn() && app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<(new BiomeOverrideLayer(1)); + biomeLayer = std::shared_ptr(new BiomeOverrideLayer(1)); } #endif #endif - shared_ptr debugLayer = biomeLayer; + std::shared_ptr debugLayer = biomeLayer; - shared_ptrzoomedLayer = shared_ptr(new VoronoiZoom(10, biomeLayer)); + std::shared_ptrzoomedLayer = std::shared_ptr(new VoronoiZoom(10, biomeLayer)); biomeLayer->init(seed); zoomedLayer->init(seed); diff --git a/Minecraft.World/Layer.h b/Minecraft.World/Layer.h index 6f31e94a..c949cfa6 100644 --- a/Minecraft.World/Layer.h +++ b/Minecraft.World/Layer.h @@ -14,7 +14,7 @@ private: int64_t seed; protected: - shared_ptrparent; + std::shared_ptrparent; private: int64_t rval; diff --git a/Minecraft.World/LeafTile.cpp b/Minecraft.World/LeafTile.cpp index 8b7d381c..bed4a7ca 100644 --- a/Minecraft.World/LeafTile.cpp +++ b/Minecraft.World/LeafTile.cpp @@ -241,17 +241,17 @@ void LeafTile::spawnResources(Level *level, int x, int y, int z, int data, float if (level->random->nextInt(chance) == 0) { int type = getResource(data, level->random,playerBonusLevel); - popResource(level, x, y, z, shared_ptr( new ItemInstance(type, 1, getSpawnResourcesAuxValue(data)))); + popResource(level, x, y, z, std::shared_ptr( new ItemInstance(type, 1, getSpawnResourcesAuxValue(data)))); } if ((data & LEAF_TYPE_MASK) == NORMAL_LEAF && level->random->nextInt(200) == 0) { - popResource(level, x, y, z, shared_ptr(new ItemInstance(Item::apple_Id, 1, 0))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(Item::apple_Id, 1, 0))); } } } -void LeafTile::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +void LeafTile::playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data) { if (!level->isClientSide && player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::shears->id) { @@ -261,7 +261,7 @@ void LeafTile::playerDestroy(Level *level, shared_ptr player, int x, int ); // drop leaf block instead of sapling - popResource(level, x, y, z, shared_ptr(new ItemInstance(Tile::leaves_Id, 1, data & LEAF_TYPE_MASK))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(Tile::leaves_Id, 1, data & LEAF_TYPE_MASK))); } else { @@ -301,12 +301,12 @@ void LeafTile::setFancy(bool fancyGraphics) fancyTextureSet = (fancyGraphics ? 0 : 1); } -shared_ptr LeafTile::getSilkTouchItemInstance(int data) +std::shared_ptr LeafTile::getSilkTouchItemInstance(int data) { - return shared_ptr( new ItemInstance(id, 1, data & LEAF_TYPE_MASK) ); + return std::shared_ptr( new ItemInstance(id, 1, data & LEAF_TYPE_MASK) ); } -void LeafTile::stepOn(Level *level, int x, int y, int z, shared_ptr entity) +void LeafTile::stepOn(Level *level, int x, int y, int z, std::shared_ptr entity) { TransparentTile::stepOn(level, x, y, z, entity); } diff --git a/Minecraft.World/LeafTile.h b/Minecraft.World/LeafTile.h index e6c39a7f..2ca8daef 100644 --- a/Minecraft.World/LeafTile.h +++ b/Minecraft.World/LeafTile.h @@ -54,7 +54,7 @@ public: // 4J DCR: Brought forward from 1.2 virtual void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel); - virtual void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data); + virtual void playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data); protected: virtual int getSpawnResourcesAuxValue(int data); public: @@ -63,11 +63,11 @@ public: void setFancy(bool fancyGraphics); protected: - virtual shared_ptr getSilkTouchItemInstance(int data); + virtual std::shared_ptr getSilkTouchItemInstance(int data); public: - virtual void stepOn(Level *level, int x, int y, int z, shared_ptr entity); - + virtual void stepOn(Level *level, int x, int y, int z, std::shared_ptr entity); + // 4J Added so we can check before we try to add a tile to the tick list if it's actually going to do seomthing virtual bool shouldTileTick(Level *level, int x,int y,int z); diff --git a/Minecraft.World/LeafTileItem.cpp b/Minecraft.World/LeafTileItem.cpp index 40036ca0..96300b1e 100644 --- a/Minecraft.World/LeafTileItem.cpp +++ b/Minecraft.World/LeafTileItem.cpp @@ -18,11 +18,11 @@ int LeafTileItem::getLevelDataForAuxValue(int auxValue) Icon *LeafTileItem::getIcon(int itemAuxValue) { - return Tile::leaves->getTexture(0, itemAuxValue); + return Tile::leaves->getTexture(0, itemAuxValue); } -int LeafTileItem::getColor(shared_ptr item, int spriteLayer) +int LeafTileItem::getColor(std::shared_ptr item, int spriteLayer) { int data = item->getAuxValue(); if ((data & LeafTile::EVERGREEN_LEAF) == LeafTile::EVERGREEN_LEAF) @@ -36,7 +36,7 @@ int LeafTileItem::getColor(shared_ptr item, int spriteLayer) return FoliageColor::getDefaultColor(); } -unsigned int LeafTileItem::getDescriptionId(shared_ptr instance) +unsigned int LeafTileItem::getDescriptionId(std::shared_ptr instance) { int auxValue = instance->getAuxValue(); if (auxValue < 0 || auxValue >= LeafTile::LEAF_NAMES_LENGTH) diff --git a/Minecraft.World/LeafTileItem.h b/Minecraft.World/LeafTileItem.h index cd311590..cd266035 100644 --- a/Minecraft.World/LeafTileItem.h +++ b/Minecraft.World/LeafTileItem.h @@ -3,7 +3,7 @@ using namespace std; #include "TileItem.h" -class LeafTileItem : public TileItem +class LeafTileItem : public TileItem { using TileItem::getColor; public: @@ -11,7 +11,7 @@ public: virtual int getLevelDataForAuxValue(int auxValue); virtual Icon *getIcon(int itemAuxValue); - virtual int getColor(shared_ptr item, int spriteLayer); + virtual int getColor(std::shared_ptr item, int spriteLayer); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); }; diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp index c159ecb8..3ad39b66 100644 --- a/Minecraft.World/Level.cpp +++ b/Minecraft.World/Level.cpp @@ -558,20 +558,20 @@ BiomeSource *Level::getBiomeSource() return dimension->biomeSource; } -Level::Level(shared_ptr levelStorage, const wstring& name, Dimension *dimension, LevelSettings *levelSettings, bool doCreateChunkSource) +Level::Level(std::shared_ptr levelStorage, const wstring& name, Dimension *dimension, LevelSettings *levelSettings, bool doCreateChunkSource) : seaLevel(constSeaLevel) { _init(); - this->levelStorage = levelStorage;//shared_ptr(levelStorage); + this->levelStorage = levelStorage;//std::shared_ptr(levelStorage); this->dimension = dimension; this->levelData = new LevelData(levelSettings, name); if( !this->levelData->useNewSeaLevel() ) seaLevel = Level::genDepth / 2; // 4J added - sea level is one unit lower since 1.8.2, maintain older height for old levels this->savedDataStorage = new SavedDataStorage(levelStorage.get()); - shared_ptr savedVillages = dynamic_pointer_cast(savedDataStorage->get(typeid(Villages), Villages::VILLAGE_FILE_ID)); + std::shared_ptr savedVillages = dynamic_pointer_cast(savedDataStorage->get(typeid(Villages), Villages::VILLAGE_FILE_ID)); if (savedVillages == NULL) { - villages = shared_ptr(new Villages(this)); + villages = std::shared_ptr(new Villages(this)); savedDataStorage->set(Villages::VILLAGE_FILE_ID, villages); } else @@ -597,10 +597,10 @@ Level::Level(Level *level, Dimension *dimension) if( !this->levelData->useNewSeaLevel() ) seaLevel = Level::genDepth / 2; // 4J added - sea level is one unit lower since 1.8.2, maintain older height for old levels this->savedDataStorage = new SavedDataStorage( levelStorage.get() ); - shared_ptr savedVillages = dynamic_pointer_cast(savedDataStorage->get(typeid(Villages), Villages::VILLAGE_FILE_ID)); + std::shared_ptr savedVillages = dynamic_pointer_cast(savedDataStorage->get(typeid(Villages), Villages::VILLAGE_FILE_ID)); if (savedVillages == NULL) { - villages = shared_ptr(new Villages(this)); + villages = std::shared_ptr(new Villages(this)); savedDataStorage->set(Villages::VILLAGE_FILE_ID, villages); } else @@ -617,29 +617,29 @@ Level::Level(Level *level, Dimension *dimension) } -Level::Level(shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings) +Level::Level(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings) : seaLevel( constSeaLevel ) { _init(levelStorage, levelName, levelSettings, NULL, true); } -Level::Level(shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource) +Level::Level(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource) : seaLevel( constSeaLevel ) { _init( levelStorage, levelName, levelSettings, fixedDimension, doCreateChunkSource ); } -void Level::_init(shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource) +void Level::_init(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource) { _init(); - this->levelStorage = levelStorage;//shared_ptr(levelStorage); + this->levelStorage = levelStorage;//std::shared_ptr(levelStorage); this->savedDataStorage = new SavedDataStorage(levelStorage.get()); - shared_ptr savedVillages = dynamic_pointer_cast(savedDataStorage->get(typeid(Villages), Villages::VILLAGE_FILE_ID)); + std::shared_ptr savedVillages = dynamic_pointer_cast(savedDataStorage->get(typeid(Villages), Villages::VILLAGE_FILE_ID)); if (savedVillages == NULL) { - villages = shared_ptr(new Villages(this)); + villages = std::shared_ptr(new Villages(this)); savedDataStorage->set(Villages::VILLAGE_FILE_ID, villages); } else @@ -1581,7 +1581,7 @@ HitResult *Level::clip(Vec3 *a, Vec3 *b, bool liquid, bool solidOnly) } -void Level::playSound(shared_ptr entity, int iSound, float volume, float pitch) +void Level::playSound(std::shared_ptr entity, int iSound, float volume, float pitch) { if(entity == NULL) return; AUTO_VAR(itEnd, listeners.end()); @@ -1648,7 +1648,7 @@ void Level::addParticle(ePARTICLE_TYPE id, double x, double y, double z, double (*it)->addParticle(id, x, y, z, xd, yd, zd); } -bool Level::addGlobalEntity(shared_ptr e) +bool Level::addGlobalEntity(std::shared_ptr e) { globalEntities.push_back(e); return true; @@ -1656,7 +1656,7 @@ bool Level::addGlobalEntity(shared_ptr e) #pragma optimize( "", off ) -bool Level::addEntity(shared_ptr e) +bool Level::addEntity(std::shared_ptr e) { int xc = Mth::floor(e->x / 16); int zc = Mth::floor(e->z / 16); @@ -1676,7 +1676,7 @@ bool Level::addEntity(shared_ptr e) { if (dynamic_pointer_cast( e ) != NULL) { - shared_ptr player = dynamic_pointer_cast(e); + std::shared_ptr player = dynamic_pointer_cast(e); // 4J Stu - Added so we don't continually add the player to the players list while they are dead if( find( players.begin(), players.end(), e ) == players.end() ) @@ -1704,7 +1704,7 @@ bool Level::addEntity(shared_ptr e) #pragma optimize( "", on ) -void Level::entityAdded(shared_ptr e) +void Level::entityAdded(std::shared_ptr e) { AUTO_VAR(itEnd, listeners.end()); for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) @@ -1714,7 +1714,7 @@ void Level::entityAdded(shared_ptr e) } -void Level::entityRemoved(shared_ptr e) +void Level::entityRemoved(std::shared_ptr e) { AUTO_VAR(itEnd, listeners.end()); for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) @@ -1724,7 +1724,7 @@ void Level::entityRemoved(shared_ptr e) } // 4J added -void Level::playerRemoved(shared_ptr e) +void Level::playerRemoved(std::shared_ptr e) { AUTO_VAR(itEnd, listeners.end()); for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) @@ -1733,7 +1733,7 @@ void Level::playerRemoved(shared_ptr e) } } -void Level::removeEntity(shared_ptr e) +void Level::removeEntity(std::shared_ptr e) { if (e->rider.lock() != NULL) { @@ -1746,8 +1746,8 @@ void Level::removeEntity(shared_ptr e) e->remove(); if (dynamic_pointer_cast( e ) != NULL) { - vector >::iterator it = players.begin(); - vector >::iterator itEnd = players.end(); + vector >::iterator it = players.begin(); + vector >::iterator itEnd = players.end(); while( it != itEnd && *it != dynamic_pointer_cast(e) ) it++; @@ -1762,14 +1762,14 @@ void Level::removeEntity(shared_ptr e) } -void Level::removeEntityImmediately(shared_ptr e) +void Level::removeEntityImmediately(std::shared_ptr e) { e->remove(); if (dynamic_pointer_cast( e ) != NULL) { - vector >::iterator it = players.begin(); - vector >::iterator itEnd = players.end(); + vector >::iterator it = players.begin(); + vector >::iterator itEnd = players.end(); while( it != itEnd && *it != dynamic_pointer_cast(e) ) it++; @@ -1790,8 +1790,8 @@ void Level::removeEntityImmediately(shared_ptr e) } EnterCriticalSection(&m_entitiesCS); - vector >::iterator it = entities.begin(); - vector >::iterator endIt = entities.end(); + vector >::iterator it = entities.begin(); + vector >::iterator endIt = entities.end(); while( it != endIt && *it != e) it++; @@ -1823,7 +1823,7 @@ void Level::removeListener(LevelListener *listener) // 4J - added noEntities and blockAtEdge parameter -AABBList *Level::getCubes(shared_ptr source, AABB *box, bool noEntities, bool blockAtEdge) +AABBList *Level::getCubes(std::shared_ptr source, AABB *box, bool noEntities, bool blockAtEdge) { boxes.clear(); int x0 = Mth::floor(box->x0); @@ -1895,8 +1895,8 @@ AABBList *Level::getCubes(shared_ptr source, AABB *box, bool noEntities, if( noEntities ) return &boxes; double r = 0.25; - vector > *ee = getEntities(source, box->grow(r, r, r)); - vector >::iterator itEnd = ee->end(); + vector > *ee = getEntities(source, box->grow(r, r, r)); + vector >::iterator itEnd = ee->end(); for (AUTO_VAR(it, ee->begin()); it != itEnd; it++) { AABB *collideBox = (*it)->getCollideBox(); @@ -1986,7 +1986,7 @@ float Level::getSkyDarken(float a) -Vec3 *Level::getSkyColor(shared_ptr source, float a) +Vec3 *Level::getSkyColor(std::shared_ptr source, float a) { float td = getTimeOfDay(a); @@ -2197,10 +2197,10 @@ void Level::forceAddTileTick(int x, int y, int z, int tileId, int tickDelay) void Level::tickEntities() { //for (int i = 0; i < globalEntities.size(); i++) - vector >::iterator itGE = globalEntities.begin(); + vector >::iterator itGE = globalEntities.begin(); while( itGE != globalEntities.end() ) { - shared_ptr e = *itGE;//globalEntities.at(i); + std::shared_ptr e = *itGE;//globalEntities.at(i); e->tick(); if (e->removed) { @@ -2241,7 +2241,7 @@ void Level::tickEntities() AUTO_VAR(itETREnd, entitiesToRemove.end()); for (AUTO_VAR(it, entitiesToRemove.begin()); it != itETREnd; it++) { - shared_ptr e = *it;//entitiesToRemove.at(j); + std::shared_ptr e = *it;//entitiesToRemove.at(j); int xc = e->xChunk; int zc = e->zChunk; if (e->inChunk && hasChunk(xc, zc)) @@ -2267,7 +2267,7 @@ void Level::tickEntities() for (unsigned int i = 0; i < entities.size(); ) { - shared_ptr e = entities.at(i); + std::shared_ptr e = entities.at(i); if (e->riding != NULL) { @@ -2326,7 +2326,7 @@ void Level::tickEntities() updatingTileEntities = true; for (AUTO_VAR(it, tileEntityList.begin()); it != tileEntityList.end();) { - shared_ptr te = *it;//tilevector >.at(i); + std::shared_ptr te = *it;//tilevector >.at(i); if( !te->isRemoved() && te->hasLevel() ) { if (hasChunkAt(te->x, te->y, te->z)) @@ -2394,7 +2394,7 @@ void Level::tickEntities() { for( AUTO_VAR(it, pendingTileEntities.begin()); it != pendingTileEntities.end(); it++ ) { - shared_ptr e = *it; + std::shared_ptr e = *it; if( !e->isRemoved() ) { if( find(tileEntityList.begin(),tileEntityList.end(),e) == tileEntityList.end() ) @@ -2415,7 +2415,7 @@ void Level::tickEntities() LeaveCriticalSection(&m_tileEntityListCS); } -void Level::addAllPendingTileEntities(vector< shared_ptr >& entities) +void Level::addAllPendingTileEntities(vector< std::shared_ptr >& entities) { EnterCriticalSection(&m_tileEntityListCS); if( updatingTileEntities ) @@ -2435,13 +2435,13 @@ void Level::addAllPendingTileEntities(vector< shared_ptr >& entities LeaveCriticalSection(&m_tileEntityListCS); } -void Level::tick(shared_ptr e) +void Level::tick(std::shared_ptr e) { tick(e, true); } -void Level::tick(shared_ptr e, bool actual) +void Level::tick(std::shared_ptr e, bool actual) { int xc = Mth::floor(e->x); int zc = Mth::floor(e->z); @@ -2537,13 +2537,13 @@ bool Level::isUnobstructed(AABB *aabb) return isUnobstructed(aabb, nullptr); } -bool Level::isUnobstructed(AABB *aabb, shared_ptr ignore) +bool Level::isUnobstructed(AABB *aabb, std::shared_ptr ignore) { - vector > *ents = getEntities(nullptr, aabb); + vector > *ents = getEntities(nullptr, aabb); AUTO_VAR(itEnd, ents->end()); for (AUTO_VAR(it, ents->begin()); it != itEnd; it++) { - shared_ptr e = *it; + std::shared_ptr e = *it; if (!e->removed && e->blocksBuilding && e != ignore) return false; } return true; @@ -2658,7 +2658,7 @@ bool Level::containsFireTile(AABB *box) } -bool Level::checkAndHandleWater(AABB *box, Material *material, shared_ptr e) +bool Level::checkAndHandleWater(AABB *box, Material *material, std::shared_ptr e) { int x0 = Mth::floor(box->x0); int x1 = Mth::floor(box->x1 + 1); @@ -2758,15 +2758,15 @@ bool Level::containsLiquid(AABB *box, Material *material) } -shared_ptr Level::explode(shared_ptr source, double x, double y, double z, float r, bool destroyBlocks) +std::shared_ptr Level::explode(std::shared_ptr source, double x, double y, double z, float r, bool destroyBlocks) { return explode(source, x, y, z, r, false, destroyBlocks); } -shared_ptr Level::explode(shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks) +std::shared_ptr Level::explode(std::shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks) { - shared_ptr explosion = shared_ptr( new Explosion(this, source, x, y, z, r) ); + std::shared_ptr explosion = std::shared_ptr( new Explosion(this, source, x, y, z, r) ); explosion->fire = fire; explosion->destroyBlocks = destroyBlocks; explosion->explode(); @@ -2799,7 +2799,7 @@ float Level::getSeenPercent(Vec3 *center, AABB *bb) } -bool Level::extinguishFire(shared_ptr player, int x, int y, int z, int face) +bool Level::extinguishFire(std::shared_ptr player, int x, int y, int z, int face) { if (face == 0) y--; if (face == 1) y++; @@ -2818,9 +2818,9 @@ bool Level::extinguishFire(shared_ptr player, int x, int y, int z, int f } /* -shared_ptr Level::findSubclassOf(Entity::Class *entityClass) +std::shared_ptr Level::findSubclassOf(Entity::Class *entityClass) { - return shared_ptr(); + return std::shared_ptr(); } */ @@ -2841,7 +2841,7 @@ wstring Level::gatherChunkSourceStats() } -shared_ptr Level::getTileEntity(int x, int y, int z) +std::shared_ptr Level::getTileEntity(int x, int y, int z) { if (y >= Level::maxBuildHeight) { @@ -2852,14 +2852,14 @@ shared_ptr Level::getTileEntity(int x, int y, int z) if (lc != NULL) { - shared_ptr tileEntity = lc->getTileEntity(x & 15, y, z & 15); + std::shared_ptr tileEntity = lc->getTileEntity(x & 15, y, z & 15); if (tileEntity == NULL) { EnterCriticalSection(&m_tileEntityListCS); for( AUTO_VAR(it, pendingTileEntities.begin()); it != pendingTileEntities.end(); it++ ) { - shared_ptr e = *it; + std::shared_ptr e = *it; if (!e->isRemoved() && e->x == x && e->y == y && e->z == z) { @@ -2876,7 +2876,7 @@ shared_ptr Level::getTileEntity(int x, int y, int z) } -void Level::setTileEntity(int x, int y, int z, shared_ptr tileEntity) +void Level::setTileEntity(int x, int y, int z, std::shared_ptr tileEntity) { if (tileEntity != NULL && !tileEntity->isRemoved()) { @@ -2905,7 +2905,7 @@ void Level::setTileEntity(int x, int y, int z, shared_ptr tileEntity void Level::removeTileEntity(int x, int y, int z) { EnterCriticalSection(&m_tileEntityListCS); - shared_ptr te = getTileEntity(x, y, z); + std::shared_ptr te = getTileEntity(x, y, z); if (te != NULL && updatingTileEntities) { te->setRemoved(); @@ -2936,7 +2936,7 @@ void Level::removeTileEntity(int x, int y, int z) LeaveCriticalSection(&m_tileEntityListCS); } -void Level::markForRemoval(shared_ptr entity) +void Level::markForRemoval(std::shared_ptr entity) { tileEntitiesToUnload.push_back(entity); } @@ -3163,7 +3163,7 @@ void Level::buildAndPrepareChunksToPoll() AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { - shared_ptr player = *it; + std::shared_ptr player = *it; int xx = Mth::floor(player->x / 16); int zz = Mth::floor(player->z / 16); @@ -3183,7 +3183,7 @@ void Level::buildAndPrepareChunksToPoll() int *zz = new int[playerCount]; for (int i = 0; i < playerCount; i++) { - shared_ptr player = players[i]; + std::shared_ptr player = players[i]; xx[i] = Mth::floor(player->x / 16); zz[i] = Mth::floor(player->z / 16); chunksToPoll.insert(ChunkPos(xx[i], zz[i] )); @@ -3239,7 +3239,7 @@ void Level::tickClientSideTiles(int xo, int zo, LevelChunk *lc) z += zo; if (id == 0 && this->getDaytimeRawBrightness(x, y, z) <= random->nextInt(8) && getBrightness(LightLayer::Sky, x, y, z) <= 0) { - shared_ptr player = getNearestPlayer(x + 0.5, y + 0.5, z + 0.5, 8); + std::shared_ptr player = getNearestPlayer(x + 0.5, y + 0.5, z + 0.5, 8); if (player != NULL && player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 2 * 2) { // 4J-PB - Fixed issue with cave audio event having 2 sounds at 192k @@ -3728,7 +3728,7 @@ vector *Level::fetchTicksInChunk(LevelChunk *chunk, bool remov } -vector > *Level::getEntities(shared_ptr except, AABB *bb) +vector > *Level::getEntities(std::shared_ptr except, AABB *bb) { MemSect(40); es.clear(); @@ -3768,13 +3768,13 @@ vector > *Level::getEntities(shared_ptr except, AABB } -vector > *Level::getEntitiesOfClass(const type_info& baseClass, AABB *bb) +vector > *Level::getEntitiesOfClass(const type_info& baseClass, AABB *bb) { int xc0 = Mth::floor((bb->x0 - 2) / 16); int xc1 = Mth::floor((bb->x1 + 2) / 16); int zc0 = Mth::floor((bb->z0 - 2) / 16); int zc1 = Mth::floor((bb->z1 + 2) / 16); - vector > *es = new vector >(); + vector > *es = new vector >(); #ifdef __PSVITA__ #ifdef _ENTITIES_RW_SECTION @@ -3805,15 +3805,15 @@ vector > *Level::getEntitiesOfClass(const type_info& baseClas return es; } -shared_ptr Level::getClosestEntityOfClass(const type_info& baseClass, AABB *bb, shared_ptr source) +std::shared_ptr Level::getClosestEntityOfClass(const type_info& baseClass, AABB *bb, std::shared_ptr source) { - vector > *entities = getEntitiesOfClass(baseClass, bb); - shared_ptr closest = nullptr; + vector > *entities = getEntitiesOfClass(baseClass, bb); + std::shared_ptr closest = nullptr; double closestDistSqr = Double::MAX_VALUE; //for (Entity entity : entities) for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - shared_ptr entity = *it; + std::shared_ptr entity = *it; if (entity == source) continue; double distSqr = source->distanceToSqr(entity); if (distSqr > closestDistSqr) continue; @@ -3824,16 +3824,16 @@ shared_ptr Level::getClosestEntityOfClass(const type_info& baseClass, AA return closest; } -vector > Level::getAllEntities() +vector > Level::getAllEntities() { EnterCriticalSection(&m_entitiesCS); - vector > retVec = entities; + vector > retVec = entities; LeaveCriticalSection(&m_entitiesCS); return retVec; } -void Level::tileEntityChanged(int x, int y, int z, shared_ptr te) +void Level::tileEntityChanged(int x, int y, int z, std::shared_ptr te) { if (this->hasChunkAt(x, y, z)) { @@ -3849,7 +3849,7 @@ unsigned int Level::countInstanceOf(BaseObject::Class *clas) AUTO_VAR(itEnd, entities.end()); for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { - shared_ptr e = *it;//entities.at(i); + std::shared_ptr e = *it;//entities.at(i); if (clas->isAssignableFrom(e->getClass())) count++; } LeaveCriticalSection(&m_entitiesCS); @@ -3869,7 +3869,7 @@ unsigned int Level::countInstanceOf(eINSTANCEOF clas, bool singleType, unsigned AUTO_VAR(itEnd, entities.end()); for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { - shared_ptr e = *it;//entities.at(i); + std::shared_ptr e = *it;//entities.at(i); if( singleType ) { if (e->GetType() == clas) @@ -3904,7 +3904,7 @@ unsigned int Level::countInstanceOfInRange(eINSTANCEOF clas, bool singleType, in AUTO_VAR(itEnd, entities.end()); for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { - shared_ptr e = *it;//entities.at(i); + std::shared_ptr e = *it;//entities.at(i); float sd = e->distanceTo(x,y,z); if (sd * sd > range * range) @@ -3932,7 +3932,7 @@ unsigned int Level::countInstanceOfInRange(eINSTANCEOF clas, bool singleType, in return count; } -void Level::addEntities(vector > *list) +void Level::addEntities(vector > *list) { //entities.addAll(list); EnterCriticalSection(&m_entitiesCS); @@ -3973,13 +3973,13 @@ void Level::addEntities(vector > *list) } -void Level::removeEntities(vector > *list) +void Level::removeEntities(vector > *list) { //entitiesToRemove.addAll(list); entitiesToRemove.insert(entitiesToRemove.end(), list->begin(), list->end()); } -bool Level::mayPlace(int tileId, int x, int y, int z, bool ignoreEntities, int face, shared_ptr ignoreEntity) +bool Level::mayPlace(int tileId, int x, int y, int z, bool ignoreEntities, int face, std::shared_ptr ignoreEntity) { int targetType = getTile(x, y, z); Tile *targetTile = Tile::tiles[targetType]; @@ -4010,7 +4010,7 @@ int Level::getSeaLevel() } -Path *Level::findPath(shared_ptr from, shared_ptr to, float maxDist, bool canPassDoors, bool canOpenDoors, bool avoidWater, bool canFloat) +Path *Level::findPath(std::shared_ptr from, std::shared_ptr to, float maxDist, bool canPassDoors, bool canOpenDoors, bool avoidWater, bool canFloat) { int x = Mth::floor(from->x); int y = Mth::floor(from->y + 1); @@ -4029,7 +4029,7 @@ Path *Level::findPath(shared_ptr from, shared_ptr to, float maxD } -Path *Level::findPath(shared_ptr from, int xBest, int yBest, int zBest, float maxDist, bool canPassDoors, bool canOpenDoors, bool avoidWater, bool canFloat) +Path *Level::findPath(std::shared_ptr from, int xBest, int yBest, int zBest, float maxDist, bool canPassDoors, bool canOpenDoors, bool avoidWater, bool canFloat) { int x = Mth::floor(from->x); int y = Mth::floor(from->y); @@ -4092,21 +4092,21 @@ bool Level::hasNeighborSignal(int x, int y, int z) } // 4J Stu - Added maxYDist param -shared_ptr Level::getNearestPlayer(shared_ptr source, double maxDist, double maxYDist /*= -1*/) +std::shared_ptr Level::getNearestPlayer(std::shared_ptr source, double maxDist, double maxYDist /*= -1*/) { return getNearestPlayer(source->x, source->y, source->z, maxDist, maxYDist); } // 4J Stu - Added maxYDist param -shared_ptr Level::getNearestPlayer(double x, double y, double z, double maxDist, double maxYDist /*= -1*/) +std::shared_ptr Level::getNearestPlayer(double x, double y, double z, double maxDist, double maxYDist /*= -1*/) { MemSect(21); double best = -1; - shared_ptr result = nullptr; + std::shared_ptr result = nullptr; AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { - shared_ptr p = *it;//players.at(i); + std::shared_ptr p = *it;//players.at(i); double dist = p->distanceToSqr(x, y, z); // Allow specifying shorter distances in the vertical @@ -4123,14 +4123,14 @@ shared_ptr Level::getNearestPlayer(double x, double y, double z, double return result; } -shared_ptr Level::getNearestPlayer(double x, double z, double maxDist) +std::shared_ptr Level::getNearestPlayer(double x, double z, double maxDist) { double best = -1; - shared_ptr result = nullptr; + std::shared_ptr result = nullptr; AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { - shared_ptr p = *it; + std::shared_ptr p = *it; double dist = p->distanceToSqr(x, p->y, z); if ((maxDist < 0 || dist < maxDist * maxDist) && (best == -1 || dist < best)) { @@ -4141,20 +4141,20 @@ shared_ptr Level::getNearestPlayer(double x, double z, double maxDist) return result; } -shared_ptr Level::getNearestAttackablePlayer(shared_ptr source, double maxDist) +std::shared_ptr Level::getNearestAttackablePlayer(std::shared_ptr source, double maxDist) { return getNearestAttackablePlayer(source->x, source->y, source->z, maxDist); } -shared_ptr Level::getNearestAttackablePlayer(double x, double y, double z, double maxDist) +std::shared_ptr Level::getNearestAttackablePlayer(double x, double y, double z, double maxDist) { double best = -1; - shared_ptr result = nullptr; + std::shared_ptr result = nullptr; AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { - shared_ptr p = *it; + std::shared_ptr p = *it; if (p->abilities.invulnerable) { @@ -4190,7 +4190,7 @@ shared_ptr Level::getNearestAttackablePlayer(double x, double y, double return result; } -shared_ptr Level::getPlayerByName(const wstring& name) +std::shared_ptr Level::getPlayerByName(const wstring& name) { AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) @@ -4200,10 +4200,10 @@ shared_ptr Level::getPlayerByName(const wstring& name) return *it; //players.at(i); } } - return shared_ptr(); + return std::shared_ptr(); } -shared_ptr Level::getPlayerByUUID(const wstring& name) +std::shared_ptr Level::getPlayerByUUID(const wstring& name) { AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) @@ -4213,7 +4213,7 @@ shared_ptr Level::getPlayerByUUID(const wstring& name) return *it; //players.at(i); } } - return shared_ptr(); + return std::shared_ptr(); } // 4J Stu - Removed in 1.2.3 ? @@ -4353,7 +4353,7 @@ void Level::setTime(int64_t time) if ( timeDiff > 0 && levelData->getTime() != -1 ) { AUTO_VAR(itEnd, players.end()); - for (vector >::iterator it = players.begin(); it != itEnd; it++) + for (vector >::iterator it = players.begin(); it != itEnd; it++) { (*it)->awardStat( GenericStats::timePlayed(), GenericStats::param_time(timeDiff) ); } @@ -4396,7 +4396,7 @@ void Level::setSpawnPos(Pos *spawnPos) } -void Level::ensureAdded(shared_ptr entity) +void Level::ensureAdded(std::shared_ptr entity) { int xc = Mth::floor(entity->x / 16); int zc = Mth::floor(entity->z / 16); @@ -4419,13 +4419,13 @@ void Level::ensureAdded(shared_ptr entity) } -bool Level::mayInteract(shared_ptr player, int xt, int yt, int zt, int content) +bool Level::mayInteract(std::shared_ptr player, int xt, int yt, int zt, int content) { return true; } -void Level::broadcastEntityEvent(shared_ptr e, byte event) +void Level::broadcastEntityEvent(std::shared_ptr e, byte event) { } @@ -4506,13 +4506,13 @@ bool Level::isHumidAt(int x, int y, int z) } -void Level::setSavedData(const wstring& id, shared_ptr data) +void Level::setSavedData(const wstring& id, std::shared_ptr data) { savedDataStorage->set(id, data); } -shared_ptr Level::getSavedData(const type_info& clazz, const wstring& id) +std::shared_ptr Level::getSavedData(const type_info& clazz, const wstring& id) { return savedDataStorage->get(clazz, id); } @@ -4544,7 +4544,7 @@ void Level::levelEvent(int type, int x, int y, int z, int data) } -void Level::levelEvent(shared_ptr source, int type, int x, int y, int z, int data) +void Level::levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data) { AUTO_VAR(itEnd, listeners.end()); for (AUTO_VAR(it, listeners.begin()); it != itEnd; it++) diff --git a/Minecraft.World/Level.h b/Minecraft.World/Level.h index ecafc02b..abf2489d 100644 --- a/Minecraft.World/Level.h +++ b/Minecraft.World/Level.h @@ -92,22 +92,22 @@ public: public: CRITICAL_SECTION m_entitiesCS; // 4J added - vector > entities; + vector > entities; protected: - vector > entitiesToRemove; + vector > entitiesToRemove; public: bool hasEntitiesToRemove(); // 4J added bool m_bDisableAddNewTileEntities; // 4J Added CRITICAL_SECTION m_tileEntityListCS; // 4J added - vector > tileEntityList; + vector > tileEntityList; private: - vector > pendingTileEntities; - vector > tileEntitiesToUnload; + vector > pendingTileEntities; + vector > tileEntitiesToUnload; bool updatingTileEntities; public: - vector > players; - vector > globalEntities; + vector > players; + vector > globalEntities; private: int cloudColor; @@ -140,16 +140,16 @@ protected: public: ChunkSource *chunkSource; // 4J - changed to public protected: - // This is the only shared_ptr ref to levelStorage - we need to keep this as long as at least one Level references it, + // This is the only std::shared_ptr ref to levelStorage - we need to keep this as long as at least one Level references it, // to be able to cope with moving from dimension to dimension where the Level(Level *level, Dimension *dimension) ctor is used - shared_ptr levelStorage; + std::shared_ptr levelStorage; LevelData *levelData; public: bool isFindingSpawn; SavedDataStorage *savedDataStorage; - shared_ptr villages; + std::shared_ptr villages; VillageSiege *villageSiege; public: @@ -160,13 +160,13 @@ private: // 4J Stu - Added these ctors to handle init of member variables void _init(); - void _init(shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource = true); + void _init(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource = true); public: - Level(shared_ptrlevelStorage, const wstring& name, Dimension *dimension, LevelSettings *levelSettings, bool doCreateChunkSource = true); + Level(std::shared_ptrlevelStorage, const wstring& name, Dimension *dimension, LevelSettings *levelSettings, bool doCreateChunkSource = true); Level(Level *level, Dimension *dimension); - Level(shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings); - Level(shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource = true); + Level(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings); + Level(std::shared_ptrlevelStorage, const wstring& levelName, LevelSettings *levelSettings, Dimension *fixedDimension, bool doCreateChunkSource = true); virtual ~Level(); @@ -278,7 +278,7 @@ public: HitResult *clip(Vec3 *a, Vec3 *b, bool liquid); HitResult *clip(Vec3 *a, Vec3 *b, bool liquid, bool solidOnly); - virtual void playSound(shared_ptr entity, int iSound, float volume, float pitch); + virtual void playSound(std::shared_ptr entity, int iSound, float volume, float pitch); virtual void playSound(double x, double y, double z, int iSound, float volume, float pitch, float fClipSoundDist=16.0f); virtual void playLocalSound(double x, double y, double z, int iSound, float volume, float pitch, float fClipSoundDist=16.0f); @@ -287,17 +287,17 @@ public: void playMusic(double x, double y, double z, const wstring& string, float volume); // 4J removed - void addParticle(const wstring& id, double x, double y, double z, double xd, double yd, double zd); void addParticle(ePARTICLE_TYPE id, double x, double y, double z, double xd, double yd, double zd); // 4J added - virtual bool addGlobalEntity(shared_ptr e); - virtual bool addEntity(shared_ptr e); + virtual bool addGlobalEntity(std::shared_ptr e); + virtual bool addEntity(std::shared_ptr e); protected: - virtual void entityAdded(shared_ptr e); - virtual void entityRemoved(shared_ptr e); - virtual void playerRemoved(shared_ptr e); // 4J added + virtual void entityAdded(std::shared_ptr e); + virtual void entityRemoved(std::shared_ptr e); + virtual void playerRemoved(std::shared_ptr e); // 4J added public: - virtual void removeEntity(shared_ptr e); - void removeEntityImmediately(shared_ptr e); + virtual void removeEntity(std::shared_ptr e); + void removeEntityImmediately(std::shared_ptr e); void addListener(LevelListener *listener); void removeListener(LevelListener *listener); @@ -305,11 +305,11 @@ private: AABBList boxes; public: - AABBList *getCubes(shared_ptr source, AABB *box, bool noEntities=false, bool blockAtEdge=false); // 4J - added noEntities & blockAtEdge parameters + AABBList *getCubes(std::shared_ptr source, AABB *box, bool noEntities=false, bool blockAtEdge=false); // 4J - added noEntities & blockAtEdge parameters AABBList *getTileCubes(AABB *box, bool blockAtEdge); // 4J Stu - Brought forward from 12w36 to fix #46282 - TU5: Gameplay: Exiting the minecart in a tight corridor damages the player int getOldSkyDarken(float a); // 4J - change brought forward from 1.8.2 float getSkyDarken(float a); // 4J - change brought forward from 1.8.2 - Vec3 *getSkyColor(shared_ptr source, float a); + Vec3 *getSkyColor(std::shared_ptr source, float a); float getTimeOfDay(float a); int getMoonPhase(float a); float getSunAngle(float a); @@ -324,29 +324,29 @@ public: virtual void addToTickNextTick(int x, int y, int z, int tileId, int tickDelay); virtual void forceAddTileTick(int x, int y, int z, int tileId, int tickDelay); virtual void tickEntities(); - void addAllPendingTileEntities(vector< shared_ptr >& entities); - void tick(shared_ptr e); - virtual void tick(shared_ptr e, bool actual); + void addAllPendingTileEntities(vector< std::shared_ptr >& entities); + void tick(std::shared_ptr e); + virtual void tick(std::shared_ptr e, bool actual); bool isUnobstructed(AABB *aabb); - bool isUnobstructed(AABB *aabb, shared_ptr ignore); + bool isUnobstructed(AABB *aabb, std::shared_ptr ignore); bool containsAnyBlocks(AABB *box); bool containsAnyLiquid(AABB *box); bool containsAnyLiquid_NoLoad(AABB *box); // 4J added bool containsFireTile(AABB *box); - bool checkAndHandleWater(AABB *box, Material *material, shared_ptr e); + bool checkAndHandleWater(AABB *box, Material *material, std::shared_ptr e); bool containsMaterial(AABB *box, Material *material); bool containsLiquid(AABB *box, Material *material); // 4J Stu - destroyBlocks param brought forward as part of fix for tnt cannons - shared_ptr explode(shared_ptr source, double x, double y, double z, float r, bool destroyBlocks); - virtual shared_ptr explode(shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks); + std::shared_ptr explode(std::shared_ptr source, double x, double y, double z, float r, bool destroyBlocks); + virtual std::shared_ptr explode(std::shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks); float getSeenPercent(Vec3 *center, AABB *bb); - bool extinguishFire(shared_ptr player, int x, int y, int z, int face); + bool extinguishFire(std::shared_ptr player, int x, int y, int z, int face); wstring gatherStats(); wstring gatherChunkSourceStats(); - virtual shared_ptr getTileEntity(int x, int y, int z); - void setTileEntity(int x, int y, int z, shared_ptr tileEntity); + virtual std::shared_ptr getTileEntity(int x, int y, int z); + void setTileEntity(int x, int y, int z, std::shared_ptr tileEntity); void removeTileEntity(int x, int y, int z); - void markForRemoval(shared_ptr entity); + void markForRemoval(std::shared_ptr entity); virtual bool isSolidRenderTile(int x, int y, int z); virtual bool isSolidBlockingTile(int x, int y, int z); bool isSolidBlockingTileInLoadedChunk(int x, int y, int z, bool valueIfNotLoaded); @@ -413,38 +413,38 @@ public: virtual vector *fetchTicksInChunk(LevelChunk *chunk, bool remove); private: - vector > es; + vector > es; public: bool isClientSide; - vector > *getEntities(shared_ptr except, AABB *bb); - vector > *getEntitiesOfClass(const type_info& baseClass, AABB *bb); - shared_ptr getClosestEntityOfClass(const type_info& baseClass, AABB *bb, shared_ptr source); - vector > getAllEntities(); - void tileEntityChanged(int x, int y, int z, shared_ptr te); + vector > *getEntities(std::shared_ptr except, AABB *bb); + vector > *getEntitiesOfClass(const type_info& baseClass, AABB *bb); + std::shared_ptr getClosestEntityOfClass(const type_info& baseClass, AABB *bb, std::shared_ptr source); + vector > getAllEntities(); + void tileEntityChanged(int x, int y, int z, std::shared_ptr te); // unsigned int countInstanceOf(BaseObject::Class *clas); unsigned int countInstanceOf(eINSTANCEOF clas, bool singleType, unsigned int *protectedCount = NULL, unsigned int *couldWanderCount = NULL); // 4J added unsigned int countInstanceOfInRange(eINSTANCEOF clas, bool singleType, int range, int x, int y, int z); // 4J Added - void addEntities(vector > *list); - virtual void removeEntities(vector > *list); - bool mayPlace(int tileId, int x, int y, int z, bool ignoreEntities, int face, shared_ptr ignoreEntity); + void addEntities(vector > *list); + virtual void removeEntities(vector > *list); + bool mayPlace(int tileId, int x, int y, int z, bool ignoreEntities, int face, std::shared_ptr ignoreEntity); int getSeaLevel(); - Path *findPath(shared_ptr from, shared_ptr to, float maxDist, bool canPassDoors, bool canOpenDoors, bool avoidWater, bool canFloat); - Path *findPath(shared_ptr from, int xBest, int yBest, int zBest, float maxDist, bool canPassDoors, bool canOpenDoors, bool avoidWater, bool canFloat); + Path *findPath(std::shared_ptr from, std::shared_ptr to, float maxDist, bool canPassDoors, bool canOpenDoors, bool avoidWater, bool canFloat); + Path *findPath(std::shared_ptr from, int xBest, int yBest, int zBest, float maxDist, bool canPassDoors, bool canOpenDoors, bool avoidWater, bool canFloat); bool getDirectSignal(int x, int y, int z, int dir); bool hasDirectSignal(int x, int y, int z); bool getSignal(int x, int y, int z, int dir); bool hasNeighborSignal(int x, int y, int z); // 4J Added maxYDist param - shared_ptr getNearestPlayer(shared_ptr source, double maxDist, double maxYDist = -1); - shared_ptr getNearestPlayer(double x, double y, double z, double maxDist, double maxYDist = -1); - shared_ptr getNearestPlayer(double x, double z, double maxDist); - shared_ptr getNearestAttackablePlayer(shared_ptr source, double maxDist); - shared_ptr getNearestAttackablePlayer(double x, double y, double z, double maxDist); + std::shared_ptr getNearestPlayer(std::shared_ptr source, double maxDist, double maxYDist = -1); + std::shared_ptr getNearestPlayer(double x, double y, double z, double maxDist, double maxYDist = -1); + std::shared_ptr getNearestPlayer(double x, double z, double maxDist); + std::shared_ptr getNearestAttackablePlayer(std::shared_ptr source, double maxDist); + std::shared_ptr getNearestAttackablePlayer(double x, double y, double z, double maxDist); - shared_ptr getPlayerByName(const wstring& name); - shared_ptr getPlayerByUUID(const wstring& name); // 4J Added + std::shared_ptr getPlayerByName(const wstring& name); + std::shared_ptr getPlayerByUUID(const wstring& name); // 4J Added byteArray getBlocksAndData(int x, int y, int z, int xs, int ys, int zs, bool includeLighting = true); void setBlocksAndData(int x, int y, int z, int xs, int ys, int zs, byteArray data, bool includeLighting = true); virtual void disconnect(bool sendDisconnect = true); @@ -456,9 +456,9 @@ public: Pos *getSharedSpawnPos(); void setSpawnPos(int x, int y, int z); void setSpawnPos(Pos *spawnPos); - void ensureAdded(shared_ptr entity); - virtual bool mayInteract(shared_ptr player, int xt, int yt, int zt, int content); - virtual void broadcastEntityEvent(shared_ptr e, byte event); + void ensureAdded(std::shared_ptr entity); + virtual bool mayInteract(std::shared_ptr player, int xt, int yt, int zt, int content); + virtual void broadcastEntityEvent(std::shared_ptr e, byte event); ChunkSource *getChunkSource(); virtual void tileEvent(int x, int y, int z, int tile, int b0, int b1); LevelStorage *getLevelStorage(); @@ -476,11 +476,11 @@ public: bool isRaining(); bool isRainingAt(int x, int y, int z); bool isHumidAt(int x, int y, int z); - void setSavedData(const wstring& id, shared_ptr data); - shared_ptr getSavedData(const type_info& clazz, const wstring& id); + void setSavedData(const wstring& id, std::shared_ptr data); + std::shared_ptr getSavedData(const type_info& clazz, const wstring& id); int getFreeAuxValueFor(const wstring& id); void levelEvent(int type, int x, int y, int z, int data); - void levelEvent(shared_ptr source, int type, int x, int y, int z, int data); + void levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data); int getMaxBuildHeight(); int getHeight(); Random *getRandomFor(int x, int z, int blend); diff --git a/Minecraft.World/LevelChunk.cpp b/Minecraft.World/LevelChunk.cpp index 332f12f5..b27fb611 100644 --- a/Minecraft.World/LevelChunk.cpp +++ b/Minecraft.World/LevelChunk.cpp @@ -58,7 +58,7 @@ void LevelChunk::init(Level *level, int x, int z) #else EnterCriticalSection(&m_csEntities); #endif - entityBlocks = new vector > *[ENTITY_BLOCKS_LENGTH]; + entityBlocks = new vector > *[ENTITY_BLOCKS_LENGTH]; #ifdef _ENTITIES_RW_SECTION LeaveCriticalRWSection(&m_csEntities, true); #else @@ -90,7 +90,7 @@ void LevelChunk::init(Level *level, int x, int z) #endif for (int i = 0; i < ENTITY_BLOCKS_LENGTH; i++) { - entityBlocks[i] = new vector >(); + entityBlocks[i] = new vector >(); } #ifdef _ENTITIES_RW_SECTION LeaveCriticalRWSection(&m_csEntities, true); @@ -1016,7 +1016,7 @@ bool LevelChunk::setTileAndData(int x, int y, int z, int _tile, int _data) // if (_tile > 0 && dynamic_cast(Tile::tiles[_tile]) != NULL) if (_tile > 0 && Tile::tiles[_tile] != NULL && Tile::tiles[_tile]->isEntityTile()) { - shared_ptr te = getTileEntity(x, y, z); + std::shared_ptr te = getTileEntity(x, y, z); if (te == NULL) { te = ((EntityTile *) Tile::tiles[_tile])->newTileEntity(level); @@ -1034,7 +1034,7 @@ bool LevelChunk::setTileAndData(int x, int y, int z, int _tile, int _data) // else if (old > 0 && dynamic_cast(Tile::tiles[old]) != NULL) else if (old > 0 && Tile::tiles[_tile] != NULL && Tile::tiles[_tile]->isEntityTile()) { - shared_ptr te = getTileEntity(x, y, z); + std::shared_ptr te = getTileEntity(x, y, z); if (te != NULL) { te->clearCache(); @@ -1074,7 +1074,7 @@ bool LevelChunk::setData(int x, int y, int z, int val, int mask, bool *maskedBit int _tile = getTile(x, y, z); if (_tile > 0 && dynamic_cast( Tile::tiles[_tile] ) != NULL) { - shared_ptr te = getTileEntity(x, y, z); + std::shared_ptr te = getTileEntity(x, y, z); if (te != NULL) { te->clearCache(); @@ -1166,7 +1166,7 @@ int LevelChunk::getRawBrightness(int x, int y, int z, int skyDampen) return light; } -void LevelChunk::addEntity(shared_ptr e) +void LevelChunk::addEntity(std::shared_ptr e) { lastSaveHadEntities = true; @@ -1200,12 +1200,12 @@ void LevelChunk::addEntity(shared_ptr e) } -void LevelChunk::removeEntity(shared_ptr e) +void LevelChunk::removeEntity(std::shared_ptr e) { removeEntity(e, e->yChunk); } -void LevelChunk::removeEntity(shared_ptr e, int yc) +void LevelChunk::removeEntity(std::shared_ptr e, int yc) { if (yc < 0) yc = 0; if (yc >= ENTITY_BLOCKS_LENGTH) yc = ENTITY_BLOCKS_LENGTH - 1; @@ -1261,14 +1261,14 @@ void LevelChunk::skyBrightnessChanged() level->setTilesDirty(x0, y0, z0, x1, y1, z1); } -shared_ptr LevelChunk::getTileEntity(int x, int y, int z) +std::shared_ptr LevelChunk::getTileEntity(int x, int y, int z) { TilePos pos(x, y, z); // 4J Stu - Changed as we should not be using the [] accessor (causes an insert when we don't want one) - //shared_ptr tileEntity = tileEntities[pos]; + //std::shared_ptr tileEntity = tileEntities[pos]; EnterCriticalSection(&m_csTileEntities); - shared_ptr tileEntity = nullptr; + std::shared_ptr tileEntity = nullptr; AUTO_VAR(it, tileEntities.find(pos)); if (it == tileEntities.end()) @@ -1320,7 +1320,7 @@ shared_ptr LevelChunk::getTileEntity(int x, int y, int z) return tileEntity; } -void LevelChunk::addTileEntity(shared_ptr te) +void LevelChunk::addTileEntity(std::shared_ptr te) { int xx = (int)(te->x - this->x * 16); int yy = (int)te->y; @@ -1334,7 +1334,7 @@ void LevelChunk::addTileEntity(shared_ptr te) } } -void LevelChunk::setTileEntity(int x, int y, int z, shared_ptr tileEntity) +void LevelChunk::setTileEntity(int x, int y, int z, std::shared_ptr tileEntity) { TilePos pos(x, y, z); @@ -1371,7 +1371,7 @@ void LevelChunk::removeTileEntity(int x, int y, int z) AUTO_VAR(it, tileEntities.find(pos)); if( it != tileEntities.end() ) { - shared_ptr te = tileEntities[pos]; + std::shared_ptr te = tileEntities[pos]; tileEntities.erase(pos); if( te != NULL ) { @@ -1401,7 +1401,7 @@ void LevelChunk::load() for (int i = 0; i < entityTags->size(); i++) { CompoundTag *teTag = entityTags->get(i); - shared_ptr te = EntityIO::loadStatic(teTag, level); + std::shared_ptr te = EntityIO::loadStatic(teTag, level); if (te != NULL) { addEntity(te); @@ -1415,7 +1415,7 @@ void LevelChunk::load() for (int i = 0; i < tileEntityTags->size(); i++) { CompoundTag *teTag = tileEntityTags->get(i); - shared_ptr te = TileEntity::loadStatic(teTag); + std::shared_ptr te = TileEntity::loadStatic(teTag); if (te != NULL) { addTileEntity(te); @@ -1428,7 +1428,7 @@ void LevelChunk::load() } #endif - vector< shared_ptr > values; + vector< std::shared_ptr > values; EnterCriticalSection(&m_csTileEntities); for( AUTO_VAR(it, tileEntities.begin()); it != tileEntities.end(); it++ ) { @@ -1506,9 +1506,9 @@ void LevelChunk::unload(bool unloadTileEntities) // 4J - added parameter for (int i = 0; i < ENTITY_BLOCKS_LENGTH; i++) { AUTO_VAR(itEnd, entityBlocks[i]->end()); - for( vector >::iterator it = entityBlocks[i]->begin(); it != itEnd; it++ ) + for( vector >::iterator it = entityBlocks[i]->begin(); it != itEnd; it++ ) { - shared_ptr e = *it; + std::shared_ptr e = *it; CompoundTag *teTag = new CompoundTag(); if (e->save(teTag)) { @@ -1529,10 +1529,10 @@ void LevelChunk::unload(bool unloadTileEntities) // 4J - added parameter ListTag *tileEntityTags = new ListTag(); AUTO_VAR(itEnd,tileEntities.end()); - for( unordered_map, TilePosKeyHash, TilePosKeyEq>::iterator it = tileEntities.begin(); + for( unordered_map, TilePosKeyHash, TilePosKeyEq>::iterator it = tileEntities.begin(); it != itEnd; it++) { - shared_ptr te = it->second; + std::shared_ptr te = it->second; CompoundTag *teTag = new CompoundTag(); te->save(teTag); tileEntityTags->add(teTag); @@ -1560,7 +1560,7 @@ void LevelChunk::markUnsaved() } -void LevelChunk::getEntities(shared_ptr except, AABB *bb, vector > &es) +void LevelChunk::getEntities(std::shared_ptr except, AABB *bb, vector > &es) { int yc0 = Mth::floor((bb->y0 - 2) / 16); int yc1 = Mth::floor((bb->y1 + 2) / 16); @@ -1573,16 +1573,16 @@ void LevelChunk::getEntities(shared_ptr except, AABB *bb, vector > *entities = entityBlocks[yc]; + vector > *entities = entityBlocks[yc]; AUTO_VAR(itEnd, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { - shared_ptr e = *it; //entities->at(i); + std::shared_ptr e = *it; //entities->at(i); if (e != except && e->bb->intersects(bb)) { es.push_back(e); - vector > *subs = e->getSubEntities(); + vector > *subs = e->getSubEntities(); if (subs != NULL) { for (int j = 0; j < subs->size(); j++) @@ -1602,7 +1602,7 @@ void LevelChunk::getEntities(shared_ptr except, AABB *bb, vector > &es) +void LevelChunk::getEntitiesOfClass(const type_info& ec, AABB *bb, vector > &es) { int yc0 = Mth::floor((bb->y0 - 2) / 16); int yc1 = Mth::floor((bb->y1 + 2) / 16); @@ -1630,12 +1630,12 @@ void LevelChunk::getEntitiesOfClass(const type_info& ec, AABB *bb, vector > *entities = entityBlocks[yc]; + vector > *entities = entityBlocks[yc]; AUTO_VAR(itEnd, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { - shared_ptr e = *it; //entities->at(i); + std::shared_ptr e = *it; //entities->at(i); bool isAssignableFrom = false; // Some special cases where the base class is a general type that our class may be derived from, otherwise do a direct comparison of type_info diff --git a/Minecraft.World/LevelChunk.h b/Minecraft.World/LevelChunk.h index 820835c3..16b6a8a7 100644 --- a/Minecraft.World/LevelChunk.h +++ b/Minecraft.World/LevelChunk.h @@ -100,8 +100,8 @@ private: bool hasGapsToCheck; public: - unordered_map, TilePosKeyHash, TilePosKeyEq> tileEntities; - vector > **entityBlocks; + unordered_map, TilePosKeyHash, TilePosKeyEq> tileEntities; + vector > **entityBlocks; static const int sTerrainPopulatedFromHere = 2; static const int sTerrainPopulatedFromW = 4; @@ -188,14 +188,14 @@ public: virtual void getNeighbourBrightnesses(int *brightnesses, LightLayer::variety layer, int x, int y, int z); // 4J added virtual void setBrightness(LightLayer::variety layer, int x, int y, int z, int brightness); virtual int getRawBrightness(int x, int y, int z, int skyDampen); - virtual void addEntity(shared_ptr e); - virtual void removeEntity(shared_ptr e); - virtual void removeEntity(shared_ptr e, int yc); + virtual void addEntity(std::shared_ptr e); + virtual void removeEntity(std::shared_ptr e); + virtual void removeEntity(std::shared_ptr e, int yc); virtual bool isSkyLit(int x, int y, int z); virtual void skyBrightnessChanged(); - virtual shared_ptr getTileEntity(int x, int y, int z); - virtual void addTileEntity(shared_ptr te); - virtual void setTileEntity(int x, int y, int z, shared_ptr tileEntity); + virtual std::shared_ptr getTileEntity(int x, int y, int z); + virtual void addTileEntity(std::shared_ptr te); + virtual void setTileEntity(int x, int y, int z, std::shared_ptr tileEntity); virtual void removeTileEntity(int x, int y, int z); virtual void load(); virtual void unload(bool unloadTileEntities) ; // 4J - added parameter @@ -203,8 +203,8 @@ public: virtual bool isUnloaded(); #endif virtual void markUnsaved(); - virtual void getEntities(shared_ptr except, AABB *bb, vector > &es); - virtual void getEntitiesOfClass(const type_info& ec, AABB *bb, vector > &es); + virtual void getEntities(std::shared_ptr except, AABB *bb, vector > &es); + virtual void getEntitiesOfClass(const type_info& ec, AABB *bb, vector > &es); virtual int countEntities(); virtual bool shouldSave(bool force); virtual int getBlocksAndData(byteArray *data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter diff --git a/Minecraft.World/LevelData.cpp b/Minecraft.World/LevelData.cpp index 486fbe98..6d8d76b5 100644 --- a/Minecraft.World/LevelData.cpp +++ b/Minecraft.World/LevelData.cpp @@ -243,7 +243,7 @@ CompoundTag *LevelData::createTag() return tag; } -CompoundTag *LevelData::createTag(vector > *players) +CompoundTag *LevelData::createTag(vector > *players) { // 4J - removed all code for storing tags for players return createTag(); diff --git a/Minecraft.World/LevelData.h b/Minecraft.World/LevelData.h index 405ba1b8..40ccb849 100644 --- a/Minecraft.World/LevelData.h +++ b/Minecraft.World/LevelData.h @@ -58,7 +58,7 @@ public: LevelData(LevelSettings *levelSettings, const wstring& levelName); LevelData(LevelData *copy); CompoundTag *createTag(); - CompoundTag *createTag(vector > *players); + CompoundTag *createTag(vector > *players); enum { diff --git a/Minecraft.World/LevelEventPacket.h b/Minecraft.World/LevelEventPacket.h index 6c2fdbaf..78da348a 100644 --- a/Minecraft.World/LevelEventPacket.h +++ b/Minecraft.World/LevelEventPacket.h @@ -19,6 +19,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new LevelEventPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new LevelEventPacket()); } virtual int getId() { return 61; } }; \ No newline at end of file diff --git a/Minecraft.World/LevelListener.h b/Minecraft.World/LevelListener.h index ec9b11de..98222e84 100644 --- a/Minecraft.World/LevelListener.h +++ b/Minecraft.World/LevelListener.h @@ -18,23 +18,23 @@ public: //virtual void playSound(const wstring& name, double x, double y, double z, float volume, float pitch) = 0; virtual void playSound(int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f) = 0; - virtual void playSound(shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f) = 0; + virtual void playSound(std::shared_ptr entity,int iSound, double x, double y, double z, float volume, float pitch, float fSoundClipDist=16.0f) = 0; // 4J removed - virtual void addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za) = 0; virtual void addParticle(ePARTICLE_TYPE name, double x, double y, double z, double xa, double ya, double za) = 0; // 4J added - virtual void entityAdded(shared_ptr entity) = 0; + virtual void entityAdded(std::shared_ptr entity) = 0; - virtual void entityRemoved(shared_ptr entity) = 0; + virtual void entityRemoved(std::shared_ptr entity) = 0; - virtual void playerRemoved(shared_ptr entity) = 0; // 4J added - for when a player is removed from the level's player array, not just the entity storage + virtual void playerRemoved(std::shared_ptr entity) = 0; // 4J added - for when a player is removed from the level's player array, not just the entity storage virtual void skyColorChanged() = 0; virtual void playStreamingMusic(const wstring& name, int x, int y, int z) = 0; - virtual void levelEvent(shared_ptr source, int type, int x, int y, int z, int data) = 0; + virtual void levelEvent(std::shared_ptr source, int type, int x, int y, int z, int data) = 0; virtual void destroyTileProgress(int id, int x, int y, int z, int progress) = 0; }; \ No newline at end of file diff --git a/Minecraft.World/LevelSoundPacket.h b/Minecraft.World/LevelSoundPacket.h index 403ac092..4e6ede72 100644 --- a/Minecraft.World/LevelSoundPacket.h +++ b/Minecraft.World/LevelSoundPacket.h @@ -33,6 +33,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new LevelSoundPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new LevelSoundPacket()); } virtual int getId() { return 62; } }; diff --git a/Minecraft.World/LevelSource.h b/Minecraft.World/LevelSource.h index 7ff99146..7bfef06b 100644 --- a/Minecraft.World/LevelSource.h +++ b/Minecraft.World/LevelSource.h @@ -10,7 +10,7 @@ class LevelSource { public: virtual int getTile(int x, int y, int z) = 0; - virtual shared_ptr getTileEntity(int x, int y, int z) = 0; + virtual std::shared_ptr getTileEntity(int x, int y, int z) = 0; virtual int getLightColor(int x, int y, int z, int emitt, int tileId = -1) = 0; // 4J - brought forward from 1.8.2, added tileId virtual float getBrightness(int x, int y, int z, int emitt) = 0; virtual float getBrightness(int x, int y, int z) = 0; diff --git a/Minecraft.World/LevelStorage.h b/Minecraft.World/LevelStorage.h index 25d2aba2..61d6cee2 100644 --- a/Minecraft.World/LevelStorage.h +++ b/Minecraft.World/LevelStorage.h @@ -12,7 +12,7 @@ class File; class ConsoleSaveFile; -class LevelStorage +class LevelStorage { public: static const wstring NETHER_FOLDER; @@ -21,7 +21,7 @@ public: virtual LevelData *prepareLevel() = 0; virtual void checkSession() = 0; virtual ChunkStorage *createChunkStorage(Dimension *dimension) = 0; - virtual void saveLevelData(LevelData *levelData, vector > *players) = 0; + virtual void saveLevelData(LevelData *levelData, vector > *players) = 0; virtual void saveLevelData(LevelData *levelData) = 0; virtual PlayerIO *getPlayerIO() = 0; virtual void closeAll() = 0; diff --git a/Minecraft.World/LevelStorageProfilerDecorator.cpp b/Minecraft.World/LevelStorageProfilerDecorator.cpp index b6a4276e..532bdcfc 100644 --- a/Minecraft.World/LevelStorageProfilerDecorator.cpp +++ b/Minecraft.World/LevelStorageProfilerDecorator.cpp @@ -26,7 +26,7 @@ ChunkStorage *LevelStorageProfilerDecorator::createChunkStorage(Dimension *dimen return new ChunkStorageProfilerDecorator(capsulated->createChunkStorage(dimension)); } -void LevelStorageProfilerDecorator::saveLevelData(LevelData *levelData, vector > *players) +void LevelStorageProfilerDecorator::saveLevelData(LevelData *levelData, vector > *players) { capsulated->saveLevelData(levelData, players); } diff --git a/Minecraft.World/LevelStorageProfilerDecorator.h b/Minecraft.World/LevelStorageProfilerDecorator.h index 98ed7620..bd1751cc 100644 --- a/Minecraft.World/LevelStorageProfilerDecorator.h +++ b/Minecraft.World/LevelStorageProfilerDecorator.h @@ -18,7 +18,7 @@ public: LevelData *prepareLevel(); void checkSession(); ChunkStorage *createChunkStorage(Dimension *dimension); - void saveLevelData(LevelData *levelData, vector > *players); + void saveLevelData(LevelData *levelData, vector > *players); void saveLevelData(LevelData *levelData); PlayerIO *getPlayerIO(); void closeAll(); diff --git a/Minecraft.World/LevelStorageSource.h b/Minecraft.World/LevelStorageSource.h index 16b8df88..ff6a41f7 100644 --- a/Minecraft.World/LevelStorageSource.h +++ b/Minecraft.World/LevelStorageSource.h @@ -9,11 +9,11 @@ class LevelData; class LevelStorage; class ConsoleSaveFile; -class LevelStorageSource +class LevelStorageSource { public: virtual wstring getName() = 0; - virtual shared_ptr selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir) = 0; + virtual std::shared_ptr selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir) = 0; virtual vector *getLevelList() = 0; virtual void clearAll() = 0; virtual LevelData *getDataTagFor(ConsoleSaveFile *saveFile, const wstring& levelId) = 0; @@ -24,7 +24,7 @@ public: * handle. *

* Also, a new levelId may not overwrite an existing one. - * + * * @param levelId * @return */ diff --git a/Minecraft.World/LeverTile.cpp b/Minecraft.World/LeverTile.cpp index a8231251..054bc461 100644 --- a/Minecraft.World/LeverTile.cpp +++ b/Minecraft.World/LeverTile.cpp @@ -144,7 +144,7 @@ bool LeverTile::checkCanSurvive(Level *level, int x, int y, int z) return true; } -void LeverTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void LeverTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { int dir = level->getData(x, y, z) & 7; float r = 3 / 16.0f; @@ -176,7 +176,7 @@ void LeverTile::updateShape(LevelSource *level, int x, int y, int z, int forceDa } } -void LeverTile::attack(Level *level, int x, int y, int z, shared_ptr player) +void LeverTile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { use(level, x, y, z, player, 0, 0, 0, 0); } @@ -187,7 +187,7 @@ bool LeverTile::TestUse() return true; } -bool LeverTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool LeverTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly ) { @@ -290,7 +290,7 @@ bool LeverTile::getDirectSignal(Level *level, int x, int y, int z, int dir) int data = level->getData(x, y, z); if ((data & 8) == 0) return false; int myDir = data & 7; - + if (myDir == 0 && dir == 0) return true; if (myDir == 7 && dir == 0) return true; if (myDir == 6 && dir == 1) return true; diff --git a/Minecraft.World/LeverTile.h b/Minecraft.World/LeverTile.h index 4d00db78..3c0140b5 100644 --- a/Minecraft.World/LeverTile.h +++ b/Minecraft.World/LeverTile.h @@ -20,10 +20,10 @@ public: private: virtual bool checkCanSurvive(Level *level, int x, int y, int z); public: - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param - virtual void attack(Level *level, int x, int y, int z, shared_ptr player); + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param + virtual void attack(Level *level, int x, int y, int z, std::shared_ptr player); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param virtual void onRemove(Level *level, int x, int y, int z, int id, int data); virtual bool getSignal(LevelSource *level, int x, int y, int z, int dir); virtual bool getDirectSignal(Level *level, int x, int y, int z, int dir); diff --git a/Minecraft.World/LightningBolt.cpp b/Minecraft.World/LightningBolt.cpp index 901bedf1..fe189cf4 100644 --- a/Minecraft.World/LightningBolt.cpp +++ b/Minecraft.World/LightningBolt.cpp @@ -9,7 +9,7 @@ #include "net.minecraft.world.level.dimension.h" -LightningBolt::LightningBolt(Level *level, double x, double y, double z) : +LightningBolt::LightningBolt(Level *level, double x, double y, double z) : life( 0 ), seed( 0 ), flashes( 0 ), @@ -105,11 +105,11 @@ void LightningBolt::tick() // 4J - added clientside check if( !level->isClientSide ) { - vector > *entities = level->getEntities(shared_from_this(), AABB::newTemp(x - r, y - r, z - r, x + r, y + 6 + r, z + r)); + vector > *entities = level->getEntities(shared_from_this(), AABB::newTemp(x - r, y - r, z - r, x + r, y + 6 + r, z + r)); AUTO_VAR(itEnd, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { - shared_ptr e = (*it); //entities->at(i); + std::shared_ptr e = (*it); //entities->at(i); e->thunderHit(this); } } diff --git a/Minecraft.World/LiquidTile.cpp b/Minecraft.World/LiquidTile.cpp index 466589a4..a17ff525 100644 --- a/Minecraft.World/LiquidTile.cpp +++ b/Minecraft.World/LiquidTile.cpp @@ -115,7 +115,7 @@ bool LiquidTile::isSolidFace(LevelSource *level, int x, int y, int z, int face) if (m == this->material) return false; if (face == Facing::UP) return true; if (m == Material::ice) return false; - + return Tile::isSolidFace(level, x, y, z, face); } @@ -203,7 +203,7 @@ Vec3 *LiquidTile::getFlow(LevelSource *level, int x, int y, int z) return flow; } -void LiquidTile::handleEntityInside(Level *level, int x, int y, int z, shared_ptr e, Vec3 *current) +void LiquidTile::handleEntityInside(Level *level, int x, int y, int z, std::shared_ptr e, Vec3 *current) { Vec3 *flow = getFlow(level, x, y, z); current->x += flow->x; diff --git a/Minecraft.World/LiquidTile.h b/Minecraft.World/LiquidTile.h index 67eb5b65..37ee3dd4 100644 --- a/Minecraft.World/LiquidTile.h +++ b/Minecraft.World/LiquidTile.h @@ -42,7 +42,7 @@ public: private: virtual Vec3 *getFlow(LevelSource *level, int x, int y, int z); public: - virtual void handleEntityInside(Level *level, int x, int y, int z, shared_ptr e, Vec3 *current); + virtual void handleEntityInside(Level *level, int x, int y, int z, std::shared_ptr e, Vec3 *current); virtual int getTickDelay(); virtual int getLightColor(LevelSource *level, int x, int y, int z, int tileId=-1); // 4J - brought forward from 1.8.2 virtual float getBrightness(LevelSource *level, int x, int y, int z); diff --git a/Minecraft.World/LoginPacket.h b/Minecraft.World/LoginPacket.h index bf7164fa..26c32ca6 100644 --- a/Minecraft.World/LoginPacket.h +++ b/Minecraft.World/LoginPacket.h @@ -40,6 +40,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new LoginPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new LoginPacket()); } virtual int getId() { return 1; } }; diff --git a/Minecraft.World/LookControl.cpp b/Minecraft.World/LookControl.cpp index 829c3e4a..13783c81 100644 --- a/Minecraft.World/LookControl.cpp +++ b/Minecraft.World/LookControl.cpp @@ -13,10 +13,10 @@ LookControl::LookControl(Mob *mob) this->mob = mob; } -void LookControl::setLookAt(shared_ptr target, float yMax, float xMax) +void LookControl::setLookAt(std::shared_ptr target, float yMax, float xMax) { this->wantedX = target->x; - shared_ptr targetMob = dynamic_pointer_cast(target); + std::shared_ptr targetMob = dynamic_pointer_cast(target); if (targetMob != NULL) this->wantedY = target->y + targetMob->getHeadHeight(); else this->wantedY = (target->bb->y0 + target->bb->y1) / 2; this->wantedZ = target->z; @@ -54,7 +54,7 @@ void LookControl::tick() mob->yHeadRot = rotlerp(mob->yHeadRot, yRotD, yMax); } else - { + { mob->yHeadRot = rotlerp(mob->yHeadRot, mob->yBodyRot, 10); } diff --git a/Minecraft.World/LookControl.h b/Minecraft.World/LookControl.h index add64e4a..fe182e7c 100644 --- a/Minecraft.World/LookControl.h +++ b/Minecraft.World/LookControl.h @@ -16,7 +16,7 @@ private: public: LookControl(Mob *mob); - void setLookAt(shared_ptr target, float yMax, float xMax); + void setLookAt(std::shared_ptr target, float yMax, float xMax); void setLookAt(double x, double y, double z, float yMax, float xMax); virtual void tick(); diff --git a/Minecraft.World/MakeLoveGoal.cpp b/Minecraft.World/MakeLoveGoal.cpp index 89f09f1d..cff6d01e 100644 --- a/Minecraft.World/MakeLoveGoal.cpp +++ b/Minecraft.World/MakeLoveGoal.cpp @@ -29,7 +29,7 @@ bool MakeLoveGoal::canUse() if (village.lock() == NULL) return false; if (!villageNeedsMoreVillagers()) return false; - shared_ptr mate = level->getClosestEntityOfClass(typeid(Villager), villager->bb->grow(8, 3, 8), villager->shared_from_this()); + std::shared_ptr mate = level->getClosestEntityOfClass(typeid(Villager), villager->bb->grow(8, 3, 8), villager->shared_from_this()); if (mate == NULL) return false; partner = weak_ptr(dynamic_pointer_cast(mate)); @@ -75,7 +75,7 @@ void MakeLoveGoal::tick() bool MakeLoveGoal::villageNeedsMoreVillagers() { - shared_ptr _village = village.lock(); + std::shared_ptr _village = village.lock(); if( _village == NULL ) return false; int idealSize = (int) ((float) _village->getDoorCount() * 0.35); @@ -93,7 +93,7 @@ void MakeLoveGoal::breed() // 4J - added limit to number of animals that can be bred if(level->canCreateMore( eTYPE_VILLAGER, Level::eSpawnType_Breed) ) { - shared_ptr child = shared_ptr( new Villager(level) ); + std::shared_ptr child = std::shared_ptr( new Villager(level) ); child->setAge(-20 * 60 * 20); child->setProfession(villager->getRandom()->nextInt(Villager::PROFESSION_MAX)); child->moveTo(villager->x, villager->y, villager->z, 0, 0); diff --git a/Minecraft.World/MapItem.cpp b/Minecraft.World/MapItem.cpp index abf4fb9a..3f5682ab 100644 --- a/Minecraft.World/MapItem.cpp +++ b/Minecraft.World/MapItem.cpp @@ -19,12 +19,12 @@ MapItem::MapItem(int id) : ComplexItem(id) this->setMaxStackSize(1); } -shared_ptr MapItem::getSavedData(short idNum, Level *level) -{ +std::shared_ptr MapItem::getSavedData(short idNum, Level *level) +{ std::wstring id = wstring( L"map_" ) + _toString(idNum); - shared_ptr mapItemSavedData = dynamic_pointer_cast(level->getSavedData(typeid(MapItemSavedData), id)); + std::shared_ptr mapItemSavedData = dynamic_pointer_cast(level->getSavedData(typeid(MapItemSavedData), id)); - if (mapItemSavedData == NULL) + if (mapItemSavedData == NULL) { // 4J Stu - This call comes from ClientConnection, but i don't see why we should be trying to work out // the id again when it's passed as a param. In any case that won't work with the new map setup @@ -32,20 +32,20 @@ shared_ptr MapItem::getSavedData(short idNum, Level *level) int aux = idNum; id = wstring( L"map_" ) + _toString(aux); - mapItemSavedData = shared_ptr( new MapItemSavedData(id) ); + mapItemSavedData = std::shared_ptr( new MapItemSavedData(id) ); - level->setSavedData(id, (shared_ptr ) mapItemSavedData); + level->setSavedData(id, (std::shared_ptr ) mapItemSavedData); } return mapItemSavedData; } -shared_ptr MapItem::getSavedData(shared_ptr itemInstance, Level *level) +std::shared_ptr MapItem::getSavedData(std::shared_ptr itemInstance, Level *level) { MemSect(31); std::wstring id = wstring( L"map_" ) + _toString(itemInstance->getAuxValue() ); MemSect(0); - shared_ptr mapItemSavedData = dynamic_pointer_cast( level->getSavedData(typeid(MapItemSavedData), id ) ); + std::shared_ptr mapItemSavedData = dynamic_pointer_cast( level->getSavedData(typeid(MapItemSavedData), id ) ); bool newData = false; if (mapItemSavedData == NULL) @@ -55,7 +55,7 @@ shared_ptr MapItem::getSavedData(shared_ptr item //itemInstance->setAuxValue(level->getFreeAuxValueFor(L"map")); id = wstring( L"map_" ) + _toString(itemInstance->getAuxValue() ); - mapItemSavedData = shared_ptr( new MapItemSavedData(id) ); + mapItemSavedData = std::shared_ptr( new MapItemSavedData(id) ); newData = true; } @@ -75,18 +75,18 @@ shared_ptr MapItem::getSavedData(shared_ptr item mapItemSavedData->z = Math::round(level->getLevelData()->getZSpawn() / scale) * scale; #endif mapItemSavedData->dimension = (byte) level->dimension->id; - + mapItemSavedData->setDirty(); - level->setSavedData(id, (shared_ptr ) mapItemSavedData); + level->setSavedData(id, (std::shared_ptr ) mapItemSavedData); } return mapItemSavedData; } -void MapItem::update(Level *level, shared_ptr player, shared_ptr data) +void MapItem::update(Level *level, std::shared_ptr player, std::shared_ptr data) { - if (level->dimension->id != data->dimension) + if (level->dimension->id != data->dimension) { // Wrong dimension, abort return; @@ -152,8 +152,8 @@ void MapItem::update(Level *level, shared_ptr player, shared_ptr> 20) & 1) == 0) count[Tile::dirt_Id] += 10; else count[Tile::rock_Id] += 10; hh = 100; - } - else + } + else { for (int xs = 0; xs < scale; xs++) { @@ -161,7 +161,7 @@ void MapItem::update(Level *level, shared_ptr player, shared_ptrgetHeightmap(xs + xso, zs + zso) + 1; int t = 0; - if (yy > 1) + if (yy > 1) { bool ok = false; do @@ -222,7 +222,7 @@ void MapItem::update(Level *level, shared_ptr player, shared_ptr 0) + if (tBest > 0) { MaterialColor *mc = Tile::tiles[tBest]->material->color; if (mc == MaterialColor::water) @@ -252,27 +252,27 @@ void MapItem::update(Level *level, shared_ptr player, shared_ptrcolors[x + z * w] = newColor; } } - if (yd0 <= yd1) + if (yd0 <= yd1) { data->setDirty(x, yd0, yd1); } } } -void MapItem::inventoryTick(shared_ptr itemInstance, Level *level, shared_ptr owner, int slot, bool selected) +void MapItem::inventoryTick(std::shared_ptr itemInstance, Level *level, std::shared_ptr owner, int slot, bool selected) { if (level->isClientSide) return; - shared_ptr data = getSavedData(itemInstance, level); - if (dynamic_pointer_cast(owner) != NULL) + std::shared_ptr data = getSavedData(itemInstance, level); + if (dynamic_pointer_cast(owner) != NULL) { - shared_ptr player = dynamic_pointer_cast(owner); + std::shared_ptr player = dynamic_pointer_cast(owner); // 4J Stu - If the player has a map that belongs to another player, then merge the data over and change this map id to the owners id int ownersAuxValue = level->getAuxValueForMap(player->getXuid(), data->dimension, data->x, data->z, data->scale); if(ownersAuxValue != itemInstance->getAuxValue() ) { - shared_ptr ownersData = getSavedData(ownersAuxValue,level); + std::shared_ptr ownersData = getSavedData(ownersAuxValue,level); ownersData->x = data->x; ownersData->z = data->z; @@ -283,7 +283,7 @@ void MapItem::inventoryTick(shared_ptr itemInstance, Level *level, ownersData->tickCarriedBy(player, itemInstance ); ownersData->mergeInMapData(data); player->inventoryMenu->broadcastChanges(); - + data = ownersData; } else @@ -292,13 +292,13 @@ void MapItem::inventoryTick(shared_ptr itemInstance, Level *level, } } - if (selected) + if (selected) { update(level, owner, data); } } -void MapItem::onCraftedBy(shared_ptr itemInstance, Level *level, shared_ptr player) +void MapItem::onCraftedBy(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { wchar_t buf[64]; @@ -314,19 +314,19 @@ void MapItem::onCraftedBy(shared_ptr itemInstance, Level *level, s #endif itemInstance->setAuxValue(level->getAuxValueForMap(player->getXuid(), player->dimension, centreXC, centreZC, mapScale)); - + swprintf(buf,64,L"map_%d", itemInstance->getAuxValue()); std::wstring id = wstring(buf); - shared_ptr data = getSavedData(itemInstance->getAuxValue(), level); + std::shared_ptr data = getSavedData(itemInstance->getAuxValue(), level); // 4J Stu - We only have one map per player per dimension, so don't reset the one that they have // when a new one is created if( data == NULL ) { - data = shared_ptr( new MapItemSavedData(id) ); + data = std::shared_ptr( new MapItemSavedData(id) ); } - level->setSavedData(id, (shared_ptr ) data); - + level->setSavedData(id, (std::shared_ptr ) data); + data->scale = mapScale; // 4J-PB - for Xbox maps, we'll centre them on the origin of the world, since we can fit the whole world in our map data->x = centreXC; @@ -335,13 +335,13 @@ void MapItem::onCraftedBy(shared_ptr itemInstance, Level *level, s data->setDirty(); } -shared_ptr MapItem::getUpdatePacket(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr MapItem::getUpdatePacket(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { charArray data = MapItem::getSavedData(itemInstance, level)->getUpdatePacket(itemInstance, level, player); if (data.data == NULL || data.length == 0) return nullptr; - shared_ptr retval = shared_ptr(new ComplexItemDataPacket((short) Item::map->id, (short) itemInstance->getAuxValue(), data)); + std::shared_ptr retval = std::shared_ptr(new ComplexItemDataPacket((short) Item::map->id, (short) itemInstance->getAuxValue(), data)); delete data.data; return retval; } diff --git a/Minecraft.World/MapItem.h b/Minecraft.World/MapItem.h index dc16339d..2d4f0518 100644 --- a/Minecraft.World/MapItem.h +++ b/Minecraft.World/MapItem.h @@ -5,7 +5,7 @@ using namespace std; class MapItemSavedData; -class MapItem : public ComplexItem +class MapItem : public ComplexItem { public: static const int IMAGE_WIDTH = 128; @@ -14,10 +14,10 @@ public: public: // 4J Stu - Was protected in Java, but then we can't access it where we need it MapItem(int id); - static shared_ptr getSavedData(short idNum, Level *level); - shared_ptr getSavedData(shared_ptr itemInstance, Level *level); - void update(Level *level, shared_ptr player, shared_ptr data); - virtual void inventoryTick(shared_ptr itemInstance, Level *level, shared_ptr owner, int slot, bool selected); - virtual void onCraftedBy(shared_ptr itemInstance, Level *level, shared_ptr player); - shared_ptr getUpdatePacket(shared_ptr itemInstance, Level *level, shared_ptr player); + static std::shared_ptr getSavedData(short idNum, Level *level); + std::shared_ptr getSavedData(std::shared_ptr itemInstance, Level *level); + void update(Level *level, std::shared_ptr player, std::shared_ptr data); + virtual void inventoryTick(std::shared_ptr itemInstance, Level *level, std::shared_ptr owner, int slot, bool selected); + virtual void onCraftedBy(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); + std::shared_ptr getUpdatePacket(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); }; diff --git a/Minecraft.World/MapItemSavedData.cpp b/Minecraft.World/MapItemSavedData.cpp index d69a7f53..ab6d7819 100644 --- a/Minecraft.World/MapItemSavedData.cpp +++ b/Minecraft.World/MapItemSavedData.cpp @@ -23,7 +23,7 @@ MapItemSavedData::MapDecoration::MapDecoration(char img, char x, char y, char ro this->visible = visible; } -MapItemSavedData::HoldingPlayer::HoldingPlayer(shared_ptr player, const MapItemSavedData *parent) : parent( parent ), player( player ) +MapItemSavedData::HoldingPlayer::HoldingPlayer(std::shared_ptr player, const MapItemSavedData *parent) : parent( parent ), player( player ) { // inited outside of ctor rowsDirtyMin = intArray(MapItem::IMAGE_WIDTH); @@ -48,12 +48,12 @@ MapItemSavedData::HoldingPlayer::~HoldingPlayer() delete lastSentDecorations.data; } -charArray MapItemSavedData::HoldingPlayer::nextUpdatePacket(shared_ptr itemInstance) +charArray MapItemSavedData::HoldingPlayer::nextUpdatePacket(std::shared_ptr itemInstance) { if (--sendPosTick < 0) { sendPosTick = 4; - + unsigned int playerDecorationsSize = (int)parent->decorations.size(); unsigned int nonPlayerDecorationsSize = (int)parent->nonPlayerDecorations.size(); charArray data = charArray( (playerDecorationsSize + nonPlayerDecorationsSize ) * DEC_PACKET_BYTES + 1); @@ -68,7 +68,7 @@ charArray MapItemSavedData::HoldingPlayer::nextUpdatePacket(shared_ptrimg << 4) | (md->rot & 0xF)); #endif data[i * DEC_PACKET_BYTES + 2] = md->x; - data[i * DEC_PACKET_BYTES + 3] = md->y; + data[i * DEC_PACKET_BYTES + 3] = md->y; data[i * DEC_PACKET_BYTES + 4] = md->entityId & 0xFF; data[i * DEC_PACKET_BYTES + 5] = (md->entityId>>8) & 0xFF; data[i * DEC_PACKET_BYTES + 6] = (md->entityId>>16) & 0xFF; @@ -86,7 +86,7 @@ charArray MapItemSavedData::HoldingPlayer::nextUpdatePacket(shared_ptrimg << 4) | (md->rot & 0xF)); #endif data[dataIndex * DEC_PACKET_BYTES + 2] = md->x; - data[dataIndex * DEC_PACKET_BYTES + 3] = md->y; + data[dataIndex * DEC_PACKET_BYTES + 3] = md->y; data[dataIndex * DEC_PACKET_BYTES + 4] = md->entityId & 0xFF; data[dataIndex * DEC_PACKET_BYTES + 5] = (md->entityId>>8) & 0xFF; data[dataIndex * DEC_PACKET_BYTES + 6] = (md->entityId>>16) & 0xFF; @@ -125,7 +125,7 @@ charArray MapItemSavedData::HoldingPlayer::nextUpdatePacket(shared_ptr servPlayer = dynamic_pointer_cast(player); + std::shared_ptr servPlayer = dynamic_pointer_cast(player); for (int d = 0; d < 10; d++) { int column = (tick * 11) % (MapItem::IMAGE_WIDTH); @@ -223,11 +223,11 @@ void MapItemSavedData::save(CompoundTag *tag) tag->putByteArray(L"colors", colors); } -void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr item) +void MapItemSavedData::tickCarriedBy(std::shared_ptr player, std::shared_ptr item) { if (carriedByPlayers.find(player) == carriedByPlayers.end()) { - shared_ptr hp = shared_ptr( new HoldingPlayer(player, this ) ); + std::shared_ptr hp = std::shared_ptr( new HoldingPlayer(player, this ) ); carriedByPlayers.insert( playerHoldingPlayerMapType::value_type(player, hp) ); carriedBy.push_back(hp); } @@ -237,7 +237,7 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr player, shared_ptr hp = *it; + std::shared_ptr hp = *it; // 4J Stu - Players in the same dimension as an item frame with a map need to be sent this data, so don't remove them if (hp->player->removed ) //|| (!hp->player->inventory->contains(item) && !item->isFramed() )) { - AUTO_VAR(it2, carriedByPlayers.find( (shared_ptr ) hp->player )); + AUTO_VAR(it2, carriedByPlayers.find( (std::shared_ptr ) hp->player )); if( it2 != carriedByPlayers.end() ) { carriedByPlayers.erase( it2 ); @@ -268,7 +268,7 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptrgetPlayerList(); for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3) { - shared_ptr serverPlayer = *it3; + std::shared_ptr serverPlayer = *it3; if(serverPlayer->dimension == 1) { atLeastOnePlayerInTheEnd = true; @@ -321,7 +321,7 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptrisFramed()) { //addDecoration(1, player.level, "frame-" + item.getFrame().entityId, item.getFrame().xTile, item.getFrame().zTile, item.getFrame().dir * 90); - + if( nonPlayerDecorations.find( item->getFrame()->entityId ) == nonPlayerDecorations.end() ) { float xd = (float) ( item->getFrame()->xTile - x ) / (1 << scale); @@ -354,7 +354,7 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptrentities.begin()); it != playerLevel->entities.end(); ++it) { - shared_ptr ent = *it; + std::shared_ptr ent = *it; if((ent->GetType() & eTYPE_ENEMY) == 0) continue; @@ -393,7 +393,7 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptrgetPlayerList(); for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3) { - shared_ptr decorationPlayer = *it3; + std::shared_ptr decorationPlayer = *it3; if(decorationPlayer!=NULL && decorationPlayer->dimension == this->dimension) { float xd = (float) (decorationPlayer->x - x) / (1 << scale); @@ -470,12 +470,12 @@ void MapItemSavedData::tickCarriedBy(shared_ptr player, shared_ptr itemInstance, Level *level, shared_ptr player) +charArray MapItemSavedData::getUpdatePacket(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { AUTO_VAR(it, carriedByPlayers.find(player)); if (it == carriedByPlayers.end() ) return charArray(); - shared_ptr hp = it->second; + std::shared_ptr hp = it->second; return hp->nextUpdatePacket(itemInstance); } @@ -486,7 +486,7 @@ void MapItemSavedData::setDirty(int x, int y0, int y1) AUTO_VAR(itEnd, carriedBy.end()); for (AUTO_VAR(it, carriedBy.begin()); it != itEnd; it++) { - shared_ptr hp = *it; //carriedBy.at(i); + std::shared_ptr hp = *it; //carriedBy.at(i); if (hp->rowsDirtyMin[x] < 0 || hp->rowsDirtyMin[x] > y0) hp->rowsDirtyMin[x] = y0; if (hp->rowsDirtyMax[x] < 0 || hp->rowsDirtyMax[x] < y1) hp->rowsDirtyMax[x] = y1; } @@ -534,7 +534,7 @@ void MapItemSavedData::handleComplexItemData(charArray &data) // 4J Added // We only have one map per player per dimension, so if they pickup someone elses map we merge their map data with ours // so that we can see everything that they discovered but still only have one map data ourself -void MapItemSavedData::mergeInMapData(shared_ptr dataToAdd) +void MapItemSavedData::mergeInMapData(std::shared_ptr dataToAdd) { int w = MapItem::IMAGE_WIDTH; int h = MapItem::IMAGE_HEIGHT; @@ -555,14 +555,14 @@ void MapItemSavedData::mergeInMapData(shared_ptr dataToAdd) colors[x + z * w] = newColor; } } - if (yd0 <= yd1) + if (yd0 <= yd1) { setDirty(x, yd0, yd1); } } } -void MapItemSavedData::removeItemFrameDecoration(shared_ptr item) +void MapItemSavedData::removeItemFrameDecoration(std::shared_ptr item) { AUTO_VAR(frameDecoration, nonPlayerDecorations.find( item->getFrame()->entityId ) ); if ( frameDecoration != nonPlayerDecorations.end() ) diff --git a/Minecraft.World/MapItemSavedData.h b/Minecraft.World/MapItemSavedData.h index fcbe5e30..79e85132 100644 --- a/Minecraft.World/MapItemSavedData.h +++ b/Minecraft.World/MapItemSavedData.h @@ -28,7 +28,7 @@ public: class HoldingPlayer { public: - const shared_ptr player; + const std::shared_ptr player; intArray rowsDirtyMin; intArray rowsDirtyMax; @@ -42,9 +42,9 @@ public: public: // 4J Stu - Had to add a reference to the MapItemSavedData object that created us as we try to access it's member variables - HoldingPlayer(shared_ptr player, const MapItemSavedData *parent); + HoldingPlayer(std::shared_ptr player, const MapItemSavedData *parent); ~HoldingPlayer(); - charArray nextUpdatePacket(shared_ptr itemInstance); + charArray nextUpdatePacket(std::shared_ptr itemInstance); }; public: @@ -53,10 +53,10 @@ public: byte scale; byteArray colors; int step; - vector > carriedBy; + vector > carriedBy; private: - typedef unordered_map , shared_ptr , PlayerKeyHash, PlayerKeyEq> playerHoldingPlayerMapType; + typedef unordered_map , std::shared_ptr , PlayerKeyHash, PlayerKeyEq> playerHoldingPlayerMapType; playerHoldingPlayerMapType carriedByPlayers; public: @@ -75,15 +75,15 @@ public: virtual void load(CompoundTag *tag); virtual void save(CompoundTag *tag); - void tickCarriedBy(shared_ptr player, shared_ptr item); + void tickCarriedBy(std::shared_ptr player, std::shared_ptr item); - charArray getUpdatePacket(shared_ptr itemInstance, Level *level, shared_ptr player); + charArray getUpdatePacket(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); using SavedData::setDirty; void setDirty(int x, int y0, int y1); void handleComplexItemData(charArray &data); // 4J Stu Added - void mergeInMapData(shared_ptr dataToAdd); - void removeItemFrameDecoration(shared_ptr item); + void mergeInMapData(std::shared_ptr dataToAdd); + void removeItemFrameDecoration(std::shared_ptr item); }; diff --git a/Minecraft.World/McRegionLevelStorage.cpp b/Minecraft.World/McRegionLevelStorage.cpp index 687ee048..1727670f 100644 --- a/Minecraft.World/McRegionLevelStorage.cpp +++ b/Minecraft.World/McRegionLevelStorage.cpp @@ -20,13 +20,13 @@ McRegionLevelStorage::~McRegionLevelStorage() RegionFileCache::clear(); } -ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension) +ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension) { //File folder = getFolder(); if (dynamic_cast(dimension) != NULL) { - + if(app.GetResetNether()) { #ifdef SPLIT_SAVES @@ -43,7 +43,7 @@ ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension) #else vector *netherFiles = m_saveFile->getFilesWithPrefix(LevelStorage::NETHER_FOLDER); if(netherFiles!=NULL) - { + { for(AUTO_VAR(it, netherFiles->begin()); it != netherFiles->end(); ++it) { m_saveFile->deleteFile(*it); @@ -56,13 +56,13 @@ ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension) return new McRegionChunkStorage(m_saveFile, LevelStorage::NETHER_FOLDER); } - + if (dynamic_cast(dimension)) { //File dir2 = new File(folder, LevelStorage.ENDER_FOLDER); //dir2.mkdirs(); //return new ThreadedMcRegionChunkStorage(dir2); - + // 4J-PB - save version 0 at this point means it's a create new world int iSaveVersion=m_saveFile->getSaveVersion(); @@ -75,7 +75,7 @@ ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension) // 4J-PB - There will be no End in early saves if(endFiles!=NULL) - { + { for(AUTO_VAR(it, endFiles->begin()); it != endFiles->end(); ++it) { m_saveFile->deleteFile(*it); @@ -89,7 +89,7 @@ ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension) return new McRegionChunkStorage(m_saveFile, L""); } -void McRegionLevelStorage::saveLevelData(LevelData *levelData, vector > *players) +void McRegionLevelStorage::saveLevelData(LevelData *levelData, vector > *players) { levelData->setVersion(MCREGION_VERSION_ID); MemSect(38); @@ -97,7 +97,7 @@ void McRegionLevelStorage::saveLevelData(LevelData *levelData, vector > *players); + virtual void saveLevelData(LevelData *levelData, vector > *players); virtual void closeAll(); }; \ No newline at end of file diff --git a/Minecraft.World/McRegionLevelStorageSource.cpp b/Minecraft.World/McRegionLevelStorageSource.cpp index 0652ad84..48531944 100644 --- a/Minecraft.World/McRegionLevelStorageSource.cpp +++ b/Minecraft.World/McRegionLevelStorageSource.cpp @@ -44,7 +44,7 @@ vector *McRegionLevelStorageSource::getLevelList() { file = *it; //subFolders->at(i); - if (file->isDirectory()) + if (file->isDirectory()) { continue; } @@ -74,13 +74,13 @@ void McRegionLevelStorageSource::clearAll() { } -shared_ptr McRegionLevelStorageSource::selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir) +std::shared_ptr McRegionLevelStorageSource::selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir) { // return new LevelStorageProfilerDecorator(new McRegionLevelStorage(baseDir, levelId, createPlayerDir)); - return shared_ptr(new McRegionLevelStorage(saveFile, baseDir, levelId, createPlayerDir)); + return std::shared_ptr(new McRegionLevelStorage(saveFile, baseDir, levelId, createPlayerDir)); } -bool McRegionLevelStorageSource::isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId) +bool McRegionLevelStorageSource::isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId) { // check if there is old file format level data LevelData *levelData = getDataTagFor(saveFile, levelId); @@ -145,7 +145,7 @@ bool McRegionLevelStorageSource::convertLevel(ConsoleSaveFile *saveFile, const w } int totalCount = normalRegions->size() + netherRegions->size() + enderRegions.size() + normalBaseFolders->size() + netherBaseFolders->size() + enderBaseFolders.size(); - + // System.out.println("Total conversion count is " + totalCount); 4J Jev, TODO // convert normal world @@ -173,7 +173,7 @@ bool McRegionLevelStorageSource::convertLevel(ConsoleSaveFile *saveFile, const w #if 0 // 4J - not required anymore -void McRegionLevelStorageSource::addRegions(File &baseFolder, vector *dest, vector *firstLevelFolders) +void McRegionLevelStorageSource::addRegions(File &baseFolder, vector *dest, vector *firstLevelFolders) { FolderFilter folderFilter; ChunkFilter chunkFilter; @@ -210,7 +210,7 @@ void McRegionLevelStorageSource::addRegions(File &baseFolder, vector *chunkFiles, int currentCount, int totalCount, ProgressListener *progress) +void McRegionLevelStorageSource::convertRegions(File &baseFolder, vector *chunkFiles, int currentCount, int totalCount, ProgressListener *progress) { assert( false ); @@ -238,7 +238,7 @@ void McRegionLevelStorageSource::convertRegions(File &baseFolder, vectorgetZ(); RegionFile *region = RegionFileCache::getRegionFile(baseFolder, x, z); - if (!region->hasChunk(x & 31, z & 31)) + if (!region->hasChunk(x & 31, z & 31)) { FileInputStream fis = new BufferedInputStream(FileInputStream(*chunkFile->getFile())); DataInputStream istream = DataInputStream(&fis); // 4J - was new GZIPInputStream as well @@ -289,7 +289,7 @@ void McRegionLevelStorageSource::eraseFolders(vector *folders, int curre #if 0 // 4J - not required anymore -bool McRegionLevelStorageSource::FolderFilter::accept(File *file) +bool McRegionLevelStorageSource::FolderFilter::accept(File *file) { if (file->isDirectory()) { @@ -300,23 +300,23 @@ bool McRegionLevelStorageSource::FolderFilter::accept(File *file) } -bool McRegionLevelStorageSource::ChunkFilter::accept(File *dir, const wstring& name) +bool McRegionLevelStorageSource::ChunkFilter::accept(File *dir, const wstring& name) { Matcher matcher( chunkFilePattern, name ); return matcher.matches(); } -McRegionLevelStorageSource::ChunkFile::ChunkFile(File *file) +McRegionLevelStorageSource::ChunkFile::ChunkFile(File *file) { this->file = file; Matcher matcher( ChunkFilter::chunkFilePattern, file->getName() ); - if (matcher.matches()) + if (matcher.matches()) { x = Integer::parseInt(matcher.group(1), 36); z = Integer::parseInt(matcher.group(2), 36); - } + } else { x = 0; @@ -348,17 +348,17 @@ bool McRegionLevelStorageSource::ChunkFile::operator<( ChunkFile *b ) return compareTo( b ) < 0; } -File *McRegionLevelStorageSource::ChunkFile::getFile() +File *McRegionLevelStorageSource::ChunkFile::getFile() { return (File *) file; } -int McRegionLevelStorageSource::ChunkFile::getX() +int McRegionLevelStorageSource::ChunkFile::getX() { return x; } -int McRegionLevelStorageSource::ChunkFile::getZ() +int McRegionLevelStorageSource::ChunkFile::getZ() { return z; } diff --git a/Minecraft.World/McRegionLevelStorageSource.h b/Minecraft.World/McRegionLevelStorageSource.h index d1a4bf30..0f6b940d 100644 --- a/Minecraft.World/McRegionLevelStorageSource.h +++ b/Minecraft.World/McRegionLevelStorageSource.h @@ -17,7 +17,7 @@ public: virtual wstring getName(); virtual vector *getLevelList(); virtual void clearAll(); - virtual shared_ptr selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir); + virtual std::shared_ptr selectLevel(ConsoleSaveFile *saveFile, const wstring& levelId, bool createPlayerDir); virtual bool isConvertible(ConsoleSaveFile *saveFile, const wstring& levelId); virtual bool requiresConversion(ConsoleSaveFile *saveFile, const wstring& levelId); virtual bool convertLevel(ConsoleSaveFile *saveFile, const wstring& levelId, ProgressListener *progress); @@ -33,14 +33,14 @@ private: public: #if 0 // 4J - not required anymore - static class FolderFilter : public FileFilter + static class FolderFilter : public FileFilter { public: static const std::tr1::wregex chunkFolderPattern; // was Pattern bool accept(File *file); }; - static class ChunkFilter : public FilenameFilter + static class ChunkFilter : public FilenameFilter { public: static const std::tr1::wregex chunkFilePattern; // was Pattern diff --git a/Minecraft.World/MeleeAttackGoal.cpp b/Minecraft.World/MeleeAttackGoal.cpp index f3aa6455..bf779234 100644 --- a/Minecraft.World/MeleeAttackGoal.cpp +++ b/Minecraft.World/MeleeAttackGoal.cpp @@ -41,7 +41,7 @@ MeleeAttackGoal::~MeleeAttackGoal() bool MeleeAttackGoal::canUse() { - shared_ptr bestTarget = mob->getTarget(); + std::shared_ptr bestTarget = mob->getTarget(); if (bestTarget == NULL) return false; if(!bestTarget->isAlive()) return false; if (attackType != eTYPE_NOTSET && (attackType & bestTarget->GetType()) != attackType) return false; @@ -53,7 +53,7 @@ bool MeleeAttackGoal::canUse() bool MeleeAttackGoal::canContinueToUse() { - shared_ptr bestTarget = mob->getTarget(); + std::shared_ptr bestTarget = mob->getTarget(); if (bestTarget == NULL) return false; if (target.lock() == NULL || !target.lock()->isAlive()) return false; if (!trackTarget) return !mob->getNavigation()->isDone(); diff --git a/Minecraft.World/MemoryLevelStorage.cpp b/Minecraft.World/MemoryLevelStorage.cpp index 5a1d43bb..bc069fc3 100644 --- a/Minecraft.World/MemoryLevelStorage.cpp +++ b/Minecraft.World/MemoryLevelStorage.cpp @@ -17,7 +17,7 @@ LevelData *MemoryLevelStorage::prepareLevel() return NULL; } -void MemoryLevelStorage::checkSession() +void MemoryLevelStorage::checkSession() { } @@ -26,7 +26,7 @@ ChunkStorage *MemoryLevelStorage::createChunkStorage(Dimension *dimension) return new MemoryChunkStorage(); } -void MemoryLevelStorage::saveLevelData(LevelData *levelData, vector > *players) +void MemoryLevelStorage::saveLevelData(LevelData *levelData, vector > *players) { } @@ -43,21 +43,21 @@ void MemoryLevelStorage::closeAll() { } -void MemoryLevelStorage::save(shared_ptr player) +void MemoryLevelStorage::save(std::shared_ptr player) { } -bool MemoryLevelStorage::load(shared_ptr player) +bool MemoryLevelStorage::load(std::shared_ptr player) { return false; } -CompoundTag *MemoryLevelStorage::loadPlayerDataTag(const wstring& playerName) +CompoundTag *MemoryLevelStorage::loadPlayerDataTag(const wstring& playerName) { return NULL; } -ConsoleSavePath MemoryLevelStorage::getDataFile(const wstring& id) +ConsoleSavePath MemoryLevelStorage::getDataFile(const wstring& id) { return ConsoleSaveFile(wstring(L"")); } \ No newline at end of file diff --git a/Minecraft.World/MemoryLevelStorage.h b/Minecraft.World/MemoryLevelStorage.h index 21ea784c..43af38c7 100644 --- a/Minecraft.World/MemoryLevelStorage.h +++ b/Minecraft.World/MemoryLevelStorage.h @@ -13,19 +13,19 @@ using namespace std; #include "ConsoleSaveFile.h" -class MemoryLevelStorage : public LevelStorage, public PlayerIO +class MemoryLevelStorage : public LevelStorage, public PlayerIO { public: MemoryLevelStorage(); virtual LevelData *prepareLevel(); virtual void checkSession(); virtual ChunkStorage *createChunkStorage(Dimension *dimension); - virtual void saveLevelData(LevelData *levelData, vector > *players); + virtual void saveLevelData(LevelData *levelData, vector > *players); virtual void saveLevelData(LevelData *levelData); virtual PlayerIO *getPlayerIO(); virtual void closeAll(); - virtual void save(shared_ptr player); - virtual bool load(shared_ptr player); + virtual void save(std::shared_ptr player); + virtual bool load(std::shared_ptr player); virtual CompoundTag *loadPlayerDataTag(const wstring& playerName); virtual ConsoleSavePath getDataFile(const wstring& id); }; \ No newline at end of file diff --git a/Minecraft.World/MemoryLevelStorageSource.cpp b/Minecraft.World/MemoryLevelStorageSource.cpp index db0cfa58..92a1b2c3 100644 --- a/Minecraft.World/MemoryLevelStorageSource.cpp +++ b/Minecraft.World/MemoryLevelStorageSource.cpp @@ -13,12 +13,12 @@ wstring MemoryLevelStorageSource::getName() return L"Memory Storage"; } -shared_ptr MemoryLevelStorageSource::selectLevel(const wstring& levelId, bool createPlayerDir) +std::shared_ptr MemoryLevelStorageSource::selectLevel(const wstring& levelId, bool createPlayerDir) { - return shared_ptr () new MemoryLevelStorage()); + return std::shared_ptr () new MemoryLevelStorage()); } -vector *MemoryLevelStorageSource::getLevelList() +vector *MemoryLevelStorageSource::getLevelList() { return new vector; } @@ -32,12 +32,12 @@ LevelData *MemoryLevelStorageSource::getDataTagFor(const wstring& levelId) return NULL; } -bool MemoryLevelStorageSource::isNewLevelIdAcceptable(const wstring& levelId) +bool MemoryLevelStorageSource::isNewLevelIdAcceptable(const wstring& levelId) { return true; } -void MemoryLevelStorageSource::deleteLevel(const wstring& levelId) +void MemoryLevelStorageSource::deleteLevel(const wstring& levelId) { } diff --git a/Minecraft.World/MemoryLevelStorageSource.h b/Minecraft.World/MemoryLevelStorageSource.h index c53c0463..0f7d6ef2 100644 --- a/Minecraft.World/MemoryLevelStorageSource.h +++ b/Minecraft.World/MemoryLevelStorageSource.h @@ -3,12 +3,12 @@ using namespace std; #include "LevelStorageSource.h" -class MemoryLevelStorageSource : public LevelStorageSource +class MemoryLevelStorageSource : public LevelStorageSource { public: MemoryLevelStorageSource(); wstring getName(); - shared_ptr selectLevel(const wstring& levelId, bool createPlayerDir); + std::shared_ptr selectLevel(const wstring& levelId, bool createPlayerDir); vector *getLevelList(); void clearAll(); LevelData *getDataTagFor(const wstring& levelId); diff --git a/Minecraft.World/MenuBackup.cpp b/Minecraft.World/MenuBackup.cpp index 6d09f3e3..71ea3d38 100644 --- a/Minecraft.World/MenuBackup.cpp +++ b/Minecraft.World/MenuBackup.cpp @@ -5,7 +5,7 @@ #include "Slot.h" #include "MenuBackup.h" -MenuBackup::MenuBackup(shared_ptr inventory, AbstractContainerMenu *menu) +MenuBackup::MenuBackup(std::shared_ptr inventory, AbstractContainerMenu *menu) { backups = new unordered_map(); diff --git a/Minecraft.World/MenuBackup.h b/Minecraft.World/MenuBackup.h index 2de750b1..27df45da 100644 --- a/Minecraft.World/MenuBackup.h +++ b/Minecraft.World/MenuBackup.h @@ -7,11 +7,11 @@ class MenuBackup { private: unordered_map *backups; - shared_ptr inventory; + std::shared_ptr inventory; AbstractContainerMenu *menu; public: - MenuBackup(shared_ptr inventory, AbstractContainerMenu *menu); + MenuBackup(std::shared_ptr inventory, AbstractContainerMenu *menu); void save(short changeUid); diff --git a/Minecraft.World/Merchant.h b/Minecraft.World/Merchant.h index 8b4b7a69..ad7ab1fc 100644 --- a/Minecraft.World/Merchant.h +++ b/Minecraft.World/Merchant.h @@ -7,11 +7,11 @@ class Player; class Merchant { public: - virtual void setTradingPlayer(shared_ptr player) = 0; - virtual shared_ptr getTradingPlayer() = 0; - virtual MerchantRecipeList *getOffers(shared_ptr forPlayer) = 0; + virtual void setTradingPlayer(std::shared_ptr player) = 0; + virtual std::shared_ptr getTradingPlayer() = 0; + virtual MerchantRecipeList *getOffers(std::shared_ptr forPlayer) = 0; virtual void overrideOffers(MerchantRecipeList *recipeList) = 0; virtual void notifyTrade(MerchantRecipe *activeRecipe) = 0; - virtual void notifyTradeUpdated(shared_ptr item) = 0; + virtual void notifyTradeUpdated(std::shared_ptr item) = 0; virtual int getDisplayName() = 0; }; \ No newline at end of file diff --git a/Minecraft.World/MerchantContainer.cpp b/Minecraft.World/MerchantContainer.cpp index cadbe4e3..9ca871e3 100644 --- a/Minecraft.World/MerchantContainer.cpp +++ b/Minecraft.World/MerchantContainer.cpp @@ -3,7 +3,7 @@ #include "MerchantMenu.h" #include "MerchantContainer.h" -MerchantContainer::MerchantContainer(shared_ptr player, shared_ptr villager) +MerchantContainer::MerchantContainer(std::shared_ptr player, std::shared_ptr villager) { this->player = player; merchant = villager; @@ -25,24 +25,24 @@ unsigned int MerchantContainer::getContainerSize() return items.length; } -shared_ptr MerchantContainer::getItem(unsigned int slot) +std::shared_ptr MerchantContainer::getItem(unsigned int slot) { return items[slot]; } -shared_ptr MerchantContainer::removeItem(unsigned int slot, int count) +std::shared_ptr MerchantContainer::removeItem(unsigned int slot, int count) { if (items[slot] != NULL) { if (slot == MerchantMenu::RESULT_SLOT) { - shared_ptr item = items[slot]; + std::shared_ptr item = items[slot]; items[slot] = nullptr; return item; } if (items[slot]->count <= count) { - shared_ptr item = items[slot]; + std::shared_ptr item = items[slot]; items[slot] = nullptr; if (isPaymentSlot(slot)) { @@ -52,7 +52,7 @@ shared_ptr MerchantContainer::removeItem(unsigned int slot, int co } else { - shared_ptr i = items[slot]->remove(count); + std::shared_ptr i = items[slot]->remove(count); if (items[slot]->count == 0) items[slot] = nullptr; if (isPaymentSlot(slot)) { @@ -69,18 +69,18 @@ bool MerchantContainer::isPaymentSlot(int slot) return slot == MerchantMenu::PAYMENT1_SLOT || slot == MerchantMenu::PAYMENT2_SLOT; } -shared_ptr MerchantContainer::removeItemNoUpdate(int slot) +std::shared_ptr MerchantContainer::removeItemNoUpdate(int slot) { if (items[slot] != NULL) { - shared_ptr item = items[slot]; + std::shared_ptr item = items[slot]; items[slot] = nullptr; return item; } return nullptr; } -void MerchantContainer::setItem(unsigned int slot, shared_ptr item) +void MerchantContainer::setItem(unsigned int slot, std::shared_ptr item) { items[slot] = item; if (item != NULL && item->count > getMaxStackSize()) item->count = getMaxStackSize(); @@ -100,7 +100,7 @@ int MerchantContainer::getMaxStackSize() return Container::LARGE_MAX_STACK_SIZE; } -bool MerchantContainer::stillValid(shared_ptr player) +bool MerchantContainer::stillValid(std::shared_ptr player) { return merchant->getTradingPlayer() == player; } @@ -122,8 +122,8 @@ void MerchantContainer::updateSellItem() { activeRecipe = NULL; - shared_ptr buyItem1 = items[MerchantMenu::PAYMENT1_SLOT]; - shared_ptr buyItem2 = items[MerchantMenu::PAYMENT2_SLOT]; + std::shared_ptr buyItem1 = items[MerchantMenu::PAYMENT1_SLOT]; + std::shared_ptr buyItem2 = items[MerchantMenu::PAYMENT2_SLOT]; if (buyItem1 == NULL) { diff --git a/Minecraft.World/MerchantContainer.h b/Minecraft.World/MerchantContainer.h index efba13d6..9f4efe33 100644 --- a/Minecraft.World/MerchantContainer.h +++ b/Minecraft.World/MerchantContainer.h @@ -10,29 +10,29 @@ class MerchantRecipe; class MerchantContainer : public Container { private: - shared_ptr merchant; + std::shared_ptr merchant; ItemInstanceArray items; - shared_ptr player; + std::shared_ptr player; MerchantRecipe *activeRecipe; int selectionHint; public: - MerchantContainer(shared_ptr player, shared_ptr villager); + MerchantContainer(std::shared_ptr player, std::shared_ptr villager); ~MerchantContainer(); unsigned int getContainerSize(); - shared_ptr getItem(unsigned int slot); - shared_ptr removeItem(unsigned int slot, int count); + std::shared_ptr getItem(unsigned int slot); + std::shared_ptr removeItem(unsigned int slot, int count); private: bool isPaymentSlot(int slot); public: - shared_ptr removeItemNoUpdate(int slot); - void setItem(unsigned int slot, shared_ptr item); + std::shared_ptr removeItemNoUpdate(int slot); + void setItem(unsigned int slot, std::shared_ptr item); int getName(); int getMaxStackSize(); - bool stillValid(shared_ptr player); + bool stillValid(std::shared_ptr player); void startOpen(); void stopOpen(); void setChanged(); diff --git a/Minecraft.World/MerchantMenu.cpp b/Minecraft.World/MerchantMenu.cpp index a6dfca1f..50f9fbdf 100644 --- a/Minecraft.World/MerchantMenu.cpp +++ b/Minecraft.World/MerchantMenu.cpp @@ -5,12 +5,12 @@ #include "net.minecraft.world.level.h" #include "MerchantMenu.h" -MerchantMenu::MerchantMenu(shared_ptr inventory, shared_ptr merchant, Level *level) +MerchantMenu::MerchantMenu(std::shared_ptr inventory, std::shared_ptr merchant, Level *level) { trader = merchant; this->level = level; - tradeContainer = shared_ptr( new MerchantContainer(dynamic_pointer_cast(inventory->player->shared_from_this()), merchant) ); + tradeContainer = std::shared_ptr( new MerchantContainer(dynamic_pointer_cast(inventory->player->shared_from_this()), merchant) ); addSlot(new Slot(tradeContainer, PAYMENT1_SLOT, SELLSLOT1_X, ROW2_Y)); addSlot(new Slot(tradeContainer, PAYMENT2_SLOT, SELLSLOT2_X, ROW2_Y)); addSlot(new MerchantResultSlot(inventory->player, merchant, tradeContainer, RESULT_SLOT, BUYSLOT_X, ROW2_Y)); @@ -28,7 +28,7 @@ MerchantMenu::MerchantMenu(shared_ptr inventory, shared_ptr } } -shared_ptr MerchantMenu::getTradeContainer() +std::shared_ptr MerchantMenu::getTradeContainer() { return tradeContainer; } @@ -43,7 +43,7 @@ void MerchantMenu::broadcastChanges() AbstractContainerMenu::broadcastChanges(); } -// 4J used to take a shared_ptr but wasn't using it, so removed to simplify things +// 4J used to take a std::shared_ptr but wasn't using it, so removed to simplify things void MerchantMenu::slotsChanged() { tradeContainer->updateSellItem(); @@ -59,20 +59,20 @@ void MerchantMenu::setData(int id, int value) { } -bool MerchantMenu::stillValid(shared_ptr player) +bool MerchantMenu::stillValid(std::shared_ptr player) { return trader->getTradingPlayer() == player; } -shared_ptr MerchantMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr MerchantMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = NULL; - + if(slotIndex < slots->size()) slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex == RESULT_SLOT) @@ -124,7 +124,7 @@ shared_ptr MerchantMenu::quickMoveStack(shared_ptr player, return clicked; } -void MerchantMenu::removed(shared_ptr player) +void MerchantMenu::removed(std::shared_ptr player) { AbstractContainerMenu::removed(player); trader->setTradingPlayer(nullptr); @@ -132,7 +132,7 @@ void MerchantMenu::removed(shared_ptr player) AbstractContainerMenu::removed(player); if (level->isClientSide) return; - shared_ptr item = tradeContainer->removeItemNoUpdate(PAYMENT1_SLOT); + std::shared_ptr item = tradeContainer->removeItemNoUpdate(PAYMENT1_SLOT); if (item) { player->drop(item); @@ -144,7 +144,7 @@ void MerchantMenu::removed(shared_ptr player) } } -shared_ptr MerchantMenu::getMerchant() +std::shared_ptr MerchantMenu::getMerchant() { return trader; } \ No newline at end of file diff --git a/Minecraft.World/MerchantMenu.h b/Minecraft.World/MerchantMenu.h index 14a5fa1d..23b63998 100644 --- a/Minecraft.World/MerchantMenu.h +++ b/Minecraft.World/MerchantMenu.h @@ -25,22 +25,22 @@ public: private: - shared_ptr trader; - shared_ptr tradeContainer; + std::shared_ptr trader; + std::shared_ptr tradeContainer; Level *level; public: - MerchantMenu(shared_ptr inventory, shared_ptr merchant, Level *level); + MerchantMenu(std::shared_ptr inventory, std::shared_ptr merchant, Level *level); - shared_ptr getTradeContainer(); + std::shared_ptr getTradeContainer(); void addSlotListener(ContainerListener *listener); void broadcastChanges(); - void slotsChanged(); // 4J used to take a shared_ptr but wasn't using it, so removed to simplify things + void slotsChanged(); // 4J used to take a std::shared_ptr but wasn't using it, so removed to simplify things void setSelectionHint(int hint); void setData(int id, int value); - bool stillValid(shared_ptr player); - shared_ptr quickMoveStack(shared_ptr player, int slotIndex); - void removed(shared_ptr player); + bool stillValid(std::shared_ptr player); + std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); + void removed(std::shared_ptr player); - shared_ptr getMerchant(); // 4J Added + std::shared_ptr getMerchant(); // 4J Added }; \ No newline at end of file diff --git a/Minecraft.World/MerchantRecipe.cpp b/Minecraft.World/MerchantRecipe.cpp index b772b0c7..84fdc744 100644 --- a/Minecraft.World/MerchantRecipe.cpp +++ b/Minecraft.World/MerchantRecipe.cpp @@ -2,7 +2,7 @@ #include "MerchantRecipe.h" -void MerchantRecipe::_init(shared_ptr buyA, shared_ptr buyB, shared_ptr sell) +void MerchantRecipe::_init(std::shared_ptr buyA, std::shared_ptr buyB, std::shared_ptr sell) { this->buyA = buyA; this->buyB = buyB; @@ -20,34 +20,34 @@ MerchantRecipe::MerchantRecipe(CompoundTag *tag) load(tag); } -MerchantRecipe::MerchantRecipe(shared_ptr buyA, shared_ptr buyB, shared_ptr sell, int uses, int maxUses) +MerchantRecipe::MerchantRecipe(std::shared_ptr buyA, std::shared_ptr buyB, std::shared_ptr sell, int uses, int maxUses) { _init(buyA, buyB, sell); this->uses = uses; this->maxUses = maxUses; } -MerchantRecipe::MerchantRecipe(shared_ptr buy, shared_ptr sell) +MerchantRecipe::MerchantRecipe(std::shared_ptr buy, std::shared_ptr sell) { _init(buy, nullptr, sell); } -MerchantRecipe::MerchantRecipe(shared_ptr buy, Item *sell) +MerchantRecipe::MerchantRecipe(std::shared_ptr buy, Item *sell) { - _init(buy, nullptr, shared_ptr(new ItemInstance(sell))); + _init(buy, nullptr, std::shared_ptr(new ItemInstance(sell))); } -MerchantRecipe::MerchantRecipe(shared_ptr buy, Tile *sell) +MerchantRecipe::MerchantRecipe(std::shared_ptr buy, Tile *sell) { - _init(buy, nullptr, shared_ptr(new ItemInstance(sell))); + _init(buy, nullptr, std::shared_ptr(new ItemInstance(sell))); } -shared_ptr MerchantRecipe::getBuyAItem() +std::shared_ptr MerchantRecipe::getBuyAItem() { return buyA; } -shared_ptr MerchantRecipe::getBuyBItem() +std::shared_ptr MerchantRecipe::getBuyBItem() { return buyB; } @@ -57,7 +57,7 @@ bool MerchantRecipe::hasSecondaryBuyItem() return buyB != NULL; } -shared_ptr MerchantRecipe::getSellItem() +std::shared_ptr MerchantRecipe::getSellItem() { return sell; } diff --git a/Minecraft.World/MerchantRecipe.h b/Minecraft.World/MerchantRecipe.h index 0ed84898..dd684b6a 100644 --- a/Minecraft.World/MerchantRecipe.h +++ b/Minecraft.World/MerchantRecipe.h @@ -3,25 +3,25 @@ class MerchantRecipe { private: - shared_ptr buyA; - shared_ptr buyB; - shared_ptr sell; + std::shared_ptr buyA; + std::shared_ptr buyB; + std::shared_ptr sell; int uses; int maxUses; - void _init(shared_ptr buyA, shared_ptr buyB, shared_ptr sell); + void _init(std::shared_ptr buyA, std::shared_ptr buyB, std::shared_ptr sell); public: MerchantRecipe(CompoundTag *tag); - MerchantRecipe(shared_ptr buyA, shared_ptr buyB, shared_ptr sell, int uses = 0, int maxUses = 7); - MerchantRecipe(shared_ptr buy, shared_ptr sell); - MerchantRecipe(shared_ptr buy, Item *sell); - MerchantRecipe(shared_ptr buy, Tile *sell); + MerchantRecipe(std::shared_ptr buyA, std::shared_ptr buyB, std::shared_ptr sell, int uses = 0, int maxUses = 7); + MerchantRecipe(std::shared_ptr buy, std::shared_ptr sell); + MerchantRecipe(std::shared_ptr buy, Item *sell); + MerchantRecipe(std::shared_ptr buy, Tile *sell); - shared_ptr getBuyAItem(); - shared_ptr getBuyBItem(); + std::shared_ptr getBuyAItem(); + std::shared_ptr getBuyBItem(); bool hasSecondaryBuyItem(); - shared_ptr getSellItem(); + std::shared_ptr getSellItem(); bool isSame(MerchantRecipe *other); bool isSameSameButBetter(MerchantRecipe *other); int getUses(); diff --git a/Minecraft.World/MerchantRecipeList.cpp b/Minecraft.World/MerchantRecipeList.cpp index bd7a126c..26436b59 100644 --- a/Minecraft.World/MerchantRecipeList.cpp +++ b/Minecraft.World/MerchantRecipeList.cpp @@ -19,7 +19,7 @@ MerchantRecipeList::~MerchantRecipeList() } } -MerchantRecipe *MerchantRecipeList::getRecipeFor(shared_ptr buyA, shared_ptr buyB, int selectionHint) +MerchantRecipe *MerchantRecipeList::getRecipeFor(std::shared_ptr buyA, std::shared_ptr buyB, int selectionHint) { if (selectionHint > 0 && selectionHint < m_recipes.size()) { @@ -67,7 +67,7 @@ bool MerchantRecipeList::addIfNewOrBetter(MerchantRecipe *recipe) return true; } -MerchantRecipe *MerchantRecipeList::getMatchingRecipeFor(shared_ptr buy, shared_ptr buyB, shared_ptr sell) +MerchantRecipe *MerchantRecipeList::getMatchingRecipeFor(std::shared_ptr buy, std::shared_ptr buyB, std::shared_ptr sell) { for (int i = 0; i < m_recipes.size(); i++) { @@ -92,7 +92,7 @@ void MerchantRecipeList::writeToStream(DataOutputStream *stream) Packet::writeItem(r->getBuyAItem(), stream); Packet::writeItem(r->getSellItem(), stream); - shared_ptr buyBItem = r->getBuyBItem(); + std::shared_ptr buyBItem = r->getBuyBItem(); stream->writeBoolean(buyBItem != NULL); if (buyBItem != NULL) { @@ -111,10 +111,10 @@ MerchantRecipeList *MerchantRecipeList::createFromStream(DataInputStream *stream int count = (int) (stream->readByte() & 0xff); for (int i = 0; i < count; i++) { - shared_ptr buy = Packet::readItem(stream); - shared_ptr sell = Packet::readItem(stream); + std::shared_ptr buy = Packet::readItem(stream); + std::shared_ptr sell = Packet::readItem(stream); - shared_ptr buyB = nullptr; + std::shared_ptr buyB = nullptr; if (stream->readBoolean()) { buyB = Packet::readItem(stream); diff --git a/Minecraft.World/MerchantRecipeList.h b/Minecraft.World/MerchantRecipeList.h index 4a761d39..b3c0cd2b 100644 --- a/Minecraft.World/MerchantRecipeList.h +++ b/Minecraft.World/MerchantRecipeList.h @@ -17,9 +17,9 @@ public: MerchantRecipeList(CompoundTag *tag); ~MerchantRecipeList(); - MerchantRecipe *getRecipeFor(shared_ptr buyA, shared_ptr buyB, int selectionHint); + MerchantRecipe *getRecipeFor(std::shared_ptr buyA, std::shared_ptr buyB, int selectionHint); bool addIfNewOrBetter(MerchantRecipe *recipe); // 4J Added bool return - MerchantRecipe *getMatchingRecipeFor(shared_ptr buy, shared_ptr buyB, shared_ptr sell); + MerchantRecipe *getMatchingRecipeFor(std::shared_ptr buy, std::shared_ptr buyB, std::shared_ptr sell); void writeToStream(DataOutputStream *stream); static MerchantRecipeList *createFromStream(DataInputStream *stream); void load(CompoundTag *tag); diff --git a/Minecraft.World/MerchantResultSlot.cpp b/Minecraft.World/MerchantResultSlot.cpp index fedbcc4a..7617bdf1 100644 --- a/Minecraft.World/MerchantResultSlot.cpp +++ b/Minecraft.World/MerchantResultSlot.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.item.trading.h" #include "MerchantResultSlot.h" -MerchantResultSlot::MerchantResultSlot(Player *player, shared_ptr merchant, shared_ptr slots, int id, int x, int y) : Slot(slots, id, x, y) +MerchantResultSlot::MerchantResultSlot(Player *player, std::shared_ptr merchant, std::shared_ptr slots, int id, int x, int y) : Slot(slots, id, x, y) { this->player = player; this->merchant = merchant; @@ -11,12 +11,12 @@ MerchantResultSlot::MerchantResultSlot(Player *player, shared_ptr merc removeCount = 0; } -bool MerchantResultSlot::mayPlace(shared_ptr item) +bool MerchantResultSlot::mayPlace(std::shared_ptr item) { return false; } -shared_ptr MerchantResultSlot::remove(int c) +std::shared_ptr MerchantResultSlot::remove(int c) { if (hasItem()) { @@ -25,27 +25,27 @@ shared_ptr MerchantResultSlot::remove(int c) return Slot::remove(c); } -void MerchantResultSlot::onQuickCraft(shared_ptr picked, int count) +void MerchantResultSlot::onQuickCraft(std::shared_ptr picked, int count) { removeCount += count; checkTakeAchievements(picked); } -void MerchantResultSlot::checkTakeAchievements(shared_ptr carried) +void MerchantResultSlot::checkTakeAchievements(std::shared_ptr carried) { carried->onCraftedBy(player->level, dynamic_pointer_cast(player->shared_from_this()), removeCount); removeCount = 0; } -void MerchantResultSlot::onTake(shared_ptr player, shared_ptr carried) +void MerchantResultSlot::onTake(std::shared_ptr player, std::shared_ptr carried) { checkTakeAchievements(carried); MerchantRecipe *activeRecipe = slots->getActiveRecipe(); if (activeRecipe != NULL) { - shared_ptr item1 = slots->getItem(MerchantMenu::PAYMENT1_SLOT); - shared_ptr item2 = slots->getItem(MerchantMenu::PAYMENT2_SLOT); + std::shared_ptr item1 = slots->getItem(MerchantMenu::PAYMENT1_SLOT); + std::shared_ptr item2 = slots->getItem(MerchantMenu::PAYMENT2_SLOT); // remove payment items, but remember slots may have switched if (removePaymentItemsIfMatching(activeRecipe, item1, item2) || removePaymentItemsIfMatching(activeRecipe, item2, item1)) @@ -66,15 +66,15 @@ void MerchantResultSlot::onTake(shared_ptr player, shared_ptr second) +bool MerchantResultSlot::mayCombine(std::shared_ptr second) { return false; } -bool MerchantResultSlot::removePaymentItemsIfMatching(MerchantRecipe *activeRecipe, shared_ptr a, shared_ptr b) +bool MerchantResultSlot::removePaymentItemsIfMatching(MerchantRecipe *activeRecipe, std::shared_ptr a, std::shared_ptr b) { - shared_ptr buyA = activeRecipe->getBuyAItem(); - shared_ptr buyB = activeRecipe->getBuyBItem(); + std::shared_ptr buyA = activeRecipe->getBuyAItem(); + std::shared_ptr buyB = activeRecipe->getBuyBItem(); if (a != NULL && a->id == buyA->id) { diff --git a/Minecraft.World/MerchantResultSlot.h b/Minecraft.World/MerchantResultSlot.h index 7b8d97b6..1b45082c 100644 --- a/Minecraft.World/MerchantResultSlot.h +++ b/Minecraft.World/MerchantResultSlot.h @@ -9,25 +9,25 @@ class Merchant; class MerchantResultSlot : public Slot { private: - shared_ptr slots; + std::shared_ptr slots; Player *player; int removeCount; - shared_ptr merchant; + std::shared_ptr merchant; public: - MerchantResultSlot(Player *player, shared_ptr merchant, shared_ptr slots, int id, int x, int y); + MerchantResultSlot(Player *player, std::shared_ptr merchant, std::shared_ptr slots, int id, int x, int y); - bool mayPlace(shared_ptr item); - shared_ptr remove(int c); + bool mayPlace(std::shared_ptr item); + std::shared_ptr remove(int c); protected: - void onQuickCraft(shared_ptr picked, int count); - void checkTakeAchievements(shared_ptr carried); + void onQuickCraft(std::shared_ptr picked, int count); + void checkTakeAchievements(std::shared_ptr carried); public: - void onTake(shared_ptr player, shared_ptr carried); - virtual bool mayCombine(shared_ptr item); // 4J Added + void onTake(std::shared_ptr player, std::shared_ptr carried); + virtual bool mayCombine(std::shared_ptr item); // 4J Added private: - bool removePaymentItemsIfMatching(MerchantRecipe *activeRecipe, shared_ptr a, shared_ptr b); + bool removePaymentItemsIfMatching(MerchantRecipe *activeRecipe, std::shared_ptr a, std::shared_ptr b); }; \ No newline at end of file diff --git a/Minecraft.World/MilkBucketItem.cpp b/Minecraft.World/MilkBucketItem.cpp index 4a371078..320c57b7 100644 --- a/Minecraft.World/MilkBucketItem.cpp +++ b/Minecraft.World/MilkBucketItem.cpp @@ -8,7 +8,7 @@ MilkBucketItem::MilkBucketItem(int id) : Item( id ) setMaxStackSize(1); } -shared_ptr MilkBucketItem::useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr MilkBucketItem::useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player) { if (!player->abilities.instabuild) instance->count--; @@ -19,22 +19,22 @@ shared_ptr MilkBucketItem::useTimeDepleted(shared_ptrcount <= 0) { - return shared_ptr( new ItemInstance(Item::bucket_empty) ); + return std::shared_ptr( new ItemInstance(Item::bucket_empty) ); } return instance; } -int MilkBucketItem::getUseDuration(shared_ptr itemInstance) +int MilkBucketItem::getUseDuration(std::shared_ptr itemInstance) { return DRINK_DURATION; } -UseAnim MilkBucketItem::getUseAnimation(shared_ptr itemInstance) +UseAnim MilkBucketItem::getUseAnimation(std::shared_ptr itemInstance) { return UseAnim_drink; } -shared_ptr MilkBucketItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr MilkBucketItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { player->startUsingItem(instance, getUseDuration(instance)); return instance; diff --git a/Minecraft.World/MilkBucketItem.h b/Minecraft.World/MilkBucketItem.h index 672e3143..32c9a215 100644 --- a/Minecraft.World/MilkBucketItem.h +++ b/Minecraft.World/MilkBucketItem.h @@ -10,8 +10,8 @@ private: public: MilkBucketItem(int id); - virtual shared_ptr useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player); - virtual int getUseDuration(shared_ptr itemInstance); - virtual UseAnim getUseAnimation(shared_ptr itemInstance); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual std::shared_ptr useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player); + virtual int getUseDuration(std::shared_ptr itemInstance); + virtual UseAnim getUseAnimation(std::shared_ptr itemInstance); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/MineShaftPieces.cpp b/Minecraft.World/MineShaftPieces.cpp index fe13b49f..d6a60ee7 100644 --- a/Minecraft.World/MineShaftPieces.cpp +++ b/Minecraft.World/MineShaftPieces.cpp @@ -440,19 +440,19 @@ bool MineShaftPieces::MineShaftCorridor::postProcess(Level *level, Random *rando { hasPlacedSpider = true; level->setTile(x, y, newZ, Tile::mobSpawner_Id); - shared_ptr entity = dynamic_pointer_cast( level->getTileEntity(x, y, newZ) ); + std::shared_ptr entity = dynamic_pointer_cast( level->getTileEntity(x, y, newZ) ); if (entity != NULL) entity->setEntityId(L"CaveSpider"); } } } // prevent air floating - for (int x = x0; x <= x1; x++) + for (int x = x0; x <= x1; x++) { - for (int z = 0; z <= length; z++) + for (int z = 0; z <= length; z++) { int block = getBlock(level, x, -1, z, chunkBB); - if (block == 0) + if (block == 0) { placeBlock(level, Tile::wood_Id, 0, x, -1, z, chunkBB); } @@ -594,12 +594,12 @@ bool MineShaftPieces::MineShaftCrossing::postProcess(Level *level, Random *rando // prevent air floating // note: use world coordinates because the corridor hasn't defined // orientation - for (int x = boundingBox->x0; x <= boundingBox->x1; x++) + for (int x = boundingBox->x0; x <= boundingBox->x1; x++) { - for (int z = boundingBox->z0; z <= boundingBox->z1; z++) + for (int z = boundingBox->z0; z <= boundingBox->z1; z++) { int block = getBlock(level, x, boundingBox->y0 - 1, z, chunkBB); - if (block == 0) + if (block == 0) { placeBlock(level, Tile::wood_Id, 0, x, boundingBox->y0 - 1, z, chunkBB); } diff --git a/Minecraft.World/Minecart.cpp b/Minecraft.World/Minecart.cpp index 2b8fbb95..529629ff 100644 --- a/Minecraft.World/Minecart.cpp +++ b/Minecraft.World/Minecart.cpp @@ -137,7 +137,7 @@ void Minecart::defineSynchedData() } -AABB *Minecart::getCollideAgainstBox(shared_ptr entity) +AABB *Minecart::getCollideAgainstBox(std::shared_ptr entity) { return entity->bb; } @@ -180,14 +180,14 @@ double Minecart::getRideHeight() bool Minecart::hurt(DamageSource *source, int hurtDamage) { if (level->isClientSide || removed) return true; - + // 4J-JEV: Fix for #88212, // Untrusted players shouldn't be able to damage minecarts or boats. if (dynamic_cast(source) != NULL) { - shared_ptr attacker = source->getDirectEntity(); + std::shared_ptr attacker = source->getDirectEntity(); - if (dynamic_pointer_cast(attacker) != NULL && + if (dynamic_pointer_cast(attacker) != NULL && !dynamic_pointer_cast(attacker)->isAllowedToHurtEntity( shared_from_this() )) return false; } @@ -202,7 +202,7 @@ bool Minecart::hurt(DamageSource *source, int hurtDamage) if( rider.lock() != NULL && rider.lock() == source->getEntity() ) hurtDamage += 1; // 4J Stu - Brought froward from 12w36 to fix #46611 - TU5: Gameplay: Minecarts and boat requires more hits than one to be destroyed in creative mode - shared_ptr player = dynamic_pointer_cast(source->getEntity()); + std::shared_ptr player = dynamic_pointer_cast(source->getEntity()); if (player != NULL && player->abilities.instabuild) this->setDamage(100); this->setDamage(getDamage() + (hurtDamage * 10)); @@ -215,10 +215,10 @@ bool Minecart::hurt(DamageSource *source, int hurtDamage) spawnAtLocation(Item::minecart->id, 1, 0); if (type == Minecart::CHEST) { - shared_ptr container = dynamic_pointer_cast( shared_from_this() ); + std::shared_ptr container = dynamic_pointer_cast( shared_from_this() ); for (unsigned int i = 0; i < container->getContainerSize(); i++) { - shared_ptr item = container->getItem(i); + std::shared_ptr item = container->getItem(i); if (item != NULL) { float xo = random->nextFloat() * 0.8f + 0.1f; @@ -231,7 +231,7 @@ bool Minecart::hurt(DamageSource *source, int hurtDamage) if (count > item->count) count = item->count; item->count -= count; - shared_ptr itemEntity = shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ) ) ); + std::shared_ptr itemEntity = std::shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, std::shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ) ) ); float pow = 0.05f; itemEntity->xd = (float) random->nextGaussian() * pow; itemEntity->yd = (float) random->nextGaussian() * pow + 0.2f; @@ -270,20 +270,20 @@ void Minecart::remove() { for (unsigned int i = 0; i < getContainerSize(); i++) { - shared_ptr item = getItem(i); - if (item != NULL) + std::shared_ptr item = getItem(i); + if (item != NULL) { float xo = random->nextFloat() * 0.8f + 0.1f; float yo = random->nextFloat() * 0.8f + 0.1f; float zo = random->nextFloat() * 0.8f + 0.1f; - while (item->count > 0) + while (item->count > 0) { int count = random->nextInt(21) + 10; if (count > item->count) count = item->count; item->count -= count; - shared_ptr itemEntity = shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ) ) ); + std::shared_ptr itemEntity = std::shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, std::shared_ptr( new ItemInstance(item->id, count, item->getAuxValue()) ) ) ); float pow = 0.05f; itemEntity->xd = (float) random->nextGaussian() * pow; itemEntity->yd = (float) random->nextGaussian() * pow + 0.2f; @@ -388,7 +388,7 @@ void Minecart::tick() if (data == 3) xd += slideSpeed; if (data == 4) zd += slideSpeed; if (data == 5) zd -= slideSpeed; - + // 4J TODO Is this a good way to copy the bit of the array that we need? int exits[2][3]; memcpy( &exits, (void *)EXITS[data], sizeof(int) * 2 * 3); @@ -409,8 +409,8 @@ void Minecart::tick() xd = pow * xD / dd; zd = pow * zD / dd; - - shared_ptr sharedRider = rider.lock(); + + std::shared_ptr sharedRider = rider.lock(); if (sharedRider != NULL) { double riderDist = (sharedRider->xd * sharedRider->xd + sharedRider->zd * sharedRider->zd); @@ -669,16 +669,16 @@ void Minecart::tick() // if (!level->isClientSide) { { - vector > *entities = level->getEntities(shared_from_this(), this->bb->grow(0.2f, 0, 0.2f)); + vector > *entities = level->getEntities(shared_from_this(), this->bb->grow(0.2f, 0, 0.2f)); if (entities != NULL && !entities->empty()) { AUTO_VAR(itEnd, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { - shared_ptr e = (*it); //entities->at(i); + std::shared_ptr e = (*it); //entities->at(i); if (e != rider.lock() && e->isPushable() && e->GetType() == eTYPE_MINECART) { - shared_ptr cart = dynamic_pointer_cast(e); + std::shared_ptr cart = dynamic_pointer_cast(e); cart->m_bHasPushedCartThisTick = false; cart->push(shared_from_this()); @@ -848,7 +848,7 @@ void Minecart::addAdditonalSaveData(CompoundTag *base) { base->putInt(L"Type", type); - if (type == Minecart::FURNACE) + if (type == Minecart::FURNACE) { base->putDouble(L"PushX", xPush); base->putDouble(L"PushZ", zPush); @@ -889,7 +889,7 @@ void Minecart::readAdditionalSaveData(CompoundTag *base) { CompoundTag *tag = inventoryList->get(i); unsigned int slot = tag->getByte(L"Slot") & 0xff; - if (slot >= 0 && slot < items->length) (*items)[slot] = shared_ptr( ItemInstance::fromTag(tag) ); + if (slot >= 0 && slot < items->length) (*items)[slot] = std::shared_ptr( ItemInstance::fromTag(tag) ); } } } @@ -900,7 +900,7 @@ float Minecart::getShadowHeightOffs() return 0; } -void Minecart::push(shared_ptr e) +void Minecart::push(std::shared_ptr e) { if (level->isClientSide) return; @@ -954,7 +954,7 @@ void Minecart::push(shared_ptr e) double xdd = (e->xd + xd); double zdd = (e->zd + zd); - shared_ptr cart = dynamic_pointer_cast(e); + std::shared_ptr cart = dynamic_pointer_cast(e); if (cart != NULL && cart->type == Minecart::FURNACE && type != Minecart::FURNACE) { xd *= 0.2f; @@ -1017,24 +1017,24 @@ unsigned int Minecart::getContainerSize() return 9 * 3; } -shared_ptr Minecart::getItem(unsigned int slot) +std::shared_ptr Minecart::getItem(unsigned int slot) { return (*items)[slot]; } -shared_ptr Minecart::removeItem(unsigned int slot, int count) +std::shared_ptr Minecart::removeItem(unsigned int slot, int count) { if ( (*items)[slot] != NULL) { if ( (*items)[slot]->count <= count) { - shared_ptr item = (*items)[slot]; + std::shared_ptr item = (*items)[slot]; (*items)[slot] = nullptr; return item; } else { - shared_ptr i = (*items)[slot]->remove(count); + std::shared_ptr i = (*items)[slot]->remove(count); if ((*items)[slot]->count == 0) (*items)[slot] = nullptr; return i; } @@ -1042,18 +1042,18 @@ shared_ptr Minecart::removeItem(unsigned int slot, int count) return nullptr; } -shared_ptr Minecart::removeItemNoUpdate(int slot) +std::shared_ptr Minecart::removeItemNoUpdate(int slot) { if ( (*items)[slot] != NULL) { - shared_ptr item = (*items)[slot]; + std::shared_ptr item = (*items)[slot]; (*items)[slot] = nullptr; return item; } return nullptr; } -void Minecart::setItem(unsigned int slot, shared_ptr item) +void Minecart::setItem(unsigned int slot, std::shared_ptr item) { (*items)[slot] = item; if (item != NULL && item->count > getMaxStackSize()) item->count = getMaxStackSize(); @@ -1073,7 +1073,7 @@ void Minecart::setChanged() { } -bool Minecart::interact(shared_ptr player) +bool Minecart::interact(std::shared_ptr player) { if (type == Minecart::RIDEABLE) { @@ -1098,7 +1098,7 @@ bool Minecart::interact(shared_ptr player) } else if (type == Minecart::FURNACE) { - shared_ptr selected = player->inventory->getSelected(); + std::shared_ptr selected = player->inventory->getSelected(); if (selected != NULL && selected->id == Item::coal->id) { if (--selected->count == 0) player->inventory->setItem(player->inventory->selected, nullptr); @@ -1144,7 +1144,7 @@ void Minecart::lerpMotion(double xd, double yd, double zd) lzd = this->zd = zd; } -bool Minecart::stillValid(shared_ptr player) +bool Minecart::stillValid(std::shared_ptr player) { if (this->removed) return false; if (player->distanceToSqr(shared_from_this()) > 8 * 8) return false; diff --git a/Minecraft.World/Minecart.h b/Minecraft.World/Minecart.h index ea119bce..77b58e5f 100644 --- a/Minecraft.World/Minecart.h +++ b/Minecraft.World/Minecart.h @@ -49,7 +49,7 @@ protected: virtual void defineSynchedData(); public: - virtual AABB *getCollideAgainstBox(shared_ptr entity); + virtual AABB *getCollideAgainstBox(std::shared_ptr entity); virtual AABB *getCollideBox(); virtual bool isPushable(); @@ -75,16 +75,16 @@ protected: public: virtual float getShadowHeightOffs(); - virtual void push(shared_ptr e); + virtual void push(std::shared_ptr e); virtual unsigned int getContainerSize(); - virtual shared_ptr getItem(unsigned int slot); - virtual shared_ptr removeItem(unsigned int slot, int count); - virtual shared_ptr removeItemNoUpdate(int slot); - virtual void setItem(unsigned int slot, shared_ptr item); + virtual std::shared_ptr getItem(unsigned int slot); + virtual std::shared_ptr removeItem(unsigned int slot, int count); + virtual std::shared_ptr removeItemNoUpdate(int slot); + virtual void setItem(unsigned int slot, std::shared_ptr item); int getName(); virtual int getMaxStackSize(); virtual void setChanged(); - virtual bool interact(shared_ptr player); + virtual bool interact(std::shared_ptr player); virtual float getLootContent(); private: @@ -95,7 +95,7 @@ private: public: virtual void lerpTo(double x, double y, double z, float yRot, float xRot, int steps); virtual void lerpMotion(double xd, double yd, double zd); - virtual bool stillValid(shared_ptr player); + virtual bool stillValid(std::shared_ptr player); protected: bool hasFuel(); diff --git a/Minecraft.World/MinecartItem.cpp b/Minecraft.World/MinecartItem.cpp index 3b062ccf..ea64152c 100644 --- a/Minecraft.World/MinecartItem.cpp +++ b/Minecraft.World/MinecartItem.cpp @@ -12,18 +12,18 @@ MinecartItem::MinecartItem(int id, int type) : Item(id) this->type = type; } -bool MinecartItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool MinecartItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { // 4J-PB - Adding a test only version to allow tooltips to be displayed int targetType = level->getTile(x, y, z); - if (RailTile::isRail(targetType)) + if (RailTile::isRail(targetType)) { if(!bTestUseOnOnly) { - if (!level->isClientSide) + if (!level->isClientSide) { - level->addEntity(shared_ptr( new Minecart(level, x + 0.5f, y + 0.5f, z + 0.5f, type) ) ); + level->addEntity(std::shared_ptr( new Minecart(level, x + 0.5f, y + 0.5f, z + 0.5f, type) ) ); } instance->count--; } diff --git a/Minecraft.World/MinecartItem.h b/Minecraft.World/MinecartItem.h index c63082a1..4ffabc63 100644 --- a/Minecraft.World/MinecartItem.h +++ b/Minecraft.World/MinecartItem.h @@ -3,12 +3,12 @@ using namespace std; #include "Item.h" -class MinecartItem : public Item +class MinecartItem : public Item { public: int type; MinecartItem(int id, int type); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); }; \ No newline at end of file diff --git a/Minecraft.World/Mob.cpp b/Minecraft.World/Mob.cpp index d2dcddfb..23f8639e 100644 --- a/Minecraft.World/Mob.cpp +++ b/Minecraft.World/Mob.cpp @@ -193,19 +193,19 @@ Random *Mob::getRandom() return random; } -shared_ptr Mob::getLastHurtByMob() +std::shared_ptr Mob::getLastHurtByMob() { return lastHurtByMob; } -shared_ptr Mob::getLastHurtMob() +std::shared_ptr Mob::getLastHurtMob() { return lastHurtMob; } -void Mob::setLastHurtMob(shared_ptr target) +void Mob::setLastHurtMob(std::shared_ptr target) { - shared_ptr mob = dynamic_pointer_cast(target); + std::shared_ptr mob = dynamic_pointer_cast(target); if (mob != NULL) lastHurtMob = mob; } @@ -235,18 +235,18 @@ void Mob::setSpeed(float speed) setYya(speed); } -bool Mob::doHurtTarget(shared_ptr target) +bool Mob::doHurtTarget(std::shared_ptr target) { setLastHurtMob(target); return false; } -shared_ptr Mob::getTarget() +std::shared_ptr Mob::getTarget() { return target; } -void Mob::setTarget(shared_ptr target) +void Mob::setTarget(std::shared_ptr target) { this->target = target; } @@ -299,18 +299,18 @@ bool Mob::hasRestriction() return restrictRadius != -1; } -void Mob::setLastHurtByMob(shared_ptr hurtBy) +void Mob::setLastHurtByMob(std::shared_ptr hurtBy) { lastHurtByMob = hurtBy; lastHurtByMobTime = lastHurtByMob != NULL ? PLAYER_HURT_EXPERIENCE_TIME : 0; } -void Mob::defineSynchedData() +void Mob::defineSynchedData() { entityData->define(DATA_EFFECT_COLOR_ID, effectColor); } -bool Mob::canSee(shared_ptr target) +bool Mob::canSee(std::shared_ptr target) { HitResult *hres = level->clip(Vec3::newTemp(x, y + getHeadHeight(), z), Vec3::newTemp(target->x, target->y + target->getHeadHeight(), target->z)); bool retVal = (hres == NULL); @@ -318,62 +318,62 @@ bool Mob::canSee(shared_ptr target) return retVal; } -int Mob::getTexture() +int Mob::getTexture() { return textureIdx; } -bool Mob::isPickable() +bool Mob::isPickable() { return !removed; } -bool Mob::isPushable() +bool Mob::isPushable() { return !removed; } -float Mob::getHeadHeight() +float Mob::getHeadHeight() { return bbHeight * 0.85f; } -int Mob::getAmbientSoundInterval() +int Mob::getAmbientSoundInterval() { return 20 * 4; } -void Mob::playAmbientSound() +void Mob::playAmbientSound() { MemSect(31); int ambient = getAmbientSound(); - if (ambient != -1) + if (ambient != -1) { level->playSound(shared_from_this(), ambient, getSoundVolume(), getVoicePitch()); } MemSect(0); } -void Mob::baseTick() +void Mob::baseTick() { oAttackAnim = attackAnim; Entity::baseTick(); - if (isAlive() && random->nextInt(1000) < ambientSoundTime++) + if (isAlive() && random->nextInt(1000) < ambientSoundTime++) { ambientSoundTime = -getAmbientSoundInterval(); - playAmbientSound(); + playAmbientSound(); } - if (isAlive() && isInWall()) + if (isAlive() && isInWall()) { hurt(DamageSource::inWall, 1); } if (isFireImmune() || level->isClientSide) clearFire(); - if (isAlive() && isUnderLiquid(Material::water) && !isWaterMob() && activeEffects.find(MobEffect::waterBreathing->id) == activeEffects.end()) + if (isAlive() && isUnderLiquid(Material::water) && !isWaterMob() && activeEffects.find(MobEffect::waterBreathing->id) == activeEffects.end()) { setAirSupply(decreaseAirSupply(getAirSupply())); if (getAirSupply() == -20) @@ -393,8 +393,8 @@ void Mob::baseTick() } clearFire(); - } - else + } + else { setAirSupply(TOTAL_AIR_SUPPLY); } @@ -404,7 +404,7 @@ void Mob::baseTick() if (attackTime > 0) attackTime--; if (hurtTime > 0) hurtTime--; if (invulnerableTime > 0) invulnerableTime--; - if (health <= 0) + if (health <= 0) { tickDeath(); } @@ -412,7 +412,7 @@ void Mob::baseTick() if (lastHurtByPlayerTime > 0) lastHurtByPlayerTime--; else { - // Note - this used to just set to nullptr, but that has to create a new shared_ptr and free an old one, when generally this won't be doing anything at all. This + // Note - this used to just set to nullptr, but that has to create a new std::shared_ptr and free an old one, when generally this won't be doing anything at all. This // is the lightweight but ugly alternative if( lastHurtByPlayer ) { @@ -440,9 +440,9 @@ void Mob::baseTick() } void Mob::tickDeath() -{ +{ deathTime++; - if (deathTime == 20) + if (deathTime == 20) { // 4J Stu - Added level->isClientSide check from 1.2 to fix XP orbs being created client side if(!level->isClientSide && (lastHurtByPlayerTime > 0 || isAlwaysExperienceDropper()) ) @@ -454,13 +454,13 @@ void Mob::tickDeath() { int newCount = ExperienceOrb::getExperienceValue(xpCount); xpCount -= newCount; - level->addEntity(shared_ptr( new ExperienceOrb(level, x, y, z, newCount) ) ); + level->addEntity(std::shared_ptr( new ExperienceOrb(level, x, y, z, newCount) ) ); } } } remove(); - for (int i = 0; i < 20; i++) + for (int i = 0; i < 20; i++) { double xa = random->nextGaussian() * 0.02; double ya = random->nextGaussian() * 0.02; @@ -475,7 +475,7 @@ int Mob::decreaseAirSupply(int currentSupply) return currentSupply - 1; } -int Mob::getExperienceReward(shared_ptr killedBy) +int Mob::getExperienceReward(std::shared_ptr killedBy) { return xpReward; } @@ -485,9 +485,9 @@ bool Mob::isAlwaysExperienceDropper() return false; } -void Mob::spawnAnim() +void Mob::spawnAnim() { - for (int i = 0; i < 20; i++) + for (int i = 0; i < 20; i++) { double xa = random->nextGaussian() * 0.02; double ya = random->nextGaussian() * 0.02; @@ -498,7 +498,7 @@ void Mob::spawnAnim() } } -void Mob::rideTick() +void Mob::rideTick() { Entity::rideTick(); oRun = run; @@ -506,7 +506,7 @@ void Mob::rideTick() fallDistance = 0; } -void Mob::lerpTo(double x, double y, double z, float yRot, float xRot, int steps) +void Mob::lerpTo(double x, double y, double z, float yRot, float xRot, int steps) { heightOffset = 0; lx = x; @@ -518,12 +518,12 @@ void Mob::lerpTo(double x, double y, double z, float yRot, float xRot, int steps lSteps = steps; } -void Mob::superTick() +void Mob::superTick() { Entity::tick(); } -void Mob::tick() +void Mob::tick() { Entity::tick(); @@ -552,21 +552,21 @@ void Mob::tick() float walkSpeed = 0; oRun = run; float tRun = 0; - if (sideDist <= 0.05f * 0.05f) + if (sideDist <= 0.05f * 0.05f) { // animStep = 0; - } - else + } + else { tRun = 1; walkSpeed = sqrt(sideDist) * 3; yBodyRotT = ((float) atan2(zd, xd) * 180 / (float) PI - 90); } - if (attackAnim > 0) + if (attackAnim > 0) { yBodyRotT = yRot; } - if (!onGround) + if (!onGround) { tRun = 0; } @@ -592,12 +592,12 @@ void Mob::tick() if (headDiff < -75) headDiff = -75; if (headDiff >= 75) headDiff = +75; yBodyRot = yRot - headDiff; - if (headDiff * headDiff > 50 * 50) + if (headDiff * headDiff > 50 * 50) { yBodyRot += headDiff * 0.2f; } - if (behind) + if (behind) { walkSpeed *= -1; } @@ -625,7 +625,7 @@ void Mob::tick() animStep += walkSpeed; } -void Mob::heal(int heal) +void Mob::heal(int heal) { if (health <= 0) return; health += heal; @@ -647,7 +647,7 @@ void Mob::setHealth(int health) } } -bool Mob::hurt(DamageSource *source, int dmg) +bool Mob::hurt(DamageSource *source, int dmg) { // 4J Stu - Reworked this function a bit to show hurt damage on the client before the server responds. // Fix for #8823 - Gameplay: Confirmation that a monster or animal has taken damage from an attack is highly delayed @@ -661,7 +661,7 @@ bool Mob::hurt(DamageSource *source, int dmg) if ( source->isFire() && hasEffect(MobEffect::fireResistance) ) { // 4J-JEV, for new achievement Stayin'Frosty, TODO merge with Java version. - shared_ptr plr = dynamic_pointer_cast(shared_from_this()); + std::shared_ptr plr = dynamic_pointer_cast(shared_from_this()); if ( plr != NULL && source == DamageSource::lava ) // Only award when in lava (not any fire). { plr->awardStat(GenericStats::stayinFrosty(),GenericStats::param_stayinFrosty()); @@ -672,14 +672,14 @@ bool Mob::hurt(DamageSource *source, int dmg) this->walkAnimSpeed = 1.5f; bool sound = true; - if (invulnerableTime > invulnerableDuration / 2.0f) + if (invulnerableTime > invulnerableDuration / 2.0f) { if (dmg <= lastHurt) return false; if(!level->isClientSide) actuallyHurt(source, dmg - lastHurt); lastHurt = dmg; sound = false; - } - else + } + else { lastHurt = dmg; lastHealth = health; @@ -690,7 +690,7 @@ bool Mob::hurt(DamageSource *source, int dmg) hurtDir = 0; - shared_ptr sourceEntity = source->getEntity(); + std::shared_ptr sourceEntity = source->getEntity(); if (sourceEntity != NULL) { if (dynamic_pointer_cast(sourceEntity) != NULL) { @@ -704,7 +704,7 @@ bool Mob::hurt(DamageSource *source, int dmg) } else if (dynamic_pointer_cast(sourceEntity)) { - shared_ptr w = dynamic_pointer_cast(sourceEntity); + std::shared_ptr w = dynamic_pointer_cast(sourceEntity); if (w->isTame()) { lastHurtByPlayerTime = PLAYER_HURT_EXPERIENCE_TIME; @@ -722,31 +722,31 @@ bool Mob::hurt(DamageSource *source, int dmg) { level->broadcastEntityEvent(shared_from_this(), EntityEvent::HURT); if (source != DamageSource::drown && source != DamageSource::controlledExplosion) markHurt(); - if (sourceEntity != NULL) + if (sourceEntity != NULL) { double xd = sourceEntity->x - x; double zd = sourceEntity->z - z; - while (xd * xd + zd * zd < 0.0001) + while (xd * xd + zd * zd < 0.0001) { xd = (Math::random() - Math::random()) * 0.01; zd = (Math::random() - Math::random()) * 0.01; } hurtDir = (float) (atan2(zd, xd) * 180 / PI) - yRot; knockback(sourceEntity, dmg, xd, zd); - } - else + } + else { hurtDir = (float) (int) ((Math::random() * 2) * 180); // 4J This cast is the same as Java } } MemSect(31); - if (health <= 0) + if (health <= 0) { if (sound) level->playSound(shared_from_this(), getDeathSound(), getSoundVolume(), getVoicePitch()); die(source); - } - else + } + else { if (sound) level->playSound(shared_from_this(), getHurtSound(), getSoundVolume(), getVoicePitch()); } @@ -765,7 +765,7 @@ float Mob::getVoicePitch() return (random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f; } -void Mob::animateHurt() +void Mob::animateHurt() { hurtTime = hurtDuration = 10; hurtDir = 0; @@ -806,7 +806,7 @@ int Mob::getDamageAfterMagicAbsorb(DamageSource *damageSource, int damage) return damage; } -void Mob::actuallyHurt(DamageSource *source, int dmg) +void Mob::actuallyHurt(DamageSource *source, int dmg) { dmg = getDamageAfterArmorAbsorb(source, dmg); dmg = getDamageAfterMagicAbsorb(source, dmg); @@ -814,27 +814,27 @@ void Mob::actuallyHurt(DamageSource *source, int dmg) } -float Mob::getSoundVolume() +float Mob::getSoundVolume() { return 1; } -int Mob::getAmbientSound() +int Mob::getAmbientSound() { return -1; } -int Mob::getHurtSound() +int Mob::getHurtSound() { return eSoundType_DAMAGE_HURT; } -int Mob::getDeathSound() +int Mob::getDeathSound() { return eSoundType_DAMAGE_HURT; } -void Mob::knockback(shared_ptr source, int dmg, double xd, double zd) +void Mob::knockback(std::shared_ptr source, int dmg, double xd, double zd) { hasImpulse = true; float dd = (float) sqrt(xd * xd + zd * zd); @@ -851,19 +851,19 @@ void Mob::knockback(shared_ptr source, int dmg, double xd, double zd) if (this->yd > 0.4f) this->yd = 0.4f; } -void Mob::die(DamageSource *source) +void Mob::die(DamageSource *source) { - shared_ptr sourceEntity = source->getEntity(); + std::shared_ptr sourceEntity = source->getEntity(); if (deathScore >= 0 && sourceEntity != NULL) sourceEntity->awardKillScore(shared_from_this(), deathScore); if (sourceEntity != NULL) sourceEntity->killed( dynamic_pointer_cast( shared_from_this() ) ); dead = true; - if (!level->isClientSide) + if (!level->isClientSide) { int playerBonus = 0; - shared_ptr player = dynamic_pointer_cast(sourceEntity); + std::shared_ptr player = dynamic_pointer_cast(sourceEntity); if (player != NULL) { playerBonus = EnchantmentHelper::getKillingLootBonus(player->inventory); @@ -894,7 +894,7 @@ void Mob::die(DamageSource *source) /** * Drop extra rare loot. Only occurs roughly 5% of the time, rareRootLevel * is set to 1 (otherwise 0) 1% of the time. -* +* * @param rareLootLevel */ void Mob::dropRareDeathLoot(int rareLootLevel) @@ -902,10 +902,10 @@ void Mob::dropRareDeathLoot(int rareLootLevel) } -void Mob::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) +void Mob::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) { int loot = getDeathLoot(); - if (loot > 0) + if (loot > 0) { int count = random->nextInt(3); if (playerBonusLevel > 0) @@ -917,16 +917,16 @@ void Mob::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) } } -int Mob::getDeathLoot() +int Mob::getDeathLoot() { return 0; } -void Mob::causeFallDamage(float distance) +void Mob::causeFallDamage(float distance) { Entity::causeFallDamage(distance); int dmg = (int) ceil(distance - 3); - if (dmg > 0) + if (dmg > 0) { // 4J - new sounds here brought forward from 1.2.3 if (dmg > 4) @@ -940,7 +940,7 @@ void Mob::causeFallDamage(float distance) hurt(DamageSource::fall, dmg); int t = level->getTile( Mth::floor(x), Mth::floor(y - 0.2f - this->heightOffset), Mth::floor(z)); - if (t > 0) + if (t > 0) { const Tile::SoundType *soundType = Tile::tiles[t]->soundType; MemSect(31); @@ -950,7 +950,7 @@ void Mob::causeFallDamage(float distance) } } -void Mob::travel(float xa, float ya) +void Mob::travel(float xa, float ya) { #ifdef __PSVITA__ // AP - dynamic_pointer_cast is a non-trivial call @@ -960,9 +960,9 @@ void Mob::travel(float xa, float ya) thisPlayer = (Player*) this; } #else - shared_ptr thisPlayer = dynamic_pointer_cast(shared_from_this()); + std::shared_ptr thisPlayer = dynamic_pointer_cast(shared_from_this()); #endif - if (isInWater() && !(thisPlayer && thisPlayer->abilities.flying) ) + if (isInWater() && !(thisPlayer && thisPlayer->abilities.flying) ) { double yo = y; moveRelative(xa, ya, useNewAi() ? 0.04f : 0.02f); @@ -973,12 +973,12 @@ void Mob::travel(float xa, float ya) zd *= 0.80f; yd -= 0.02; - if (horizontalCollision && isFree(xd, yd + 0.6f - y + yo, zd)) + if (horizontalCollision && isFree(xd, yd + 0.6f - y + yo, zd)) { yd = 0.3f; } - } - else if (isInLava() && !(thisPlayer && thisPlayer->abilities.flying) ) + } + else if (isInLava() && !(thisPlayer && thisPlayer->abilities.flying) ) { double yo = y; moveRelative(xa, ya, 0.02f); @@ -988,19 +988,19 @@ void Mob::travel(float xa, float ya) zd *= 0.50f; yd -= 0.02; - if (horizontalCollision && isFree(xd, yd + 0.6f - y + yo, zd)) + if (horizontalCollision && isFree(xd, yd + 0.6f - y + yo, zd)) { yd = 0.3f; } - } - else + } + else { float friction = 0.91f; - if (onGround) + if (onGround) { friction = 0.6f * 0.91f; int t = level->getTile(Mth::floor(x), Mth::floor(bb->y0) - 1, Mth::floor(z)); - if (t > 0) + if (t > 0) { friction = Tile::tiles[t]->friction * 0.91f; } @@ -1020,16 +1020,16 @@ void Mob::travel(float xa, float ya) moveRelative(xa, ya, speed); friction = 0.91f; - if (onGround) + if (onGround) { friction = 0.6f * 0.91f; int t = level->getTile( Mth::floor(x), Mth::floor(bb->y0) - 1, Mth::floor(z)); - if (t > 0) + if (t > 0) { friction = Tile::tiles[t]->friction * 0.91f; } } - if (onLadder()) + if (onLadder()) { float max = 0.15f; if (xd < -max) xd = -max; @@ -1044,7 +1044,7 @@ void Mob::travel(float xa, float ya) move(xd, yd, zd); - if (horizontalCollision && onLadder()) + if (horizontalCollision && onLadder()) { yd = 0.2; } @@ -1064,7 +1064,7 @@ void Mob::travel(float xa, float ya) walkAnimPos += walkAnimSpeed; } -bool Mob::onLadder() +bool Mob::onLadder() { int xt = Mth::floor(x); int yt = Mth::floor(bb->y0); @@ -1076,12 +1076,12 @@ bool Mob::onLadder() } -bool Mob::isShootable() +bool Mob::isShootable() { return true; } -void Mob::addAdditonalSaveData(CompoundTag *entityTag) +void Mob::addAdditonalSaveData(CompoundTag *entityTag) { entityTag->putShort(L"Health", (short) health); entityTag->putShort(L"HurtTime", (short) hurtTime); @@ -1106,7 +1106,7 @@ void Mob::addAdditonalSaveData(CompoundTag *entityTag) } } -void Mob::readAdditionalSaveData(CompoundTag *tag) +void Mob::readAdditionalSaveData(CompoundTag *tag) { if (health < Short::MIN_VALUE) health = Short::MIN_VALUE; health = tag->getShort(L"Health"); @@ -1130,12 +1130,12 @@ void Mob::readAdditionalSaveData(CompoundTag *tag) } } -bool Mob::isAlive() +bool Mob::isAlive() { return !removed && health > 0; } -bool Mob::isWaterMob() +bool Mob::isWaterMob() { return false; } @@ -1191,10 +1191,10 @@ void Mob::setJumping(bool jump) jumping = jump; } -void Mob::aiStep() +void Mob::aiStep() { if (noJumpDelay > 0) noJumpDelay--; - if (lSteps > 0) + if (lSteps > 0) { double xt = x + (lx - x) / lSteps; double yt = y + (ly - y) / lSteps; @@ -1236,14 +1236,14 @@ void Mob::aiStep() if (abs(zd) < MIN_MOVEMENT_DISTANCE) zd = 0; } - if (isImmobile()) + if (isImmobile()) { jumping = false; xxa = 0; yya = 0; yRotA = 0; - } - else + } + else { MemSect(25); if (isEffectiveAI()) @@ -1261,13 +1261,13 @@ void Mob::aiStep() MemSect(0); } - if (jumping) + if (jumping) { - if (isInWater() || isInLava() ) + if (isInWater() || isInLava() ) { yd += 0.04f; } - else if (onGround) + else if (onGround) { if (noJumpDelay == 0) { @@ -1293,13 +1293,13 @@ void Mob::aiStep() if(!level->isClientSide) { - vector > *entities = level->getEntities(shared_from_this(), this->bb->grow(0.2f, 0, 0.2f)); - if (entities != NULL && !entities->empty()) + vector > *entities = level->getEntities(shared_from_this(), this->bb->grow(0.2f, 0, 0.2f)); + if (entities != NULL && !entities->empty()) { AUTO_VAR(itEnd, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { - shared_ptr e = *it; //entities->at(i); + std::shared_ptr e = *it; //entities->at(i); if (e->isPushable()) e->push(shared_from_this()); } } @@ -1316,7 +1316,7 @@ bool Mob::isEffectiveAI() return !level->isClientSide; } -bool Mob::isImmobile() +bool Mob::isImmobile() { return health <= 0; } @@ -1326,7 +1326,7 @@ bool Mob::isBlocking() return false; } -void Mob::jumpFromGround() +void Mob::jumpFromGround() { yd = 0.42f; if (hasEffect(MobEffect::jump)) @@ -1343,31 +1343,31 @@ void Mob::jumpFromGround() this->hasImpulse = true; } -bool Mob::removeWhenFarAway() +bool Mob::removeWhenFarAway() { return true; } -void Mob::checkDespawn() +void Mob::checkDespawn() { - shared_ptr player = level->getNearestPlayer(shared_from_this(), -1); - if (player != NULL) + std::shared_ptr player = level->getNearestPlayer(shared_from_this(), -1); + if (player != NULL) { double xd = player->x - x; double yd = player->y - y; double zd = player->z - z; double sd = xd * xd + yd * yd + zd * zd; - if (removeWhenFarAway() && sd > 128 * 128) + if (removeWhenFarAway() && sd > 128 * 128) { remove(); } - if (noActionTime > 20 * 30 && random->nextInt(800) == 0 && sd > 32 * 32 && removeWhenFarAway()) + if (noActionTime > 20 * 30 && random->nextInt(800) == 0 && sd > 32 * 32 && removeWhenFarAway()) { remove(); } - else if (sd < 32 * 32) + else if (sd < 32 * 32) { noActionTime = 0; } @@ -1397,7 +1397,7 @@ void Mob::serverAiMobStep() { } -void Mob::serverAiStep() +void Mob::serverAiStep() { noActionTime++; @@ -1407,15 +1407,15 @@ void Mob::serverAiStep() yya = 0; float lookDistance = 8; - if (random->nextFloat() < 0.02f) + if (random->nextFloat() < 0.02f) { - shared_ptr player = level->getNearestPlayer(shared_from_this(), lookDistance); - if (player != NULL) + std::shared_ptr player = level->getNearestPlayer(shared_from_this(), lookDistance); + if (player != NULL) { lookingAt = player; lookTime = 10 + random->nextInt(20); - } - else + } + else { yRotA = (random->nextFloat() - 0.5f) * 20; } @@ -1424,14 +1424,14 @@ void Mob::serverAiStep() if (lookingAt != NULL) { lookAt(lookingAt, 10.0f, (float) getMaxHeadXRot()); - if (lookTime-- <= 0 || lookingAt->removed || lookingAt->distanceToSqr(shared_from_this()) > lookDistance * lookDistance) + if (lookTime-- <= 0 || lookingAt->removed || lookingAt->distanceToSqr(shared_from_this()) > lookDistance * lookDistance) { lookingAt = nullptr; } - } - else + } + else { - if (random->nextFloat() < 0.05f) + if (random->nextFloat() < 0.05f) { yRotA = (random->nextFloat() - 0.5f) * 20; } @@ -1444,23 +1444,23 @@ void Mob::serverAiStep() if (inWater || inLava) jumping = random->nextFloat() < 0.8f; } -int Mob::getMaxHeadXRot() +int Mob::getMaxHeadXRot() { return 40; } -void Mob::lookAt(shared_ptr e, float yMax, float xMax) +void Mob::lookAt(std::shared_ptr e, float yMax, float xMax) { double xd = e->x - x; double yd; double zd = e->z - z; - - shared_ptr mob = dynamic_pointer_cast(e); + + std::shared_ptr mob = dynamic_pointer_cast(e); if(mob != NULL) { yd = (y + getHeadHeight()) - (mob->y + mob->getHeadHeight()); - } - else + } + else { yd = (e->bb->y0 + e->bb->y1) / 2 - (y + getHeadHeight()); } @@ -1473,42 +1473,42 @@ void Mob::lookAt(shared_ptr e, float yMax, float xMax) yRot = rotlerp(yRot, yRotD, yMax); } -bool Mob::isLookingAtAnEntity() +bool Mob::isLookingAtAnEntity() { return lookingAt != NULL; } -shared_ptr Mob::getLookingAt() +std::shared_ptr Mob::getLookingAt() { return lookingAt; } -float Mob::rotlerp(float a, float b, float max) +float Mob::rotlerp(float a, float b, float max) { float diff = Mth::wrapDegrees(b - a); - if (diff > max) + if (diff > max) { diff = max; } - if (diff < -max) + if (diff < -max) { diff = -max; } return a + diff; } -bool Mob::canSpawn() +bool Mob::canSpawn() { // 4J - altered to use special containsAnyLiquid variant return level->isUnobstructed(bb) && level->getCubes(shared_from_this(), bb)->empty() && !level->containsAnyLiquid_NoLoad(bb); } -void Mob::outOfWorld() +void Mob::outOfWorld() { hurt(DamageSource::outOfWorld, 4); } -float Mob::getAttackAnim(float a) +float Mob::getAttackAnim(float a) { float diff = attackAnim - oAttackAnim; if (diff < 0) diff += 1; @@ -1516,9 +1516,9 @@ float Mob::getAttackAnim(float a) } -Vec3 *Mob::getPos(float a) +Vec3 *Mob::getPos(float a) { - if (a == 1) + if (a == 1) { return Vec3::newTemp(x, y, z); } @@ -1529,14 +1529,14 @@ Vec3 *Mob::getPos(float a) return Vec3::newTemp(x, y, z); } -Vec3 *Mob::getLookAngle() +Vec3 *Mob::getLookAngle() { return getViewVector(1); } -Vec3 *Mob::getViewVector(float a) +Vec3 *Mob::getViewVector(float a) { - if (a == 1) + if (a == 1) { float yCos = Mth::cos(-yRot * Mth::RAD_TO_GRAD - PI); float ySin = Mth::sin(-yRot * Mth::RAD_TO_GRAD - PI); @@ -1566,7 +1566,7 @@ float Mob::getHeadSizeScale() return 1.0f; } -HitResult *Mob::pick(double range, float a) +HitResult *Mob::pick(double range, float a) { Vec3 *from = getPos(a); Vec3 *b = getViewVector(a); @@ -1574,26 +1574,26 @@ HitResult *Mob::pick(double range, float a) return level->clip(from, to); } -int Mob::getMaxSpawnClusterSize() +int Mob::getMaxSpawnClusterSize() { return 4; } -shared_ptr Mob::getCarriedItem() +std::shared_ptr Mob::getCarriedItem() { return nullptr; } -shared_ptr Mob::getArmor(int pos) +std::shared_ptr Mob::getArmor(int pos) { // 4J Stu - Not implemented yet return nullptr; //return equipment[pos + 1]; } -void Mob::handleEntityEvent(byte id) +void Mob::handleEntityEvent(byte id) { - if (id == EntityEvent::HURT) + if (id == EntityEvent::HURT) { this->walkAnimSpeed = 1.5f; @@ -1605,37 +1605,37 @@ void Mob::handleEntityEvent(byte id) // 4J-PB -added because villagers have no sounds int iHurtSound=getHurtSound(); if(iHurtSound!=-1) - { + { level->playSound(shared_from_this(), iHurtSound, getSoundVolume(), (random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f); } MemSect(0); hurt(DamageSource::genericSource, 0); - } - else if (id == EntityEvent::DEATH) + } + else if (id == EntityEvent::DEATH) { MemSect(31); // 4J-PB -added because villagers have no sounds int iDeathSound=getDeathSound(); if(iDeathSound!=-1) - { + { level->playSound(shared_from_this(), iDeathSound, getSoundVolume(), (random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f); } MemSect(0); health = 0; die(DamageSource::genericSource); - } - else + } + else { Entity::handleEntityEvent(id); } } -bool Mob::isSleeping() +bool Mob::isSleeping() { return false; } -Icon *Mob::getItemInHandIcon(shared_ptr item, int layer) +Icon *Mob::getItemInHandIcon(std::shared_ptr item, int layer) { return item->getIcon(); } @@ -1885,7 +1885,7 @@ float Mob::getWalkingSpeedModifier() return speed; } -void Mob::teleportTo(double x, double y, double z) +void Mob::teleportTo(double x, double y, double z) { moveTo(x, y, z, yRot, xRot); } @@ -1900,7 +1900,7 @@ MobType Mob::getMobType() return UNDEFINED; } -void Mob::breakItem(shared_ptr itemInstance) +void Mob::breakItem(std::shared_ptr itemInstance) { level->playSound(shared_from_this(), eSoundType_RANDOM_BREAK, 0.8f, 0.8f + level->random->nextFloat() * 0.4f); diff --git a/Minecraft.World/Mob.h b/Minecraft.World/Mob.h index 0e1af2be..1844922a 100644 --- a/Minecraft.World/Mob.h +++ b/Minecraft.World/Mob.h @@ -99,13 +99,13 @@ public: float walkAnimPos; protected: - shared_ptr lastHurtByPlayer; + std::shared_ptr lastHurtByPlayer; int lastHurtByPlayerTime; private: - shared_ptr lastHurtByMob; + std::shared_ptr lastHurtByMob; int lastHurtByMobTime; - shared_ptr lastHurtMob; + std::shared_ptr lastHurtMob; public: int arrowCount; @@ -129,7 +129,7 @@ protected: GoalSelector targetSelector; private: - shared_ptr target; + std::shared_ptr target; Sensing *sensing; float speed; @@ -143,17 +143,17 @@ public: virtual PathNavigation *getNavigation(); virtual Sensing *getSensing(); virtual Random *getRandom(); - virtual shared_ptr getLastHurtByMob(); - virtual shared_ptr getLastHurtMob(); - void setLastHurtMob(shared_ptr target); + virtual std::shared_ptr getLastHurtByMob(); + virtual std::shared_ptr getLastHurtMob(); + void setLastHurtMob(std::shared_ptr target); virtual int getNoActionTime(); float getYHeadRot(); void setYHeadRot(float yHeadRot); float getSpeed(); void setSpeed(float speed); - virtual bool doHurtTarget(shared_ptr target); - shared_ptr getTarget(); - virtual void setTarget(shared_ptr target); + virtual bool doHurtTarget(std::shared_ptr target); + std::shared_ptr getTarget(); + virtual void setTarget(std::shared_ptr target); virtual bool canAttackType(eINSTANCEOF targetType); virtual void ate(); @@ -165,13 +165,13 @@ public: void clearRestriction(); bool hasRestriction(); - virtual void setLastHurtByMob(shared_ptr hurtBy); + virtual void setLastHurtByMob(std::shared_ptr hurtBy); protected: virtual void defineSynchedData(); public: - bool canSee(shared_ptr target); + bool canSee(std::shared_ptr target); virtual int getTexture(); // 4J - changed from wstring to int virtual bool isPickable() ; virtual bool isPushable(); @@ -183,7 +183,7 @@ public: protected: virtual void tickDeath(); virtual int decreaseAirSupply(int currentSupply); - virtual int getExperienceReward(shared_ptr killedBy); + virtual int getExperienceReward(std::shared_ptr killedBy); virtual bool isAlwaysExperienceDropper(); public: @@ -222,7 +222,7 @@ public: /** * Fetches the mob's armor value, from 0 (no armor) to 20 (full armor) - * + * * @return */ virtual int getArmorValue(); @@ -239,7 +239,7 @@ protected: virtual int getDeathSound(); public: - void knockback(shared_ptr source, int dmg, double xd, double zd); + void knockback(std::shared_ptr source, int dmg, double xd, double zd); virtual void die(DamageSource *source); protected: @@ -286,7 +286,7 @@ protected: virtual bool removeWhenFarAway(); private: - shared_ptr lookingAt; + std::shared_ptr lookingAt; protected: int lookTime; @@ -300,9 +300,9 @@ public: virtual int getMaxHeadXRot(); protected: - void lookAt(shared_ptr e, float yMax, float xMax); + void lookAt(std::shared_ptr e, float yMax, float xMax); bool isLookingAtAnEntity(); - shared_ptr getLookingAt(); + std::shared_ptr getLookingAt(); private: float rotlerp(float a, float b, float max); @@ -322,11 +322,11 @@ public: virtual float getHeadSizeScale(); HitResult *pick(double range, float a); virtual int getMaxSpawnClusterSize(); - virtual shared_ptr getCarriedItem(); - virtual shared_ptr getArmor(int pos); + virtual std::shared_ptr getCarriedItem(); + virtual std::shared_ptr getArmor(int pos); virtual void handleEntityEvent(byte id); virtual bool isSleeping(); - virtual Icon *getItemInHandIcon(shared_ptr item, int layer); + virtual Icon *getItemInHandIcon(std::shared_ptr item, int layer); virtual bool shouldRender(Vec3 *c); protected: @@ -357,7 +357,7 @@ public: virtual void teleportTo(double x, double y, double z); virtual bool isBaby(); virtual MobType getMobType(); - virtual void breakItem(shared_ptr itemInstance); + virtual void breakItem(std::shared_ptr itemInstance); virtual bool isInvulnerable(); diff --git a/Minecraft.World/MobEffect.cpp b/Minecraft.World/MobEffect.cpp index f9687a15..f9fecc18 100644 --- a/Minecraft.World/MobEffect.cpp +++ b/Minecraft.World/MobEffect.cpp @@ -82,11 +82,11 @@ int MobEffect::getId() * This method should perform periodic updates on the player. Mainly used * for regeneration effects and the like. Other effects, such as blindness, * are in effect for the whole duration of the effect. -* +* * @param mob * @param amplification */ -void MobEffect::applyEffectTick(shared_ptr mob, int amplification) +void MobEffect::applyEffectTick(std::shared_ptr mob, int amplification) { // Maybe move this to separate class implementations in the future? @@ -120,7 +120,7 @@ void MobEffect::applyEffectTick(shared_ptr mob, int amplification) } } -void MobEffect::applyInstantenousEffect(shared_ptr source, shared_ptr mob, int amplification, double scale) +void MobEffect::applyInstantenousEffect(std::shared_ptr source, std::shared_ptr mob, int amplification, double scale) { if ((id == heal->id && !mob->isInvertedHealAndHarm()) || (id == harm->id && mob->isInvertedHealAndHarm())) { @@ -152,7 +152,7 @@ bool MobEffect::isInstantenous() * This parameter says if the applyEffect method should be called depending * on the remaining duration ticker. For instance, the regeneration will be * activated every 8 ticks, healing one point of health. -* +* * @param remainingDuration * @param amplification * Effect amplification, starts at 0 (weakest) diff --git a/Minecraft.World/MobEffect.h b/Minecraft.World/MobEffect.h index b0460bf1..6d760e87 100644 --- a/Minecraft.World/MobEffect.h +++ b/Minecraft.World/MobEffect.h @@ -86,14 +86,14 @@ protected: public: int getId(); - void applyEffectTick(shared_ptr mob, int amplification); - void applyInstantenousEffect(shared_ptr source, shared_ptr mob, int amplification, double scale); + void applyEffectTick(std::shared_ptr mob, int amplification); + void applyInstantenousEffect(std::shared_ptr source, std::shared_ptr mob, int amplification, double scale); virtual bool isInstantenous(); virtual bool isDurationEffectTick(int remainingDuration, int amplification); MobEffect *setDescriptionId(unsigned int id); unsigned int getDescriptionId(int iData = -1); - + // 4J Added MobEffect *setPostfixDescriptionId(unsigned int id); unsigned int getPostfixDescriptionId(int iData = -1); diff --git a/Minecraft.World/MobEffectInstance.cpp b/Minecraft.World/MobEffectInstance.cpp index 1e15e58c..a05b7b10 100644 --- a/Minecraft.World/MobEffectInstance.cpp +++ b/Minecraft.World/MobEffectInstance.cpp @@ -64,11 +64,11 @@ int MobEffectInstance::getAmplifier() /** * Runs the effect on a Mob target. -* +* * @param target * @return True if the effect is still active. */ -bool MobEffectInstance::tick(shared_ptr target) +bool MobEffectInstance::tick(std::shared_ptr target) { if (duration > 0) { @@ -86,7 +86,7 @@ int MobEffectInstance::tickDownDuration() return --duration; } -void MobEffectInstance::applyEffect(shared_ptr mob) +void MobEffectInstance::applyEffect(std::shared_ptr mob) { if (duration > 0) { diff --git a/Minecraft.World/MobEffectInstance.h b/Minecraft.World/MobEffectInstance.h index d1c716e6..bfecc612 100644 --- a/Minecraft.World/MobEffectInstance.h +++ b/Minecraft.World/MobEffectInstance.h @@ -24,13 +24,13 @@ public: int getId(); int getDuration(); int getAmplifier(); - bool tick(shared_ptr target); + bool tick(std::shared_ptr target); private: int tickDownDuration(); public: - void applyEffect(shared_ptr mob); + void applyEffect(std::shared_ptr mob); int getDescriptionId(); int getPostfixDescriptionId(); // 4J Added int hashCode(); diff --git a/Minecraft.World/MobSpawner.cpp b/Minecraft.World/MobSpawner.cpp index d2b4f6fd..f89ac395 100644 --- a/Minecraft.World/MobSpawner.cpp +++ b/Minecraft.World/MobSpawner.cpp @@ -100,12 +100,12 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie } MemSect(20); chunksToPoll.clear(); - + #if 0 AUTO_VAR(itEnd, level->players.end()); for (AUTO_VAR(it, level->players.begin()); it != itEnd; it++) { - shared_ptr player = *it; //level->players.at(i); + std::shared_ptr player = *it; //level->players.at(i); int xx = Mth::floor(player->x / 16); int zz = Mth::floor(player->z / 16); @@ -125,7 +125,7 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie int *zz = new int[playerCount]; for (int i = 0; i < playerCount; i++) { - shared_ptr player = level->players[i]; + std::shared_ptr player = level->players[i]; xx[i] = Mth::floor(player->x / 16); zz[i] = Mth::floor(player->z / 16); #ifdef __PSVITA__ @@ -164,20 +164,20 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie #ifdef __PSVITA__ ChunkPos cp = ChunkPos( ( xx[i] - r ) + l , ( zz[i] - r )); if( chunksToPoll.find( cp ) ) chunksToPoll.insert(cp, true); - cp = ChunkPos( ( xx[i] + r ), ( zz[i] - r ) + l ); + cp = ChunkPos( ( xx[i] + r ), ( zz[i] - r ) + l ); if( chunksToPoll.find( cp ) ) chunksToPoll.insert(cp, true); - cp = ChunkPos( ( xx[i] + r ) - l , ( zz[i] + r )); + cp = ChunkPos( ( xx[i] + r ) - l , ( zz[i] + r )); if( chunksToPoll.find( cp ) ) chunksToPoll.insert(cp, true); - cp = ChunkPos( ( xx[i] - r ), ( zz[i] + r ) - l); + cp = ChunkPos( ( xx[i] - r ), ( zz[i] + r ) - l); if( chunksToPoll.find( cp ) ) chunksToPoll.insert(cp, true); #else ChunkPos cp = ChunkPos( ( xx[i] - r ) + l , ( zz[i] - r )); if( chunksToPoll.find( cp ) == chunksToPoll.end() ) chunksToPoll.insert(std::pair(cp, true)); - cp = ChunkPos( ( xx[i] + r ), ( zz[i] - r ) + l ); + cp = ChunkPos( ( xx[i] + r ), ( zz[i] - r ) + l ); if( chunksToPoll.find( cp ) == chunksToPoll.end() ) chunksToPoll.insert(std::pair(cp, true)); - cp = ChunkPos( ( xx[i] + r ) - l , ( zz[i] + r )); + cp = ChunkPos( ( xx[i] + r ) - l , ( zz[i] + r )); if( chunksToPoll.find( cp ) == chunksToPoll.end() ) chunksToPoll.insert(std::pair(cp, true)); - cp = ChunkPos( ( xx[i] - r ), ( zz[i] + r ) - l); + cp = ChunkPos( ( xx[i] - r ), ( zz[i] + r ) - l); if( chunksToPoll.find( cp ) == chunksToPoll.end() ) chunksToPoll.insert(std::pair(cp, true)); #endif @@ -193,7 +193,7 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie MemSect(31); Pos *spawnPos = level->getSharedSpawnPos(); MemSect(0); - + for (unsigned int i = 0; i < MobCategory::values.length; i++) { MobCategory *mobCategory = MobCategory::values[i]; @@ -288,7 +288,7 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie } } - shared_ptr mob; + std::shared_ptr mob; // 4J - removed try/catch // try // { @@ -391,7 +391,7 @@ bool MobSpawner::isSpawnPositionOk(MobCategory *category, Level *level, int x, i // 4J - changed to spawn water things only in deep water int yo = 0; int liquidCount = 0; - + while( ( y - yo ) >= 0 && ( yo < 5 ) ) { if( level->getMaterial(x, y - yo, z)->isLiquid() ) liquidCount++; @@ -423,11 +423,11 @@ bool MobSpawner::isSpawnPositionOk(MobCategory *category, Level *level, int x, i } -void MobSpawner::finalizeMobSettings(shared_ptr mob, Level *level, float xx, float yy, float zz) +void MobSpawner::finalizeMobSettings(std::shared_ptr mob, Level *level, float xx, float yy, float zz) { if (dynamic_pointer_cast( mob ) != NULL && level->random->nextInt(100) == 0) { - shared_ptr skeleton = shared_ptr( new Skeleton(level) ); + std::shared_ptr skeleton = std::shared_ptr( new Skeleton(level) ); skeleton->moveTo(xx, yy, zz, mob->yRot, 0); level->addEntity(skeleton); skeleton->ride(mob); @@ -442,7 +442,7 @@ void MobSpawner::finalizeMobSettings(shared_ptr mob, Level *level, float xx { for (int kitten = 0; kitten < 2; kitten++) { - shared_ptr ozelot = shared_ptr(new Ozelot(level)); + std::shared_ptr ozelot = std::shared_ptr(new Ozelot(level)); ozelot->moveTo(xx, yy, zz, mob->yRot, 0); ozelot->setAge(-20 * 60 * 20); level->addEntity(ozelot); @@ -459,7 +459,7 @@ eINSTANCEOF MobSpawner::bedEnemies[bedEnemyCount] = { }; -bool MobSpawner::attackSleepingPlayers(Level *level, vector > *players) +bool MobSpawner::attackSleepingPlayers(Level *level, vector > *players) { bool somebodyWokeUp = false; @@ -469,7 +469,7 @@ bool MobSpawner::attackSleepingPlayers(Level *level, vector > AUTO_VAR(itEnd, players->end()); for (AUTO_VAR(it, players->begin()); it != itEnd; it++) { - shared_ptr player = (*it); + std::shared_ptr player = (*it); bool nextPlayer = false; @@ -514,7 +514,7 @@ bool MobSpawner::attackSleepingPlayers(Level *level, vector > float yy = (float) y; float zz = z + 0.5f; - shared_ptr mob; + std::shared_ptr mob; // 4J - removed try/catch // try // { @@ -619,7 +619,7 @@ void MobSpawner::postProcessSpawnMobs(Level *level, Biome *biome, int xo, int zo float yy = (float)y; float zz = z + 0.5f; - shared_ptr mob; + std::shared_ptr mob; //try { mob = dynamic_pointer_cast( EntityIO::newByEnumType(type->mobClass, level ) ); //} catch (Exception e) { diff --git a/Minecraft.World/MobSpawner.h b/Minecraft.World/MobSpawner.h index b5022a77..a426f0e6 100644 --- a/Minecraft.World/MobSpawner.h +++ b/Minecraft.World/MobSpawner.h @@ -30,7 +30,7 @@ public: static bool isSpawnPositionOk(MobCategory *category, Level *level, int x, int y, int z); private: - static void finalizeMobSettings(shared_ptr mob, Level *level, float xx, float yy, float zz); + static void finalizeMobSettings(std::shared_ptr mob, Level *level, float xx, float yy, float zz); protected: // 4J Stu TODO This was an array of Class type. I haven't made a base Class type yet, but don't need to @@ -40,7 +40,7 @@ protected: public: - static bool attackSleepingPlayers(Level *level, vector > *players); + static bool attackSleepingPlayers(Level *level, vector > *players); static void postProcessSpawnMobs(Level *level, Biome *biome, int xo, int zo, int cellWidth, int cellHeight, Random *random); }; \ No newline at end of file diff --git a/Minecraft.World/MobSpawnerTile.cpp b/Minecraft.World/MobSpawnerTile.cpp index d926fc24..b16d685f 100644 --- a/Minecraft.World/MobSpawnerTile.cpp +++ b/Minecraft.World/MobSpawnerTile.cpp @@ -7,9 +7,9 @@ MobSpawnerTile::MobSpawnerTile(int id) : EntityTile(id, Material::stone, isSolid { } -shared_ptr MobSpawnerTile::newTileEntity(Level *level) +std::shared_ptr MobSpawnerTile::newTileEntity(Level *level) { - return shared_ptr( new MobSpawnerTileEntity() ); + return std::shared_ptr( new MobSpawnerTileEntity() ); } int MobSpawnerTile::getResource(int data, Random *random, int playerBonusLevel) diff --git a/Minecraft.World/MobSpawnerTile.h b/Minecraft.World/MobSpawnerTile.h index edf3c5e7..82ef6ea4 100644 --- a/Minecraft.World/MobSpawnerTile.h +++ b/Minecraft.World/MobSpawnerTile.h @@ -9,7 +9,7 @@ class MobSpawnerTile : public EntityTile protected: MobSpawnerTile(int id); public: - virtual shared_ptr newTileEntity(Level *level); + virtual std::shared_ptr newTileEntity(Level *level); virtual int getResource(int data, Random *random, int playerBonusLevel); virtual int getResourceCount(Random *random); virtual bool isSolidRender(bool isServerLevel = false); diff --git a/Minecraft.World/MobSpawnerTileEntity.cpp b/Minecraft.World/MobSpawnerTileEntity.cpp index ce7ae1dc..31240a40 100644 --- a/Minecraft.World/MobSpawnerTileEntity.cpp +++ b/Minecraft.World/MobSpawnerTileEntity.cpp @@ -35,7 +35,7 @@ MobSpawnerTileEntity::MobSpawnerTileEntity() : TileEntity() displayEntity = nullptr; } -wstring MobSpawnerTileEntity::getEntityId() +wstring MobSpawnerTileEntity::getEntityId() { return entityId; } @@ -81,18 +81,18 @@ void MobSpawnerTileEntity::tick() if (spawnDelay == -1) delay(); - if (spawnDelay > 0) + if (spawnDelay > 0) { spawnDelay--; return; } - for (int c = 0; c < spawnCount; c++) + for (int c = 0; c < spawnCount; c++) { - shared_ptr entity = dynamic_pointer_cast (EntityIO::newEntity(entityId, level)); + std::shared_ptr entity = dynamic_pointer_cast (EntityIO::newEntity(entityId, level)); if (entity == NULL) return; - vector > *vecNearby = level->getEntitiesOfClass(typeid(*entity), AABB::newTemp(x, y, z, x + 1, y + 1, z + 1)->grow(8, 4, 8)); + vector > *vecNearby = level->getEntitiesOfClass(typeid(*entity), AABB::newTemp(x, y, z, x + 1, y + 1, z + 1)->grow(8, 4, 8)); int nearBy = (int)vecNearby->size(); //4J - IB, TODO, Mob contains no getClass delete vecNearby; @@ -110,16 +110,16 @@ void MobSpawnerTileEntity::tick() return; } - if (entity != NULL) + if (entity != NULL) { double xp = x + (level->random->nextDouble() - level->random->nextDouble()) * 4; double yp = y + level->random->nextInt(3) - 1; double zp = z + (level->random->nextDouble() - level->random->nextDouble()) * 4; - shared_ptr mob = dynamic_pointer_cast( entity ); + std::shared_ptr mob = dynamic_pointer_cast( entity ); entity->moveTo(xp, yp, zp, level->random->nextFloat() * 360, 0); - if (mob == NULL || mob->canSpawn()) + if (mob == NULL || mob->canSpawn()) { fillExtraData(entity); @@ -137,7 +137,7 @@ void MobSpawnerTileEntity::tick() TileEntity::tick(); } -void MobSpawnerTileEntity::fillExtraData(shared_ptr entity) +void MobSpawnerTileEntity::fillExtraData(std::shared_ptr entity) { if (spawnData != NULL) { @@ -156,7 +156,7 @@ void MobSpawnerTileEntity::fillExtraData(shared_ptr entity) } } -void MobSpawnerTileEntity::delay() +void MobSpawnerTileEntity::delay() { spawnDelay = minSpawnDelay + level->random->nextInt(maxSpawnDelay - minSpawnDelay); } @@ -201,11 +201,11 @@ void MobSpawnerTileEntity::save(CompoundTag *tag) } } -shared_ptr MobSpawnerTileEntity::getDisplayEntity() +std::shared_ptr MobSpawnerTileEntity::getDisplayEntity() { if (displayEntity == NULL || m_bEntityIdUpdated) { - shared_ptr e = EntityIO::newEntity(getEntityId(), NULL); + std::shared_ptr e = EntityIO::newEntity(getEntityId(), NULL); fillExtraData(e); displayEntity = e; m_bEntityIdUpdated = false; @@ -214,17 +214,17 @@ shared_ptr MobSpawnerTileEntity::getDisplayEntity() return displayEntity; } -shared_ptr MobSpawnerTileEntity::getUpdatePacket() +std::shared_ptr MobSpawnerTileEntity::getUpdatePacket() { CompoundTag *tag = new CompoundTag(); save(tag); - return shared_ptr( new TileEntityDataPacket(x, y, z, TileEntityDataPacket::TYPE_MOB_SPAWNER, tag) ); + return std::shared_ptr( new TileEntityDataPacket(x, y, z, TileEntityDataPacket::TYPE_MOB_SPAWNER, tag) ); } // 4J Added -shared_ptr MobSpawnerTileEntity::clone() +std::shared_ptr MobSpawnerTileEntity::clone() { - shared_ptr result = shared_ptr( new MobSpawnerTileEntity() ); + std::shared_ptr result = std::shared_ptr( new MobSpawnerTileEntity() ); TileEntity::clone(result); result->entityId = entityId; diff --git a/Minecraft.World/MobSpawnerTileEntity.h b/Minecraft.World/MobSpawnerTileEntity.h index 9cfb9f2f..f22f8e8f 100644 --- a/Minecraft.World/MobSpawnerTileEntity.h +++ b/Minecraft.World/MobSpawnerTileEntity.h @@ -33,8 +33,8 @@ private: int minSpawnDelay; int maxSpawnDelay; int spawnCount; - shared_ptr displayEntity; - + std::shared_ptr displayEntity; + public: MobSpawnerTileEntity(); @@ -42,7 +42,7 @@ public: void setEntityId(const wstring& entityId); bool isNearPlayer(); virtual void tick(); - void fillExtraData(shared_ptr entity); + void fillExtraData(std::shared_ptr entity); private: void delay(); @@ -51,9 +51,9 @@ public: virtual void load(CompoundTag *tag); virtual void save(CompoundTag *tag); - shared_ptr getDisplayEntity(); - virtual shared_ptr getUpdatePacket(); + std::shared_ptr getDisplayEntity(); + virtual std::shared_ptr getUpdatePacket(); // 4J Added - virtual shared_ptr clone(); + virtual std::shared_ptr clone(); }; diff --git a/Minecraft.World/MockedLevelStorage.cpp b/Minecraft.World/MockedLevelStorage.cpp index 9a7a63c0..8ac5fd7c 100644 --- a/Minecraft.World/MockedLevelStorage.cpp +++ b/Minecraft.World/MockedLevelStorage.cpp @@ -7,7 +7,7 @@ #include "ConsoleSaveFileIO.h" -LevelData *MockedLevelStorage::prepareLevel() +LevelData *MockedLevelStorage::prepareLevel() { return NULL; } @@ -21,7 +21,7 @@ ChunkStorage *MockedLevelStorage::createChunkStorage(Dimension *dimension) return NULL; } -void MockedLevelStorage::saveLevelData(LevelData *levelData, vector > *players) +void MockedLevelStorage::saveLevelData(LevelData *levelData, vector > *players) { } @@ -34,7 +34,7 @@ PlayerIO *MockedLevelStorage::getPlayerIO() return NULL; } -void MockedLevelStorage::closeAll() +void MockedLevelStorage::closeAll() { } diff --git a/Minecraft.World/MockedLevelStorage.h b/Minecraft.World/MockedLevelStorage.h index 6a9eed70..e481379e 100644 --- a/Minecraft.World/MockedLevelStorage.h +++ b/Minecraft.World/MockedLevelStorage.h @@ -5,13 +5,13 @@ using namespace std; #include "ConsoleSavePath.h" -class MockedLevelStorage : public LevelStorage +class MockedLevelStorage : public LevelStorage { public: virtual LevelData *prepareLevel(); virtual void checkSession(); virtual ChunkStorage *createChunkStorage(Dimension *dimension); - virtual void saveLevelData(LevelData *levelData, vector > *players); + virtual void saveLevelData(LevelData *levelData, vector > *players); virtual void saveLevelData(LevelData *levelData); virtual PlayerIO *getPlayerIO(); virtual void closeAll(); diff --git a/Minecraft.World/Monster.cpp b/Minecraft.World/Monster.cpp index 627ce8d1..1ec418ae 100644 --- a/Minecraft.World/Monster.cpp +++ b/Minecraft.World/Monster.cpp @@ -30,7 +30,7 @@ Monster::Monster(Level *level) : PathfinderMob( level ) xpReward = Enemy::XP_REWARD_MEDIUM; } -void Monster::aiStep() +void Monster::aiStep() { float br = getBrightness(1); if (br > 0.5f) @@ -47,28 +47,28 @@ void Monster::tick() if (!level->isClientSide && (level->difficulty == Difficulty::PEACEFUL || Minecraft::GetInstance()->isTutorial() ) ) remove(); } -shared_ptr Monster::findAttackTarget() +std::shared_ptr Monster::findAttackTarget() { #ifndef _FINAL_BUILD if(app.GetMobsDontAttackEnabled()) { - return shared_ptr(); + return std::shared_ptr(); } #endif - shared_ptr player = level->getNearestAttackablePlayer(shared_from_this(), 16); + std::shared_ptr player = level->getNearestAttackablePlayer(shared_from_this(), 16); if (player != NULL && canSee(player) ) return player; - return shared_ptr(); + return std::shared_ptr(); } bool Monster::hurt(DamageSource *source, int dmg) { if (PathfinderMob::hurt(source, dmg)) { - shared_ptr sourceEntity = source->getEntity(); + std::shared_ptr sourceEntity = source->getEntity(); if (rider.lock() == sourceEntity || riding == sourceEntity) return true; - if (sourceEntity != shared_from_this()) + if (sourceEntity != shared_from_this()) { this->attackTarget = sourceEntity; } @@ -79,11 +79,11 @@ bool Monster::hurt(DamageSource *source, int dmg) /** * Performs hurt action, returns if successful -* +* * @param target * @return */ -bool Monster::doHurtTarget(shared_ptr target) +bool Monster::doHurtTarget(std::shared_ptr target) { int dmg = attackDamage; if (hasEffect(MobEffect::damageBoost)) @@ -107,7 +107,7 @@ bool Monster::doHurtTarget(shared_ptr target) target->setOnFire(fireAspect * 4); } - shared_ptr mob = dynamic_pointer_cast(target); + std::shared_ptr mob = dynamic_pointer_cast(target); if (mob != NULL) { ThornsEnchantment::doThornsAfterAttack(shared_from_this(), mob, random); @@ -117,7 +117,7 @@ bool Monster::doHurtTarget(shared_ptr target) return didHurt; } -void Monster::checkHurtTarget(shared_ptr target, float distance) +void Monster::checkHurtTarget(std::shared_ptr target, float distance) { if (attackTime <= 0 && distance < 2.0f && target->bb->y1 > bb->y0 && target->bb->y0 < bb->y1) { @@ -140,7 +140,7 @@ bool Monster::isDarkEnoughToSpawn() int br = level->getRawBrightness(xt, yt, zt); - if (level->isThundering()) + if (level->isThundering()) { int tmp = level->skyDarken; level->skyDarken = 10; diff --git a/Minecraft.World/Monster.h b/Minecraft.World/Monster.h index 2bad48da..804760ee 100644 --- a/Minecraft.World/Monster.h +++ b/Minecraft.World/Monster.h @@ -27,14 +27,14 @@ public: virtual void tick(); protected: - virtual shared_ptr findAttackTarget(); + virtual std::shared_ptr findAttackTarget(); public: virtual bool hurt(DamageSource *source, int dmg); - virtual bool doHurtTarget(shared_ptr target); + virtual bool doHurtTarget(std::shared_ptr target); protected: - virtual void checkHurtTarget(shared_ptr target, float distance); + virtual void checkHurtTarget(std::shared_ptr target, float distance); public: virtual float getWalkTargetValue(int x, int y, int z); diff --git a/Minecraft.World/MonsterPlacerItem.cpp b/Minecraft.World/MonsterPlacerItem.cpp index a2970033..3c7809fe 100644 --- a/Minecraft.World/MonsterPlacerItem.cpp +++ b/Minecraft.World/MonsterPlacerItem.cpp @@ -18,7 +18,7 @@ MonsterPlacerItem::MonsterPlacerItem(int id) : Item(id) overlay = NULL; } -wstring MonsterPlacerItem::getHoverName(shared_ptr itemInstance) +wstring MonsterPlacerItem::getHoverName(std::shared_ptr itemInstance) { wstring elementName = getDescription(); @@ -29,14 +29,14 @@ wstring MonsterPlacerItem::getHoverName(shared_ptr itemInstance) //elementName += " " + I18n.get("entity." + encodeId + ".name"); } else - { + { elementName = replaceAll(elementName,L"{*CREATURE*}",L""); } return elementName; } -int MonsterPlacerItem::getColor(shared_ptr item, int spriteLayer) +int MonsterPlacerItem::getColor(std::shared_ptr item, int spriteLayer) { AUTO_VAR(it, EntityIO::idsSpawnableInCreative.find(item->getAuxValue())); if (it != EntityIO::idsSpawnableInCreative.end()) @@ -65,9 +65,9 @@ Icon *MonsterPlacerItem::getLayerIcon(int auxValue, int spriteLayer) } // 4J-PB - added for dispenser -shared_ptr MonsterPlacerItem::canSpawn(int iAuxVal, Level *level, int *piResult) +std::shared_ptr MonsterPlacerItem::canSpawn(int iAuxVal, Level *level, int *piResult) { - shared_ptr newEntity = EntityIO::newById(iAuxVal, level); + std::shared_ptr newEntity = EntityIO::newById(iAuxVal, level); if (newEntity != NULL) { bool canSpawn = false; @@ -166,7 +166,7 @@ shared_ptr MonsterPlacerItem::canSpawn(int iAuxVal, Level *level, int *p return nullptr; } -bool MonsterPlacerItem::useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool MonsterPlacerItem::useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { if (level->isClientSide) { @@ -181,7 +181,7 @@ bool MonsterPlacerItem::useOn(shared_ptr itemInstance, shared_ptr< // 4J Stu - Force adding this as a tile update level->setTile(x,y,z,0); level->setTile(x,y,z,Tile::mobSpawner_Id); - shared_ptr mste = dynamic_pointer_cast( level->getTileEntity(x,y,z) ); + std::shared_ptr mste = dynamic_pointer_cast( level->getTileEntity(x,y,z) ); if(mste != NULL) { mste->setEntityId( EntityIO::getEncodeId(itemInstance->getAuxValue()) ); @@ -193,7 +193,7 @@ bool MonsterPlacerItem::useOn(shared_ptr itemInstance, shared_ptr< x += Facing::STEP_X[face]; y += Facing::STEP_Y[face]; z += Facing::STEP_Z[face]; - + double yOff = 0; // 4J-PB - missing parentheses added if (face == Facing::UP && (tile == Tile::fence_Id || tile == Tile::netherFence_Id)) @@ -211,11 +211,11 @@ bool MonsterPlacerItem::useOn(shared_ptr itemInstance, shared_ptr< } if (spawned) - { + { if (!player->abilities.instabuild) { itemInstance->count--; - } + } } else { @@ -254,20 +254,20 @@ bool MonsterPlacerItem::useOn(shared_ptr itemInstance, shared_ptr< return true; } -shared_ptr MonsterPlacerItem::spawnMobAt(Level *level, int mobId, double x, double y, double z, int *piResult) +std::shared_ptr MonsterPlacerItem::spawnMobAt(Level *level, int mobId, double x, double y, double z, int *piResult) { if (EntityIO::idsSpawnableInCreative.find(mobId) == EntityIO::idsSpawnableInCreative.end()) { return nullptr; } - shared_ptr newEntity = nullptr; + std::shared_ptr newEntity = nullptr; for (int i = 0; i < SPAWN_COUNT; i++) { newEntity = canSpawn(mobId, level, piResult); - shared_ptr mob = dynamic_pointer_cast(newEntity); + std::shared_ptr mob = dynamic_pointer_cast(newEntity); if (mob) { newEntity->moveTo(x, y, z, Mth::wrapDegrees(level->random->nextFloat() * 360), 0); diff --git a/Minecraft.World/MonsterPlacerItem.h b/Minecraft.World/MonsterPlacerItem.h index f1cead6d..bccca915 100644 --- a/Minecraft.World/MonsterPlacerItem.h +++ b/Minecraft.World/MonsterPlacerItem.h @@ -27,15 +27,15 @@ public: MonsterPlacerItem(int id); - virtual wstring getHoverName(shared_ptr itemInstance); - virtual int getColor(shared_ptr item, int spriteLayer); + virtual wstring getHoverName(std::shared_ptr itemInstance); + virtual int getColor(std::shared_ptr item, int spriteLayer); virtual bool hasMultipleSpriteLayers(); virtual Icon *getLayerIcon(int auxValue, int spriteLayer); - virtual bool useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - static shared_ptr spawnMobAt(Level *level, int mobId, double x, double y, double z, int *piResult); // 4J Added piResult param + virtual bool useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + static std::shared_ptr spawnMobAt(Level *level, int mobId, double x, double y, double z, int *piResult); // 4J Added piResult param // 4J-PB added for dispenser - static shared_ptr canSpawn(int iAuxVal, Level *level, int *piResult); + static std::shared_ptr canSpawn(int iAuxVal, Level *level, int *piResult); //@Override void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/MonsterRoomFeature.cpp b/Minecraft.World/MonsterRoomFeature.cpp index cd44376a..cd8e4d53 100644 --- a/Minecraft.World/MonsterRoomFeature.cpp +++ b/Minecraft.World/MonsterRoomFeature.cpp @@ -84,12 +84,12 @@ bool MonsterRoomFeature::place(Level *level, Random *random, int x, int y, int z if (count != 1) continue; level->setTile(xc, yc, zc, Tile::chest_Id); - shared_ptr chest = dynamic_pointer_cast( level->getTileEntity(xc, yc, zc) ); + std::shared_ptr chest = dynamic_pointer_cast( level->getTileEntity(xc, yc, zc) ); if (chest != NULL ) { for (int j = 0; j < 8; j++) { - shared_ptr item = randomItem(random); + std::shared_ptr item = randomItem(random); if (item != NULL) chest->setItem(random->nextInt(chest->getContainerSize()), item); } } @@ -100,7 +100,7 @@ bool MonsterRoomFeature::place(Level *level, Random *random, int x, int y, int z level->setTile(x, y, z, Tile::mobSpawner_Id); - shared_ptr entity = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr entity = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if( entity != NULL ) { entity->setEntityId(randomEntityId(random)); @@ -110,23 +110,23 @@ bool MonsterRoomFeature::place(Level *level, Random *random, int x, int y, int z } -shared_ptr MonsterRoomFeature::randomItem(Random *random) +std::shared_ptr MonsterRoomFeature::randomItem(Random *random) { int type = random->nextInt(12); - if (type == 0) return shared_ptr( new ItemInstance(Item::saddle) ); - if (type == 1) return shared_ptr( new ItemInstance(Item::ironIngot, random->nextInt(4) + 1) ); - if (type == 2) return shared_ptr( new ItemInstance(Item::bread) ); - if (type == 3) return shared_ptr( new ItemInstance(Item::wheat, random->nextInt(4) + 1) ); - if (type == 4) return shared_ptr( new ItemInstance(Item::sulphur, random->nextInt(4) + 1) ); - if (type == 5) return shared_ptr( new ItemInstance(Item::string, random->nextInt(4) + 1) ); - if (type == 6) return shared_ptr( new ItemInstance(Item::bucket_empty) ); - if (type == 7 && random->nextInt(100) == 0) return shared_ptr( new ItemInstance(Item::apple_gold) ); - if (type == 8 && random->nextInt(2) == 0) return shared_ptr( new ItemInstance(Item::redStone, random->nextInt(4) + 1) ); - if (type == 9 && random->nextInt(10) == 0) return shared_ptr( new ItemInstance( Item::items[Item::record_01->id + random->nextInt(2)]) ); - if (type == 10) return shared_ptr( new ItemInstance(Item::dye_powder, 1, DyePowderItem::BROWN) ); + if (type == 0) return std::shared_ptr( new ItemInstance(Item::saddle) ); + if (type == 1) return std::shared_ptr( new ItemInstance(Item::ironIngot, random->nextInt(4) + 1) ); + if (type == 2) return std::shared_ptr( new ItemInstance(Item::bread) ); + if (type == 3) return std::shared_ptr( new ItemInstance(Item::wheat, random->nextInt(4) + 1) ); + if (type == 4) return std::shared_ptr( new ItemInstance(Item::sulphur, random->nextInt(4) + 1) ); + if (type == 5) return std::shared_ptr( new ItemInstance(Item::string, random->nextInt(4) + 1) ); + if (type == 6) return std::shared_ptr( new ItemInstance(Item::bucket_empty) ); + if (type == 7 && random->nextInt(100) == 0) return std::shared_ptr( new ItemInstance(Item::apple_gold) ); + if (type == 8 && random->nextInt(2) == 0) return std::shared_ptr( new ItemInstance(Item::redStone, random->nextInt(4) + 1) ); + if (type == 9 && random->nextInt(10) == 0) return std::shared_ptr( new ItemInstance( Item::items[Item::record_01->id + random->nextInt(2)]) ); + if (type == 10) return std::shared_ptr( new ItemInstance(Item::dye_powder, 1, DyePowderItem::BROWN) ); if (type == 11) return Item::enchantedBook->createForRandomLoot(random); - return shared_ptr(); + return std::shared_ptr(); } wstring MonsterRoomFeature::randomEntityId(Random *random) diff --git a/Minecraft.World/MonsterRoomFeature.h b/Minecraft.World/MonsterRoomFeature.h index 88304ad6..81eeafde 100644 --- a/Minecraft.World/MonsterRoomFeature.h +++ b/Minecraft.World/MonsterRoomFeature.h @@ -11,6 +11,6 @@ public: virtual bool place(Level *level, Random *random, int x, int y, int z); private: - shared_ptr randomItem(Random *random); + std::shared_ptr randomItem(Random *random); wstring randomEntityId(Random *random); }; diff --git a/Minecraft.World/MoveEntityPacket.cpp b/Minecraft.World/MoveEntityPacket.cpp index b52482f5..ce33c019 100644 --- a/Minecraft.World/MoveEntityPacket.cpp +++ b/Minecraft.World/MoveEntityPacket.cpp @@ -4,7 +4,7 @@ #include "PacketListener.h" #include "MoveEntityPacket.h" -MoveEntityPacket::MoveEntityPacket() +MoveEntityPacket::MoveEntityPacket() { hasRot = false; @@ -28,7 +28,7 @@ MoveEntityPacket::MoveEntityPacket(int id) xRot = 0; } -void MoveEntityPacket::read(DataInputStream *dis) //throws IOException +void MoveEntityPacket::read(DataInputStream *dis) //throws IOException { id = dis->readShort(); } @@ -48,7 +48,7 @@ void MoveEntityPacket::handle(PacketListener *listener) listener->handleMoveEntity(shared_from_this()); } -int MoveEntityPacket::getEstimatedSize() +int MoveEntityPacket::getEstimatedSize() { return 2; } @@ -58,9 +58,9 @@ bool MoveEntityPacket::canBeInvalidated() return true; } -bool MoveEntityPacket::isInvalidatedBy(shared_ptr packet) +bool MoveEntityPacket::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target != NULL && target->id == id; } @@ -79,7 +79,7 @@ MoveEntityPacket::PosRot::PosRot(int id, char xa, char ya, char za, char yRot, c hasRot = true; } -void MoveEntityPacket::PosRot::read(DataInputStream *dis) //throws IOException +void MoveEntityPacket::PosRot::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); xa = dis->readByte(); @@ -89,7 +89,7 @@ void MoveEntityPacket::PosRot::read(DataInputStream *dis) //throws IOException xRot = dis->readByte(); } -void MoveEntityPacket::PosRot::write(DataOutputStream *dos) //throws IOException +void MoveEntityPacket::PosRot::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); dos->writeByte(xa); @@ -99,12 +99,12 @@ void MoveEntityPacket::PosRot::write(DataOutputStream *dos) //throws IOException dos->writeByte(xRot); } -int MoveEntityPacket::PosRot::getEstimatedSize() +int MoveEntityPacket::PosRot::getEstimatedSize() { return 2+5; } -MoveEntityPacket::Pos::Pos() +MoveEntityPacket::Pos::Pos() { } @@ -115,7 +115,7 @@ MoveEntityPacket::Pos::Pos(int id, char xa, char ya, char za) : MoveEntityPacket this->za = za; } -void MoveEntityPacket::Pos::read(DataInputStream *dis) //throws IOException +void MoveEntityPacket::Pos::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); xa = dis->readByte(); @@ -136,7 +136,7 @@ int MoveEntityPacket::Pos::getEstimatedSize() return 2+3; } -MoveEntityPacket::Rot::Rot() +MoveEntityPacket::Rot::Rot() { hasRot = true; } @@ -148,14 +148,14 @@ MoveEntityPacket::Rot::Rot(int id, char yRot, char xRot) : MoveEntityPacket(id) hasRot = true; } -void MoveEntityPacket::Rot::read(DataInputStream *dis) //throws IOException +void MoveEntityPacket::Rot::read(DataInputStream *dis) //throws IOException { MoveEntityPacket::read(dis); yRot = dis->readByte(); xRot = dis->readByte(); } -void MoveEntityPacket::Rot::write(DataOutputStream *dos) //throws IOException +void MoveEntityPacket::Rot::write(DataOutputStream *dos) //throws IOException { MoveEntityPacket::write(dos); dos->writeByte(yRot); diff --git a/Minecraft.World/MoveEntityPacket.h b/Minecraft.World/MoveEntityPacket.h index ab16ac3a..7dbe0c29 100644 --- a/Minecraft.World/MoveEntityPacket.h +++ b/Minecraft.World/MoveEntityPacket.h @@ -24,10 +24,10 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new MoveEntityPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new MoveEntityPacket()); } virtual int getId() { return 30; } }; @@ -42,7 +42,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new MoveEntityPacket::PosRot()); } + static std::shared_ptr create() { return std::shared_ptr(new MoveEntityPacket::PosRot()); } virtual int getId() { return 33; } }; @@ -57,7 +57,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new MoveEntityPacket::Pos()); } + static std::shared_ptr create() { return std::shared_ptr(new MoveEntityPacket::Pos()); } virtual int getId() { return 31; } }; @@ -72,7 +72,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new MoveEntityPacket::Rot()); } + static std::shared_ptr create() { return std::shared_ptr(new MoveEntityPacket::Rot()); } virtual int getId() { return 32; } }; \ No newline at end of file diff --git a/Minecraft.World/MoveEntityPacketSmall.cpp b/Minecraft.World/MoveEntityPacketSmall.cpp index 8216478f..8a46537f 100644 --- a/Minecraft.World/MoveEntityPacketSmall.cpp +++ b/Minecraft.World/MoveEntityPacketSmall.cpp @@ -5,7 +5,7 @@ #include "MoveEntityPacketSmall.h" -MoveEntityPacketSmall::MoveEntityPacketSmall() +MoveEntityPacketSmall::MoveEntityPacketSmall() { hasRot = false; @@ -35,7 +35,7 @@ MoveEntityPacketSmall::MoveEntityPacketSmall(int id) xRot = 0; } -void MoveEntityPacketSmall::read(DataInputStream *dis) //throws IOException +void MoveEntityPacketSmall::read(DataInputStream *dis) //throws IOException { id = dis->readShort(); } @@ -55,7 +55,7 @@ void MoveEntityPacketSmall::handle(PacketListener *listener) listener->handleMoveEntitySmall(shared_from_this()); } -int MoveEntityPacketSmall::getEstimatedSize() +int MoveEntityPacketSmall::getEstimatedSize() { return 2; } @@ -65,9 +65,9 @@ bool MoveEntityPacketSmall::canBeInvalidated() return true; } -bool MoveEntityPacketSmall::isInvalidatedBy(shared_ptr packet) +bool MoveEntityPacketSmall::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target != NULL && target->id == id; } @@ -86,18 +86,18 @@ MoveEntityPacketSmall::PosRot::PosRot(int id, char xa, char ya, char za, char yR hasRot = true; } -void MoveEntityPacketSmall::PosRot::read(DataInputStream *dis) //throws IOException +void MoveEntityPacketSmall::PosRot::read(DataInputStream *dis) //throws IOException { int idAndRot = dis->readShort(); this->id = idAndRot & 0x07ff; this->yRot = idAndRot >> 11; int xAndYAndZ = (int)dis->readShort(); - this->xa = xAndYAndZ >> 11; + this->xa = xAndYAndZ >> 11; this->ya = (xAndYAndZ << 21 ) >> 26; this->za = (xAndYAndZ << 27 ) >> 27; } -void MoveEntityPacketSmall::PosRot::write(DataOutputStream *dos) //throws IOException +void MoveEntityPacketSmall::PosRot::write(DataOutputStream *dos) //throws IOException { if( (id < 0 ) || (id >= 2048 ) ) { @@ -110,12 +110,12 @@ void MoveEntityPacketSmall::PosRot::write(DataOutputStream *dos) //throws IOExce dos->writeShort(xAndYAndZ); } -int MoveEntityPacketSmall::PosRot::getEstimatedSize() +int MoveEntityPacketSmall::PosRot::getEstimatedSize() { return 4; } -MoveEntityPacketSmall::Pos::Pos() +MoveEntityPacketSmall::Pos::Pos() { } @@ -126,7 +126,7 @@ MoveEntityPacketSmall::Pos::Pos(int id, char xa, char ya, char za) : MoveEntityP this->za = za; } -void MoveEntityPacketSmall::Pos::read(DataInputStream *dis) //throws IOException +void MoveEntityPacketSmall::Pos::read(DataInputStream *dis) //throws IOException { int idAndY = dis->readShort(); this->id = idAndY & 0x07ff; @@ -154,7 +154,7 @@ int MoveEntityPacketSmall::Pos::getEstimatedSize() return 3; } -MoveEntityPacketSmall::Rot::Rot() +MoveEntityPacketSmall::Rot::Rot() { hasRot = true; } @@ -167,14 +167,14 @@ MoveEntityPacketSmall::Rot::Rot(int id, char yRot, char xRot) : MoveEntityPacket hasRot = true; } -void MoveEntityPacketSmall::Rot::read(DataInputStream *dis) //throws IOException +void MoveEntityPacketSmall::Rot::read(DataInputStream *dis) //throws IOException { int idAndRot = (int)dis->readShort(); this->id = idAndRot & 0x07ff; this->yRot = idAndRot >> 11; } -void MoveEntityPacketSmall::Rot::write(DataOutputStream *dos) //throws IOException +void MoveEntityPacketSmall::Rot::write(DataOutputStream *dos) //throws IOException { if( (id < 0 ) || (id >= 2048 ) ) { diff --git a/Minecraft.World/MoveEntityPacketSmall.h b/Minecraft.World/MoveEntityPacketSmall.h index 4218f11b..2fc54dd6 100644 --- a/Minecraft.World/MoveEntityPacketSmall.h +++ b/Minecraft.World/MoveEntityPacketSmall.h @@ -24,10 +24,10 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new MoveEntityPacketSmall()); } + static std::shared_ptr create() { return std::shared_ptr(new MoveEntityPacketSmall()); } virtual int getId() { return 162; } }; @@ -42,7 +42,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new MoveEntityPacketSmall::PosRot()); } + static std::shared_ptr create() { return std::shared_ptr(new MoveEntityPacketSmall::PosRot()); } virtual int getId() { return 165; } }; @@ -57,7 +57,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new MoveEntityPacketSmall::Pos()); } + static std::shared_ptr create() { return std::shared_ptr(new MoveEntityPacketSmall::Pos()); } virtual int getId() { return 163; } }; @@ -73,7 +73,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new MoveEntityPacketSmall::Rot()); } + static std::shared_ptr create() { return std::shared_ptr(new MoveEntityPacketSmall::Rot()); } virtual int getId() { return 164; } }; \ No newline at end of file diff --git a/Minecraft.World/MoveIndoorsGoal.cpp b/Minecraft.World/MoveIndoorsGoal.cpp index 215f9a29..697b2840 100644 --- a/Minecraft.World/MoveIndoorsGoal.cpp +++ b/Minecraft.World/MoveIndoorsGoal.cpp @@ -21,9 +21,9 @@ bool MoveIndoorsGoal::canUse() if ((mob->level->isDay() && !mob->level->isRaining()) || mob->level->dimension->hasCeiling) return false; if (mob->getRandom()->nextInt(50) != 0) return false; if (insideX != -1 && mob->distanceToSqr(insideX, mob->y, insideZ) < 2 * 2) return false; - shared_ptr village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 14); + std::shared_ptr village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 14); if (village == NULL) return false; - shared_ptr _doorInfo = village->getBestDoorInfo(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)); + std::shared_ptr _doorInfo = village->getBestDoorInfo(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)); doorInfo = _doorInfo; return _doorInfo != NULL; } @@ -36,7 +36,7 @@ bool MoveIndoorsGoal::canContinueToUse() void MoveIndoorsGoal::start() { insideX = -1; - shared_ptr _doorInfo = doorInfo.lock(); + std::shared_ptr _doorInfo = doorInfo.lock(); if( _doorInfo == NULL ) { doorInfo = weak_ptr(); @@ -52,7 +52,7 @@ void MoveIndoorsGoal::start() void MoveIndoorsGoal::stop() { - shared_ptr _doorInfo = doorInfo.lock(); + std::shared_ptr _doorInfo = doorInfo.lock(); if( _doorInfo == NULL ) { doorInfo = weak_ptr(); diff --git a/Minecraft.World/MovePlayerPacket.cpp b/Minecraft.World/MovePlayerPacket.cpp index 9f0a8867..e5153cb5 100644 --- a/Minecraft.World/MovePlayerPacket.cpp +++ b/Minecraft.World/MovePlayerPacket.cpp @@ -4,7 +4,7 @@ #include "PacketListener.h" #include "MovePlayerPacket.h" -MovePlayerPacket::MovePlayerPacket() +MovePlayerPacket::MovePlayerPacket() { x = 0; y = 0; @@ -33,12 +33,12 @@ MovePlayerPacket::MovePlayerPacket(bool onGround, bool isFlying) this->isFlying = isFlying; } -void MovePlayerPacket::handle(PacketListener *listener) +void MovePlayerPacket::handle(PacketListener *listener) { listener->handleMovePlayer(shared_from_this()); } -void MovePlayerPacket::read(DataInputStream *dis) //throws IOException +void MovePlayerPacket::read(DataInputStream *dis) //throws IOException { char value = dis->read(); onGround = (value & 0x1) != 0; @@ -46,7 +46,7 @@ void MovePlayerPacket::read(DataInputStream *dis) //throws IOException //onGround = dis->read() != 0; } -void MovePlayerPacket::write(DataOutputStream *dos) //throws IOException +void MovePlayerPacket::write(DataOutputStream *dos) //throws IOException { char value = (onGround ? 0x1 : 0) | (isFlying ? 0x2 : 0); dos->write(value); @@ -63,7 +63,7 @@ bool MovePlayerPacket::canBeInvalidated() return true; } -bool MovePlayerPacket::isInvalidatedBy(shared_ptr packet) +bool MovePlayerPacket::isInvalidatedBy(std::shared_ptr packet) { return true; } @@ -88,7 +88,7 @@ MovePlayerPacket::PosRot::PosRot(double x, double y, double yView, double z, flo this->isFlying = isFlying; } -void MovePlayerPacket::PosRot::read(DataInputStream *dis) //throws IOException +void MovePlayerPacket::PosRot::read(DataInputStream *dis) //throws IOException { x = dis->readDouble(); y = dis->readDouble(); @@ -99,7 +99,7 @@ void MovePlayerPacket::PosRot::read(DataInputStream *dis) //throws IOException MovePlayerPacket::read(dis); } -void MovePlayerPacket::PosRot::write(DataOutputStream *dos) //throws IOException +void MovePlayerPacket::PosRot::write(DataOutputStream *dos) //throws IOException { dos->writeDouble(x); dos->writeDouble(y); @@ -120,7 +120,7 @@ MovePlayerPacket::Pos::Pos() hasPos = true; } -MovePlayerPacket::Pos::Pos(double x, double y, double yView, double z, bool onGround, bool isFlying) +MovePlayerPacket::Pos::Pos(double x, double y, double yView, double z, bool onGround, bool isFlying) { this->x = x; this->y = y; @@ -149,17 +149,17 @@ void MovePlayerPacket::Pos::write(DataOutputStream *dos) //throws IOException MovePlayerPacket::write(dos); } -int MovePlayerPacket::Pos::getEstimatedSize() +int MovePlayerPacket::Pos::getEstimatedSize() { return 8 * 4 + 1; } -MovePlayerPacket::Rot::Rot() +MovePlayerPacket::Rot::Rot() { hasRot = true; } -MovePlayerPacket::Rot::Rot(float yRot, float xRot, bool onGround, bool isFlying) +MovePlayerPacket::Rot::Rot(float yRot, float xRot, bool onGround, bool isFlying) { this->yRot = yRot; this->xRot = xRot; @@ -168,7 +168,7 @@ MovePlayerPacket::Rot::Rot(float yRot, float xRot, bool onGround, bool isFlying) this->isFlying = isFlying; } -void MovePlayerPacket::Rot::read(DataInputStream *dis) //throws IOException +void MovePlayerPacket::Rot::read(DataInputStream *dis) //throws IOException { yRot = dis->readFloat(); xRot = dis->readFloat(); @@ -182,7 +182,7 @@ void MovePlayerPacket::Rot::write(DataOutputStream *dos) //throws IOException MovePlayerPacket::write(dos); } -int MovePlayerPacket::Rot::getEstimatedSize() +int MovePlayerPacket::Rot::getEstimatedSize() { return 8 + 1; } diff --git a/Minecraft.World/MovePlayerPacket.h b/Minecraft.World/MovePlayerPacket.h index 26ae8392..d91c0c37 100644 --- a/Minecraft.World/MovePlayerPacket.h +++ b/Minecraft.World/MovePlayerPacket.h @@ -24,10 +24,10 @@ public: virtual void write(DataOutputStream *dos); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new MovePlayerPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new MovePlayerPacket()); } virtual int getId() { return 10; } }; @@ -42,7 +42,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new MovePlayerPacket::PosRot()); } + static std::shared_ptr create() { return std::shared_ptr(new MovePlayerPacket::PosRot()); } virtual int getId() { return 13; } }; @@ -57,7 +57,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new MovePlayerPacket::Pos()); } + static std::shared_ptr create() { return std::shared_ptr(new MovePlayerPacket::Pos()); } virtual int getId() { return 11; } }; @@ -72,7 +72,7 @@ public: virtual void write(DataOutputStream *dos); virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new MovePlayerPacket::Rot()); } + static std::shared_ptr create() { return std::shared_ptr(new MovePlayerPacket::Rot()); } virtual int getId() { return 12; } }; \ No newline at end of file diff --git a/Minecraft.World/MoveThroughVillageGoal.cpp b/Minecraft.World/MoveThroughVillageGoal.cpp index 2405374f..40acca5d 100644 --- a/Minecraft.World/MoveThroughVillageGoal.cpp +++ b/Minecraft.World/MoveThroughVillageGoal.cpp @@ -31,10 +31,10 @@ bool MoveThroughVillageGoal::canUse() if (onlyAtNight && mob->level->isDay()) return false; - shared_ptr village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 0); + std::shared_ptr village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 0); if (village == NULL) return false; - shared_ptr _doorInfo = getNextDoorInfo(village); + std::shared_ptr _doorInfo = getNextDoorInfo(village); if (_doorInfo == NULL) return false; doorInfo = _doorInfo; @@ -59,7 +59,7 @@ bool MoveThroughVillageGoal::canContinueToUse() { if (mob->getNavigation()->isDone()) return false; float dist = mob->bbWidth + 4.f; - shared_ptr _doorInfo = doorInfo.lock(); + std::shared_ptr _doorInfo = doorInfo.lock(); if( _doorInfo == NULL ) return false; return mob->distanceToSqr(_doorInfo->x, _doorInfo->y, _doorInfo->z) > dist * dist; @@ -73,7 +73,7 @@ void MoveThroughVillageGoal::start() void MoveThroughVillageGoal::stop() { - shared_ptr _doorInfo = doorInfo.lock(); + std::shared_ptr _doorInfo = doorInfo.lock(); if( _doorInfo == NULL ) return; if (mob->getNavigation()->isDone() || mob->distanceToSqr(_doorInfo->x, _doorInfo->y, _doorInfo->z) < 4 * 4) @@ -82,15 +82,15 @@ void MoveThroughVillageGoal::stop() } } -shared_ptr MoveThroughVillageGoal::getNextDoorInfo(shared_ptr village) +std::shared_ptr MoveThroughVillageGoal::getNextDoorInfo(std::shared_ptr village) { - shared_ptr closest = nullptr; + std::shared_ptr closest = nullptr; int closestDistSqr = Integer::MAX_VALUE; - vector > *doorInfos = village->getDoorInfos(); + vector > *doorInfos = village->getDoorInfos(); //for (DoorInfo di : doorInfos) for(AUTO_VAR(it, doorInfos->begin()); it != doorInfos->end(); ++it) { - shared_ptr di = *it; + std::shared_ptr di = *it; int distSqr = di->distanceToSqr(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)); if (distSqr < closestDistSqr) { @@ -102,12 +102,12 @@ shared_ptr MoveThroughVillageGoal::getNextDoorInfo(shared_ptr return closest; } -bool MoveThroughVillageGoal::hasVisited(shared_ptrdi) +bool MoveThroughVillageGoal::hasVisited(std::shared_ptrdi) { //for (DoorInfo di2 : visited) for(AUTO_VAR(it, visited.begin()); it != visited.end(); ) { - shared_ptr di2 = (*it).lock(); + std::shared_ptr di2 = (*it).lock(); if( di2 == NULL ) { it = visited.erase(it); diff --git a/Minecraft.World/MoveThroughVillageGoal.h b/Minecraft.World/MoveThroughVillageGoal.h index a087e522..1d14d587 100644 --- a/Minecraft.World/MoveThroughVillageGoal.h +++ b/Minecraft.World/MoveThroughVillageGoal.h @@ -26,7 +26,7 @@ public: virtual void stop(); private: - shared_ptr getNextDoorInfo(shared_ptr village); - bool hasVisited(shared_ptr di); + std::shared_ptr getNextDoorInfo(std::shared_ptr village); + bool hasVisited(std::shared_ptr di); void updateVisited(); }; \ No newline at end of file diff --git a/Minecraft.World/MultiTextureTileItem.cpp b/Minecraft.World/MultiTextureTileItem.cpp index a41a896f..6af8acd2 100644 --- a/Minecraft.World/MultiTextureTileItem.cpp +++ b/Minecraft.World/MultiTextureTileItem.cpp @@ -13,19 +13,19 @@ MultiTextureTileItem::MultiTextureTileItem(int id, Tile *parentTile, int *nameEx setStackedByData(true); } -Icon *MultiTextureTileItem::getIcon(int itemAuxValue) +Icon *MultiTextureTileItem::getIcon(int itemAuxValue) { return parentTile->getTexture(2, itemAuxValue); } -int MultiTextureTileItem::getLevelDataForAuxValue(int auxValue) +int MultiTextureTileItem::getLevelDataForAuxValue(int auxValue) { return auxValue; } unsigned int MultiTextureTileItem::getDescriptionId(int iData) { - if (iData < 0 || iData >= m_iNameExtensionsLength) + if (iData < 0 || iData >= m_iNameExtensionsLength) { iData = 0; } @@ -33,10 +33,10 @@ unsigned int MultiTextureTileItem::getDescriptionId(int iData) return nameExtensions[iData]; } -unsigned int MultiTextureTileItem::getDescriptionId(shared_ptr instance) +unsigned int MultiTextureTileItem::getDescriptionId(std::shared_ptr instance) { int auxValue = instance->getAuxValue(); - if (auxValue < 0 || auxValue >= m_iNameExtensionsLength) + if (auxValue < 0 || auxValue >= m_iNameExtensionsLength) { auxValue = 0; } diff --git a/Minecraft.World/MultiTextureTileItem.h b/Minecraft.World/MultiTextureTileItem.h index 078357ea..028169cd 100644 --- a/Minecraft.World/MultiTextureTileItem.h +++ b/Minecraft.World/MultiTextureTileItem.h @@ -4,7 +4,7 @@ class Tile; -class MultiTextureTileItem : public TileItem +class MultiTextureTileItem : public TileItem { private: Tile *parentTile; @@ -18,5 +18,5 @@ public: virtual Icon *getIcon(int itemAuxValue); virtual int getLevelDataForAuxValue(int auxValue); virtual unsigned int getDescriptionId(int iData = -1); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); }; diff --git a/Minecraft.World/MushroomCow.cpp b/Minecraft.World/MushroomCow.cpp index a2aef158..179746f1 100644 --- a/Minecraft.World/MushroomCow.cpp +++ b/Minecraft.World/MushroomCow.cpp @@ -20,18 +20,18 @@ MushroomCow::MushroomCow(Level *level) : Cow(level) this->setSize(0.9f, 1.3f); } -bool MushroomCow::interact(shared_ptr player) +bool MushroomCow::interact(std::shared_ptr player) { - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); if (item != NULL && item->id == Item::bowl_Id && getAge() >= 0) { - if (item->count == 1) + if (item->count == 1) { - player->inventory->setItem(player->inventory->selected, shared_ptr( new ItemInstance(Item::mushroomStew) ) ); + player->inventory->setItem(player->inventory->selected, std::shared_ptr( new ItemInstance(Item::mushroomStew) ) ); return true; } - if (player->inventory->add(shared_ptr(new ItemInstance(Item::mushroomStew))) && !player->abilities.instabuild) + if (player->inventory->add(std::shared_ptr(new ItemInstance(Item::mushroomStew))) && !player->abilities.instabuild) { player->inventory->removeItem(player->inventory->selected, 1); return true; @@ -45,16 +45,16 @@ bool MushroomCow::interact(shared_ptr player) { // 4J Stu - We don't need to check spawn limits when adding the new cow, as we are removing the MushroomCow remove(); - shared_ptr cow = shared_ptr( new Cow(level) ); + std::shared_ptr cow = std::shared_ptr( new Cow(level) ); cow->moveTo(x, y, z, yRot, xRot); cow->setHealth(getHealth()); cow->yBodyRot = yBodyRot; level->addEntity(cow); for (int i = 0; i < 5; i++) { - level->addEntity( shared_ptr( new ItemEntity(level, x, y + bbHeight, z, shared_ptr( new ItemInstance(Tile::mushroom2))) )); + level->addEntity( std::shared_ptr( new ItemEntity(level, x, y + bbHeight, z, std::shared_ptr( new ItemInstance(Tile::mushroom2))) )); } - return true; + return true; } return true; } @@ -70,12 +70,12 @@ bool MushroomCow::canSpawn() return ( level->getTile(xt, yt - 1, zt) == Tile::grass_Id || level->getTile(xt, yt - 1, zt) == Tile::mycel_Id ) && level->getDaytimeRawBrightness(xt, yt, zt) > 8 && PathfinderMob::canSpawn(); } -shared_ptr MushroomCow::getBreedOffspring(shared_ptr target) +std::shared_ptr MushroomCow::getBreedOffspring(std::shared_ptr target) { // 4J - added limit to number of animals that can be bred if( level->canCreateMore( GetType(), Level::eSpawnType_Breed) ) { - return shared_ptr( new MushroomCow(level) ); + return std::shared_ptr( new MushroomCow(level) ); } else { diff --git a/Minecraft.World/MushroomCow.h b/Minecraft.World/MushroomCow.h index 4ec97476..27bc9e35 100644 --- a/Minecraft.World/MushroomCow.h +++ b/Minecraft.World/MushroomCow.h @@ -11,7 +11,7 @@ public: public: MushroomCow(Level *level); - virtual bool interact(shared_ptr player); + virtual bool interact(std::shared_ptr player); virtual bool canSpawn(); // 4J added - virtual shared_ptr getBreedOffspring(shared_ptr target); + virtual std::shared_ptr getBreedOffspring(std::shared_ptr target); }; \ No newline at end of file diff --git a/Minecraft.World/MusicTile.cpp b/Minecraft.World/MusicTile.cpp index ebdb9680..fe8503e2 100644 --- a/Minecraft.World/MusicTile.cpp +++ b/Minecraft.World/MusicTile.cpp @@ -12,7 +12,7 @@ void MusicTile::neighborChanged(Level *level, int x, int y, int z, int type) { app.DebugPrintf("-------- Neighbour changed type %d\n", type); bool signal = level->hasNeighborSignal(x, y, z); - shared_ptr mte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr mte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); app.DebugPrintf("-------- Signal is %s, tile is currently %s\n",signal?"TRUE":"FALSE", mte->on?"ON":"OFF"); if (mte != NULL && mte->on != signal) { @@ -30,11 +30,11 @@ bool MusicTile::TestUse() return true; } -bool MusicTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool MusicTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if (soundOnly) return false; if (level->isClientSide) return true; - shared_ptr mte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr mte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if (mte != NULL ) { mte->tune(); @@ -43,16 +43,16 @@ bool MusicTile::use(Level *level, int x, int y, int z, shared_ptr player return true; } -void MusicTile::attack(Level *level, int x, int y, int z, shared_ptr player) +void MusicTile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { if (level->isClientSide) return; - shared_ptr mte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr mte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if( mte != NULL ) mte->playNote(level, x, y, z); } -shared_ptr MusicTile::newTileEntity(Level *level) +std::shared_ptr MusicTile::newTileEntity(Level *level) { - return shared_ptr( new MusicTileEntity() ); + return std::shared_ptr( new MusicTileEntity() ); } void MusicTile::triggerEvent(Level *level, int x, int y, int z, int i, int note) diff --git a/Minecraft.World/MusicTile.h b/Minecraft.World/MusicTile.h index 47333870..09c4618b 100644 --- a/Minecraft.World/MusicTile.h +++ b/Minecraft.World/MusicTile.h @@ -9,8 +9,8 @@ public: MusicTile(int id); virtual void neighborChanged(Level *level, int x, int y, int z, int type); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param - virtual void attack(Level *level, int x, int y, int z, shared_ptr player); - virtual shared_ptr newTileEntity(Level *level); + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual void attack(Level *level, int x, int y, int z, std::shared_ptr player); + virtual std::shared_ptr newTileEntity(Level *level); virtual void triggerEvent(Level *level, int x, int y, int z, int i, int note); }; \ No newline at end of file diff --git a/Minecraft.World/MusicTileEntity.cpp b/Minecraft.World/MusicTileEntity.cpp index 4c2d2615..54e1568b 100644 --- a/Minecraft.World/MusicTileEntity.cpp +++ b/Minecraft.World/MusicTileEntity.cpp @@ -13,7 +13,7 @@ MusicTileEntity::MusicTileEntity() : TileEntity() { note = 0; - + on = false; } @@ -23,7 +23,7 @@ void MusicTileEntity::save(CompoundTag *tag) tag->putByte(L"note", note); } -void MusicTileEntity::load(CompoundTag *tag) +void MusicTileEntity::load(CompoundTag *tag) { TileEntity::load(tag); note = tag->getByte(L"note"); @@ -31,7 +31,7 @@ void MusicTileEntity::load(CompoundTag *tag) if (note > 24) note = 24; } -void MusicTileEntity::tune() +void MusicTileEntity::tune() { note = (byte) ((note + 1) % 25); setChanged(); @@ -53,9 +53,9 @@ void MusicTileEntity::playNote(Level *level, int x, int y, int z) } // 4J Added -shared_ptr MusicTileEntity::clone() +std::shared_ptr MusicTileEntity::clone() { - shared_ptr result = shared_ptr( new MusicTileEntity() ); + std::shared_ptr result = std::shared_ptr( new MusicTileEntity() ); TileEntity::clone(result); result->note = note; diff --git a/Minecraft.World/MusicTileEntity.h b/Minecraft.World/MusicTileEntity.h index a4941ff1..6e631981 100644 --- a/Minecraft.World/MusicTileEntity.h +++ b/Minecraft.World/MusicTileEntity.h @@ -22,5 +22,5 @@ public: void playNote(Level *level, int x, int y, int z); // 4J Added - virtual shared_ptr clone(); + virtual std::shared_ptr clone(); }; diff --git a/Minecraft.World/NearestAttackableTargetGoal.cpp b/Minecraft.World/NearestAttackableTargetGoal.cpp index 5ed9f4f1..23bf8d0b 100644 --- a/Minecraft.World/NearestAttackableTargetGoal.cpp +++ b/Minecraft.World/NearestAttackableTargetGoal.cpp @@ -9,7 +9,7 @@ NearestAttackableTargetGoal::DistComp::DistComp(Entity *source) this->source = source; } -bool NearestAttackableTargetGoal::DistComp::operator() (shared_ptr e1, shared_ptr e2) +bool NearestAttackableTargetGoal::DistComp::operator() (std::shared_ptr e1, std::shared_ptr e2) { // Should return true if e1 comes before e2 in the sorted list double distSqr1 = source->distanceToSqr(e1); @@ -38,7 +38,7 @@ bool NearestAttackableTargetGoal::canUse() if (randomInterval > 0 && mob->getRandom()->nextInt(randomInterval) != 0) return false; if (targetType == typeid(Player)) { - shared_ptr potentialTarget = mob->level->getNearestAttackablePlayer(mob->shared_from_this(), within); + std::shared_ptr potentialTarget = mob->level->getNearestAttackablePlayer(mob->shared_from_this(), within); if (canAttack(potentialTarget, false)) { target = weak_ptr(potentialTarget); @@ -47,12 +47,12 @@ bool NearestAttackableTargetGoal::canUse() } else { - vector > *entities = mob->level->getEntitiesOfClass(targetType, mob->bb->grow(within, 4, within)); + vector > *entities = mob->level->getEntitiesOfClass(targetType, mob->bb->grow(within, 4, within)); //Collections.sort(entities, distComp); std::sort(entities->begin(), entities->end(), *distComp); for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it) { - shared_ptr potTarget = dynamic_pointer_cast(*it); + std::shared_ptr potTarget = dynamic_pointer_cast(*it); if (canAttack(potTarget, false)) { target = weak_ptr(potTarget); diff --git a/Minecraft.World/NearestAttackableTargetGoal.h b/Minecraft.World/NearestAttackableTargetGoal.h index a10e9264..af796840 100644 --- a/Minecraft.World/NearestAttackableTargetGoal.h +++ b/Minecraft.World/NearestAttackableTargetGoal.h @@ -13,7 +13,7 @@ public: public: DistComp(Entity *source); - bool operator() (shared_ptr e1, shared_ptr e2); + bool operator() (std::shared_ptr e1, std::shared_ptr e2); }; private: diff --git a/Minecraft.World/NetherBridgePieces.cpp b/Minecraft.World/NetherBridgePieces.cpp index 9a795e78..d643904b 100644 --- a/Minecraft.World/NetherBridgePieces.cpp +++ b/Minecraft.World/NetherBridgePieces.cpp @@ -43,7 +43,7 @@ NetherBridgePieces::PieceWeight *NetherBridgePieces::bridgePieceWeights[NetherBr new PieceWeight(EPieceClass_StairsRoom, 10, 3), }; -NetherBridgePieces::PieceWeight *NetherBridgePieces::castlePieceWeights[NetherBridgePieces::CASTLE_PIECEWEIGHTS_COUNT] = +NetherBridgePieces::PieceWeight *NetherBridgePieces::castlePieceWeights[NetherBridgePieces::CASTLE_PIECEWEIGHTS_COUNT] = { new PieceWeight(EPieceClass_CastleStalkRoom, 30, 2), // 4J Stu - Increased weight to ensure that we have these (was 5), required for Nether Wart, and therefore required for brewing new PieceWeight(EPieceClass_CastleSmallCorridorPiece, 25, 0, true), @@ -325,7 +325,7 @@ NetherBridgePieces::BridgeStraight *NetherBridgePieces::BridgeStraight::createPi { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -1, -3, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -386,7 +386,7 @@ NetherBridgePieces::BridgeEndFiller *NetherBridgePieces::BridgeEndFiller::create { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -1, -3, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -475,7 +475,7 @@ NetherBridgePieces::BridgeCrossing *NetherBridgePieces::BridgeCrossing::createPi { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -8, -3, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -576,7 +576,7 @@ NetherBridgePieces::RoomCrossing *NetherBridgePieces::RoomCrossing::createPiece( { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -2, 0, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -641,7 +641,7 @@ NetherBridgePieces::StairsRoom *NetherBridgePieces::StairsRoom::createPiece(list { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -2, 0, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -711,7 +711,7 @@ NetherBridgePieces::MonsterThrone *NetherBridgePieces::MonsterThrone::createPiec { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -2, 0, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -757,7 +757,7 @@ bool NetherBridgePieces::MonsterThrone::postProcess(Level *level, Random *random { hasPlacedMobSpawner = true; level->setTile(x, y, z, Tile::mobSpawner_Id); - shared_ptr entity = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr entity = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if (entity != NULL) entity->setEntityId(L"Blaze"); } } @@ -789,7 +789,7 @@ NetherBridgePieces::CastleEntrance *NetherBridgePieces::CastleEntrance::createPi { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -5, -3, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -915,7 +915,7 @@ NetherBridgePieces::CastleStalkRoom *NetherBridgePieces::CastleStalkRoom::create { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -5, -3, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1077,7 +1077,7 @@ NetherBridgePieces::CastleSmallCorridorPiece *NetherBridgePieces::CastleSmallCor BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -1, 0, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1137,7 +1137,7 @@ NetherBridgePieces::CastleSmallCorridorCrossingPiece *NetherBridgePieces::Castle { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -1, 0, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1193,7 +1193,7 @@ NetherBridgePieces::CastleSmallCorridorRightTurnPiece *NetherBridgePieces::Castl { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -1, 0, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1254,7 +1254,7 @@ NetherBridgePieces::CastleSmallCorridorLeftTurnPiece *NetherBridgePieces::Castle { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -1, 0, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1315,7 +1315,7 @@ NetherBridgePieces::CastleCorridorStairsPiece *NetherBridgePieces::CastleCorrido { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -1, -7, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1393,7 +1393,7 @@ NetherBridgePieces::CastleCorridorTBalconyPiece *NetherBridgePieces::CastleCorri { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -3, 0, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((NetherBridgePieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) diff --git a/Minecraft.World/NetherStalkTile.cpp b/Minecraft.World/NetherStalkTile.cpp index eadf9646..731552f8 100644 --- a/Minecraft.World/NetherStalkTile.cpp +++ b/Minecraft.World/NetherStalkTile.cpp @@ -92,7 +92,7 @@ void NetherStalkTile::spawnResources(Level *level, int x, int y, int z, int data } for (int i = 0; i < count; i++) { - popResource(level, x, y, z, shared_ptr(new ItemInstance(Item::netherStalkSeeds))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(Item::netherStalkSeeds))); } } diff --git a/Minecraft.World/OcelotSitOnTileGoal.cpp b/Minecraft.World/OcelotSitOnTileGoal.cpp index f5cf7066..0d0af7de 100644 --- a/Minecraft.World/OcelotSitOnTileGoal.cpp +++ b/Minecraft.World/OcelotSitOnTileGoal.cpp @@ -107,7 +107,7 @@ bool OcelotSitOnTileGoal::isValidTarget(Level *level, int x, int y, int z) if (tile == Tile::chest_Id) { - shared_ptr chest = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + std::shared_ptr chest = dynamic_pointer_cast(level->getTileEntity(x, y, z)); if (chest->openCount < 1) { diff --git a/Minecraft.World/OldChunkStorage.cpp b/Minecraft.World/OldChunkStorage.cpp index c1515c12..ca085cbe 100644 --- a/Minecraft.World/OldChunkStorage.cpp +++ b/Minecraft.World/OldChunkStorage.cpp @@ -211,9 +211,9 @@ bool OldChunkStorage::saveEntities(LevelChunk *lc, Level *level, CompoundTag *ta for (int i = 0; i < lc->ENTITY_BLOCKS_LENGTH; i++) { AUTO_VAR(itEnd, lc->entityBlocks[i]->end()); - for( vector >::iterator it = lc->entityBlocks[i]->begin(); it != itEnd; it++ ) + for( vector >::iterator it = lc->entityBlocks[i]->begin(); it != itEnd; it++ ) { - shared_ptr e = *it; + std::shared_ptr e = *it; lc->lastSaveHadEntities = true; CompoundTag *teTag = new CompoundTag(); if (e->save(teTag)) @@ -268,10 +268,10 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, DataOutputStream *dos) ListTag *tileEntityTags = new ListTag(); AUTO_VAR(itEnd, lc->tileEntities.end()); - for( unordered_map, TilePosKeyHash, TilePosKeyEq>::iterator it = lc->tileEntities.begin(); + for( unordered_map, TilePosKeyHash, TilePosKeyEq>::iterator it = lc->tileEntities.begin(); it != itEnd; it++) { - shared_ptr te = it->second; + std::shared_ptr te = it->second; CompoundTag *teTag = new CompoundTag(); te->save(teTag); tileEntityTags->add(teTag); @@ -357,10 +357,10 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, CompoundTag *tag) ListTag *tileEntityTags = new ListTag(); AUTO_VAR(itEnd, lc->tileEntities.end()); - for( unordered_map, TilePosKeyHash, TilePosKeyEq>::iterator it = lc->tileEntities.begin(); + for( unordered_map, TilePosKeyHash, TilePosKeyEq>::iterator it = lc->tileEntities.begin(); it != itEnd; it++) { - shared_ptr te = it->second; + std::shared_ptr te = it->second; CompoundTag *teTag = new CompoundTag(); te->save(teTag); tileEntityTags->add(teTag); @@ -402,7 +402,7 @@ void OldChunkStorage::loadEntities(LevelChunk *lc, Level *level, CompoundTag *ta for (int i = 0; i < entityTags->size(); i++) { CompoundTag *teTag = entityTags->get(i); - shared_ptr te = EntityIO::loadStatic(teTag, level); + std::shared_ptr te = EntityIO::loadStatic(teTag, level); lc->lastSaveHadEntities = true; if (te != NULL) { @@ -417,7 +417,7 @@ void OldChunkStorage::loadEntities(LevelChunk *lc, Level *level, CompoundTag *ta for (int i = 0; i < tileEntityTags->size(); i++) { CompoundTag *teTag = tileEntityTags->get(i); - shared_ptr te = TileEntity::loadStatic(teTag); + std::shared_ptr te = TileEntity::loadStatic(teTag); if (te != NULL) { lc->addTileEntity(te); diff --git a/Minecraft.World/OwnerHurtByTargetGoal.cpp b/Minecraft.World/OwnerHurtByTargetGoal.cpp index e576f575..521d859d 100644 --- a/Minecraft.World/OwnerHurtByTargetGoal.cpp +++ b/Minecraft.World/OwnerHurtByTargetGoal.cpp @@ -12,7 +12,7 @@ OwnerHurtByTargetGoal::OwnerHurtByTargetGoal(TamableAnimal *tameAnimal) : Target bool OwnerHurtByTargetGoal::canUse() { if (!tameAnimal->isTame()) return false; - shared_ptr owner = tameAnimal->getOwner(); + std::shared_ptr owner = tameAnimal->getOwner(); if (owner == NULL) return false; ownerLastHurtBy = weak_ptr(owner->getLastHurtByMob()); return canAttack(ownerLastHurtBy.lock(), false); diff --git a/Minecraft.World/OwnerHurtTargetGoal.cpp b/Minecraft.World/OwnerHurtTargetGoal.cpp index c6c367d7..9782951b 100644 --- a/Minecraft.World/OwnerHurtTargetGoal.cpp +++ b/Minecraft.World/OwnerHurtTargetGoal.cpp @@ -12,7 +12,7 @@ OwnerHurtTargetGoal::OwnerHurtTargetGoal(TamableAnimal *tameAnimal) : TargetGoal bool OwnerHurtTargetGoal::canUse() { if (!tameAnimal->isTame()) return false; - shared_ptr owner = tameAnimal->getOwner(); + std::shared_ptr owner = tameAnimal->getOwner(); if (owner == NULL) return false; ownerLastHurt = weak_ptr(owner->getLastHurtMob()); return canAttack(ownerLastHurt.lock(), false); diff --git a/Minecraft.World/Ozelot.cpp b/Minecraft.World/Ozelot.cpp index 3c05f357..e43705ec 100644 --- a/Minecraft.World/Ozelot.cpp +++ b/Minecraft.World/Ozelot.cpp @@ -184,7 +184,7 @@ int Ozelot::getDeathLoot() return Item::leather_Id; } -bool Ozelot::doHurtTarget(shared_ptr target) +bool Ozelot::doHurtTarget(std::shared_ptr target) { return target->hurt(DamageSource::mobAttack(dynamic_pointer_cast(shared_from_this())), 3); } @@ -199,9 +199,9 @@ void Ozelot::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) { } -bool Ozelot::interact(shared_ptr player) +bool Ozelot::interact(std::shared_ptr player) { - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); if (isTame()) { if (equalsIgnoreCase(player->getUUID(), getOwnerUUID())) @@ -250,12 +250,12 @@ bool Ozelot::interact(shared_ptr player) return TamableAnimal::interact(player); } -shared_ptr Ozelot::getBreedOffspring(shared_ptr target) +std::shared_ptr Ozelot::getBreedOffspring(std::shared_ptr target) { // 4J - added limit to number of animals that can be bred if( level->canCreateMore( GetType(), Level::eSpawnType_Breed) ) { - shared_ptr offspring = shared_ptr( new Ozelot(level) ); + std::shared_ptr offspring = std::shared_ptr( new Ozelot(level) ); if (isTame()) { offspring->setOwnerUUID(getOwnerUUID()); @@ -270,17 +270,17 @@ shared_ptr Ozelot::getBreedOffspring(shared_ptr target) } } -bool Ozelot::isFood(shared_ptr itemInstance) +bool Ozelot::isFood(std::shared_ptr itemInstance) { return itemInstance != NULL && itemInstance->id == Item::fish_raw_Id; } -bool Ozelot::canMate(shared_ptr animal) +bool Ozelot::canMate(std::shared_ptr animal) { if (animal == shared_from_this()) return false; if (!isTame()) return false; - shared_ptr partner = dynamic_pointer_cast(animal); + std::shared_ptr partner = dynamic_pointer_cast(animal); if (partner == NULL) return false; if (!partner->isTame()) return false; diff --git a/Minecraft.World/Ozelot.h b/Minecraft.World/Ozelot.h index c763f3bc..fd628f4b 100644 --- a/Minecraft.World/Ozelot.h +++ b/Minecraft.World/Ozelot.h @@ -58,17 +58,17 @@ protected: virtual int getDeathLoot(); public: - virtual bool doHurtTarget(shared_ptr target); + virtual bool doHurtTarget(std::shared_ptr target); virtual bool hurt(DamageSource *source, int dmg); protected: virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel); public: - virtual bool interact(shared_ptr player); - virtual shared_ptr getBreedOffspring(shared_ptr target); - virtual bool isFood(shared_ptr itemInstance); - virtual bool canMate(shared_ptr animal); + virtual bool interact(std::shared_ptr player); + virtual std::shared_ptr getBreedOffspring(std::shared_ptr target); + virtual bool isFood(std::shared_ptr itemInstance); + virtual bool canMate(std::shared_ptr animal); virtual int getCatType(); virtual void setCatType(int type); virtual bool canSpawn(); diff --git a/Minecraft.World/OzelotAttackGoal.cpp b/Minecraft.World/OzelotAttackGoal.cpp index 27ca2b5c..099a3f8a 100644 --- a/Minecraft.World/OzelotAttackGoal.cpp +++ b/Minecraft.World/OzelotAttackGoal.cpp @@ -20,7 +20,7 @@ OzelotAttackGoal::OzelotAttackGoal(Mob *mob) bool OzelotAttackGoal::canUse() { - shared_ptr bestTarget = mob->getTarget(); + std::shared_ptr bestTarget = mob->getTarget(); if (bestTarget == NULL) return false; target = weak_ptr(bestTarget); return true; diff --git a/Minecraft.World/Packet.cpp b/Minecraft.World/Packet.cpp index 8bac8629..48e203f7 100644 --- a/Minecraft.World/Packet.cpp +++ b/Minecraft.World/Packet.cpp @@ -207,7 +207,7 @@ void Packet::map(int id, bool receiveOnClient, bool receiveOnServer, bool sendTo } // 4J Added to record data for outgoing packets -void Packet::recordOutgoingPacket(shared_ptr packet) +void Packet::recordOutgoingPacket(std::shared_ptr packet) { #ifndef _CONTENT_PACKAGE #if PACKET_ENABLE_STAT_TRACKING @@ -285,7 +285,7 @@ int64_t Packet::getIndexedStatValue(unsigned int samplePos, unsigned int rendera } -shared_ptr Packet::getPacket(int id) +std::shared_ptr Packet::getPacket(int id) { // 4J - removed try/catch // try @@ -326,7 +326,7 @@ byteArray Packet::readBytes(DataInputStream *datainputstream) } -bool Packet::canSendToAnyClient(shared_ptr packet) +bool Packet::canSendToAnyClient(std::shared_ptr packet) { int packetId = packet->getId(); @@ -345,10 +345,10 @@ unordered_map Packet::statistics = unordered_ma //int Packet::nextPrint = 0; -shared_ptr Packet::readPacket(DataInputStream *dis, bool isServer) // throws IOException TODO 4J JEV, should this declare a throws? +std::shared_ptr Packet::readPacket(DataInputStream *dis, bool isServer) // throws IOException TODO 4J JEV, should this declare a throws? { int id = 0; - shared_ptr packet = nullptr; + std::shared_ptr packet = nullptr; // 4J - removed try/catch // try @@ -399,7 +399,7 @@ shared_ptr Packet::readPacket(DataInputStream *dis, bool isServer) // th return packet; } -void Packet::writePacket(shared_ptr packet, DataOutputStream *dos) // throws IOException TODO 4J JEV, should this declare a throws? +void Packet::writePacket(std::shared_ptr packet, DataOutputStream *dos) // throws IOException TODO 4J JEV, should this declare a throws? { //app.DebugPrintf("Writing packet %d\n", packet->getId()); dos->write(packet->getId()); @@ -519,7 +519,7 @@ bool Packet::canBeInvalidated() return false; } -bool Packet::isInvalidatedBy(shared_ptr packet) +bool Packet::isInvalidatedBy(std::shared_ptr packet) { return false; } @@ -530,16 +530,16 @@ bool Packet::isAync() } // 4J Stu - Brought these functions forward for enchanting/game rules -shared_ptr Packet::readItem(DataInputStream *dis) +std::shared_ptr Packet::readItem(DataInputStream *dis) { - shared_ptr item = nullptr; + std::shared_ptr item = nullptr; int id = dis->readShort(); if (id >= 0) { int count = dis->readByte(); int damage = dis->readShort(); - item = shared_ptr( new ItemInstance(id, count, damage) ); + item = std::shared_ptr( new ItemInstance(id, count, damage) ); // 4J Stu - Always read/write the tag //if (Item.items[id].canBeDepleted() || Item.items[id].shouldOverrideMultiplayerNBT()) { @@ -550,7 +550,7 @@ shared_ptr Packet::readItem(DataInputStream *dis) return item; } -void Packet::writeItem(shared_ptr item, DataOutputStream *dos) +void Packet::writeItem(std::shared_ptr item, DataOutputStream *dos) { if (item == NULL) { diff --git a/Minecraft.World/Packet.h b/Minecraft.World/Packet.h index 0bafe443..46499e0c 100644 --- a/Minecraft.World/Packet.h +++ b/Minecraft.World/Packet.h @@ -10,7 +10,7 @@ class DataOutputStream; class Packet; -typedef shared_ptr (*packetCreateFn)(); +typedef std::shared_ptr (*packetCreateFn)(); class Packet { @@ -62,10 +62,10 @@ public: Packet(); - static shared_ptr getPacket(int id); + static std::shared_ptr getPacket(int id); // 4J Added - static bool canSendToAnyClient(shared_ptr packet); + static bool canSendToAnyClient(std::shared_ptr packet); static void writeBytes(DataOutputStream *dataoutputstream, byteArray bytes); static byteArray readBytes(DataInputStream *datainputstream); @@ -80,7 +80,7 @@ private: static vector renderableStats; static int renderPos; public: - static void recordOutgoingPacket(shared_ptr packet); + static void recordOutgoingPacket(std::shared_ptr packet); static void renderPacketStats(int id); static void renderAllPacketStats(); static void renderAllPacketStatsKey(); @@ -91,8 +91,8 @@ private : //static int nextPrint; public: - static shared_ptr readPacket(DataInputStream *dis, bool isServer); - static void writePacket(shared_ptr packet, DataOutputStream *dos); + static std::shared_ptr readPacket(DataInputStream *dis, bool isServer); + static void writePacket(std::shared_ptr packet, DataOutputStream *dos); static void writeUtf(const wstring& value, DataOutputStream *dos); static wstring readUtf(DataInputStream *dis, int maxLength); virtual void read(DataInputStream *dis) = 0; // throws IOException = 0; TODO 4J JEV, should this declare a throws? @@ -100,12 +100,12 @@ public: virtual void handle(PacketListener *listener) = 0; virtual int getEstimatedSize() = 0; virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); virtual bool isAync(); // 4J Stu - Brought these functions forward for enchanting/game rules - static shared_ptr readItem(DataInputStream *dis); - static void writeItem(shared_ptr item, DataOutputStream *dos); + static std::shared_ptr readItem(DataInputStream *dis); + static void writeItem(std::shared_ptr item, DataOutputStream *dos); static CompoundTag *readNbt(DataInputStream *dis); protected: diff --git a/Minecraft.World/PacketListener.cpp b/Minecraft.World/PacketListener.cpp index 2f051d7d..8c507cdc 100644 --- a/Minecraft.World/PacketListener.cpp +++ b/Minecraft.World/PacketListener.cpp @@ -2,383 +2,383 @@ #include "net.minecraft.network.packet.h" #include "PacketListener.h" -void PacketListener::handleBlockRegionUpdate(shared_ptr packet) +void PacketListener::handleBlockRegionUpdate(std::shared_ptr packet) { } -void PacketListener::onUnhandledPacket(shared_ptr packet) +void PacketListener::onUnhandledPacket(std::shared_ptr packet) { } -void PacketListener::onDisconnect(DisconnectPacket::eDisconnectReason reason, void *reasonObjects) +void PacketListener::onDisconnect(DisconnectPacket::eDisconnectReason reason, void *reasonObjects) { } -void PacketListener::handleDisconnect(shared_ptr packet) +void PacketListener::handleDisconnect(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleLogin(shared_ptr packet) +void PacketListener::handleLogin(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleMovePlayer(shared_ptr packet) +void PacketListener::handleMovePlayer(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleChunkTilesUpdate(shared_ptr packet) +void PacketListener::handleChunkTilesUpdate(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handlePlayerAction(shared_ptr packet) +void PacketListener::handlePlayerAction(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleTileUpdate(shared_ptr packet) +void PacketListener::handleTileUpdate(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleChunkVisibility(shared_ptr packet) +void PacketListener::handleChunkVisibility(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleAddPlayer(shared_ptr packet) +void PacketListener::handleAddPlayer(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleMoveEntity(shared_ptr packet) +void PacketListener::handleMoveEntity(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleMoveEntitySmall(shared_ptr packet) +void PacketListener::handleMoveEntitySmall(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleTeleportEntity(shared_ptr packet) +void PacketListener::handleTeleportEntity(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleUseItem(shared_ptr packet) +void PacketListener::handleUseItem(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleSetCarriedItem(shared_ptr packet) +void PacketListener::handleSetCarriedItem(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleRemoveEntity(shared_ptr packet) +void PacketListener::handleRemoveEntity(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleTakeItemEntity(shared_ptr packet) +void PacketListener::handleTakeItemEntity(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleChat(shared_ptr packet) +void PacketListener::handleChat(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleAddEntity(shared_ptr packet) +void PacketListener::handleAddEntity(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleAnimate(shared_ptr packet) +void PacketListener::handleAnimate(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handlePlayerCommand(shared_ptr packet) +void PacketListener::handlePlayerCommand(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handlePreLogin(shared_ptr packet) +void PacketListener::handlePreLogin(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleAddMob(shared_ptr packet) +void PacketListener::handleAddMob(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleSetTime(shared_ptr packet) +void PacketListener::handleSetTime(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleSetSpawn(shared_ptr packet) +void PacketListener::handleSetSpawn(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleSetEntityMotion(shared_ptr packet) +void PacketListener::handleSetEntityMotion(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleSetEntityData(shared_ptr packet) +void PacketListener::handleSetEntityData(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleRidePacket(shared_ptr packet) +void PacketListener::handleRidePacket(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleInteract(shared_ptr packet) +void PacketListener::handleInteract(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleEntityEvent(shared_ptr packet) +void PacketListener::handleEntityEvent(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleSetHealth(shared_ptr packet) +void PacketListener::handleSetHealth(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleRespawn(shared_ptr packet) +void PacketListener::handleRespawn(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleTexture(shared_ptr packet) +void PacketListener::handleTexture(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleTextureAndGeometry(shared_ptr packet) +void PacketListener::handleTextureAndGeometry(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleExplosion(shared_ptr packet) +void PacketListener::handleExplosion(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleContainerOpen(shared_ptr packet) +void PacketListener::handleContainerOpen(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleContainerClose(shared_ptr packet) +void PacketListener::handleContainerClose(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleContainerClick(shared_ptr packet) +void PacketListener::handleContainerClick(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleContainerSetSlot(shared_ptr packet) +void PacketListener::handleContainerSetSlot(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleContainerContent(shared_ptr packet) +void PacketListener::handleContainerContent(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleSignUpdate(shared_ptr packet) +void PacketListener::handleSignUpdate(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleContainerSetData(shared_ptr packet) +void PacketListener::handleContainerSetData(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleSetEquippedItem(shared_ptr packet) +void PacketListener::handleSetEquippedItem(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleContainerAck(shared_ptr packet) +void PacketListener::handleContainerAck(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleAddPainting(shared_ptr packet) +void PacketListener::handleAddPainting(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleTileEvent(shared_ptr packet) +void PacketListener::handleTileEvent(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleAwardStat(shared_ptr packet) +void PacketListener::handleAwardStat(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleEntityActionAtPosition(shared_ptr packet) +void PacketListener::handleEntityActionAtPosition(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handlePlayerInput(shared_ptr packet) +void PacketListener::handlePlayerInput(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleGameEvent(shared_ptr packet) +void PacketListener::handleGameEvent(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleAddGlobalEntity(shared_ptr packet) +void PacketListener::handleAddGlobalEntity(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleComplexItemData(shared_ptr packet) +void PacketListener::handleComplexItemData(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleLevelEvent(shared_ptr packet) +void PacketListener::handleLevelEvent(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } // 1.8.2 -void PacketListener::handleGetInfo(shared_ptr packet) +void PacketListener::handleGetInfo(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleUpdateMobEffect(shared_ptr packet) +void PacketListener::handleUpdateMobEffect(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleRemoveMobEffect(shared_ptr packet) +void PacketListener::handleRemoveMobEffect(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handlePlayerInfo(shared_ptr packet) +void PacketListener::handlePlayerInfo(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleKeepAlive(shared_ptr packet) +void PacketListener::handleKeepAlive(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleSetExperience(shared_ptr packet) +void PacketListener::handleSetExperience(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleSetCreativeModeSlot(shared_ptr packet) +void PacketListener::handleSetCreativeModeSlot(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleAddExperienceOrb(shared_ptr packet) +void PacketListener::handleAddExperienceOrb(std::shared_ptr packet) { onUnhandledPacket(packet); } // 1.0.1 -void PacketListener::handleContainerButtonClick(shared_ptr packet) +void PacketListener::handleContainerButtonClick(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleTileEntityData(shared_ptr tileEntityDataPacket) +void PacketListener::handleTileEntityData(std::shared_ptr tileEntityDataPacket) { onUnhandledPacket(tileEntityDataPacket); } // 1.1 -void PacketListener::handleCustomPayload(shared_ptr customPayloadPacket) +void PacketListener::handleCustomPayload(std::shared_ptr customPayloadPacket) { onUnhandledPacket(customPayloadPacket); } // 1.2.3 -void PacketListener::handleRotateMob(shared_ptr rotateMobPacket) +void PacketListener::handleRotateMob(std::shared_ptr rotateMobPacket) { onUnhandledPacket(rotateMobPacket); } // 1.3.2 -void PacketListener::handleClientProtocolPacket(shared_ptr packet) +void PacketListener::handleClientProtocolPacket(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleServerAuthData(shared_ptr packet) +void PacketListener::handleServerAuthData(std::shared_ptr packet) { onUnhandledPacket(packet); } -//void PacketListener::handleSharedKey(shared_ptr packet) +//void PacketListener::handleSharedKey(std::shared_ptr packet) //{ // onUnhandledPacket(packet); //} -void PacketListener::handlePlayerAbilities(shared_ptr playerAbilitiesPacket) +void PacketListener::handlePlayerAbilities(std::shared_ptr playerAbilitiesPacket) { onUnhandledPacket(playerAbilitiesPacket); } -void PacketListener::handleChatAutoComplete(shared_ptr packet) +void PacketListener::handleChatAutoComplete(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleClientInformation(shared_ptr packet) +void PacketListener::handleClientInformation(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleSoundEvent(shared_ptr packet) +void PacketListener::handleSoundEvent(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleTileDestruction(shared_ptr packet) +void PacketListener::handleTileDestruction(std::shared_ptr packet) { onUnhandledPacket(packet); } -void PacketListener::handleClientCommand(shared_ptr packet) +void PacketListener::handleClientCommand(std::shared_ptr packet) { } -//void PacketListener::handleLevelChunks(shared_ptr packet) +//void PacketListener::handleLevelChunks(std::shared_ptr packet) //{ // onUnhandledPacket(packet); //} @@ -390,62 +390,62 @@ bool PacketListener::canHandleAsyncPackets() // 4J Added -void PacketListener::handleCraftItem(shared_ptr packet) +void PacketListener::handleCraftItem(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleTradeItem(shared_ptr packet) +void PacketListener::handleTradeItem(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleDebugOptions(shared_ptr packet) +void PacketListener::handleDebugOptions(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleServerSettingsChanged(shared_ptr packet) +void PacketListener::handleServerSettingsChanged(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleChunkVisibilityArea(shared_ptr packet) +void PacketListener::handleChunkVisibilityArea(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleUpdateProgress(shared_ptr packet) +void PacketListener::handleUpdateProgress(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleTextureChange(shared_ptr packet) +void PacketListener::handleTextureChange(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleTextureAndGeometryChange(shared_ptr packet) +void PacketListener::handleTextureAndGeometryChange(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleUpdateGameRuleProgressPacket(shared_ptr packet) +void PacketListener::handleUpdateGameRuleProgressPacket(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleKickPlayer(shared_ptr packet) +void PacketListener::handleKickPlayer(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleXZ(shared_ptr packet) +void PacketListener::handleXZ(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } -void PacketListener::handleGameCommand(shared_ptr packet) +void PacketListener::handleGameCommand(std::shared_ptr packet) { - onUnhandledPacket( (shared_ptr ) packet); + onUnhandledPacket( (std::shared_ptr ) packet); } diff --git a/Minecraft.World/PacketListener.h b/Minecraft.World/PacketListener.h index 93b14603..85d8d122 100644 --- a/Minecraft.World/PacketListener.h +++ b/Minecraft.World/PacketListener.h @@ -107,105 +107,105 @@ class PacketListener { public: virtual bool isServerPacketListener() = 0; - virtual void handleBlockRegionUpdate(shared_ptr packet); - virtual void onUnhandledPacket(shared_ptr packet); + virtual void handleBlockRegionUpdate(std::shared_ptr packet); + virtual void onUnhandledPacket(std::shared_ptr packet); virtual void onDisconnect(DisconnectPacket::eDisconnectReason reason, void *reasonObjects); - virtual void handleDisconnect(shared_ptr packet); - virtual void handleLogin(shared_ptr packet); - virtual void handleMovePlayer(shared_ptr packet); - virtual void handleChunkTilesUpdate(shared_ptr packet); - virtual void handlePlayerAction(shared_ptr packet); - virtual void handleTileUpdate(shared_ptr packet); - virtual void handleChunkVisibility(shared_ptr packet); - virtual void handleAddPlayer(shared_ptr packet); - virtual void handleMoveEntity(shared_ptr packet); - virtual void handleMoveEntitySmall(shared_ptr packet); - virtual void handleTeleportEntity(shared_ptr packet); - virtual void handleUseItem(shared_ptr packet); - virtual void handleSetCarriedItem(shared_ptr packet); - virtual void handleRemoveEntity(shared_ptr packet); - virtual void handleTakeItemEntity(shared_ptr packet); - virtual void handleChat(shared_ptr packet); - virtual void handleAddEntity(shared_ptr packet); - virtual void handleAnimate(shared_ptr packet); - virtual void handlePlayerCommand(shared_ptr packet); - virtual void handlePreLogin(shared_ptr packet); - virtual void handleAddMob(shared_ptr packet); - virtual void handleSetTime(shared_ptr packet); - virtual void handleSetSpawn(shared_ptr packet); - virtual void handleSetEntityMotion(shared_ptr packet); - virtual void handleSetEntityData(shared_ptr packet); - virtual void handleRidePacket(shared_ptr packet); - virtual void handleInteract(shared_ptr packet); - virtual void handleEntityEvent(shared_ptr packet); - virtual void handleSetHealth(shared_ptr packet); - virtual void handleRespawn(shared_ptr packet); - virtual void handleExplosion(shared_ptr packet); - virtual void handleContainerOpen(shared_ptr packet); - virtual void handleContainerClose(shared_ptr packet); - virtual void handleContainerClick(shared_ptr packet); - virtual void handleContainerSetSlot(shared_ptr packet); - virtual void handleContainerContent(shared_ptr packet); - virtual void handleSignUpdate(shared_ptr packet); - virtual void handleContainerSetData(shared_ptr packet); - virtual void handleSetEquippedItem(shared_ptr packet); - virtual void handleContainerAck(shared_ptr packet); - virtual void handleAddPainting(shared_ptr packet); - virtual void handleTileEvent(shared_ptr packet); - virtual void handleAwardStat(shared_ptr packet); - virtual void handleEntityActionAtPosition(shared_ptr packet); - virtual void handlePlayerInput(shared_ptr packet); - virtual void handleGameEvent(shared_ptr packet); - virtual void handleAddGlobalEntity(shared_ptr packet); - virtual void handleComplexItemData(shared_ptr packet); - virtual void handleLevelEvent(shared_ptr packet); + virtual void handleDisconnect(std::shared_ptr packet); + virtual void handleLogin(std::shared_ptr packet); + virtual void handleMovePlayer(std::shared_ptr packet); + virtual void handleChunkTilesUpdate(std::shared_ptr packet); + virtual void handlePlayerAction(std::shared_ptr packet); + virtual void handleTileUpdate(std::shared_ptr packet); + virtual void handleChunkVisibility(std::shared_ptr packet); + virtual void handleAddPlayer(std::shared_ptr packet); + virtual void handleMoveEntity(std::shared_ptr packet); + virtual void handleMoveEntitySmall(std::shared_ptr packet); + virtual void handleTeleportEntity(std::shared_ptr packet); + virtual void handleUseItem(std::shared_ptr packet); + virtual void handleSetCarriedItem(std::shared_ptr packet); + virtual void handleRemoveEntity(std::shared_ptr packet); + virtual void handleTakeItemEntity(std::shared_ptr packet); + virtual void handleChat(std::shared_ptr packet); + virtual void handleAddEntity(std::shared_ptr packet); + virtual void handleAnimate(std::shared_ptr packet); + virtual void handlePlayerCommand(std::shared_ptr packet); + virtual void handlePreLogin(std::shared_ptr packet); + virtual void handleAddMob(std::shared_ptr packet); + virtual void handleSetTime(std::shared_ptr packet); + virtual void handleSetSpawn(std::shared_ptr packet); + virtual void handleSetEntityMotion(std::shared_ptr packet); + virtual void handleSetEntityData(std::shared_ptr packet); + virtual void handleRidePacket(std::shared_ptr packet); + virtual void handleInteract(std::shared_ptr packet); + virtual void handleEntityEvent(std::shared_ptr packet); + virtual void handleSetHealth(std::shared_ptr packet); + virtual void handleRespawn(std::shared_ptr packet); + virtual void handleExplosion(std::shared_ptr packet); + virtual void handleContainerOpen(std::shared_ptr packet); + virtual void handleContainerClose(std::shared_ptr packet); + virtual void handleContainerClick(std::shared_ptr packet); + virtual void handleContainerSetSlot(std::shared_ptr packet); + virtual void handleContainerContent(std::shared_ptr packet); + virtual void handleSignUpdate(std::shared_ptr packet); + virtual void handleContainerSetData(std::shared_ptr packet); + virtual void handleSetEquippedItem(std::shared_ptr packet); + virtual void handleContainerAck(std::shared_ptr packet); + virtual void handleAddPainting(std::shared_ptr packet); + virtual void handleTileEvent(std::shared_ptr packet); + virtual void handleAwardStat(std::shared_ptr packet); + virtual void handleEntityActionAtPosition(std::shared_ptr packet); + virtual void handlePlayerInput(std::shared_ptr packet); + virtual void handleGameEvent(std::shared_ptr packet); + virtual void handleAddGlobalEntity(std::shared_ptr packet); + virtual void handleComplexItemData(std::shared_ptr packet); + virtual void handleLevelEvent(std::shared_ptr packet); // 1.8.2 - virtual void handleGetInfo(shared_ptr packet); - virtual void handleUpdateMobEffect(shared_ptr packet); - virtual void handleRemoveMobEffect(shared_ptr packet); - virtual void handlePlayerInfo(shared_ptr packet); - virtual void handleKeepAlive(shared_ptr packet); - virtual void handleSetExperience(shared_ptr packet); - virtual void handleSetCreativeModeSlot(shared_ptr packet); - virtual void handleAddExperienceOrb(shared_ptr packet); + virtual void handleGetInfo(std::shared_ptr packet); + virtual void handleUpdateMobEffect(std::shared_ptr packet); + virtual void handleRemoveMobEffect(std::shared_ptr packet); + virtual void handlePlayerInfo(std::shared_ptr packet); + virtual void handleKeepAlive(std::shared_ptr packet); + virtual void handleSetExperience(std::shared_ptr packet); + virtual void handleSetCreativeModeSlot(std::shared_ptr packet); + virtual void handleAddExperienceOrb(std::shared_ptr packet); // 1.0.1 - virtual void handleContainerButtonClick(shared_ptr packet); - virtual void handleTileEntityData(shared_ptr tileEntityDataPacket); + virtual void handleContainerButtonClick(std::shared_ptr packet); + virtual void handleTileEntityData(std::shared_ptr tileEntityDataPacket); // 1.1s - virtual void handleCustomPayload(shared_ptr customPayloadPacket); + virtual void handleCustomPayload(std::shared_ptr customPayloadPacket); // 1.2.3 - virtual void handleRotateMob(shared_ptr rotateMobPacket); + virtual void handleRotateMob(std::shared_ptr rotateMobPacket); // 1.3.2 - virtual void handleClientProtocolPacket(shared_ptr packet); - virtual void handleServerAuthData(shared_ptr packet); - //virtual void handleSharedKey(shared_ptr packet); - virtual void handlePlayerAbilities(shared_ptr playerAbilitiesPacket); - virtual void handleChatAutoComplete(shared_ptr packet); - virtual void handleClientInformation(shared_ptr packet); - virtual void handleSoundEvent(shared_ptr packet); - virtual void handleTileDestruction(shared_ptr packet); - virtual void handleClientCommand(shared_ptr packet); - //virtual void handleLevelChunks(shared_ptr packet); + virtual void handleClientProtocolPacket(std::shared_ptr packet); + virtual void handleServerAuthData(std::shared_ptr packet); + //virtual void handleSharedKey(std::shared_ptr packet); + virtual void handlePlayerAbilities(std::shared_ptr playerAbilitiesPacket); + virtual void handleChatAutoComplete(std::shared_ptr packet); + virtual void handleClientInformation(std::shared_ptr packet); + virtual void handleSoundEvent(std::shared_ptr packet); + virtual void handleTileDestruction(std::shared_ptr packet); + virtual void handleClientCommand(std::shared_ptr packet); + //virtual void handleLevelChunks(std::shared_ptr packet); virtual bool canHandleAsyncPackets(); // 4J Added - virtual void handleCraftItem(shared_ptr packet); - virtual void handleTradeItem(shared_ptr packet); - virtual void handleDebugOptions(shared_ptr packet); - virtual void handleServerSettingsChanged(shared_ptr packet); - virtual void handleTexture(shared_ptr packet); - virtual void handleTextureAndGeometry(shared_ptr packet); - virtual void handleChunkVisibilityArea(shared_ptr packet); - virtual void handleUpdateProgress(shared_ptr packet); - virtual void handleTextureChange(shared_ptr packet); - virtual void handleTextureAndGeometryChange(shared_ptr packet); - virtual void handleUpdateGameRuleProgressPacket(shared_ptr packet); - virtual void handleKickPlayer(shared_ptr packet); - virtual void handleXZ(shared_ptr packet); - virtual void handleGameCommand(shared_ptr packet); + virtual void handleCraftItem(std::shared_ptr packet); + virtual void handleTradeItem(std::shared_ptr packet); + virtual void handleDebugOptions(std::shared_ptr packet); + virtual void handleServerSettingsChanged(std::shared_ptr packet); + virtual void handleTexture(std::shared_ptr packet); + virtual void handleTextureAndGeometry(std::shared_ptr packet); + virtual void handleChunkVisibilityArea(std::shared_ptr packet); + virtual void handleUpdateProgress(std::shared_ptr packet); + virtual void handleTextureChange(std::shared_ptr packet); + virtual void handleTextureAndGeometryChange(std::shared_ptr packet); + virtual void handleUpdateGameRuleProgressPacket(std::shared_ptr packet); + virtual void handleKickPlayer(std::shared_ptr packet); + virtual void handleXZ(std::shared_ptr packet); + virtual void handleGameCommand(std::shared_ptr packet); }; diff --git a/Minecraft.World/Painting.cpp b/Minecraft.World/Painting.cpp index 0d8f35fe..bc4eef38 100644 --- a/Minecraft.World/Painting.cpp +++ b/Minecraft.World/Painting.cpp @@ -73,7 +73,7 @@ Painting::Painting(Level *level, int xTile, int yTile, int zTile, int dir) : Han // 4J Stu - If you use this ctor, then you need to call the PaintingPostConstructor } -// 4J Stu - Added this so that we can use some shared_ptr functions that were needed in the ctor +// 4J Stu - Added this so that we can use some std::shared_ptr functions that were needed in the ctor void Painting::PaintingPostConstructor(int dir) { vector *survivableMotives = new vector(); @@ -132,17 +132,17 @@ void Painting::readAdditionalSaveData(CompoundTag *tag) HangingEntity::readAdditionalSaveData(tag); } -int Painting::getWidth() +int Painting::getWidth() { return motive->w; } -int Painting::getHeight() +int Painting::getHeight() { return motive->h; } -void Painting::dropItem() +void Painting::dropItem() { - spawnAtLocation(shared_ptr(new ItemInstance(Item::painting)), 0.0f); + spawnAtLocation(std::shared_ptr(new ItemInstance(Item::painting)), 0.0f); } \ No newline at end of file diff --git a/Minecraft.World/Painting.h b/Minecraft.World/Painting.h index 7866b662..c382420e 100644 --- a/Minecraft.World/Painting.h +++ b/Minecraft.World/Painting.h @@ -73,7 +73,7 @@ public: public: // int dir; -// +// // int xTile, yTile, zTile; Motive *motive; @@ -87,7 +87,7 @@ public: Painting(Level *level, int xTile, int yTile, int zTile, int dir); Painting(Level *level, int x, int y, int z, int dir, wstring motiveName); - // 4J Stu - Added this so that we can use some shared_ptr functions that were needed in the ctor + // 4J Stu - Added this so that we can use some std::shared_ptr functions that were needed in the ctor void PaintingPostConstructor(int dir); protected: diff --git a/Minecraft.World/Path.cpp b/Minecraft.World/Path.cpp index 538917f6..61bd055e 100644 --- a/Minecraft.World/Path.cpp +++ b/Minecraft.World/Path.cpp @@ -13,7 +13,7 @@ Path::~Path() } } -Path::Path(NodeArray nodes) +Path::Path(NodeArray nodes) { index = 0; @@ -30,26 +30,26 @@ Path::Path(NodeArray nodes) } } -void Path::next() +void Path::next() { index++; } -bool Path::isDone() +bool Path::isDone() { return index >= length; } -Node *Path::last() +Node *Path::last() { - if (length > 0) + if (length > 0) { return nodes[length - 1]; } return NULL; } -Node *Path::get(int i) +Node *Path::get(int i) { return nodes[i]; } @@ -74,7 +74,7 @@ void Path::setIndex(int index) this->index = index; } -Vec3 *Path::getPos(shared_ptr e, int index) +Vec3 *Path::getPos(std::shared_ptr e, int index) { double x = nodes[index]->x + (int) (e->bbWidth + 1) * 0.5; double y = nodes[index]->y; @@ -82,7 +82,7 @@ Vec3 *Path::getPos(shared_ptr e, int index) return Vec3::newTemp(x, y, z); } -Vec3 *Path::currentPos(shared_ptr e) +Vec3 *Path::currentPos(std::shared_ptr e) { return getPos(e, index); } diff --git a/Minecraft.World/Path.h b/Minecraft.World/Path.h index 01f56e72..f0983e47 100644 --- a/Minecraft.World/Path.h +++ b/Minecraft.World/Path.h @@ -1,6 +1,6 @@ #pragma once -class Path +class Path { friend class PathFinder; @@ -21,9 +21,9 @@ public: void setSize(int length); int getIndex(); void setIndex(int index); - Vec3 *getPos(shared_ptr e, int index); + Vec3 *getPos(std::shared_ptr e, int index); NodeArray Getarray(); - Vec3 *currentPos(shared_ptr e); + Vec3 *currentPos(std::shared_ptr e); Vec3 *currentPos(); bool sameAs(Path *path); bool endsIn(Vec3 *pos); diff --git a/Minecraft.World/PathNavigation.cpp b/Minecraft.World/PathNavigation.cpp index 2bf01672..30140712 100644 --- a/Minecraft.World/PathNavigation.cpp +++ b/Minecraft.World/PathNavigation.cpp @@ -92,13 +92,13 @@ bool PathNavigation::moveTo(double x, double y, double z, float speed) return moveTo(newPath, speed); } -Path *PathNavigation::createPath(shared_ptr target) +Path *PathNavigation::createPath(std::shared_ptr target) { if (!canUpdatePath()) return NULL; return level->findPath(mob->shared_from_this(), target, maxDist, _canPassDoors, _canOpenDoors, avoidWater, canFloat); } -bool PathNavigation::moveTo(shared_ptr target, float speed) +bool PathNavigation::moveTo(std::shared_ptr target, float speed) { MemSect(53); Path *newPath = createPath(target); diff --git a/Minecraft.World/PathNavigation.h b/Minecraft.World/PathNavigation.h index b8a8cfd6..9dd40c1d 100644 --- a/Minecraft.World/PathNavigation.h +++ b/Minecraft.World/PathNavigation.h @@ -37,8 +37,8 @@ public: void setCanFloat(bool canFloat); Path *createPath(double x, double y, double z); bool moveTo(double x, double y, double z, float speed); - Path *createPath(shared_ptr target); - bool moveTo(shared_ptr target, float speed); + Path *createPath(std::shared_ptr target); + bool moveTo(std::shared_ptr target, float speed); bool moveTo(Path *newPath, float speed); Path *getPath(); void tick(); diff --git a/Minecraft.World/PathfinderMob.cpp b/Minecraft.World/PathfinderMob.cpp index b72e064f..da6ccd55 100644 --- a/Minecraft.World/PathfinderMob.cpp +++ b/Minecraft.World/PathfinderMob.cpp @@ -71,7 +71,7 @@ void PathfinderMob::serverAiStep() } else if (!holdGround && ((path == NULL && (random->nextInt(180) == 0) || fleeTime > 0) || (random->nextInt(120) == 0 || fleeTime > 0))) { - if(noActionTime < SharedConstants::TICKS_PER_SECOND * 5) + if(noActionTime < SharedConstants::TICKS_PER_SECOND * 5) { findRandomStrollLocation(); } @@ -206,7 +206,7 @@ void PathfinderMob::findRandomStrollLocation(int quadrant/*=-1*/) // 4J - added } } -void PathfinderMob::checkHurtTarget(shared_ptr target, float d) +void PathfinderMob::checkHurtTarget(std::shared_ptr target, float d) { } @@ -215,9 +215,9 @@ float PathfinderMob::getWalkTargetValue(int x, int y, int z) return 0; } -shared_ptr PathfinderMob::findAttackTarget() +std::shared_ptr PathfinderMob::findAttackTarget() { - return shared_ptr(); + return std::shared_ptr(); } @@ -240,12 +240,12 @@ void PathfinderMob::setPath(Path *path) this->path = path; } -shared_ptr PathfinderMob::getAttackTarget() +std::shared_ptr PathfinderMob::getAttackTarget() { return attackTarget; } -void PathfinderMob::setAttackTarget(shared_ptr attacker) +void PathfinderMob::setAttackTarget(std::shared_ptr attacker) { attackTarget = attacker; } diff --git a/Minecraft.World/PathfinderMob.h b/Minecraft.World/PathfinderMob.h index fdbadf8c..df759f48 100644 --- a/Minecraft.World/PathfinderMob.h +++ b/Minecraft.World/PathfinderMob.h @@ -18,27 +18,27 @@ private: Path *path; protected: - shared_ptr attackTarget; + std::shared_ptr attackTarget; bool holdGround; int fleeTime; virtual bool shouldHoldGround(); virtual void serverAiStep(); virtual void findRandomStrollLocation(int quadrant = -1); - virtual void checkHurtTarget(shared_ptr target, float d); + virtual void checkHurtTarget(std::shared_ptr target, float d); public: virtual float getWalkTargetValue(int x, int y, int z); protected: - virtual shared_ptr findAttackTarget(); + virtual std::shared_ptr findAttackTarget(); public: virtual bool canSpawn(); bool isPathFinding(); void setPath(Path *path); - shared_ptr getAttackTarget(); - void setAttackTarget(shared_ptr attacker); + std::shared_ptr getAttackTarget(); + void setAttackTarget(std::shared_ptr attacker); protected: float getWalkingSpeedModifier(); diff --git a/Minecraft.World/PickaxeItem.cpp b/Minecraft.World/PickaxeItem.cpp index 5876b9bb..d545fba2 100644 --- a/Minecraft.World/PickaxeItem.cpp +++ b/Minecraft.World/PickaxeItem.cpp @@ -52,7 +52,7 @@ bool PickaxeItem::canDestroySpecial(Tile *tile) } // 4J - brought forward from 1.2.3 -float PickaxeItem::getDestroySpeed(shared_ptr itemInstance, Tile *tile) +float PickaxeItem::getDestroySpeed(std::shared_ptr itemInstance, Tile *tile) { if (tile != NULL && (tile->material == Material::metal || tile->material == Material::heavyMetal || tile->material == Material::stone)) { diff --git a/Minecraft.World/PickaxeItem.h b/Minecraft.World/PickaxeItem.h index 52dac510..2ecf1263 100644 --- a/Minecraft.World/PickaxeItem.h +++ b/Minecraft.World/PickaxeItem.h @@ -9,12 +9,12 @@ class PickaxeItem : public DiggerItem private: static TileArray *diggables; -public: // +public: // static void staticCtor(); PickaxeItem(int id, const Tier *tier); public: virtual bool canDestroySpecial(Tile *tile); - virtual float getDestroySpeed(shared_ptr itemInstance, Tile *tile); // 4J - brought forward from 1.2.3 + virtual float getDestroySpeed(std::shared_ptr itemInstance, Tile *tile); // 4J - brought forward from 1.2.3 }; diff --git a/Minecraft.World/Pig.cpp b/Minecraft.World/Pig.cpp index b556a936..21086365 100644 --- a/Minecraft.World/Pig.cpp +++ b/Minecraft.World/Pig.cpp @@ -56,49 +56,49 @@ int Pig::getMaxHealth() bool Pig::canBeControlledByRider() { - shared_ptr item = dynamic_pointer_cast(rider.lock())->getCarriedItem(); + std::shared_ptr item = dynamic_pointer_cast(rider.lock())->getCarriedItem(); return item != NULL && item->id == Item::carrotOnAStick_Id; } -void Pig::defineSynchedData() +void Pig::defineSynchedData() { Animal::defineSynchedData(); entityData->define(DATA_SADDLE_ID, (byte) 0); } -void Pig::addAdditonalSaveData(CompoundTag *tag) +void Pig::addAdditonalSaveData(CompoundTag *tag) { Animal::addAdditonalSaveData(tag); tag->putBoolean(L"Saddle", hasSaddle()); } -void Pig::readAdditionalSaveData(CompoundTag *tag) +void Pig::readAdditionalSaveData(CompoundTag *tag) { Animal::readAdditionalSaveData(tag); setSaddle(tag->getBoolean(L"Saddle")); } -int Pig::getAmbientSound() +int Pig::getAmbientSound() { return eSoundType_MOB_PIG_AMBIENT; } -int Pig::getHurtSound() +int Pig::getHurtSound() { return eSoundType_MOB_PIG_AMBIENT; } -int Pig::getDeathSound() +int Pig::getDeathSound() { return eSoundType_MOB_PIG_DEATH; } -bool Pig::interact(shared_ptr player) +bool Pig::interact(std::shared_ptr player) { if(!Animal::interact(player)) { - if (hasSaddle() && !level->isClientSide && (rider.lock() == NULL || rider.lock() == player)) + if (hasSaddle() && !level->isClientSide && (rider.lock() == NULL || rider.lock() == player)) { // 4J HEG - Fixed issue with player not being able to dismount pig (issue #4479) player->ride( rider.lock() == player ? nullptr : shared_from_this() ); @@ -109,7 +109,7 @@ bool Pig::interact(shared_ptr player) return true; } -int Pig::getDeathLoot() +int Pig::getDeathLoot() { if (this->isOnFire() ) return Item::porkChop_cooked->id; return Item::porkChop_raw_Id; @@ -133,18 +133,18 @@ void Pig::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) if (hasSaddle()) spawnAtLocation(Item::saddle_Id, 1); } -bool Pig::hasSaddle() +bool Pig::hasSaddle() { return (entityData->getByte(DATA_SADDLE_ID) & 1) != 0; } -void Pig::setSaddle(bool value) +void Pig::setSaddle(bool value) { - if (value) + if (value) { entityData->set(DATA_SADDLE_ID, (byte) 1); - } - else + } + else { entityData->set(DATA_SADDLE_ID, (byte) 0); } @@ -153,13 +153,13 @@ void Pig::setSaddle(bool value) void Pig::thunderHit(const LightningBolt *lightningBolt) { if (level->isClientSide) return; - shared_ptr pz = shared_ptr( new PigZombie(level) ); + std::shared_ptr pz = std::shared_ptr( new PigZombie(level) ); pz->moveTo(x, y, z, yRot, xRot); level->addEntity(pz); remove(); } -void Pig::causeFallDamage(float distance) +void Pig::causeFallDamage(float distance) { Animal::causeFallDamage(distance); if (distance > 5 && dynamic_pointer_cast( rider.lock() ) != NULL) @@ -168,12 +168,12 @@ void Pig::causeFallDamage(float distance) } } -shared_ptr Pig::getBreedOffspring(shared_ptr target) +std::shared_ptr Pig::getBreedOffspring(std::shared_ptr target) { // 4J - added limit to number of animals that can be bred if( level->canCreateMore( GetType(), Level::eSpawnType_Breed) ) { - return shared_ptr( new Pig(level) ); + return std::shared_ptr( new Pig(level) ); } else { @@ -181,7 +181,7 @@ shared_ptr Pig::getBreedOffspring(shared_ptr target) } } -bool Pig::isFood(shared_ptr itemInstance) +bool Pig::isFood(std::shared_ptr itemInstance) { return itemInstance != NULL && itemInstance->id == Item::carrots_Id; } diff --git a/Minecraft.World/Pig.h b/Minecraft.World/Pig.h index adcfbf4e..34695b74 100644 --- a/Minecraft.World/Pig.h +++ b/Minecraft.World/Pig.h @@ -37,7 +37,7 @@ protected: virtual int getDeathSound(); public: - virtual bool interact(shared_ptr player); + virtual bool interact(std::shared_ptr player); protected: virtual int getDeathLoot(); @@ -52,7 +52,7 @@ protected: virtual void causeFallDamage(float distance); public: - virtual shared_ptr getBreedOffspring(shared_ptr target); - bool isFood(shared_ptr itemInstance); + virtual std::shared_ptr getBreedOffspring(std::shared_ptr target); + bool isFood(std::shared_ptr itemInstance); ControlledByPlayerGoal *getControlGoal(); }; diff --git a/Minecraft.World/PigZombie.cpp b/Minecraft.World/PigZombie.cpp index cc060484..35da6eb9 100644 --- a/Minecraft.World/PigZombie.cpp +++ b/Minecraft.World/PigZombie.cpp @@ -14,11 +14,11 @@ -shared_ptr PigZombie::sword; +std::shared_ptr PigZombie::sword; void PigZombie::staticCtor() { - PigZombie::sword = shared_ptr( new ItemInstance(Item::sword_gold, 1) ); + PigZombie::sword = std::shared_ptr( new ItemInstance(Item::sword_gold, 1) ); } void PigZombie::_init() @@ -51,7 +51,7 @@ bool PigZombie::useNewAi() return false; } -int PigZombie::getTexture() +int PigZombie::getTexture() { return textureIdx; } @@ -69,7 +69,7 @@ void PigZombie::tick() Zombie::tick(); } -bool PigZombie::canSpawn() +bool PigZombie::canSpawn() { return level->difficulty > Difficulty::PEACEFUL && level->isUnobstructed(bb) && level->getCubes(shared_from_this(), bb)->empty() && !level->containsAnyLiquid(bb); } @@ -86,13 +86,13 @@ void PigZombie::readAdditionalSaveData(CompoundTag *tag) angerTime = tag->getShort(L"Anger"); } -shared_ptr PigZombie::findAttackTarget() +std::shared_ptr PigZombie::findAttackTarget() { #ifndef _FINAL_BUILD #ifdef _DEBUG_MENUS_ENABLED if(app.GetMobsDontAttackEnabled()) { - return shared_ptr(); + return std::shared_ptr(); } #endif #endif @@ -103,17 +103,17 @@ shared_ptr PigZombie::findAttackTarget() bool PigZombie::hurt(DamageSource *source, int dmg) { - shared_ptr sourceEntity = source->getEntity(); + std::shared_ptr sourceEntity = source->getEntity(); if (dynamic_pointer_cast(sourceEntity) != NULL) { - vector > *nearby = level->getEntities( shared_from_this(), bb->grow(32, 32, 32)); + vector > *nearby = level->getEntities( shared_from_this(), bb->grow(32, 32, 32)); AUTO_VAR(itEnd, nearby->end()); for (AUTO_VAR(it, nearby->begin()); it != itEnd; it++) { - shared_ptr e = *it; //nearby->at(i); + std::shared_ptr e = *it; //nearby->at(i); if (dynamic_pointer_cast(e) != NULL) { - shared_ptr pigZombie = dynamic_pointer_cast(e); + std::shared_ptr pigZombie = dynamic_pointer_cast(e); pigZombie->alert(sourceEntity); } } @@ -122,7 +122,7 @@ bool PigZombie::hurt(DamageSource *source, int dmg) return Zombie::hurt(source, dmg); } -void PigZombie::alert(shared_ptr target) +void PigZombie::alert(std::shared_ptr target) { this->attackTarget = target; angerTime = 20 * 20 + random->nextInt(20 * 20); @@ -162,7 +162,7 @@ void PigZombie::dropRareDeathLoot(int rareLootLevel) { if (rareLootLevel > 0) { - shared_ptr sword = shared_ptr( new ItemInstance(Item::sword_gold) ); + std::shared_ptr sword = std::shared_ptr( new ItemInstance(Item::sword_gold) ); EnchantmentHelper::enchantItem(random, sword, 5); spawnAtLocation(sword, 0); } @@ -195,8 +195,8 @@ void PigZombie::finalizeMobSpawn() setVillager(false); } -shared_ptr PigZombie::getCarriedItem() +std::shared_ptr PigZombie::getCarriedItem() { - // TODO 4J - could be of const shared_ptr type. - return (shared_ptr ) sword; + // TODO 4J - could be of const std::shared_ptr type. + return (std::shared_ptr ) sword; } diff --git a/Minecraft.World/PigZombie.h b/Minecraft.World/PigZombie.h index b47efacb..ff164edf 100644 --- a/Minecraft.World/PigZombie.h +++ b/Minecraft.World/PigZombie.h @@ -5,7 +5,7 @@ using namespace std; class DamageSource; -// SKIN BY XaPhobia Chris Beidler +// SKIN BY XaPhobia Chris Beidler class PigZombie : public Zombie { public: @@ -32,13 +32,13 @@ public: virtual void readAdditionalSaveData(CompoundTag *tag); protected: - virtual shared_ptr findAttackTarget(); + virtual std::shared_ptr findAttackTarget(); public: virtual bool hurt(DamageSource *source, int dmg); private: - void alert(shared_ptr target); + void alert(std::shared_ptr target); protected: virtual int getAmbientSound(); @@ -49,12 +49,12 @@ protected: virtual int getDeathLoot(); private: - static shared_ptr sword; + static std::shared_ptr sword; public: virtual void finalizeMobSpawn(); - shared_ptr getCarriedItem(); + std::shared_ptr getCarriedItem(); static void staticCtor(); }; diff --git a/Minecraft.World/PistonBaseTile.cpp b/Minecraft.World/PistonBaseTile.cpp index cbad5cec..ab8199c3 100644 --- a/Minecraft.World/PistonBaseTile.cpp +++ b/Minecraft.World/PistonBaseTile.cpp @@ -119,12 +119,12 @@ bool PistonBaseTile::isSolidRender(bool isServerLevel) return false; } -bool PistonBaseTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool PistonBaseTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { return false; } -void PistonBaseTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void PistonBaseTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int targetData = getNewFacing(level, x, y, z, dynamic_pointer_cast(by) ); level->setData(x, y, z, targetData); @@ -180,7 +180,7 @@ void PistonBaseTile::checkIfExtend(Level *level, int x, int y, int z) * This method checks neighbor signals for this block and the block above, * and directly beneath. However, it avoids checking blocks that would be * pushed by this block. - * + * * @param level * @param x * @param y @@ -249,7 +249,7 @@ void PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1, else if (param1 == TRIGGER_CONTRACT) { PIXBeginNamedEvent(0,"Contract phase A\n"); - shared_ptr prevTileEntity = level->getTileEntity(x + Facing::STEP_X[facing], y + Facing::STEP_Y[facing], z + Facing::STEP_Z[facing]); + std::shared_ptr prevTileEntity = level->getTileEntity(x + Facing::STEP_X[facing], y + Facing::STEP_Y[facing], z + Facing::STEP_Z[facing]); if (prevTileEntity != NULL && dynamic_pointer_cast(prevTileEntity) != NULL) { dynamic_pointer_cast(prevTileEntity)->finalTick(); @@ -280,10 +280,10 @@ void PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1, // the block two steps away is a moving piston block piece, // so replace it with the real data, since it's probably // this piston which is changing too fast - shared_ptr tileEntity = level->getTileEntity(twoX, twoY, twoZ); + std::shared_ptr tileEntity = level->getTileEntity(twoX, twoY, twoZ); if (tileEntity != NULL && dynamic_pointer_cast(tileEntity) != NULL ) { - shared_ptr ppe = dynamic_pointer_cast(tileEntity); + std::shared_ptr ppe = dynamic_pointer_cast(tileEntity); if (ppe->getFacing() == facing && ppe->isExtending()) { @@ -337,7 +337,7 @@ void PistonBaseTile::triggerEvent(Level *level, int x, int y, int z, int param1, ignoreUpdate(false); } -void PistonBaseTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void PistonBaseTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { int data = (forceData == -1 ) ? level->getData(x, y, z) : forceData; @@ -377,7 +377,7 @@ void PistonBaseTile::updateDefaultShape() setShape(0, 0, 0, 1, 1, 1); } -void PistonBaseTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void PistonBaseTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { setShape(0, 0, 0, 1, 1, 1); Tile::addAABBs(level, x, y, z, box, boxes, source); @@ -404,9 +404,9 @@ bool PistonBaseTile::isExtended(int data) return (data & EXTENDED_BIT) != 0; } -int PistonBaseTile::getNewFacing(Level *level, int x, int y, int z, shared_ptr player) +int PistonBaseTile::getNewFacing(Level *level, int x, int y, int z, std::shared_ptr player) { - if (Mth::abs((float) player->x - x) < 2 && Mth::abs((float) player->z - z) < 2) + if (Mth::abs((float) player->x - x) < 2 && Mth::abs((float) player->z - z) < 2) { // If the player is above the block, the slot is on the top double py = player->y + 1.82 - player->heightOffset; @@ -456,7 +456,7 @@ bool PistonBaseTile::isPushable(int block, Level *level, int cx, int cy, int cz, { return false; } - + if (!allowDestroyable && Tile::tiles[block]->getPistonPushReaction() == Material::PUSH_DESTROY) { return false; @@ -486,7 +486,7 @@ bool PistonBaseTile::canPush(Level *level, int sx, int sy, int sz, int facing) // out of bounds return false; } - + // 4J - added to also check for out of bounds in x/z for our finite world int minXZ = - (level->dimension->getXZSize() * 16 ) / 2; int maxXZ = (level->dimension->getXZSize() * 16 ) / 2 - 1; @@ -529,7 +529,7 @@ bool PistonBaseTile::canPush(Level *level, int sx, int sy, int sz, int facing) void PistonBaseTile::stopSharingIfServer(Level *level, int x, int y, int z) { if( !level->isClientSide ) - { + { MultiPlayerLevel *clientLevel = Minecraft::GetInstance()->getLevel(level->dimension->id); if( clientLevel ) { @@ -552,7 +552,7 @@ bool PistonBaseTile::createPush(Level *level, int sx, int sy, int sz, int facing // out of bounds return false; } - + // 4J - added to also check for out of bounds in x/z for our finite world int minXZ = - (level->dimension->getXZSize() * 16 ) / 2; int maxXZ = (level->dimension->getXZSize() * 16 ) / 2 - 1; diff --git a/Minecraft.World/PistonBaseTile.h b/Minecraft.World/PistonBaseTile.h index 0fda1391..c61eec86 100644 --- a/Minecraft.World/PistonBaseTile.h +++ b/Minecraft.World/PistonBaseTile.h @@ -27,8 +27,8 @@ private: static DWORD tlsIdx; // 4J - was just a static but implemented with TLS for our version - static bool ignoreUpdate(); - static void ignoreUpdate(bool set); + static bool ignoreUpdate(); + static void ignoreUpdate(bool set); public: PistonBaseTile(int id, bool isSticky); @@ -42,8 +42,8 @@ public: virtual int getRenderShape(); virtual bool isSolidRender(bool isServerLevel = false); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); virtual void neighborChanged(Level *level, int x, int y, int z, int type); virtual void onPlace(Level *level, int x, int y, int z); @@ -53,15 +53,15 @@ private: public: virtual void triggerEvent(Level *level, int x, int y, int z, int param1, int facing); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual void updateDefaultShape(); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); virtual AABB *getAABB(Level *level, int x, int y, int z); virtual bool isCubeShaped(); static int getFacing(int data); static bool isExtended(int data); - static int getNewFacing(Level *level, int x, int y, int z, shared_ptr player); + static int getNewFacing(Level *level, int x, int y, int z, std::shared_ptr player); private: static bool isPushable(int block, Level *level, int cx, int cy, int cz, bool allowDestroyable); static bool canPush(Level *level, int sx, int sy, int sz, int facing); diff --git a/Minecraft.World/PistonExtensionTile.cpp b/Minecraft.World/PistonExtensionTile.cpp index 1827ddde..882a6116 100644 --- a/Minecraft.World/PistonExtensionTile.cpp +++ b/Minecraft.World/PistonExtensionTile.cpp @@ -103,7 +103,7 @@ int PistonExtensionTile::getResourceCount(Random *random) return 0; } -void PistonExtensionTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void PistonExtensionTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { int data = level->getData(x, y, z); @@ -156,7 +156,7 @@ void PistonExtensionTile::addAABBs(Level *level, int x, int y, int z, AABB *box, } -void PistonExtensionTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void PistonExtensionTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { int data = (forceData == -1 ) ? level->getData(x, y, z) : forceData; diff --git a/Minecraft.World/PistonExtensionTile.h b/Minecraft.World/PistonExtensionTile.h index a0b08729..8ebb9bd1 100644 --- a/Minecraft.World/PistonExtensionTile.h +++ b/Minecraft.World/PistonExtensionTile.h @@ -23,8 +23,8 @@ public: virtual bool mayPlace(Level *level, int x, int y, int z); virtual bool mayPlace(Level *level, int x, int y, int z, int face); virtual int getResourceCount(Random *random); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual void neighborChanged(Level *level, int x, int y, int z, int type); static int getFacing(int data); virtual int cloneTileId(Level *level, int x, int y, int z); diff --git a/Minecraft.World/PistonMovingPiece.cpp b/Minecraft.World/PistonMovingPiece.cpp index e141cebe..a9d661ee 100644 --- a/Minecraft.World/PistonMovingPiece.cpp +++ b/Minecraft.World/PistonMovingPiece.cpp @@ -11,7 +11,7 @@ PistonMovingPiece::PistonMovingPiece(int id) : EntityTile(id, Material::piston, setDestroyTime(INDESTRUCTIBLE_DESTROY_TIME); } -shared_ptr PistonMovingPiece::newTileEntity(Level *level) +std::shared_ptr PistonMovingPiece::newTileEntity(Level *level) { return nullptr; } @@ -22,7 +22,7 @@ void PistonMovingPiece::onPlace(Level *level, int x, int y, int z) void PistonMovingPiece::onRemove(Level *level, int x, int y, int z, int id, int data) { - shared_ptr tileEntity = level->getTileEntity(x, y, z); + std::shared_ptr tileEntity = level->getTileEntity(x, y, z); if (tileEntity != NULL && dynamic_pointer_cast(tileEntity) != NULL) { dynamic_pointer_cast(tileEntity)->finalTick(); @@ -58,7 +58,7 @@ bool PistonMovingPiece::isCubeShaped() return false; } -bool PistonMovingPiece::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool PistonMovingPiece::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly) return false; // this is a special case in order to help removing invisible, unbreakable, blocks in the world @@ -80,7 +80,7 @@ void PistonMovingPiece::spawnResources(Level *level, int x, int y, int z, int da { if (level->isClientSide) return; - shared_ptr entity = getEntity(level, x, y, z); + std::shared_ptr entity = getEntity(level, x, y, z); if (entity == NULL) { return; @@ -96,14 +96,14 @@ void PistonMovingPiece::neighborChanged(Level *level, int x, int y, int z, int t } } -shared_ptr PistonMovingPiece::newMovingPieceEntity(int block, int data, int facing, bool extending, bool isSourcePiston) +std::shared_ptr PistonMovingPiece::newMovingPieceEntity(int block, int data, int facing, bool extending, bool isSourcePiston) { - return shared_ptr(new PistonPieceEntity(block, data, facing, extending, isSourcePiston)); + return std::shared_ptr(new PistonPieceEntity(block, data, facing, extending, isSourcePiston)); } AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z) { - shared_ptr entity = getEntity(level, x, y, z); + std::shared_ptr entity = getEntity(level, x, y, z); if (entity == NULL) { return NULL; @@ -118,9 +118,9 @@ AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z) return getAABB(level, x, y, z, entity->getId(), progress, entity->getFacing()); } -void PistonMovingPiece::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void PistonMovingPiece::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { - shared_ptr entity = dynamic_pointer_cast(forceEntity); + std::shared_ptr entity = dynamic_pointer_cast(forceEntity); if( entity == NULL ) entity = getEntity(level, x, y, z); if (entity != NULL) { @@ -188,9 +188,9 @@ AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z, int tile, fl return aabb; } -shared_ptr PistonMovingPiece::getEntity(LevelSource *level, int x, int y, int z) +std::shared_ptr PistonMovingPiece::getEntity(LevelSource *level, int x, int y, int z) { - shared_ptr tileEntity = level->getTileEntity(x, y, z); + std::shared_ptr tileEntity = level->getTileEntity(x, y, z); if (tileEntity != NULL && dynamic_pointer_cast(tileEntity) != NULL) { return dynamic_pointer_cast(tileEntity); diff --git a/Minecraft.World/PistonMovingPiece.h b/Minecraft.World/PistonMovingPiece.h index 1b1a61dc..e27a6381 100644 --- a/Minecraft.World/PistonMovingPiece.h +++ b/Minecraft.World/PistonMovingPiece.h @@ -8,7 +8,7 @@ public: PistonMovingPiece(int id); protected: - virtual shared_ptr newTileEntity(Level *level); + virtual std::shared_ptr newTileEntity(Level *level); public: virtual void onPlace(Level *level, int x, int y, int z); @@ -18,18 +18,18 @@ public: virtual int getRenderShape(); virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param; + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param; virtual int getResource(int data, Random *random, int playerBonusLevel); virtual void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonus); virtual void neighborChanged(Level *level, int x, int y, int z, int type); - static shared_ptr newMovingPieceEntity(int block, int data, int facing, bool extending, bool isSourcePiston); + static std::shared_ptr newMovingPieceEntity(int block, int data, int facing, bool extending, bool isSourcePiston); virtual AABB *getAABB(Level *level, int x, int y, int z); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param AABB *getAABB(Level *level, int x, int y, int z, int tile, float progress, int facing); private: - shared_ptr getEntity(LevelSource *level, int x, int y, int z); + std::shared_ptr getEntity(LevelSource *level, int x, int y, int z); public: virtual int cloneTileId(Level *level, int x, int y, int z); diff --git a/Minecraft.World/PistonPieceEntity.cpp b/Minecraft.World/PistonPieceEntity.cpp index 3498cec0..99b9e5ca 100644 --- a/Minecraft.World/PistonPieceEntity.cpp +++ b/Minecraft.World/PistonPieceEntity.cpp @@ -119,10 +119,10 @@ void PistonPieceEntity::moveCollidedEntities(float progress, float amount) AABB *aabb = Tile::pistonMovingPiece->getAABB(level, x, y, z, id, progress, facing); if (aabb != NULL) { - vector > *entities = level->getEntities(nullptr, aabb); + vector > *entities = level->getEntities(nullptr, aabb); if (!entities->empty()) { - vector< shared_ptr > collisionHolder; + vector< std::shared_ptr > collisionHolder; for( AUTO_VAR(it, entities->begin()); it != entities->end(); it++ ) { collisionHolder.push_back(*it); @@ -199,9 +199,9 @@ void PistonPieceEntity::save(CompoundTag *tag) } // 4J Added -shared_ptr PistonPieceEntity::clone() +std::shared_ptr PistonPieceEntity::clone() { - shared_ptr result = shared_ptr( new PistonPieceEntity() ); + std::shared_ptr result = std::shared_ptr( new PistonPieceEntity() ); TileEntity::clone(result); result->id = id; diff --git a/Minecraft.World/PistonPieceEntity.h b/Minecraft.World/PistonPieceEntity.h index 8d8543ef..2a451207 100644 --- a/Minecraft.World/PistonPieceEntity.h +++ b/Minecraft.World/PistonPieceEntity.h @@ -36,5 +36,5 @@ public: virtual void save(CompoundTag *tag); // 4J Added - shared_ptr clone(); + std::shared_ptr clone(); }; \ No newline at end of file diff --git a/Minecraft.World/PlayGoal.cpp b/Minecraft.World/PlayGoal.cpp index 304e7758..07b94ff9 100644 --- a/Minecraft.World/PlayGoal.cpp +++ b/Minecraft.World/PlayGoal.cpp @@ -25,14 +25,14 @@ bool PlayGoal::canUse() if (mob->getAge() >= 0) return false; if (mob->getRandom()->nextInt(400) != 0) return false; - vector > *children = mob->level->getEntitiesOfClass(typeid(Villager), mob->bb->grow(6, 3, 6)); + vector > *children = mob->level->getEntitiesOfClass(typeid(Villager), mob->bb->grow(6, 3, 6)); double closestDistSqr = Double::MAX_VALUE; //for (Entity c : children) for(AUTO_VAR(it, children->begin()); it != children->end(); ++it) { - shared_ptr c = *it; + std::shared_ptr c = *it; if (c.get() == mob) continue; - shared_ptr friendV = dynamic_pointer_cast(c); + std::shared_ptr friendV = dynamic_pointer_cast(c); if (friendV->isChasing()) continue; if (friendV->getAge() >= 0) continue; double distSqr = friendV->distanceToSqr(mob->shared_from_this()); diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index d4832e40..25aeceb8 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -2,7 +2,7 @@ // All the instanceof s from Java have been converted to dynamic_cast in this file // Once all the classes are finished it may be that we do not need to use dynamic_cast -// for every test and a simple virtual function should suffice. We probably only need +// for every test and a simple virtual function should suffice. We probably only need // dynamic_cast to find one of the classes that an object derives from, and not to find // the derived class itself (which should own the virtual GetType function) @@ -44,7 +44,7 @@ void Player::_init() { - inventory = shared_ptr( new Inventory( this ) ); + inventory = std::shared_ptr( new Inventory( this ) ); userType = 0; score = 0; @@ -116,7 +116,7 @@ void Player::_init() m_ePlayerNameValidState=ePlayerNameValid_NotSet; #endif - enderChestInventory = shared_ptr(new PlayerEnderChestContainer()); + enderChestInventory = std::shared_ptr(new PlayerEnderChestContainer()); m_bAwardedOnARail=false; } @@ -186,7 +186,7 @@ void Player::defineSynchedData() entityData->define(DATA_PLAYER_RUNNING_ID, (byte) 0); } -shared_ptr Player::getUseItem() +std::shared_ptr Player::getUseItem() { return useItem; } @@ -245,7 +245,7 @@ void Player::tick() { if (useItem != NULL) { - shared_ptr item = inventory->getSelected(); + std::shared_ptr item = inventory->getSelected(); // 4J Stu - Fix for #45508 - TU5: Gameplay: Eating one piece of food will result in a second piece being eaten as well // Original code was item != useItem. Changed this now to use the equals function, and add the NULL check as well for the other possible not equals (useItem is not NULL if we are here) // This is because the useItem and item could be different objects due to an inventory update from the server, but still be the same item (with the same id,count and auxvalue) @@ -344,7 +344,7 @@ void Player::tick() zCloak += zca * 0.25; yCloak += yca * 0.25; - if (riding == NULL) + if (riding == NULL) { if( minecartAchievementPos != NULL ) { @@ -367,73 +367,73 @@ void Player::tick() #if 0 #ifdef _WINDOWS64 // Drop some items so we have them in inventory to play with - this->drop( shared_ptr( new ItemInstance(Tile::recordPlayer) ) ); - this->drop( shared_ptr( new ItemInstance(Item::map) ) ); - this->drop( shared_ptr( new ItemInstance(Item::record_01) ) ); - this->drop( shared_ptr( new ItemInstance(Item::record_02) ) ); - this->drop( shared_ptr(new ItemInstance( Item::pickAxe_diamond, 1 )) ); + this->drop( std::shared_ptr( new ItemInstance(Tile::recordPlayer) ) ); + this->drop( std::shared_ptr( new ItemInstance(Item::map) ) ); + this->drop( std::shared_ptr( new ItemInstance(Item::record_01) ) ); + this->drop( std::shared_ptr( new ItemInstance(Item::record_02) ) ); + this->drop( std::shared_ptr(new ItemInstance( Item::pickAxe_diamond, 1 )) ); #endif #ifdef __PS3__ // #ifdef _DEBUG // // Drop some items so we have them in inventory to play with - // this->drop( shared_ptr( new ItemInstance(Tile::recordPlayer) ) ); - // this->drop( shared_ptr( new ItemInstance(Item::map) ) ); - // this->drop( shared_ptr( new ItemInstance(Item::record_01) ) ); - // this->drop( shared_ptr( new ItemInstance(Item::record_02) ) ); - // this->drop( shared_ptr(new ItemInstance( Item::pickAxe_diamond, 1 )) ); + // this->drop( std::shared_ptr( new ItemInstance(Tile::recordPlayer) ) ); + // this->drop( std::shared_ptr( new ItemInstance(Item::map) ) ); + // this->drop( std::shared_ptr( new ItemInstance(Item::record_01) ) ); + // this->drop( std::shared_ptr( new ItemInstance(Item::record_02) ) ); + // this->drop( std::shared_ptr(new ItemInstance( Item::pickAxe_diamond, 1 )) ); // #endif #endif #ifdef _DURANGO // Drop some items so we have them in inventory to play with - this->drop( shared_ptr( new ItemInstance(Tile::recordPlayer) ) ); - this->drop( shared_ptr( new ItemInstance(Item::map) ) ); - this->drop( shared_ptr( new ItemInstance(Item::record_01) ) ); - this->drop( shared_ptr( new ItemInstance(Item::record_02) ) ); - this->drop( shared_ptr(new ItemInstance( Item::pickAxe_diamond, 1 )) ); + this->drop( std::shared_ptr( new ItemInstance(Tile::recordPlayer) ) ); + this->drop( std::shared_ptr( new ItemInstance(Item::map) ) ); + this->drop( std::shared_ptr( new ItemInstance(Item::record_01) ) ); + this->drop( std::shared_ptr( new ItemInstance(Item::record_02) ) ); + this->drop( std::shared_ptr(new ItemInstance( Item::pickAxe_diamond, 1 )) ); #endif #endif // 4J-PB - Throw items out at the start of the level //this->drop( new ItemInstance( Item::pickAxe_diamond, 1 ) ); //this->drop( new ItemInstance( Tile::workBench, 1 ) ); //this->drop( new ItemInstance( Tile::treeTrunk, 8 ) ); - //this->drop( shared_ptr( new ItemInstance( Item::milk, 3 ) ) ); - //this->drop( shared_ptr( new ItemInstance( Item::sugar, 2 ) ) ); + //this->drop( std::shared_ptr( new ItemInstance( Item::milk, 3 ) ) ); + //this->drop( std::shared_ptr( new ItemInstance( Item::sugar, 2 ) ) ); //this->drop( new ItemInstance( Tile::stoneBrick, 8 ) ); - //this->drop( shared_ptr( new ItemInstance( Item::wheat, 3 ) ) ); - //this->drop( shared_ptr( new ItemInstance( Item::egg, 1 ) ) ); + //this->drop( std::shared_ptr( new ItemInstance( Item::wheat, 3 ) ) ); + //this->drop( std::shared_ptr( new ItemInstance( Item::egg, 1 ) ) ); //this->drop( new ItemInstance( Item::bow, 1 ) ); //this->drop( new ItemInstance( Item::arrow, 10 ) ); - //this->drop( shared_ptr( new ItemInstance( Item::saddle, 10 ) ) ); - //this->drop( shared_ptr( new ItemInstance( Tile::fence, 64 ) ) ); - //this->drop( shared_ptr( new ItemInstance( Tile::fence, 64 ) ) ); - //this->drop( shared_ptr( new ItemInstance( Tile::fence, 64 ) ) ); + //this->drop( std::shared_ptr( new ItemInstance( Item::saddle, 10 ) ) ); + //this->drop( std::shared_ptr( new ItemInstance( Tile::fence, 64 ) ) ); + //this->drop( std::shared_ptr( new ItemInstance( Tile::fence, 64 ) ) ); + //this->drop( std::shared_ptr( new ItemInstance( Tile::fence, 64 ) ) ); - //shared_ptr mob = dynamic_pointer_cast(Pig::_class->newInstance( level )); + //std::shared_ptr mob = dynamic_pointer_cast(Pig::_class->newInstance( level )); //mob->moveTo(x+1, y, z+1, level->random->nextFloat() * 360, 0); //level->addEntity(mob); // 4J : WESTY : Spawn some wolves to befriend! /* - shared_ptr mob1 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); + std::shared_ptr mob1 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); mob1->moveTo(x+1, y, z+1, level->random->nextFloat() * 360, 0); level->addEntity(mob1); - shared_ptr mob2 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); + std::shared_ptr mob2 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); mob2->moveTo(x+2, y, z+1, level->random->nextFloat() * 360, 0); level->addEntity(mob2); - shared_ptr mob3 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); + std::shared_ptr mob3 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); mob3->moveTo(x+1, y, z+2, level->random->nextFloat() * 360, 0); level->addEntity(mob3); - shared_ptr mob4 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); + std::shared_ptr mob4 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); mob4->moveTo(x+3, y, z+1, level->random->nextFloat() * 360, 0); level->addEntity(mob4); - shared_ptr mob5 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); + std::shared_ptr mob5 = dynamic_pointer_cast(Wolf::_class->newInstance( level )); mob5->moveTo(x+1, y, z+3, level->random->nextFloat() * 360, 0); level->addEntity(mob5); */ @@ -454,10 +454,10 @@ void Player::tick() // minecart. For some reason some of the torches come off so it will also need some fixing along the way. static bool madeTrack = false; if( !madeTrack ) - { - this->drop( shared_ptr( new ItemInstance( Item::minecart, 1 ) ) ); - this->drop( shared_ptr( new ItemInstance( Tile::goldenRail, 10 ) ) ); - this->drop( shared_ptr( new ItemInstance( Tile::lever, 10 ) ) ); + { + this->drop( std::shared_ptr( new ItemInstance( Item::minecart, 1 ) ) ); + this->drop( std::shared_ptr( new ItemInstance( Tile::goldenRail, 10 ) ) ); + this->drop( std::shared_ptr( new ItemInstance( Tile::lever, 10 ) ) ); level->setTime( 0 ); int poweredCount = 0; @@ -523,7 +523,7 @@ void Player::tick() //End 4J sTU } -void Player::spawnEatParticles(shared_ptr useItem, int count) +void Player::spawnEatParticles(std::shared_ptr useItem, int count) { if (useItem->getUseAnimation() == UseAnim_drink) { @@ -558,7 +558,7 @@ void Player::completeUsingItem() spawnEatParticles(useItem, 16); int oldCount = useItem->count; - shared_ptr itemInstance = useItem->useTimeDepleted(level, dynamic_pointer_cast(shared_from_this())); + std::shared_ptr itemInstance = useItem->useTimeDepleted(level, dynamic_pointer_cast(shared_from_this())); if (itemInstance != useItem || (itemInstance != NULL && itemInstance->count != oldCount)) { inventory->items[inventory->selected] = itemInstance; @@ -594,7 +594,7 @@ void Player::closeContainer() containerMenu = inventoryMenu; } -void Player::ride(shared_ptr e) +void Player::ride(std::shared_ptr e) { if (riding != NULL && e == NULL) { @@ -611,8 +611,8 @@ void Player::ride(shared_ptr e) Mob::ride(e); } -void Player::setPlayerDefaultSkin(EDefaultSkins skin) -{ +void Player::setPlayerDefaultSkin(EDefaultSkins skin) +{ #ifndef _CONTENT_PACKAGE wprintf(L"Setting default skin to %d for player %ls\n", skin, name.c_str() ); #endif @@ -631,8 +631,8 @@ void Player::setCustomSkin(DWORD skinId) setAnimOverrideBitmask(getSkinAnimOverrideBitmask(skinId)); if( !GET_IS_DLC_SKIN_FROM_BITMASK(skinId) ) - { - // GET_UGC_SKIN_ID_FROM_BITMASK will always be zero - this was for a possible custom skin editor skin + { + // GET_UGC_SKIN_ID_FROM_BITMASK will always be zero - this was for a possible custom skin editor skin DWORD ugcSkinIndex = GET_UGC_SKIN_ID_FROM_BITMASK(skinId); DWORD defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(skinId); if( ugcSkinIndex == 0 && defaultSkinIndex > 0 ) @@ -702,7 +702,7 @@ unsigned int Player::getSkinAnimOverrideBitmask(DWORD skinId) { unsigned long bitmask = 0L; if( GET_IS_DLC_SKIN_FROM_BITMASK(skinId) ) - { + { // Temp check for anim override switch( GET_DLC_SKIN_ID_FROM_BITMASK(skinId) ) { @@ -765,7 +765,7 @@ void Player::setCustomCape(DWORD capeId) else { MOJANG_DATA *pMojangData=app.GetMojangDataForXuid(getOnlineXuid()); - if(pMojangData) + if(pMojangData) { // Cape if(pMojangData->wchCape) @@ -802,7 +802,7 @@ void Player::setCustomCape(DWORD capeId) DWORD Player::getCapeIdFromPath(const wstring &cape) { - bool dlcCape = false; + bool dlcCape = false; unsigned int capeId = 0; if(cape.size() >= 14) @@ -866,7 +866,7 @@ void Player::ChangePlayerSkin() this->customTextureUrl=L""; } else - { + { if(m_uiPlayerCurrentSkin>0) { // change this players custom texture url @@ -880,7 +880,7 @@ void Player::prepareCustomTextures() { MOJANG_DATA *pMojangData=app.GetMojangDataForXuid(getOnlineXuid()); - if(pMojangData) + if(pMojangData) { // Skin if(pMojangData->wchSkin) @@ -943,7 +943,7 @@ void Player::rideTick() //xRot = preXRot; //yRot = preYRot; - shared_ptr pig = dynamic_pointer_cast(riding); + std::shared_ptr pig = dynamic_pointer_cast(riding); yBodyRot = pig->yBodyRot; while (yBodyRot - yBodyRotO < -180) @@ -1037,13 +1037,13 @@ void Player::aiStep() if (getHealth() > 0) { - vector > *entities = level->getEntities(shared_from_this(), bb->grow(1, 0, 1)); + vector > *entities = level->getEntities(shared_from_this(), bb->grow(1, 0, 1)); if (entities != NULL) { AUTO_VAR(itEnd, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { - shared_ptr e = *it; //entities->at(i); + std::shared_ptr e = *it; //entities->at(i); if (!e->removed) { touch(e); @@ -1054,7 +1054,7 @@ void Player::aiStep() } -void Player::touch(shared_ptr entity) +void Player::touch(std::shared_ptr entity) { entity->playerTouch( dynamic_pointer_cast( shared_from_this() ) ); } @@ -1062,7 +1062,7 @@ void Player::touch(shared_ptr entity) // 4J - Removed 1.0.1 //bool Player::addResource(int resource) //{ -// return inventory->add(shared_ptr( new ItemInstance(resource, 1, 0) ) ); +// return inventory->add(std::shared_ptr( new ItemInstance(resource, 1, 0) ) ); //} int Player::getScore() @@ -1080,7 +1080,7 @@ void Player::die(DamageSource *source) // 4J - TODO need to use a xuid if ( app.isXuidNotch( m_xuid ) ) { - drop(shared_ptr( new ItemInstance(Item::apple, 1) ), true); + drop(std::shared_ptr( new ItemInstance(Item::apple, 1) ), true); } inventory->dropAll(); @@ -1096,7 +1096,7 @@ void Player::die(DamageSource *source) this->heightOffset = 0.1f; } -void Player::awardKillScore(shared_ptr victim, int score) +void Player::awardKillScore(std::shared_ptr victim, int score) { this->score += score; } @@ -1125,21 +1125,21 @@ bool Player::isCreativeModeAllowed() return true; } -shared_ptr Player::drop() +std::shared_ptr Player::drop() { return drop(inventory->removeItem(inventory->selected, 1), false); } -shared_ptr Player::drop(shared_ptr item) +std::shared_ptr Player::drop(std::shared_ptr item) { return drop(item, false); } -shared_ptr Player::drop(shared_ptr item, bool randomly) +std::shared_ptr Player::drop(std::shared_ptr item, bool randomly) { if (item == NULL) return nullptr; - shared_ptr thrownItem = shared_ptr( new ItemEntity(level, x, y - 0.3f + getHeadHeight(), z, item) ); + std::shared_ptr thrownItem = std::shared_ptr( new ItemEntity(level, x, y - 0.3f + getHeadHeight(), z, item) ); thrownItem->throwTime = 20 * 2; thrownItem->setThrower(getName()); @@ -1175,7 +1175,7 @@ shared_ptr Player::drop(shared_ptr item, bool randomly } -void Player::reallyDrop(shared_ptr thrownItem) +void Player::reallyDrop(std::shared_ptr thrownItem) { level->addEntity(thrownItem); } @@ -1290,7 +1290,7 @@ Pos *Player::getRespawnPosition(Level *level, CompoundTag *entityTag) return level->getSharedSpawnPos(); } -bool Player::openContainer(shared_ptr container) +bool Player::openContainer(std::shared_ptr container) { return true; } @@ -1310,7 +1310,7 @@ bool Player::startCrafting(int x, int y, int z) return true; } -void Player::take(shared_ptr e, int orgCount) +void Player::take(std::shared_ptr e, int orgCount) { } @@ -1349,7 +1349,7 @@ bool Player::hurt(DamageSource *source, int dmg) if (dmg == 0) return false; - shared_ptr attacker = source->getEntity(); + std::shared_ptr attacker = source->getEntity(); if ( dynamic_pointer_cast( attacker ) != NULL ) { if ((dynamic_pointer_cast(attacker))->owner != NULL) @@ -1395,7 +1395,7 @@ bool Player::isPlayerVersusPlayer() return false; } -void Player::directAllTameWolvesOnTarget(shared_ptr target, bool skipSitting) +void Player::directAllTameWolvesOnTarget(std::shared_ptr target, bool skipSitting) { // filter un-attackable mobs @@ -1406,7 +1406,7 @@ void Player::directAllTameWolvesOnTarget(shared_ptr target, bool skipSittin // never target wolves that has this player as owner if (dynamic_pointer_cast(target) != NULL) { - shared_ptr wolfTarget = dynamic_pointer_cast(target); + std::shared_ptr wolfTarget = dynamic_pointer_cast(target); if (wolfTarget->isTame() && m_UUID.compare( wolfTarget->getOwnerUUID() ) == 0 ) { return; @@ -1420,11 +1420,11 @@ void Player::directAllTameWolvesOnTarget(shared_ptr target, bool skipSittin // TODO: Optimize this? Most of the time players wont have pets: - vector > *nearbyWolves = level->getEntitiesOfClass(typeid(Wolf), AABB::newTemp(x, y, z, x + 1, y + 1, z + 1)->grow(16, 4, 16)); + vector > *nearbyWolves = level->getEntitiesOfClass(typeid(Wolf), AABB::newTemp(x, y, z, x + 1, y + 1, z + 1)->grow(16, 4, 16)); AUTO_VAR(itEnd, nearbyWolves->end()); for (AUTO_VAR(it, nearbyWolves->begin()); it != itEnd; it++) { - shared_ptr wolf = dynamic_pointer_cast(*it);; + std::shared_ptr wolf = dynamic_pointer_cast(*it);; if (wolf->isTame() && wolf->getAttackTarget() == NULL && m_UUID.compare( wolf->getOwnerUUID() ) == 0) { if (!skipSitting || !wolf->isSitting()) @@ -1474,26 +1474,26 @@ void Player::actuallyHurt(DamageSource *source, int dmg) } -bool Player::openFurnace(shared_ptr container) +bool Player::openFurnace(std::shared_ptr container) { return true; } -bool Player::openTrap(shared_ptr container) +bool Player::openTrap(std::shared_ptr container) { return true; } -void Player::openTextEdit(shared_ptr sign) +void Player::openTextEdit(std::shared_ptr sign) { } -bool Player::openBrewingStand(shared_ptr brewingStand) +bool Player::openBrewingStand(std::shared_ptr brewingStand) { return true; } -bool Player::openTrading(shared_ptr traderTarget) +bool Player::openTrading(std::shared_ptr traderTarget) { return true; } @@ -1503,16 +1503,16 @@ bool Player::openTrading(shared_ptr traderTarget) * * @param itemInstance */ -void Player::openItemInstanceGui(shared_ptr itemInstance) +void Player::openItemInstanceGui(std::shared_ptr itemInstance) { } -bool Player::interact(shared_ptr entity) +bool Player::interact(std::shared_ptr entity) { if (entity->interact( dynamic_pointer_cast( shared_from_this() ) )) return true; - shared_ptr item = getSelectedItem(); + std::shared_ptr item = getSelectedItem(); if (item != NULL && dynamic_pointer_cast( entity ) != NULL) - { + { // 4J - PC Comments // Hack to prevent item stacks from decrementing if the player has // the ability to instabuild @@ -1533,7 +1533,7 @@ bool Player::interact(shared_ptr entity) return false; } -shared_ptr Player::getSelectedItem() +std::shared_ptr Player::getSelectedItem() { return inventory->getSelected(); } @@ -1557,7 +1557,7 @@ void Player::swing() } } -void Player::attack(shared_ptr entity) +void Player::attack(std::shared_ptr entity) { if (!entity->isAttackable()) { @@ -1577,7 +1577,7 @@ void Player::attack(shared_ptr entity) int knockback = 0; int magicBoost = 0; - shared_ptr mob = dynamic_pointer_cast(entity); + std::shared_ptr mob = dynamic_pointer_cast(entity); if (mob != NULL) { magicBoost = EnchantmentHelper::getDamageBonus(inventory, mob); @@ -1596,7 +1596,7 @@ void Player::attack(shared_ptr entity) dmg += random->nextInt(dmg / 2 + 2); } dmg += magicBoost; - + // Ensure we put the entity on fire if we're hitting with a // fire-enchanted weapon bool setOnFireTemporatily = false; @@ -1635,14 +1635,14 @@ void Player::attack(shared_ptr entity) } setLastHurtMob(entity); - shared_ptr mob = dynamic_pointer_cast(entity); + std::shared_ptr mob = dynamic_pointer_cast(entity); if (mob) { ThornsEnchantment::doThornsAfterAttack(shared_from_this(), mob, random); } } - shared_ptr item = getSelectedItem(); + std::shared_ptr item = getSelectedItem(); if (item != NULL && dynamic_pointer_cast( entity ) != NULL) { item->hurtEnemy(dynamic_pointer_cast(entity), dynamic_pointer_cast( shared_from_this() ) ); @@ -1672,11 +1672,11 @@ void Player::attack(shared_ptr entity) } } -void Player::crit(shared_ptr entity) +void Player::crit(std::shared_ptr entity) { } -void Player::magicCrit(shared_ptr entity) +void Player::magicCrit(std::shared_ptr entity) { } @@ -1686,7 +1686,7 @@ void Player::respawn() } -void Player::animateRespawn(shared_ptr player, Level *level) +void Player::animateRespawn(std::shared_ptr player, Level *level) { for (int i = 0; i < 45; i++) @@ -1756,7 +1756,7 @@ Player::BedSleepingResult Player::startSleepInBed(int x, int y, int z, bool bTes double hRange = 8; double vRange = 5; - vector > *monsters = level->getEntitiesOfClass(typeid(Monster), AABB::newTemp(x - hRange, y - vRange, z - hRange, x + hRange, y + vRange, z + hRange)); + vector > *monsters = level->getEntitiesOfClass(typeid(Monster), AABB::newTemp(x - hRange, y - vRange, z - hRange, x + hRange, y + vRange, z + hRange)); if (!monsters->empty()) { return NOT_SAFE; @@ -1765,11 +1765,11 @@ Player::BedSleepingResult Player::startSleepInBed(int x, int y, int z, bool bTes } // This causes a message to be displayed, so we do want to show the tooltip in test mode - if (!bTestUse && level->isDay()) + if (!bTestUse && level->isDay()) { // may not sleep during day return NOT_POSSIBLE_NOW; - } + } } if(bTestUse) @@ -1852,7 +1852,7 @@ void Player::setBedOffset(int bedDirection) /** -* +* * @param forcefulWakeUp * If the player has been forced to wake up. When this happens, * the client will skip the wake-up animation. For example, when @@ -2136,7 +2136,7 @@ void Player::checkMovementStatistiscs(double dx, double dy, double dz) void Player::checkRidingStatistiscs(double dx, double dy, double dz) -{ +{ if (riding != NULL) { int distance = (int) Math::round(sqrt(dx * dx + dy * dy + dz * dz) * 100.0f); @@ -2158,7 +2158,7 @@ void Player::checkRidingStatistiscs(double dx, double dy, double dz) minecartAchievementPos = new Pos(Mth::floor(x), Mth::floor(y), Mth::floor(z)); } // 4J-PB - changed this because our world isn't big enough to go 1000m - else + else { // 4-JEV, changed slightly to add extra parameters for event on durango. int dist = minecartAchievementPos->dist(Mth::floor(x), Mth::floor(y), Mth::floor(z)); @@ -2185,7 +2185,7 @@ void Player::checkRidingStatistiscs(double dx, double dy, double dz) awardStat(GenericStats::onARail(), GenericStats::param_onARail(dist)); m_bAwardedOnARail=true; } -#endif +#endif } } @@ -2232,7 +2232,7 @@ void Player::causeFallDamage(float distance) } -void Player::killed(shared_ptr mob) +void Player::killed(std::shared_ptr mob) { // 4J-PB - added the lavaslime enemy - fix for #64007 - TU7: Code: Achievements: TCR#073: Killing Magma Cubes doesn't unlock "Monster Hunter" Achievement. if( dynamic_pointer_cast( mob ) != NULL || mob->GetType() == eTYPE_GHAST || mob->GetType() == eTYPE_SLIME || mob->GetType() == eTYPE_LAVASLIME || mob->GetType() == eTYPE_ENDERDRAGON) @@ -2247,13 +2247,13 @@ void Player::killed(shared_ptr mob) case eTYPE_SKELETON: if( mob->isRiding() && mob->riding->GetType() == eTYPE_SPIDER ) awardStat(GenericStats::killsSpiderJockey(), GenericStats::param_noArgs()); - else + else awardStat(GenericStats::killsSkeleton(), GenericStats::param_noArgs()); break; case eTYPE_SPIDER: if( mob->rider.lock() != NULL && mob->rider.lock()->GetType() == eTYPE_SKELETON ) awardStat(GenericStats::killsSpiderJockey(), GenericStats::param_noArgs()); - else + else awardStat(GenericStats::killsSpider(), GenericStats::param_noArgs()); break; case eTYPE_ZOMBIE: @@ -2282,7 +2282,7 @@ void Player::killed(shared_ptr mob) } } -Icon *Player::getItemInHandIcon(shared_ptr item, int layer) +Icon *Player::getItemInHandIcon(std::shared_ptr item, int layer) { Icon *icon = Mob::getItemInHandIcon(item, layer); if (item->id == Item::fishingRod->id && fishing != NULL) @@ -2312,7 +2312,7 @@ Icon *Player::getItemInHandIcon(shared_ptr item, int layer) return icon; } -shared_ptr Player::getArmor(int pos) +std::shared_ptr Player::getArmor(int pos) { return inventory->getArmor(pos); } @@ -2378,7 +2378,7 @@ void Player::levelUp() /** * This method adds on to the player's exhaustion, which may decrease the * player's food level. -* +* * @param amount * Amount of exhaustion to add, between 0 and 20 (setting it to * 20 will guarantee that at least 1, and at most 4, food points @@ -2413,7 +2413,7 @@ bool Player::isHurt() return getHealth() > 0 && getHealth() < getMaxHealth(); } -void Player::startUsingItem(shared_ptr instance, int duration) +void Player::startUsingItem(std::shared_ptr instance, int duration) { if (instance == useItem) return; useItem = instance; @@ -2438,7 +2438,7 @@ bool Player::mayBuild(int x, int y, int z) return abilities.mayBuild; } -int Player::getExperienceReward(shared_ptr killedBy) +int Player::getExperienceReward(std::shared_ptr killedBy) { int reward = experienceLevel * 7; if (reward > 100) @@ -2463,7 +2463,7 @@ void Player::changeDimension(int i) { } -void Player::restoreFrom(shared_ptr oldPlayer, bool restoreAll) +void Player::restoreFrom(std::shared_ptr oldPlayer, bool restoreAll) { if(restoreAll) { @@ -2514,17 +2514,17 @@ wstring Player::getDisplayName() //Language getLanguage() { return Language.getInstance(); } //String localize(String key, Object... args) { return getLanguage().getElement(key, args); } -shared_ptr Player::getEnderChestInventory() +std::shared_ptr Player::getEnderChestInventory() { return enderChestInventory; } -shared_ptr Player::getCarriedItem() +std::shared_ptr Player::getCarriedItem() { return inventory->getSelected(); } -bool Player::isInvisibleTo(shared_ptr player) +bool Player::isInvisibleTo(std::shared_ptr player) { return isInvisible(); } @@ -2555,7 +2555,7 @@ int Player::getTexture() } } -int Player::hash_fnct(const shared_ptr k) +int Player::hash_fnct(const std::shared_ptr k) { // TODO 4J Stu - Should we just be using the pointers and hashing them? #ifdef __PS3__ @@ -2565,7 +2565,7 @@ int Player::hash_fnct(const shared_ptr k) #endif //__PS3__ } -bool Player::eq_test(const shared_ptr x, const shared_ptr y) +bool Player::eq_test(const std::shared_ptr x, const std::shared_ptr y) { // TODO 4J Stu - Should we just be using the pointers and comparing them for equality? return x->name.compare( y->name ) == 0; // 4J Stu - Names are completely unique? @@ -2617,7 +2617,7 @@ void Player::setPlayerGamePrivilege(unsigned int &uiGamePrivileges, EPlayerGameP } } else if (privilege < ePlayerGamePrivilege_MAX ) - { + { if(value!=0) { uiGamePrivileges|=(1< item) +bool Player::isAllowedToUse(std::shared_ptr item) { bool allowed = true; if(item != NULL && app.GetGameHostOption(eGameHostOption_TrustPlayers) == 0) @@ -2765,7 +2765,7 @@ bool Player::isAllowedToUse(shared_ptr item) return allowed; } -bool Player::isAllowedToInteract(shared_ptr target) +bool Player::isAllowedToInteract(std::shared_ptr target) { bool allowed = true; if(app.GetGameHostOption(eGameHostOption_TrustPlayers) == 0) @@ -2774,7 +2774,7 @@ bool Player::isAllowedToInteract(shared_ptr target) { if (getPlayerGamePrivilege(Player::ePlayerGamePrivilege_CanUseContainers) == 0) { - shared_ptr minecart = dynamic_pointer_cast( target ); + std::shared_ptr minecart = dynamic_pointer_cast( target ); if (minecart->type == Minecart::CHEST) allowed = false; } @@ -2830,7 +2830,7 @@ bool Player::isAllowedToAttackAnimals() return allowed; } -bool Player::isAllowedToHurtEntity(shared_ptr target) +bool Player::isAllowedToHurtEntity(std::shared_ptr target) { bool allowed = true; @@ -2921,7 +2921,7 @@ void Player::enableAllPlayerPrivileges(unsigned int &uigamePrivileges, bool enab } void Player::enableAllPlayerPrivileges(bool enable) -{ +{ Player::enableAllPlayerPrivileges(m_uiGamePrivileges,enable); } @@ -2930,8 +2930,8 @@ bool Player::canCreateParticles() return !hasInvisiblePrivilege(); } -vector *Player::GetAdditionalModelParts() -{ +vector *Player::GetAdditionalModelParts() +{ if(m_ppAdditionalModelParts==NULL && !m_bCheckedForModelParts) { bool hasCustomTexture = !customTextureUrl.empty(); @@ -2975,8 +2975,8 @@ vector *Player::GetAdditionalModelParts() return m_ppAdditionalModelParts; } -void Player::SetAdditionalModelParts(vector *ppAdditionalModelParts) -{ +void Player::SetAdditionalModelParts(vector *ppAdditionalModelParts) +{ m_ppAdditionalModelParts=ppAdditionalModelParts; } @@ -2987,7 +2987,7 @@ Player::ePlayerNameValidState Player::GetPlayerNameValidState(void) return m_ePlayerNameValidState; } -void Player::SetPlayerNameValidState(bool bState) +void Player::SetPlayerNameValidState(bool bState) { if(bState) { diff --git a/Minecraft.World/Player.h b/Minecraft.World/Player.h index 185a70a7..68088fc1 100644 --- a/Minecraft.World/Player.h +++ b/Minecraft.World/Player.h @@ -50,10 +50,10 @@ private: static const int DATA_PLAYER_RUNNING_ID = 17; public: - shared_ptr inventory; + std::shared_ptr inventory; private: - shared_ptr enderChestInventory; + std::shared_ptr enderChestInventory; public: AbstractContainerMenu *inventoryMenu; @@ -124,7 +124,7 @@ public: // 4J Stu - Made protected so that we can access it from MultiPlayerLocalPlayer protected: - shared_ptr useItem; + std::shared_ptr useItem; int useItemDuration; protected: @@ -146,7 +146,7 @@ protected: virtual void defineSynchedData(); public: - shared_ptr getUseItem(); + std::shared_ptr getUseItem(); int getUseItemDuration(); bool isUsingItem(); int getTicksUsingItem(); void releaseUsingItem(); @@ -156,7 +156,7 @@ public: virtual void tick(); protected: - void spawnEatParticles(shared_ptr useItem, int count); + void spawnEatParticles(std::shared_ptr useItem, int count); virtual void completeUsingItem(); public: @@ -167,7 +167,7 @@ protected: virtual void closeContainer(); public: - virtual void ride(shared_ptr e); + virtual void ride(std::shared_ptr e); void prepareCustomTextures(); virtual void rideTick(); virtual void resetPos(); @@ -182,13 +182,13 @@ public: virtual void aiStep(); private: - virtual void touch(shared_ptr entity); + virtual void touch(std::shared_ptr entity); public: //bool addResource(int resource); // 4J - Removed 1.0.1 int getScore(); virtual void die(DamageSource *source); - void awardKillScore(shared_ptr victim, int score); + void awardKillScore(std::shared_ptr victim, int score); protected: virtual int decreaseAirSupply(int currentSupply); @@ -196,12 +196,12 @@ protected: public: virtual bool isShootable(); bool isCreativeModeAllowed(); - virtual shared_ptr drop(); - shared_ptr drop(shared_ptr item); - shared_ptr drop(shared_ptr item, bool randomly); + virtual std::shared_ptr drop(); + std::shared_ptr drop(std::shared_ptr item); + std::shared_ptr drop(std::shared_ptr item, bool randomly); protected: - virtual void reallyDrop(shared_ptr thrownItem); + virtual void reallyDrop(std::shared_ptr thrownItem); public: float getDestroySpeed(Tile *tile); @@ -209,11 +209,11 @@ public: virtual void readAdditionalSaveData(CompoundTag *entityTag); virtual void addAdditonalSaveData(CompoundTag *entityTag); static Pos *getRespawnPosition(Level *level, CompoundTag *entityTag); - virtual bool openContainer(shared_ptr container); // 4J - added bool return + virtual bool openContainer(std::shared_ptr container); // 4J - added bool return virtual bool startEnchanting(int x, int y, int z); // 4J - added bool return virtual bool startRepairing(int x, int y, int z); // 4J - added bool return virtual bool startCrafting(int x, int y, int z); // 4J - added boo return - virtual void take(shared_ptr e, int orgCount); + virtual void take(std::shared_ptr e, int orgCount); virtual float getHeadHeight(); // 4J-PB - added to keep the code happy with the change to make the third person view per player @@ -224,14 +224,14 @@ protected: virtual void setDefaultHeadHeight(); public: - shared_ptr fishing; + std::shared_ptr fishing; virtual bool hurt(DamageSource *source, int dmg); protected: virtual int getDamageAfterMagicAbsorb(DamageSource *damageSource, int damage); virtual bool isPlayerVersusPlayer(); - void directAllTameWolvesOnTarget(shared_ptr target, bool skipSitting); + void directAllTameWolvesOnTarget(std::shared_ptr target, bool skipSitting); virtual void hurtArmor(int damage); public: @@ -244,24 +244,24 @@ protected: public: using Entity::interact; - virtual bool openFurnace(shared_ptr container); // 4J - added bool return - virtual bool openTrap(shared_ptr container); // 4J - added bool return - virtual void openTextEdit(shared_ptr sign); - virtual bool openBrewingStand(shared_ptr brewingStand); // 4J - added bool return - virtual bool openTrading(shared_ptr traderTarget); // 4J - added bool return - virtual void openItemInstanceGui(shared_ptr itemInstance); - virtual bool interact(shared_ptr entity); - virtual shared_ptr getSelectedItem(); + virtual bool openFurnace(std::shared_ptr container); // 4J - added bool return + virtual bool openTrap(std::shared_ptr container); // 4J - added bool return + virtual void openTextEdit(std::shared_ptr sign); + virtual bool openBrewingStand(std::shared_ptr brewingStand); // 4J - added bool return + virtual bool openTrading(std::shared_ptr traderTarget); // 4J - added bool return + virtual void openItemInstanceGui(std::shared_ptr itemInstance); + virtual bool interact(std::shared_ptr entity); + virtual std::shared_ptr getSelectedItem(); void removeSelectedItem(); virtual double getRidingHeight(); virtual void swing(); - virtual void attack(shared_ptr entity); - virtual void crit(shared_ptr entity); - virtual void magicCrit(shared_ptr entity); + virtual void attack(std::shared_ptr entity); + virtual void crit(std::shared_ptr entity); + virtual void magicCrit(std::shared_ptr entity); virtual void respawn(); protected: - static void animateRespawn(shared_ptr player, Level *level); + static void animateRespawn(std::shared_ptr player, Level *level); public: Slot *getInventorySlot(int slotId); @@ -281,7 +281,7 @@ private: public: /** - * + * * @param forcefulWakeUp * If the player has been forced to wake up. When this happens, * the client will skip the wake-up animation. For example, when @@ -336,9 +336,9 @@ protected: virtual void causeFallDamage(float distance); public: - virtual void killed(shared_ptr mob); - virtual Icon *getItemInHandIcon(shared_ptr item, int layer); - virtual shared_ptr getArmor(int pos); + virtual void killed(std::shared_ptr mob); + virtual Icon *getItemInHandIcon(std::shared_ptr item, int layer); + virtual std::shared_ptr getArmor(int pos); virtual void handleInsidePortal(); void increaseXp(int i); @@ -353,18 +353,18 @@ public: FoodData *getFoodData(); bool canEat(bool magicalItem); bool isHurt(); - virtual void startUsingItem(shared_ptr instance, int duration); + virtual void startUsingItem(std::shared_ptr instance, int duration); bool mayBuild(int x, int y, int z); protected: - virtual int getExperienceReward(shared_ptr killedBy); + virtual int getExperienceReward(std::shared_ptr killedBy); virtual bool isAlwaysExperienceDropper(); public: virtual wstring getAName(); virtual void changeDimension(int i); - virtual void restoreFrom(shared_ptr oldPlayer, bool restoreAll); + virtual void restoreFrom(std::shared_ptr oldPlayer, bool restoreAll); protected: bool makeStepSound(); @@ -378,19 +378,19 @@ public: //Language getLanguage() { return Language.getInstance(); } //String localize(String key, Object... args) { return getLanguage().getElement(key, args); } - shared_ptr getEnderChestInventory(); + std::shared_ptr getEnderChestInventory(); public: - virtual shared_ptr getCarriedItem(); + virtual std::shared_ptr getCarriedItem(); - virtual bool isInvisibleTo(shared_ptr player); + virtual bool isInvisibleTo(std::shared_ptr player); - static int hash_fnct(const shared_ptr k); - static bool eq_test(const shared_ptr x, const shared_ptr y); + static int hash_fnct(const std::shared_ptr k); + static bool eq_test(const std::shared_ptr x, const std::shared_ptr y); // 4J Stu - Added to allow callback to tutorial to stay within Minecraft.Client // Overidden in LocalPlayer - virtual void onCrafted(shared_ptr item) {} + virtual void onCrafted(std::shared_ptr item) {} // 4J Overriding this so that we can have some different default skins virtual int getTexture(); // 4J changed from wstring to int @@ -421,7 +421,7 @@ public: void setShowOnMaps(bool bVal) { m_bShownOnMaps = bVal; } bool canShowOnMaps() { return m_bShownOnMaps && !getPlayerGamePrivilege(ePlayerGamePrivilege_Invisible); } - + virtual void sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const wstring& additionalMessage = L"") { } private: PlayerUID m_xuid; @@ -493,12 +493,12 @@ public: static void setPlayerGamePrivilege(unsigned int &uiGamePrivileges, EPlayerGamePrivileges privilege, unsigned int value); bool isAllowedToUse(Tile *tile); - bool isAllowedToUse(shared_ptr item); - bool isAllowedToInteract(shared_ptr target); + bool isAllowedToUse(std::shared_ptr item); + bool isAllowedToInteract(std::shared_ptr target); bool isAllowedToMine(); bool isAllowedToAttackPlayers(); bool isAllowedToAttackAnimals(); - bool isAllowedToHurtEntity(shared_ptr target); + bool isAllowedToHurtEntity(std::shared_ptr target); bool isAllowedToFly(); bool isAllowedToIgnoreExhaustion(); bool isAllowedToTeleport(); @@ -513,7 +513,7 @@ public: public: // 4J Stu - Added hooks for the game rules - virtual void handleCollectItem(shared_ptr item) {} + virtual void handleCollectItem(std::shared_ptr item) {} vector *GetAdditionalModelParts(); void SetAdditionalModelParts(vector *ppAdditionalModelParts); @@ -541,13 +541,13 @@ private: struct PlayerKeyHash { - inline int operator() (const shared_ptr k) const + inline int operator() (const std::shared_ptr k) const { return Player::hash_fnct (k); } }; struct PlayerKeyEq { - inline bool operator() (const shared_ptr x, const shared_ptr y) const + inline bool operator() (const std::shared_ptr x, const std::shared_ptr y) const { return Player::eq_test (x, y); } }; diff --git a/Minecraft.World/PlayerAbilitiesPacket.cpp b/Minecraft.World/PlayerAbilitiesPacket.cpp index b1b854a5..e0bfb21e 100644 --- a/Minecraft.World/PlayerAbilitiesPacket.cpp +++ b/Minecraft.World/PlayerAbilitiesPacket.cpp @@ -131,7 +131,7 @@ bool PlayerAbilitiesPacket::canBeInvalidated() return true; } -bool PlayerAbilitiesPacket::isInvalidatedBy(shared_ptr packet) +bool PlayerAbilitiesPacket::isInvalidatedBy(std::shared_ptr packet) { return true; } \ No newline at end of file diff --git a/Minecraft.World/PlayerAbilitiesPacket.h b/Minecraft.World/PlayerAbilitiesPacket.h index 21c1fdc2..8a6e43a3 100644 --- a/Minecraft.World/PlayerAbilitiesPacket.h +++ b/Minecraft.World/PlayerAbilitiesPacket.h @@ -42,9 +42,9 @@ public: float getWalkingSpeed(); void setWalkingSpeed(float walkingSpeed); bool canBeInvalidated(); - bool isInvalidatedBy(shared_ptr packet); + bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new PlayerAbilitiesPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new PlayerAbilitiesPacket()); } virtual int getId() { return 202; } }; \ No newline at end of file diff --git a/Minecraft.World/PlayerActionPacket.h b/Minecraft.World/PlayerActionPacket.h index 0228ebb4..35221628 100644 --- a/Minecraft.World/PlayerActionPacket.h +++ b/Minecraft.World/PlayerActionPacket.h @@ -24,7 +24,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new PlayerActionPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new PlayerActionPacket()); } virtual int getId() { return 14; } }; diff --git a/Minecraft.World/PlayerCommandPacket.cpp b/Minecraft.World/PlayerCommandPacket.cpp index 6aecc0e6..626a71fc 100644 --- a/Minecraft.World/PlayerCommandPacket.cpp +++ b/Minecraft.World/PlayerCommandPacket.cpp @@ -22,19 +22,19 @@ PlayerCommandPacket::PlayerCommandPacket() action = 0; } -PlayerCommandPacket::PlayerCommandPacket(shared_ptr e, int action) +PlayerCommandPacket::PlayerCommandPacket(std::shared_ptr e, int action) { id = e->entityId; this->action = action; } -void PlayerCommandPacket::read(DataInputStream *dis) //throws IOException +void PlayerCommandPacket::read(DataInputStream *dis) //throws IOException { id = dis->readInt(); action = dis->readByte(); } -void PlayerCommandPacket::write(DataOutputStream *dos) //throws IOException +void PlayerCommandPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(id); dos->writeByte(action); @@ -45,7 +45,7 @@ void PlayerCommandPacket::handle(PacketListener *listener) listener->handlePlayerCommand(shared_from_this()); } -int PlayerCommandPacket::getEstimatedSize() +int PlayerCommandPacket::getEstimatedSize() { return 5; } diff --git a/Minecraft.World/PlayerCommandPacket.h b/Minecraft.World/PlayerCommandPacket.h index dd6c8cb1..5e558358 100644 --- a/Minecraft.World/PlayerCommandPacket.h +++ b/Minecraft.World/PlayerCommandPacket.h @@ -25,13 +25,13 @@ public: int action; PlayerCommandPacket(); - PlayerCommandPacket(shared_ptr e, int action); + PlayerCommandPacket(std::shared_ptr e, int action); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new PlayerCommandPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new PlayerCommandPacket()); } virtual int getId() { return 19; } }; \ No newline at end of file diff --git a/Minecraft.World/PlayerEnderChestContainer.cpp b/Minecraft.World/PlayerEnderChestContainer.cpp index 466d9710..9bcf07d2 100644 --- a/Minecraft.World/PlayerEnderChestContainer.cpp +++ b/Minecraft.World/PlayerEnderChestContainer.cpp @@ -7,7 +7,7 @@ PlayerEnderChestContainer::PlayerEnderChestContainer() : SimpleContainer(IDS_TIL activeChest = nullptr; } -void PlayerEnderChestContainer::setActiveChest(shared_ptr activeChest) +void PlayerEnderChestContainer::setActiveChest(std::shared_ptr activeChest) { this->activeChest = activeChest; } @@ -31,7 +31,7 @@ ListTag *PlayerEnderChestContainer::createTag() ListTag *items = new ListTag(L"EnderItems"); for (int i = 0; i < getContainerSize(); i++) { - shared_ptr item = getItem(i); + std::shared_ptr item = getItem(i); if (item != NULL) { CompoundTag *tag = new CompoundTag(); @@ -43,7 +43,7 @@ ListTag *PlayerEnderChestContainer::createTag() return items; } -bool PlayerEnderChestContainer::stillValid(shared_ptr player) +bool PlayerEnderChestContainer::stillValid(std::shared_ptr player) { if (activeChest != NULL && !activeChest->stillValid(player)) { diff --git a/Minecraft.World/PlayerEnderChestContainer.h b/Minecraft.World/PlayerEnderChestContainer.h index 523417aa..43bb3052 100644 --- a/Minecraft.World/PlayerEnderChestContainer.h +++ b/Minecraft.World/PlayerEnderChestContainer.h @@ -7,15 +7,15 @@ class EnderChestTileEntity; class PlayerEnderChestContainer : public SimpleContainer { private: - shared_ptr activeChest; + std::shared_ptr activeChest; public: PlayerEnderChestContainer(); - void setActiveChest(shared_ptr activeChest); + void setActiveChest(std::shared_ptr activeChest); void setItemsByTag(ListTag *enderItemsList); ListTag *createTag(); - bool stillValid(shared_ptr player); + bool stillValid(std::shared_ptr player); void startOpen(); void stopOpen(); }; \ No newline at end of file diff --git a/Minecraft.World/PlayerIO.h b/Minecraft.World/PlayerIO.h index 559ab2ee..dc843605 100644 --- a/Minecraft.World/PlayerIO.h +++ b/Minecraft.World/PlayerIO.h @@ -7,16 +7,16 @@ using namespace std; class Player; -class PlayerIO +class PlayerIO { public: - virtual void save(shared_ptr player) = 0; - virtual bool load(shared_ptr player) = 0; // 4J Changed return val to bool to check if new player or loaded player + virtual void save(std::shared_ptr player) = 0; + virtual bool load(std::shared_ptr player) = 0; // 4J Changed return val to bool to check if new player or loaded player virtual CompoundTag *loadPlayerDataTag(PlayerUID xuid) = 0; // 4J Changed from string name to xuid // 4J Added virtual void clearOldPlayerFiles() = 0; virtual void saveMapIdLookup() = 0; - virtual void deleteMapFilesForPlayer(shared_ptr player) = 0; + virtual void deleteMapFilesForPlayer(std::shared_ptr player) = 0; virtual void saveAllCachedData() = 0; }; \ No newline at end of file diff --git a/Minecraft.World/PlayerInfoPacket.cpp b/Minecraft.World/PlayerInfoPacket.cpp index 9cbe5f7c..d0d94c62 100644 --- a/Minecraft.World/PlayerInfoPacket.cpp +++ b/Minecraft.World/PlayerInfoPacket.cpp @@ -25,7 +25,7 @@ PlayerInfoPacket::PlayerInfoPacket(BYTE networkSmallId, short playerColourIndex, m_entityId = -1; } -PlayerInfoPacket::PlayerInfoPacket(shared_ptr player) +PlayerInfoPacket::PlayerInfoPacket(std::shared_ptr player) { m_networkSmallId = 0; if(player->connection != NULL && player->connection->getNetworkPlayer() != NULL) m_networkSmallId = player->connection->getNetworkPlayer()->GetSmallId(); diff --git a/Minecraft.World/PlayerInfoPacket.h b/Minecraft.World/PlayerInfoPacket.h index 85e2ed64..f4ad972f 100644 --- a/Minecraft.World/PlayerInfoPacket.h +++ b/Minecraft.World/PlayerInfoPacket.h @@ -19,7 +19,7 @@ class PlayerInfoPacket : public Packet, public enable_shared_from_this player); + PlayerInfoPacket(std::shared_ptr player); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); @@ -27,6 +27,6 @@ class PlayerInfoPacket : public Packet, public enable_shared_from_this create() { return shared_ptr(new PlayerInfoPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new PlayerInfoPacket()); } virtual int getId() { return 201; } }; \ No newline at end of file diff --git a/Minecraft.World/PlayerInputPacket.h b/Minecraft.World/PlayerInputPacket.h index 8bc11d3e..93bbf797 100644 --- a/Minecraft.World/PlayerInputPacket.h +++ b/Minecraft.World/PlayerInputPacket.h @@ -31,6 +31,6 @@ public: bool isSneaking(); public: - static shared_ptr create() { return shared_ptr(new PlayerInputPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new PlayerInputPacket()); } virtual int getId() { return 27; } }; \ No newline at end of file diff --git a/Minecraft.World/PortalForcer.cpp b/Minecraft.World/PortalForcer.cpp index 7c9b7a86..e6c51a41 100644 --- a/Minecraft.World/PortalForcer.cpp +++ b/Minecraft.World/PortalForcer.cpp @@ -11,7 +11,7 @@ PortalForcer::PortalForcer() } -void PortalForcer::force(Level *level, shared_ptr e) +void PortalForcer::force(Level *level, std::shared_ptr e) { if (level->dimension->id == 1) { @@ -54,7 +54,7 @@ void PortalForcer::force(Level *level, shared_ptr e) } -bool PortalForcer::findPortal(Level *level, shared_ptr e) +bool PortalForcer::findPortal(Level *level, std::shared_ptr e) { // 4J Stu - Decrease the range at which we search for a portal in the nether given our smaller nether int r = 16;//* 8; @@ -133,7 +133,7 @@ bool PortalForcer::findPortal(Level *level, shared_ptr e) } -bool PortalForcer::createPortal(Level *level, shared_ptr e) +bool PortalForcer::createPortal(Level *level, std::shared_ptr e) { // 4J Stu - Increase the range at which we try and create a portal to stop creating them floating in mid air over lava int r = 16 * 3; @@ -147,7 +147,7 @@ bool PortalForcer::createPortal(Level *level, shared_ptr e) int XZSIZE = level->dimension->getXZSize() * 16; // XZSize is chunks, convert to blocks int XZOFFSET = (XZSIZE / 2) - 4; // Subtract 4 to stay away from the edges // TODO Make the 4 a constant in HellRandomLevelSource - // Move the positions that we want to check away from the edge of the world + // Move the positions that we want to check away from the edge of the world if( (xc - r) < -XZOFFSET ) { app.DebugPrintf("Adjusting portal creation x due to being too close to the edge\n"); @@ -215,7 +215,7 @@ bool PortalForcer::createPortal(Level *level, shared_ptr e) int yt = y + h; int zt = z + (s - 1) * za - b * xa; - // 4J Stu - Changes to stop Portals being created at the border of the nether inside the bedrock + // 4J Stu - Changes to stop Portals being created at the border of the nether inside the bedrock if( ( xt < -XZOFFSET ) || ( xt >= XZOFFSET ) || ( zt < -XZOFFSET ) || ( zt >= XZOFFSET ) ) { app.DebugPrintf("Skipping possible portal location as at least one block is too close to the edge\n"); @@ -275,7 +275,7 @@ bool PortalForcer::createPortal(Level *level, shared_ptr e) int yt = y + h; int zt = z + (s - 1) * za; - // 4J Stu - Changes to stop Portals being created at the border of the nether inside the bedrock + // 4J Stu - Changes to stop Portals being created at the border of the nether inside the bedrock if( ( xt < -XZOFFSET ) || ( xt >= XZOFFSET ) || ( zt < -XZOFFSET ) || ( zt >= XZOFFSET ) ) { app.DebugPrintf("Skipping possible portal location as at least one block is too close to the edge\n"); diff --git a/Minecraft.World/PortalForcer.h b/Minecraft.World/PortalForcer.h index feb2f129..b3dcd4e6 100644 --- a/Minecraft.World/PortalForcer.h +++ b/Minecraft.World/PortalForcer.h @@ -11,11 +11,11 @@ public: // 4J Stu Added - Java has no ctor, but we need to initialise random PortalForcer(); - void force(Level *level, shared_ptr e); + void force(Level *level, std::shared_ptr e); public: - bool findPortal(Level *level, shared_ptr e); + bool findPortal(Level *level, std::shared_ptr e); public: - bool createPortal(Level *level, shared_ptr e); + bool createPortal(Level *level, std::shared_ptr e); }; \ No newline at end of file diff --git a/Minecraft.World/PortalTile.cpp b/Minecraft.World/PortalTile.cpp index 1b500a36..f97670a8 100644 --- a/Minecraft.World/PortalTile.cpp +++ b/Minecraft.World/PortalTile.cpp @@ -37,7 +37,7 @@ AABB *PortalTile::getAABB(Level *level, int x, int y, int z) return NULL; } -void PortalTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void PortalTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { if (level->getTile(x - 1, y, z) == id || level->getTile(x + 1, y, z) == id) { @@ -195,7 +195,7 @@ int PortalTile::getRenderLayer() return 1; } -void PortalTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void PortalTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { if (entity->riding == NULL && entity->rider.lock() == NULL) entity->handleInsidePortal(); } diff --git a/Minecraft.World/PortalTile.h b/Minecraft.World/PortalTile.h index 7be4320f..df6e4dee 100644 --- a/Minecraft.World/PortalTile.h +++ b/Minecraft.World/PortalTile.h @@ -10,7 +10,7 @@ public: PortalTile(int id); virtual void tick(Level *level, int x, int y, int z, Random *random); virtual AABB *getAABB(Level *level, int x, int y, int z); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); virtual bool trySpawnPortal(Level *level, int x, int y, int z, bool actuallySpawn); @@ -18,7 +18,7 @@ public: virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face); virtual int getResourceCount(Random *random); virtual int getRenderLayer(); - virtual void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + virtual void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); virtual void animateTick(Level *level, int xt, int yt, int zt, Random *random); virtual int cloneTileId(Level *level, int x, int y, int z); virtual bool mayPick(); // 4J Added override diff --git a/Minecraft.World/PotatoTile.cpp b/Minecraft.World/PotatoTile.cpp index 27ca1984..d348aaec 100644 --- a/Minecraft.World/PotatoTile.cpp +++ b/Minecraft.World/PotatoTile.cpp @@ -46,7 +46,7 @@ void PotatoTile::spawnResources(Level *level, int x, int y, int z, int data, flo { if (level->random->nextInt(50) == 0) { - popResource(level, x, y, z, shared_ptr(new ItemInstance(Item::potatoPoisonous))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(Item::potatoPoisonous))); } } } diff --git a/Minecraft.World/PotionItem.cpp b/Minecraft.World/PotionItem.cpp index 643e9661..d7154c49 100644 --- a/Minecraft.World/PotionItem.cpp +++ b/Minecraft.World/PotionItem.cpp @@ -30,7 +30,7 @@ PotionItem::PotionItem(int id) : Item(id) iconOverlay = NULL; } -vector *PotionItem::getMobEffects(shared_ptr potion) +vector *PotionItem::getMobEffects(std::shared_ptr potion) { return getMobEffects(potion->getAuxValue()); } @@ -48,7 +48,7 @@ vector *PotionItem::getMobEffects(int auxValue) return effects; } -shared_ptr PotionItem::useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr PotionItem::useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player) { if (!player->abilities.instabuild) instance->count--; @@ -68,46 +68,46 @@ shared_ptr PotionItem::useTimeDepleted(shared_ptr in { if (instance->count <= 0) { - return shared_ptr( new ItemInstance(Item::glassBottle) ); + return std::shared_ptr( new ItemInstance(Item::glassBottle) ); } else { - player->inventory->add( shared_ptr( new ItemInstance(Item::glassBottle) ) ); + player->inventory->add( std::shared_ptr( new ItemInstance(Item::glassBottle) ) ); } } return instance; } -int PotionItem::getUseDuration(shared_ptr itemInstance) +int PotionItem::getUseDuration(std::shared_ptr itemInstance) { return DRINK_DURATION; } -UseAnim PotionItem::getUseAnimation(shared_ptr itemInstance) +UseAnim PotionItem::getUseAnimation(std::shared_ptr itemInstance) { return UseAnim_drink; } -bool PotionItem::TestUse(Level *level, shared_ptr player) +bool PotionItem::TestUse(Level *level, std::shared_ptr player) { return true; } -shared_ptr PotionItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr PotionItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { if (isThrowable(instance->getAuxValue())) { if (!player->abilities.instabuild) instance->count--; level->playSound(player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f)); - if (!level->isClientSide) level->addEntity(shared_ptr( new ThrownPotion(level, player, instance->getAuxValue()) )); + if (!level->isClientSide) level->addEntity(std::shared_ptr( new ThrownPotion(level, player, instance->getAuxValue()) )); return instance; } player->startUsingItem(instance, getUseDuration(instance)); return instance; } -bool PotionItem::useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool PotionItem::useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { return false; } @@ -140,7 +140,7 @@ int PotionItem::getColor(int data) return PotionBrewing::getColorValue(data, false); } -int PotionItem::getColor(shared_ptr item, int spriteLayer) +int PotionItem::getColor(std::shared_ptr item, int spriteLayer) { if (spriteLayer > 0) { @@ -173,7 +173,7 @@ bool PotionItem::hasInstantenousEffects(int itemAuxValue) return false; } -wstring PotionItem::getHoverName(shared_ptr itemInstance) +wstring PotionItem::getHoverName(std::shared_ptr itemInstance) { if (itemInstance->getAuxValue() == 0) { @@ -197,7 +197,7 @@ wstring PotionItem::getHoverName(shared_ptr itemInstance) //String postfixString = effects.get(0).getDescriptionId(); //postfixString += ".postfix"; //return elementName + " " + I18n.get(postfixString).trim(); - + elementName = replaceAll(elementName,L"{*prefix*}",L""); elementName = replaceAll(elementName,L"{*postfix*}",app.GetString(effects->at(0)->getPostfixDescriptionId())); } @@ -205,14 +205,14 @@ wstring PotionItem::getHoverName(shared_ptr itemInstance) { //String appearanceName = PotionBrewing.getAppearanceName(itemInstance.getAuxValue()); //return I18n.get(appearanceName).trim() + " " + elementName; - + elementName = replaceAll(elementName,L"{*prefix*}",app.GetString( PotionBrewing::getAppearanceName(itemInstance->getAuxValue()))); elementName = replaceAll(elementName,L"{*postfix*}",L""); } return elementName; } -void PotionItem::appendHoverText(shared_ptr itemInstance, shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) +void PotionItem::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) { if (itemInstance->getAuxValue() == 0) { @@ -260,12 +260,12 @@ void PotionItem::appendHoverText(shared_ptr itemInstance, shared_p if (MobEffect::effects[effect->getId()]->isHarmful()) { colour = eHTMLColor_c; - //lines->push_back(L"§c + effectString); //"§c" + //lines->push_back(L"�c + effectString); //"�c" } else { colour = eHTMLColor_7; - //lines->push_back(L"§7" + effectString); //"§7" + //lines->push_back(L"�7" + effectString); //"�7" } swprintf(formatted, 256, L"%ls",app.GetHTMLColour(colour),effectString.c_str()); lines->push_back(formatted); @@ -277,21 +277,21 @@ void PotionItem::appendHoverText(shared_ptr itemInstance, shared_p //eHTMLColor_7 wchar_t formatted[256]; swprintf(formatted,256,L"%ls",app.GetHTMLColour(eHTMLColor_7),effectString.c_str()); - lines->push_back(formatted); //"§7" + lines->push_back(formatted); //"�7" } } -bool PotionItem::isFoil(shared_ptr itemInstance) +bool PotionItem::isFoil(std::shared_ptr itemInstance) { vector *mobEffects = getMobEffects(itemInstance); return mobEffects != NULL && !mobEffects->empty(); } -unsigned int PotionItem::getUseDescriptionId(shared_ptr instance) +unsigned int PotionItem::getUseDescriptionId(std::shared_ptr instance) { int brew = instance->getAuxValue(); - + #define MACRO_POTION_IS_NIGHTVISION(aux) ((aux & 0x200F) == MASK_NIGHTVISION) #define MACRO_POTION_IS_INVISIBILITY(aux) ((aux & 0x200F) == MASK_INVISIBILITY) diff --git a/Minecraft.World/PotionItem.h b/Minecraft.World/PotionItem.h index d03d3308..0d5dd181 100644 --- a/Minecraft.World/PotionItem.h +++ b/Minecraft.World/PotionItem.h @@ -24,26 +24,26 @@ private: public: PotionItem(int id); - virtual vector *getMobEffects(shared_ptr potion); + virtual vector *getMobEffects(std::shared_ptr potion); virtual vector *getMobEffects(int auxValue); - virtual shared_ptr useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player); - virtual int getUseDuration(shared_ptr itemInstance); - virtual UseAnim getUseAnimation(shared_ptr itemInstance); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); - virtual bool TestUse(Level *level, shared_ptr player); - virtual bool useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual std::shared_ptr useTimeDepleted(std::shared_ptr instance, Level *level, std::shared_ptr player); + virtual int getUseDuration(std::shared_ptr itemInstance); + virtual UseAnim getUseAnimation(std::shared_ptr itemInstance); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); + virtual bool TestUse(Level *level, std::shared_ptr player); + virtual bool useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); virtual Icon *getIcon(int auxValue); virtual Icon *getLayerIcon(int auxValue, int spriteLayer); static bool isThrowable(int auxValue); int getColor(int data); - virtual int getColor(shared_ptr item, int spriteLayer); + virtual int getColor(std::shared_ptr item, int spriteLayer); virtual bool hasMultipleSpriteLayers(); virtual bool hasInstantenousEffects(int itemAuxValue); - virtual wstring getHoverName(shared_ptr itemInstance); - virtual void appendHoverText(shared_ptr itemInstance, shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); - virtual bool isFoil(shared_ptr itemInstance); + virtual wstring getHoverName(std::shared_ptr itemInstance); + virtual void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); + virtual bool isFoil(std::shared_ptr itemInstance); - virtual unsigned int getUseDescriptionId(shared_ptr instance); + virtual unsigned int getUseDescriptionId(std::shared_ptr instance); //@Override void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/PreLoginPacket.h b/Minecraft.World/PreLoginPacket.h index 243f2f36..2d73d630 100644 --- a/Minecraft.World/PreLoginPacket.h +++ b/Minecraft.World/PreLoginPacket.h @@ -34,6 +34,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new PreLoginPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new PreLoginPacket()); } virtual int getId() { return 2; } }; \ No newline at end of file diff --git a/Minecraft.World/PressurePlateTile.cpp b/Minecraft.World/PressurePlateTile.cpp index eacdeb07..43dd9aed 100644 --- a/Minecraft.World/PressurePlateTile.cpp +++ b/Minecraft.World/PressurePlateTile.cpp @@ -76,7 +76,7 @@ void PressurePlateTile::tick(Level *level, int x, int y, int z, Random *random) checkPressed(level, x, y, z); } -void PressurePlateTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void PressurePlateTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { if (level->isClientSide) return; @@ -94,7 +94,7 @@ void PressurePlateTile::checkPressed(Level *level, int x, int y, int z) bool shouldBePressed = false; float b = 2 / 16.0f; - vector > *entities = NULL; + vector > *entities = NULL; bool entitiesToBeFreed = false; if (sensitivity == PressurePlateTile::everything) entities = level->getEntities(nullptr, AABB::newTemp(x + b, y, z + b, x + 1 - b, y + 0.25, z + 1 - b)); @@ -155,7 +155,7 @@ void PressurePlateTile::onRemove(Level *level, int x, int y, int z, int id, int Tile::onRemove(level, x, y, z, id, data); } -void PressurePlateTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void PressurePlateTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { bool pressed = level->getData(x, y, z) == 1; diff --git a/Minecraft.World/PressurePlateTile.h b/Minecraft.World/PressurePlateTile.h index 0b70fca9..e46f5a1a 100644 --- a/Minecraft.World/PressurePlateTile.h +++ b/Minecraft.World/PressurePlateTile.h @@ -31,19 +31,19 @@ public: virtual bool mayPlace(Level *level, int x, int y, int z); virtual void neighborChanged(Level *level, int x, int y, int z, int type); virtual void tick(Level *level, int x, int y, int z, Random *random); - virtual void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + virtual void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); private: virtual void checkPressed(Level *level, int x, int y, int z); public: virtual void onRemove(Level *level, int x, int y, int z, int id, int data); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual bool getSignal(LevelSource *level, int x, int y, int z, int dir); virtual bool getDirectSignal(Level *level, int x, int y, int z, int dir); virtual bool isSignalSource(); virtual void updateDefaultShape(); virtual int getPistonPushReaction(); void registerIcons(IconRegister *iconRegister); - + // 4J Added so we can check before we try to add a tile to the tick list if it's actually going to do seomthing virtual bool shouldTileTick(Level *level, int x,int y,int z); }; diff --git a/Minecraft.World/ProtectionEnchantment.cpp b/Minecraft.World/ProtectionEnchantment.cpp index 39e3eca1..b8311c85 100644 --- a/Minecraft.World/ProtectionEnchantment.cpp +++ b/Minecraft.World/ProtectionEnchantment.cpp @@ -52,7 +52,7 @@ int ProtectionEnchantment::getDescriptionId() } bool ProtectionEnchantment::isCompatibleWith(Enchantment *other) const -{ +{ ProtectionEnchantment *pe = dynamic_cast( other ); if (pe != NULL) { @@ -69,7 +69,7 @@ bool ProtectionEnchantment::isCompatibleWith(Enchantment *other) const return Enchantment::isCompatibleWith(other); } -int ProtectionEnchantment::getFireAfterDampener(shared_ptr entity, int time) +int ProtectionEnchantment::getFireAfterDampener(std::shared_ptr entity, int time) { int level = EnchantmentHelper::getEnchantmentLevel(Enchantment::fireProtection->id, entity->getEquipmentSlots()); @@ -81,7 +81,7 @@ int ProtectionEnchantment::getFireAfterDampener(shared_ptr entity, int t return time; } -double ProtectionEnchantment::getExplosionKnockbackAfterDampener(shared_ptr entity, double power) +double ProtectionEnchantment::getExplosionKnockbackAfterDampener(std::shared_ptr entity, double power) { int level = EnchantmentHelper::getEnchantmentLevel(Enchantment::explosionProtection->id, entity->getEquipmentSlots()); diff --git a/Minecraft.World/ProtectionEnchantment.h b/Minecraft.World/ProtectionEnchantment.h index 910e32df..e9727254 100644 --- a/Minecraft.World/ProtectionEnchantment.h +++ b/Minecraft.World/ProtectionEnchantment.h @@ -28,6 +28,6 @@ public: virtual int getDamageProtection(int level, DamageSource *source); virtual int getDescriptionId(); virtual bool isCompatibleWith(Enchantment *other) const; - static int getFireAfterDampener(shared_ptr entity, int time); - static double getExplosionKnockbackAfterDampener(shared_ptr entity, double power); + static int getFireAfterDampener(std::shared_ptr entity, int time); + static double getExplosionKnockbackAfterDampener(std::shared_ptr entity, double power); }; \ No newline at end of file diff --git a/Minecraft.World/PumpkinTile.cpp b/Minecraft.World/PumpkinTile.cpp index 577b9a17..22c31d3d 100644 --- a/Minecraft.World/PumpkinTile.cpp +++ b/Minecraft.World/PumpkinTile.cpp @@ -45,7 +45,7 @@ void PumpkinTile::onPlace(Level *level, int x, int y, int z) level->setTileNoUpdate(x, y, z, 0); level->setTileNoUpdate(x, y - 1, z, 0); level->setTileNoUpdate(x, y - 2, z, 0); - shared_ptr snowMan = shared_ptr(new SnowMan(level)); + std::shared_ptr snowMan = std::shared_ptr(new SnowMan(level)); snowMan->moveTo(x + 0.5, y - 1.95, z + 0.5, 0, 0); level->addEntity(snowMan); @@ -94,7 +94,7 @@ void PumpkinTile::onPlace(Level *level, int x, int y, int z) level->setTileNoUpdate(x, y - 1, z + 1, 0); } - shared_ptr villagerGolem = shared_ptr(new VillagerGolem(level)); + std::shared_ptr villagerGolem = std::shared_ptr(new VillagerGolem(level)); villagerGolem->setPlayerCreated(true); villagerGolem->moveTo(x + 0.5, y - 1.95, z + 0.5, 0, 0); level->addEntity(villagerGolem); @@ -155,7 +155,7 @@ bool PumpkinTile::mayPlace(Level *level, int x, int y, int z) } -void PumpkinTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void PumpkinTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int dir = Mth::floor(by->yRot * 4 / (360) + 2.5) & 3; level->setData(x, y, z, dir); diff --git a/Minecraft.World/PumpkinTile.h b/Minecraft.World/PumpkinTile.h index 1c808b54..03e55569 100644 --- a/Minecraft.World/PumpkinTile.h +++ b/Minecraft.World/PumpkinTile.h @@ -26,6 +26,6 @@ public: virtual Icon *getTexture(int face, int data); virtual void onPlace(Level *level, int x, int y, int z); virtual bool mayPlace(Level *level, int x, int y, int z); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); void registerIcons(IconRegister *iconRegister); }; \ No newline at end of file diff --git a/Minecraft.World/QuartzBlockTile.cpp b/Minecraft.World/QuartzBlockTile.cpp index a7beeb21..f719ff7a 100644 --- a/Minecraft.World/QuartzBlockTile.cpp +++ b/Minecraft.World/QuartzBlockTile.cpp @@ -89,9 +89,9 @@ int QuartzBlockTile::getSpawnResourcesAuxValue(int data) return data; } -shared_ptr QuartzBlockTile::getSilkTouchItemInstance(int data) +std::shared_ptr QuartzBlockTile::getSilkTouchItemInstance(int data) { - if (data == TYPE_LINES_X || data == TYPE_LINES_Z) return shared_ptr(new ItemInstance(id, 1, TYPE_LINES_Y)); + if (data == TYPE_LINES_X || data == TYPE_LINES_Z) return std::shared_ptr(new ItemInstance(id, 1, TYPE_LINES_Y)); return Tile::getSilkTouchItemInstance(data); } diff --git a/Minecraft.World/QuartzBlockTile.h b/Minecraft.World/QuartzBlockTile.h index bdb5af8b..d812e8a1 100644 --- a/Minecraft.World/QuartzBlockTile.h +++ b/Minecraft.World/QuartzBlockTile.h @@ -39,7 +39,7 @@ public: int getSpawnResourcesAuxValue(int data); protected: - shared_ptr getSilkTouchItemInstance(int data); + std::shared_ptr getSilkTouchItemInstance(int data); public: int getRenderShape(); diff --git a/Minecraft.World/RailTile.cpp b/Minecraft.World/RailTile.cpp index 4ece48ca..c2d1befc 100644 --- a/Minecraft.World/RailTile.cpp +++ b/Minecraft.World/RailTile.cpp @@ -397,7 +397,7 @@ HitResult *RailTile::clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b return Tile::clip(level, xt, yt, zt, a, b); } -void RailTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void RailTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { int data = level->getData(x, y, z); if (data >= 2 && data <= 5) diff --git a/Minecraft.World/RailTile.h b/Minecraft.World/RailTile.h index 776d8454..9fb854ad 100644 --- a/Minecraft.World/RailTile.h +++ b/Minecraft.World/RailTile.h @@ -66,7 +66,7 @@ public: virtual bool blocksLight(); virtual bool isSolidRender(bool isServerLevel = false); virtual HitResult *clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual Icon *getTexture(int face, int data); virtual bool isCubeShaped(); virtual int getRenderShape(); diff --git a/Minecraft.World/RandomPos.cpp b/Minecraft.World/RandomPos.cpp index c2cfd908..a12c93a9 100644 --- a/Minecraft.World/RandomPos.cpp +++ b/Minecraft.World/RandomPos.cpp @@ -5,12 +5,12 @@ Vec3 *RandomPos::tempDir = Vec3::newPermanent(0, 0, 0); -Vec3 *RandomPos::getPos(shared_ptr mob, int xzDist, int yDist, int quadrant/*=-1*/) // 4J - added quadrant +Vec3 *RandomPos::getPos(std::shared_ptr mob, int xzDist, int yDist, int quadrant/*=-1*/) // 4J - added quadrant { return generateRandomPos(mob, xzDist, yDist, NULL, quadrant); } -Vec3 *RandomPos::getPosTowards(shared_ptr mob, int xzDist, int yDist, Vec3 *towardsPos) +Vec3 *RandomPos::getPosTowards(std::shared_ptr mob, int xzDist, int yDist, Vec3 *towardsPos) { tempDir->x = towardsPos->x - mob->x; tempDir->y = towardsPos->y - mob->y; @@ -18,7 +18,7 @@ Vec3 *RandomPos::getPosTowards(shared_ptr mob, int xzDist, int yD return generateRandomPos(mob, xzDist, yDist, tempDir); } -Vec3 *RandomPos::getPosAvoid(shared_ptr mob, int xzDist, int yDist, Vec3 *avoidPos) +Vec3 *RandomPos::getPosAvoid(std::shared_ptr mob, int xzDist, int yDist, Vec3 *avoidPos) { tempDir->x = mob->x - avoidPos->x; tempDir->y = mob->y - avoidPos->y; @@ -26,7 +26,7 @@ Vec3 *RandomPos::getPosAvoid(shared_ptr mob, int xzDist, int yDis return generateRandomPos(mob, xzDist, yDist, tempDir); } -Vec3 *RandomPos::generateRandomPos(shared_ptr mob, int xzDist, int yDist, Vec3 *dir, int quadrant/*=-1*/) // 4J - added quadrant +Vec3 *RandomPos::generateRandomPos(std::shared_ptr mob, int xzDist, int yDist, Vec3 *dir, int quadrant/*=-1*/) // 4J - added quadrant { Random *random = mob->getRandom(); bool hasBest = false; diff --git a/Minecraft.World/RandomPos.h b/Minecraft.World/RandomPos.h index eceed17e..a5ee447b 100644 --- a/Minecraft.World/RandomPos.h +++ b/Minecraft.World/RandomPos.h @@ -8,10 +8,10 @@ private: static Vec3 *tempDir; public: - static Vec3 *getPos(shared_ptr mob, int xzDist, int yDist, int quadrant = -1); // 4J added quadrant - static Vec3 *getPosTowards(shared_ptr mob, int xzDist, int yDist, Vec3 *towardsPos); - static Vec3 *getPosAvoid(shared_ptr mob, int xzDist, int yDist, Vec3 *avoidPos); + static Vec3 *getPos(std::shared_ptr mob, int xzDist, int yDist, int quadrant = -1); // 4J added quadrant + static Vec3 *getPosTowards(std::shared_ptr mob, int xzDist, int yDist, Vec3 *towardsPos); + static Vec3 *getPosAvoid(std::shared_ptr mob, int xzDist, int yDist, Vec3 *avoidPos); private: - static Vec3 *generateRandomPos(shared_ptr mob, int xzDist, int yDist, Vec3 *dir, int quadrant = -1); // 4J added quadrant + static Vec3 *generateRandomPos(std::shared_ptr mob, int xzDist, int yDist, Vec3 *dir, int quadrant = -1); // 4J added quadrant }; \ No newline at end of file diff --git a/Minecraft.World/Recipes.cpp b/Minecraft.World/Recipes.cpp index 93be1dfb..066bd4a1 100644 --- a/Minecraft.World/Recipes.cpp +++ b/Minecraft.World/Recipes.cpp @@ -45,7 +45,7 @@ void Recipes::_init() recipies = new RecipyList(); } -Recipes::Recipes() +Recipes::Recipes() { int iCount=0; _init(); @@ -55,7 +55,7 @@ Recipes::Recipes() pFoodRecipies = new FoodRecipies; pOreRecipies = new OreRecipies; pStructureRecipies = new StructureRecipies; - pToolRecipies = new ToolRecipies; + pToolRecipies = new ToolRecipies; pWeaponRecipies = new WeaponRecipies; // 4J Stu - These just don't work with our crafting menu @@ -74,8 +74,8 @@ Recipes::Recipes() L"#", // L'#', new ItemInstance(Tile::treeTrunk, 1, TreeTile::BIRCH_TRUNK), - L'S'); - + L'S'); + addShapedRecipy(new ItemInstance(Tile::wood, 4, TreeTile::DARK_TRUNK), // L"sczg", L"#", // @@ -99,7 +99,7 @@ Recipes::Recipes() L'S'); pToolRecipies->addRecipes(this); - pFoodRecipies->addRecipes(this); + pFoodRecipies->addRecipes(this); pStructureRecipies->addRecipes(this); @@ -146,8 +146,8 @@ Recipes::Recipes() L"#W#", // L'#', Item::stick, L'W', Tile::wood, - L'S'); - + L'S'); + addShapedRecipy(new ItemInstance(Tile::fence, 2), // L"sscig", L"###", // @@ -155,7 +155,7 @@ Recipes::Recipes() L'#', Item::stick, L'S'); - + addShapedRecipy(new ItemInstance(Tile::netherFence, 6), // L"ssctg", L"###", // @@ -303,10 +303,10 @@ Recipes::Recipes() L'#', Tile::quartzBlock, L'S'); - pArmorRecipes->addRecipes(this); + pArmorRecipes->addRecipes(this); //iCount=getRecipies()->size(); - pClothDyeRecipes->addRecipes(this); + pClothDyeRecipes->addRecipes(this); addShapedRecipy(new ItemInstance(Tile::snow, 1), // @@ -363,14 +363,14 @@ Recipes::Recipes() L"###", // L'#', Tile::rock, - L'S'); + L'S'); addShapedRecipy(new ItemInstance(Tile::stoneSlabHalf, 6, StoneSlabTile::COBBLESTONE_SLAB), // L"sctg", L"###", // L'#', Tile::stoneBrick, L'S'); - + addShapedRecipy(new ItemInstance(Tile::stoneSlabHalf, 6, StoneSlabTile::BRICK_SLAB), // L"sctg", L"###", // @@ -556,7 +556,7 @@ Recipes::Recipes() L"# X", // L" #X", // - L'X', Item::string,// + L'X', Item::string,// L'#', Item::stick, L'T'); @@ -566,8 +566,8 @@ Recipes::Recipes() L"#", // L"Y", // - L'Y', Item::feather,// - L'X', Item::flint,// + L'Y', Item::feather,// + L'X', Item::flint,// L'#', Item::stick, L'T'); @@ -715,7 +715,7 @@ Recipes::Recipes() L'#', Item::paper, L'X', Item::compass, L'T'); - + addShapedRecipy(new ItemInstance(Tile::button, 1), // L"sctg", L"#", // @@ -844,7 +844,7 @@ Recipes::Recipes() L'#', Item::stick, L'X', Item::leather, L'D'); - pOreRecipies->addRecipes(this); + pOreRecipies->addRecipes(this); addShapedRecipy(new ItemInstance(Item::goldIngot), // L"ssscig", @@ -894,17 +894,17 @@ Recipes::Recipes() // Sort so the largest recipes get checked first! /* 4J-PB - TODO - Collections.sort(recipies, new Comparator() + Collections.sort(recipies, new Comparator() { - public: int compare(Recipy r0, Recipy r1) + public: int compare(Recipy r0, Recipy r1) { // shapeless recipes are put in the back of the list - if (r0 instanceof ShapelessRecipy && r1 instanceof ShapedRecipy) + if (r0 instanceof ShapelessRecipy && r1 instanceof ShapedRecipy) { return 1; } - if (r1 instanceof ShapelessRecipy && r0 instanceof ShapedRecipy) + if (r1 instanceof ShapelessRecipy && r0 instanceof ShapedRecipy) { return -1; } @@ -957,7 +957,7 @@ ShapedRecipy *Recipes::addShapedRecipy(ItemInstance *result, ...) wchTypes = va_arg(vl,wchar_t *); - for(int i = 0; wchTypes[i] != L'\0'; ++i ) + for(int i = 0; wchTypes[i] != L'\0'; ++i ) { if(wchTypes[i+1]==L'\0' && wchTypes[i]!=L'g') { @@ -1051,15 +1051,15 @@ ShapedRecipy *Recipes::addShapedRecipy(ItemInstance *result, ...) ids = new ItemInstance *[width * height]; - for (int j = 0; j < width * height; j++) + for (int j = 0; j < width * height; j++) { wchar_t ch = map[j]; myMap::iterator it=mappings->find(ch); - if (it != mappings->end()) + if (it != mappings->end()) { ids[j] =it->second; - } - else + } + else { ids[j] = NULL; } @@ -1073,7 +1073,7 @@ ShapedRecipy *Recipes::addShapedRecipy(ItemInstance *result, ...) return recipe; } -void Recipes::addShapelessRecipy(ItemInstance *result,... ) +void Recipes::addShapelessRecipy(ItemInstance *result,... ) { va_list vl; wchar_t *szTypes; @@ -1092,7 +1092,7 @@ void Recipes::addShapelessRecipy(ItemInstance *result,... ) // t - Tile * szTypes = va_arg(vl,wchar_t *); - for(int i = 0; szTypes[i] != L'\0'; ++i ) + for(int i = 0; szTypes[i] != L'\0'; ++i ) { switch(szTypes[i]) { @@ -1143,17 +1143,17 @@ void Recipes::addShapelessRecipy(ItemInstance *result,... ) break; } } - recipies->push_back(new ShapelessRecipy(result, ingredients, group)); + recipies->push_back(new ShapelessRecipy(result, ingredients, group)); } -shared_ptr Recipes::getItemFor(shared_ptr craftSlots, Level *level) +std::shared_ptr Recipes::getItemFor(std::shared_ptr craftSlots, Level *level) { int count = 0; - shared_ptr first = nullptr; - shared_ptr second = nullptr; + std::shared_ptr first = nullptr; + std::shared_ptr second = nullptr; for (int i = 0; i < craftSlots->getContainerSize(); i++) { - shared_ptr item = craftSlots->getItem(i); + std::shared_ptr item = craftSlots->getItem(i); if (item != NULL) { if (count == 0) first = item; @@ -1170,7 +1170,7 @@ shared_ptr Recipes::getItemFor(shared_ptr craft int remaining = (remaining1 + remaining2) + item->getMaxDamage() * 5 / 100; int resultDamage = item->getMaxDamage() - remaining; if (resultDamage < 0) resultDamage = 0; - return shared_ptr( new ItemInstance(first->id, 1, resultDamage) ); + return std::shared_ptr( new ItemInstance(first->id, 1, resultDamage) ); } AUTO_VAR(itEnd, recipies->end()); @@ -1182,13 +1182,13 @@ shared_ptr Recipes::getItemFor(shared_ptr craft return nullptr; } -vector *Recipes::getRecipies() +vector *Recipes::getRecipies() { return recipies; } // 4J-PB - added to deal with Xb0x 'crafting' -shared_ptr Recipes::getItemForRecipe(Recipy *r) +std::shared_ptr Recipes::getItemForRecipe(Recipy *r) { return r->assemble(nullptr); } @@ -1204,9 +1204,9 @@ void Recipes::buildRecipeIngredientsArray(void) int iCount=0; AUTO_VAR(itEndRec, recipies->end()); - for (AUTO_VAR(it, recipies->begin()); it != itEndRec; it++) + for (AUTO_VAR(it, recipies->begin()); it != itEndRec; it++) { - Recipy *recipe = *it; + Recipy *recipe = *it; //wprintf(L"RECIPE - [%d] is %w\n",iCount,recipe->getResultItem()->getItem()->getName()); recipe->requires(&m_pRecipeIngredientsRequired[iCount++]); } diff --git a/Minecraft.World/Recipes.h b/Minecraft.World/Recipes.h index c5d091e1..5d75b0e6 100644 --- a/Minecraft.World/Recipes.h +++ b/Minecraft.World/Recipes.h @@ -62,12 +62,12 @@ private: eINSTANCEOF eType; }; -class Recipes +class Recipes { public: static const int ANY_AUX_VALUE = -1; -private: +private: static Recipes *instance; vector *recipies; @@ -75,25 +75,25 @@ private: public: static void staticCtor(); -public: - static Recipes *getInstance() +public: + static Recipes *getInstance() { return instance; } -private: +private: void _init(); // 4J add Recipes(); public: ShapedRecipy *addShapedRecipy(ItemInstance *, ... ); - void addShapelessRecipy(ItemInstance *result,... ); + void addShapelessRecipy(ItemInstance *result,... ); - shared_ptr getItemFor(shared_ptr craftSlots, Level *level); + std::shared_ptr getItemFor(std::shared_ptr craftSlots, Level *level); vector *getRecipies(); // 4J-PB - Added all below for new Xbox 'crafting' - shared_ptr getItemForRecipe(Recipy *r); + std::shared_ptr getItemForRecipe(Recipy *r); Recipy::INGREDIENTS_REQUIRED *getRecipeIngredientsArray(); private: diff --git a/Minecraft.World/Recipy.h b/Minecraft.World/Recipy.h index 88d9640a..96d6be35 100644 --- a/Minecraft.World/Recipy.h +++ b/Minecraft.World/Recipy.h @@ -1,5 +1,5 @@ // package net.minecraft.world.item.crafting; -// +// // import net.minecraft.world.inventory.CraftingContainer; // import net.minecraft.world.item.ItemInstance; @@ -10,7 +10,7 @@ #define RECIPE_TYPE_2x2 0 #define RECIPE_TYPE_3x3 1 -class Recipy +class Recipy { public: enum _eGroupType @@ -28,7 +28,7 @@ public: eGroupType; // to class the item produced by the recipe // 4J-PB - we'll classing an ingredient ID with a different aux value as a different IngID AuxVal pair - typedef struct + typedef struct { int iIngC; int iType; // Can be a 2x2 or a 3x3. Inventory crafting can only make a 2x2. @@ -42,11 +42,11 @@ public: } INGREDIENTS_REQUIRED; ~Recipy() {} - virtual bool matches(shared_ptr craftSlots, Level *level) = 0; - virtual shared_ptr assemble(shared_ptr craftSlots) = 0; + virtual bool matches(std::shared_ptr craftSlots, Level *level) = 0; + virtual std::shared_ptr assemble(std::shared_ptr craftSlots) = 0; virtual int size() = 0; virtual const ItemInstance *getResultItem() = 0; - virtual const int getGroup() = 0; + virtual const int getGroup() = 0; // 4J-PB virtual bool requires(int iRecipe) = 0; diff --git a/Minecraft.World/RecordPlayerTile.cpp b/Minecraft.World/RecordPlayerTile.cpp index de5f7386..12fd3590 100644 --- a/Minecraft.World/RecordPlayerTile.cpp +++ b/Minecraft.World/RecordPlayerTile.cpp @@ -23,14 +23,14 @@ Icon *RecordPlayerTile::getTexture(int face, int data) } // 4J-PB - Adding a TestUse for tooltip display -bool RecordPlayerTile::TestUse(Level *level, int x, int y, int z, shared_ptr player) +bool RecordPlayerTile::TestUse(Level *level, int x, int y, int z, std::shared_ptr player) { // if the jukebox is empty, return true if (level->getData(x, y, z) == 0) return false; return true; } -bool RecordPlayerTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool RecordPlayerTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if (soundOnly) return false; if (level->getData(x, y, z) == 0) return false; @@ -42,7 +42,7 @@ void RecordPlayerTile::setRecord(Level *level, int x, int y, int z, int record) { if (level->isClientSide) return; - shared_ptr rte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr rte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); rte->record = record; rte->setChanged(); @@ -53,7 +53,7 @@ void RecordPlayerTile::dropRecording(Level *level, int x, int y, int z) { if (level->isClientSide) return; - shared_ptr rte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr rte = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if( rte == NULL ) return; int oldRecord = rte->record; @@ -71,7 +71,7 @@ void RecordPlayerTile::dropRecording(Level *level, int x, int y, int z) double xo = level->random->nextFloat() * s + (1 - s) * 0.5; double yo = level->random->nextFloat() * s + (1 - s) * 0.2 + 0.6; double zo = level->random->nextFloat() * s + (1 - s) * 0.5; - shared_ptr item = shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, shared_ptr( new ItemInstance(oldRecord, 1, 0) ) ) ); + std::shared_ptr item = std::shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, std::shared_ptr( new ItemInstance(oldRecord, 1, 0) ) ) ); item->throwTime = 10; level->addEntity(item); } @@ -88,9 +88,9 @@ void RecordPlayerTile::spawnResources(Level *level, int x, int y, int z, int dat Tile::spawnResources(level, x, y, z, data, odds, 0); } -shared_ptr RecordPlayerTile::newTileEntity(Level *level) +std::shared_ptr RecordPlayerTile::newTileEntity(Level *level) { - return shared_ptr( new RecordPlayerTile::Entity() ); + return std::shared_ptr( new RecordPlayerTile::Entity() ); } void RecordPlayerTile::registerIcons(IconRegister *iconRegister) diff --git a/Minecraft.World/RecordPlayerTile.h b/Minecraft.World/RecordPlayerTile.h index b6a2d901..8d216af8 100644 --- a/Minecraft.World/RecordPlayerTile.h +++ b/Minecraft.World/RecordPlayerTile.h @@ -37,9 +37,9 @@ public: } // 4J Added - shared_ptr clone() + std::shared_ptr clone() { - shared_ptr result = shared_ptr( new RecordPlayerTile::Entity() ); + std::shared_ptr result = std::shared_ptr( new RecordPlayerTile::Entity() ); TileEntity::clone(result); result->record = record; @@ -56,13 +56,13 @@ protected: public: virtual Icon *getTexture(int face, int data); - virtual bool TestUse(Level *level, int x, int y, int z, shared_ptr player); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool TestUse(Level *level, int x, int y, int z, std::shared_ptr player); + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param void setRecord(Level *level, int x, int y, int z, int record); void dropRecording(Level *level, int x, int y, int z); virtual void onRemove(Level *level, int x, int y, int z, int id, int data); virtual void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonus); - virtual shared_ptr newTileEntity(Level *level); + virtual std::shared_ptr newTileEntity(Level *level); void registerIcons(IconRegister *iconRegister); }; diff --git a/Minecraft.World/RecordingItem.cpp b/Minecraft.World/RecordingItem.cpp index 24be1190..dffd38c6 100644 --- a/Minecraft.World/RecordingItem.cpp +++ b/Minecraft.World/RecordingItem.cpp @@ -17,7 +17,7 @@ Icon *RecordingItem::getIcon(int auxValue) return icon; } -bool RecordingItem::useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool RecordingItem::useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { // 4J-PB - Adding a test only version to allow tooltips to be displayed if (level->getTile(x, y, z) == Tile::recordPlayer_Id && level->getData(x, y, z) == 0) @@ -40,9 +40,9 @@ bool RecordingItem::useOn(shared_ptr itemInstance, shared_ptr itemInstance, shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) +void RecordingItem::appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings) { - eMinecraftColour rarityColour = getRarity(shared_ptr())->color; + eMinecraftColour rarityColour = getRarity(std::shared_ptr())->color; int colour = app.GetHTMLColour(rarityColour); wchar_t formatted[256]; @@ -53,7 +53,7 @@ void RecordingItem::appendHoverText(shared_ptr itemInstance, share unformattedStrings.push_back(recording); } -const Rarity *RecordingItem::getRarity(shared_ptr itemInstance) +const Rarity *RecordingItem::getRarity(std::shared_ptr itemInstance) { return (Rarity *)Rarity::rare; } diff --git a/Minecraft.World/RecordingItem.h b/Minecraft.World/RecordingItem.h index 9b184c6a..5aba0b51 100644 --- a/Minecraft.World/RecordingItem.h +++ b/Minecraft.World/RecordingItem.h @@ -13,10 +13,10 @@ public: // 4J Stu - Was protected in Java, but the can't access it where we need //@Override Icon *getIcon(int auxValue); - virtual bool useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - virtual void appendHoverText(shared_ptr itemInstance, shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); - virtual const Rarity *getRarity(shared_ptr itemInstance); + virtual void appendHoverText(std::shared_ptr itemInstance, std::shared_ptr player, vector *lines, bool advanced, vector &unformattedStrings); + virtual const Rarity *getRarity(std::shared_ptr itemInstance); //@Override void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/RedStoneItem.cpp b/Minecraft.World/RedStoneItem.cpp index 64201caa..f2769e92 100644 --- a/Minecraft.World/RedStoneItem.cpp +++ b/Minecraft.World/RedStoneItem.cpp @@ -10,7 +10,7 @@ RedStoneItem::RedStoneItem(int id) : Item(id) { } -bool RedStoneItem::useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool RedStoneItem::useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { // 4J-PB - Adding a test only version to allow tooltips to be displayed if (level->getTile(x, y, z) != Tile::topSnow_Id) @@ -27,7 +27,7 @@ bool RedStoneItem::useOn(shared_ptr itemInstance, shared_ptrmayPlace(level, x, y, z)) { if(!bTestUseOnOnly) - { + { // 4J-JEV: Hook for durango 'BlockPlaced' event. player->awardStat(GenericStats::blocksPlaced(Tile::redStoneDust_Id), GenericStats::param_blocksPlaced(Tile::redStoneDust_Id,itemInstance->getAuxValue(),1)); diff --git a/Minecraft.World/RedStoneItem.h b/Minecraft.World/RedStoneItem.h index 01be92ff..13ee7f13 100644 --- a/Minecraft.World/RedStoneItem.h +++ b/Minecraft.World/RedStoneItem.h @@ -3,11 +3,11 @@ using namespace std; #include "Item.h" - class RedStoneItem : public Item + class RedStoneItem : public Item { public: RedStoneItem(int id); public: - virtual bool useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr itemInstance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); }; \ No newline at end of file diff --git a/Minecraft.World/RedStoneOreTile.cpp b/Minecraft.World/RedStoneOreTile.cpp index 9317ffdd..f08cf9fa 100644 --- a/Minecraft.World/RedStoneOreTile.cpp +++ b/Minecraft.World/RedStoneOreTile.cpp @@ -17,13 +17,13 @@ int RedStoneOreTile::getTickDelay() return 30; } -void RedStoneOreTile::attack(Level *level, int x, int y, int z, shared_ptr player) +void RedStoneOreTile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { interact(level, x, y, z); Tile::attack(level, x, y, z, player); } -void RedStoneOreTile::stepOn(Level *level, int x, int y, int z, shared_ptr entity) +void RedStoneOreTile::stepOn(Level *level, int x, int y, int z, std::shared_ptr entity) { interact(level, x, y, z); Tile::stepOn(level, x, y, z, entity); @@ -35,7 +35,7 @@ bool RedStoneOreTile::TestUse() return true; } -bool RedStoneOreTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool RedStoneOreTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if (soundOnly) return false; interact(level, x, y, z); @@ -122,7 +122,7 @@ bool RedStoneOreTile::shouldTileTick(Level *level, int x,int y,int z) return id == Tile::redStoneOre_lit_Id; } -shared_ptr RedStoneOreTile::getSilkTouchItemInstance(int data) +std::shared_ptr RedStoneOreTile::getSilkTouchItemInstance(int data) { - return shared_ptr(new ItemInstance(Tile::redStoneOre)); + return std::shared_ptr(new ItemInstance(Tile::redStoneOre)); } \ No newline at end of file diff --git a/Minecraft.World/RedStoneOreTile.h b/Minecraft.World/RedStoneOreTile.h index bc1d48d7..3e96a228 100644 --- a/Minecraft.World/RedStoneOreTile.h +++ b/Minecraft.World/RedStoneOreTile.h @@ -11,10 +11,10 @@ private: public: RedStoneOreTile(int id, bool lit); virtual int getTickDelay(); - virtual void attack(Level *level, int x, int y, int z, shared_ptr player); - virtual void stepOn(Level *level, int x, int y, int z, shared_ptr entity); + virtual void attack(Level *level, int x, int y, int z, std::shared_ptr player); + virtual void stepOn(Level *level, int x, int y, int z, std::shared_ptr entity); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param private: virtual void interact(Level *level, int x, int y, int z); public: @@ -24,11 +24,11 @@ public: virtual int getResourceCount(Random *random); virtual void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel); virtual void animateTick(Level *level, int x, int y, int z, Random *random); - + // 4J Added so we can check before we try to add a tile to the tick list if it's actually going to do seomthing virtual bool shouldTileTick(Level *level, int x,int y,int z); private: void poofParticles(Level *level, int x, int y, int z); protected: - virtual shared_ptr getSilkTouchItemInstance(int data); + virtual std::shared_ptr getSilkTouchItemInstance(int data); }; diff --git a/Minecraft.World/Region.cpp b/Minecraft.World/Region.cpp index 4c3a454d..fb7a62d5 100644 --- a/Minecraft.World/Region.cpp +++ b/Minecraft.World/Region.cpp @@ -137,7 +137,7 @@ LevelChunk* Region::getLevelChunk(int x, int y, int z) -shared_ptr Region::getTileEntity(int x, int y, int z) +std::shared_ptr Region::getTileEntity(int x, int y, int z) { int xc = (x >> 4) - xc1; int zc = (z >> 4) - zc1; diff --git a/Minecraft.World/Region.h b/Minecraft.World/Region.h index 0d200a35..fad828ee 100644 --- a/Minecraft.World/Region.h +++ b/Minecraft.World/Region.h @@ -23,7 +23,7 @@ public: virtual ~Region(); bool isAllEmpty(); int getTile(int x, int y, int z); - shared_ptr getTileEntity(int x, int y, int z); + std::shared_ptr getTileEntity(int x, int y, int z); float getBrightness(int x, int y, int z, int emitt); float getBrightness(int x, int y, int z); int getLightColor(int x, int y, int z, int emitt, int tileId = -1); // 4J - change brought forward from 1.8.2 diff --git a/Minecraft.World/RegionHillsLayer.cpp b/Minecraft.World/RegionHillsLayer.cpp index a1e17524..63d284e2 100644 --- a/Minecraft.World/RegionHillsLayer.cpp +++ b/Minecraft.World/RegionHillsLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "RegionHillsLayer.h" -RegionHillsLayer::RegionHillsLayer(int64_t seed, shared_ptr parent) : Layer(seed) +RegionHillsLayer::RegionHillsLayer(int64_t seed, std::shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/RegionHillsLayer.h b/Minecraft.World/RegionHillsLayer.h index 5ad0bb75..23a63abc 100644 --- a/Minecraft.World/RegionHillsLayer.h +++ b/Minecraft.World/RegionHillsLayer.h @@ -5,7 +5,7 @@ class RegionHillsLayer : public Layer { public: - RegionHillsLayer(int64_t seed, shared_ptr parent); + RegionHillsLayer(int64_t seed, std::shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RemoveEntitiesPacket.h b/Minecraft.World/RemoveEntitiesPacket.h index 2e734e71..f6626d56 100644 --- a/Minecraft.World/RemoveEntitiesPacket.h +++ b/Minecraft.World/RemoveEntitiesPacket.h @@ -21,7 +21,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new RemoveEntitiesPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new RemoveEntitiesPacket()); } virtual int getId() { return 29; } }; diff --git a/Minecraft.World/RemoveMobEffectPacket.h b/Minecraft.World/RemoveMobEffectPacket.h index d69a4ed4..ade1ed1b 100644 --- a/Minecraft.World/RemoveMobEffectPacket.h +++ b/Minecraft.World/RemoveMobEffectPacket.h @@ -18,6 +18,6 @@ class RemoveMobEffectPacket : public Packet, public enable_shared_from_this create() { return shared_ptr(new RemoveMobEffectPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new RemoveMobEffectPacket()); } virtual int getId() { return 42; } }; \ No newline at end of file diff --git a/Minecraft.World/RepairMenu.cpp b/Minecraft.World/RepairMenu.cpp index d246b73f..c254eb21 100644 --- a/Minecraft.World/RepairMenu.cpp +++ b/Minecraft.World/RepairMenu.cpp @@ -6,10 +6,10 @@ #include "net.minecraft.world.item.enchantment.h" #include "RepairMenu.h" -RepairMenu::RepairMenu(shared_ptr inventory, Level *level, int xt, int yt, int zt, shared_ptr player) +RepairMenu::RepairMenu(std::shared_ptr inventory, Level *level, int xt, int yt, int zt, std::shared_ptr player) { - resultSlots = shared_ptr( new ResultContainer() ); - repairSlots = shared_ptr( new RepairContainer(this,IDS_REPAIR_AND_NAME, 2) ); + resultSlots = std::shared_ptr( new ResultContainer() ); + repairSlots = std::shared_ptr( new RepairContainer(this,IDS_REPAIR_AND_NAME, 2) ); cost = 0; repairItemCountCost = 0; @@ -38,7 +38,7 @@ RepairMenu::RepairMenu(shared_ptr inventory, Level *level, int xt, in } } -void RepairMenu::slotsChanged(shared_ptr container) +void RepairMenu::slotsChanged(std::shared_ptr container) { AbstractContainerMenu::slotsChanged(); @@ -47,7 +47,7 @@ void RepairMenu::slotsChanged(shared_ptr container) void RepairMenu::createResult() { - shared_ptr input = repairSlots->getItem(INPUT_SLOT); + std::shared_ptr input = repairSlots->getItem(INPUT_SLOT); cost = 0; int price = 0; int tax = 0; @@ -63,8 +63,8 @@ void RepairMenu::createResult() } else { - shared_ptr result = input->copy(); - shared_ptr addition = repairSlots->getItem(ADDITIONAL_SLOT); + std::shared_ptr result = input->copy(); + std::shared_ptr addition = repairSlots->getItem(ADDITIONAL_SLOT); unordered_map *enchantments = EnchantmentHelper::getEnchantments(result); bool usingBook = false; @@ -319,14 +319,14 @@ void RepairMenu::setData(int id, int value) if (id == DATA_TOTAL_COST) cost = value; } -void RepairMenu::removed(shared_ptr player) +void RepairMenu::removed(std::shared_ptr player) { AbstractContainerMenu::removed(player); if (level->isClientSide) return; for (int i = 0; i < repairSlots->getContainerSize(); i++) { - shared_ptr item = repairSlots->removeItemNoUpdate(i); + std::shared_ptr item = repairSlots->removeItemNoUpdate(i); if (item != NULL) { player->drop(item); @@ -334,20 +334,20 @@ void RepairMenu::removed(shared_ptr player) } } -bool RepairMenu::stillValid(shared_ptr player) +bool RepairMenu::stillValid(std::shared_ptr player) { if (level->getTile(x, y, z) != Tile::anvil_Id) return false; if (player->distanceToSqr(x + 0.5, y + 0.5, z + 0.5) > 8 * 8) return false; return true; } -shared_ptr RepairMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr RepairMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex == RESULT_SLOT) diff --git a/Minecraft.World/RepairMenu.h b/Minecraft.World/RepairMenu.h index e0c90267..acd7dc37 100644 --- a/Minecraft.World/RepairMenu.h +++ b/Minecraft.World/RepairMenu.h @@ -22,10 +22,10 @@ public: static const int DATA_TOTAL_COST = 0; private: - shared_ptr resultSlots; + std::shared_ptr resultSlots; // 4J Stu - anonymous class here now RepairContainer - shared_ptr repairSlots; + std::shared_ptr repairSlots; Level *level; int x, y, z; @@ -36,20 +36,20 @@ public: private: int repairItemCountCost; wstring itemName; - shared_ptr player; + std::shared_ptr player; public: using AbstractContainerMenu::slotsChanged; - RepairMenu(shared_ptr inventory, Level *level, int xt, int yt, int zt, shared_ptr player); + RepairMenu(std::shared_ptr inventory, Level *level, int xt, int yt, int zt, std::shared_ptr player); - void slotsChanged(shared_ptr container); + void slotsChanged(std::shared_ptr container); void createResult(); void sendData(int id, int value); void addSlotListener(ContainerListener *listener); void setData(int id, int value); - void removed(shared_ptr player); - bool stillValid(shared_ptr player); - shared_ptr quickMoveStack(shared_ptr player, int slotIndex); + void removed(std::shared_ptr player); + bool stillValid(std::shared_ptr player); + std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); void setItemName(const wstring &name); }; diff --git a/Minecraft.World/RepairResultSlot.cpp b/Minecraft.World/RepairResultSlot.cpp index 041a64a7..651cd3a1 100644 --- a/Minecraft.World/RepairResultSlot.cpp +++ b/Minecraft.World/RepairResultSlot.cpp @@ -5,7 +5,7 @@ #include "net.minecraft.world.entity.player.h" #include "RepairResultSlot.h" -RepairResultSlot::RepairResultSlot(RepairMenu *menu, int xt, int yt, int zt, shared_ptr container, int slot, int x, int y) : Slot(container, slot, x, y) +RepairResultSlot::RepairResultSlot(RepairMenu *menu, int xt, int yt, int zt, std::shared_ptr container, int slot, int x, int y) : Slot(container, slot, x, y) { m_menu = menu; this->xt = xt; @@ -13,23 +13,23 @@ RepairResultSlot::RepairResultSlot(RepairMenu *menu, int xt, int yt, int zt, sha this->zt = zt; } -bool RepairResultSlot::mayPlace(shared_ptr item) +bool RepairResultSlot::mayPlace(std::shared_ptr item) { return false; } -bool RepairResultSlot::mayPickup(shared_ptr player) +bool RepairResultSlot::mayPickup(std::shared_ptr player) { return (player->abilities.instabuild || player->experienceLevel >= m_menu->cost) && (m_menu->cost > 0 && hasItem()); } -void RepairResultSlot::onTake(shared_ptr player, shared_ptr carried) +void RepairResultSlot::onTake(std::shared_ptr player, std::shared_ptr carried) { if (!player->abilities.instabuild) player->withdrawExperienceLevels(m_menu->cost); m_menu->repairSlots->setItem(RepairMenu::INPUT_SLOT, nullptr); if (m_menu->repairItemCountCost > 0) { - shared_ptr addition = m_menu->repairSlots->getItem(RepairMenu::ADDITIONAL_SLOT); + std::shared_ptr addition = m_menu->repairSlots->getItem(RepairMenu::ADDITIONAL_SLOT); if (addition != NULL && addition->count > m_menu->repairItemCountCost) { addition->count -= m_menu->repairItemCountCost; @@ -69,7 +69,7 @@ void RepairResultSlot::onTake(shared_ptr player, shared_ptr second) +bool RepairResultSlot::mayCombine(std::shared_ptr second) { return false; } \ No newline at end of file diff --git a/Minecraft.World/RepairResultSlot.h b/Minecraft.World/RepairResultSlot.h index 1895ca30..92af20fe 100644 --- a/Minecraft.World/RepairResultSlot.h +++ b/Minecraft.World/RepairResultSlot.h @@ -11,10 +11,10 @@ private: int xt, yt, zt; public: - RepairResultSlot(RepairMenu *menu, int xt, int yt, int zt, shared_ptr container, int slot, int x, int y); + RepairResultSlot(RepairMenu *menu, int xt, int yt, int zt, std::shared_ptr container, int slot, int x, int y); - bool mayPlace(shared_ptr item); - bool mayPickup(shared_ptr player); - void onTake(shared_ptr player, shared_ptr carried); - virtual bool mayCombine(shared_ptr item); // 4J Added + bool mayPlace(std::shared_ptr item); + bool mayPickup(std::shared_ptr player); + void onTake(std::shared_ptr player, std::shared_ptr carried); + virtual bool mayCombine(std::shared_ptr item); // 4J Added }; \ No newline at end of file diff --git a/Minecraft.World/RespawnPacket.h b/Minecraft.World/RespawnPacket.h index 3caf1ee3..e8af00b0 100644 --- a/Minecraft.World/RespawnPacket.h +++ b/Minecraft.World/RespawnPacket.h @@ -29,6 +29,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new RespawnPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new RespawnPacket()); } virtual int getId() { return 9; } }; diff --git a/Minecraft.World/RestrictOpenDoorGoal.cpp b/Minecraft.World/RestrictOpenDoorGoal.cpp index e8620a71..2849aabc 100644 --- a/Minecraft.World/RestrictOpenDoorGoal.cpp +++ b/Minecraft.World/RestrictOpenDoorGoal.cpp @@ -13,9 +13,9 @@ RestrictOpenDoorGoal::RestrictOpenDoorGoal(PathfinderMob *mob) bool RestrictOpenDoorGoal::canUse() { if (mob->level->isDay()) return false; - shared_ptr village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 16); + std::shared_ptr village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 16); if (village == NULL) return false; - shared_ptr _doorInfo = village->getClosestDoorInfo(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)); + std::shared_ptr _doorInfo = village->getClosestDoorInfo(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)); if (_doorInfo == NULL) return false; doorInfo = _doorInfo; return _doorInfo->distanceToInsideSqr(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)) < 1.5 * 1.5; @@ -24,7 +24,7 @@ bool RestrictOpenDoorGoal::canUse() bool RestrictOpenDoorGoal::canContinueToUse() { if (mob->level->isDay()) return false; - shared_ptr _doorInfo = doorInfo.lock(); + std::shared_ptr _doorInfo = doorInfo.lock(); if ( _doorInfo == NULL ) return false; return !_doorInfo->removed && _doorInfo->isInsideSide(Mth::floor(mob->x), Mth::floor(mob->z)); } @@ -44,6 +44,6 @@ void RestrictOpenDoorGoal::stop() void RestrictOpenDoorGoal::tick() { - shared_ptr _doorInfo = doorInfo.lock(); + std::shared_ptr _doorInfo = doorInfo.lock(); if ( _doorInfo ) _doorInfo->incBookingCount(); } \ No newline at end of file diff --git a/Minecraft.World/ResultContainer.cpp b/Minecraft.World/ResultContainer.cpp index c28b3cf3..782c2aa8 100644 --- a/Minecraft.World/ResultContainer.cpp +++ b/Minecraft.World/ResultContainer.cpp @@ -12,7 +12,7 @@ unsigned int ResultContainer::getContainerSize() return 1; } -shared_ptr ResultContainer::getItem(unsigned int slot) +std::shared_ptr ResultContainer::getItem(unsigned int slot) { return (*items)[0]; } @@ -22,29 +22,29 @@ int ResultContainer::getName() return 0; } -shared_ptr ResultContainer::removeItem(unsigned int slot, int count) +std::shared_ptr ResultContainer::removeItem(unsigned int slot, int count) { if ((*items)[0] != NULL) { - shared_ptr item = (*items)[0]; + std::shared_ptr item = (*items)[0]; (*items)[0] = nullptr; return item; } return nullptr; } -shared_ptr ResultContainer::removeItemNoUpdate(int slot) +std::shared_ptr ResultContainer::removeItemNoUpdate(int slot) { if ((*items)[0] != NULL) { - shared_ptr item = (*items)[0]; + std::shared_ptr item = (*items)[0]; (*items)[0] = nullptr; return item; } return nullptr; } -void ResultContainer::setItem(unsigned int slot, shared_ptr item) +void ResultContainer::setItem(unsigned int slot, std::shared_ptr item) { (*items)[0] = item; } @@ -58,7 +58,7 @@ void ResultContainer::setChanged() { } -bool ResultContainer::stillValid(shared_ptr player) +bool ResultContainer::stillValid(std::shared_ptr player) { return true; } \ No newline at end of file diff --git a/Minecraft.World/ResultContainer.h b/Minecraft.World/ResultContainer.h index 62df65d8..1b030d81 100644 --- a/Minecraft.World/ResultContainer.h +++ b/Minecraft.World/ResultContainer.h @@ -12,14 +12,14 @@ public: ResultContainer(); virtual unsigned int getContainerSize(); - virtual shared_ptr getItem(unsigned int slot); + virtual std::shared_ptr getItem(unsigned int slot); virtual int getName(); - virtual shared_ptr removeItem(unsigned int slot, int count); - virtual shared_ptr removeItemNoUpdate(int slot); - virtual void setItem(unsigned int slot, shared_ptr item); + virtual std::shared_ptr removeItem(unsigned int slot, int count); + virtual std::shared_ptr removeItemNoUpdate(int slot); + virtual void setItem(unsigned int slot, std::shared_ptr item); virtual int getMaxStackSize(); virtual void setChanged(); - virtual bool stillValid(shared_ptr player); + virtual bool stillValid(std::shared_ptr player); void startOpen() { } // TODO Auto-generated method stub void stopOpen() { } // TODO Auto-generated method stub diff --git a/Minecraft.World/ResultSlot.cpp b/Minecraft.World/ResultSlot.cpp index b79329af..d44083c7 100644 --- a/Minecraft.World/ResultSlot.cpp +++ b/Minecraft.World/ResultSlot.cpp @@ -6,19 +6,19 @@ #include "net.minecraft.world.level.tile.h" #include "ResultSlot.h" -ResultSlot::ResultSlot(Player *player, shared_ptr craftSlots, shared_ptr container, int id, int x, int y) : Slot( container, id, x, y ) +ResultSlot::ResultSlot(Player *player, std::shared_ptr craftSlots, std::shared_ptr container, int id, int x, int y) : Slot( container, id, x, y ) { this->player = player; this->craftSlots = craftSlots; removeCount = 0; } -bool ResultSlot::mayPlace(shared_ptr item) +bool ResultSlot::mayPlace(std::shared_ptr item) { return false; } -shared_ptr ResultSlot::remove(int c) +std::shared_ptr ResultSlot::remove(int c) { if (hasItem()) { @@ -27,13 +27,13 @@ shared_ptr ResultSlot::remove(int c) return Slot::remove(c); } -void ResultSlot::onQuickCraft(shared_ptr picked, int count) +void ResultSlot::onQuickCraft(std::shared_ptr picked, int count) { removeCount += count; checkTakeAchievements(picked); } -void ResultSlot::checkTakeAchievements(shared_ptr carried) +void ResultSlot::checkTakeAchievements(std::shared_ptr carried) { carried->onCraftedBy(player->level, dynamic_pointer_cast( player->shared_from_this() ), removeCount); removeCount = 0; @@ -49,17 +49,17 @@ void ResultSlot::checkTakeAchievements(shared_ptr carried) //else if (carried->id == Tile::enchantTable_Id) player->awardStat(GenericStats::enchantments(), GenericStats::param_achievement(eAward_)); else if (carried->id == Tile::bookshelf_Id) player->awardStat(GenericStats::bookcase(), GenericStats::param_bookcase()); - // 4J : WESTY : Added new acheivements. + // 4J : WESTY : Added new acheivements. else if (carried->id == Tile::dispenser_Id) player->awardStat(GenericStats::dispenseWithThis(), GenericStats::param_dispenseWithThis()); } -void ResultSlot::onTake(shared_ptr player, shared_ptr carried) +void ResultSlot::onTake(std::shared_ptr player, std::shared_ptr carried) { checkTakeAchievements(carried); for (unsigned int i = 0; i < craftSlots->getContainerSize(); i++) { - shared_ptr item = craftSlots->getItem(i); + std::shared_ptr item = craftSlots->getItem(i); if (item != NULL) { craftSlots->removeItem(i, 1); @@ -68,7 +68,7 @@ void ResultSlot::onTake(shared_ptr player, shared_ptr carr { // (TheApathetic) - shared_ptr craftResult = shared_ptr(new ItemInstance(item->getItem()->getCraftingRemainingItem())); + std::shared_ptr craftResult = std::shared_ptr(new ItemInstance(item->getItem()->getCraftingRemainingItem())); /* * Try to place this in the player's inventory (See we.java @@ -96,7 +96,7 @@ void ResultSlot::onTake(shared_ptr player, shared_ptr carr } } -bool ResultSlot::mayCombine(shared_ptr second) +bool ResultSlot::mayCombine(std::shared_ptr second) { return false; } diff --git a/Minecraft.World/ResultSlot.h b/Minecraft.World/ResultSlot.h index 28e464f0..b8308f66 100644 --- a/Minecraft.World/ResultSlot.h +++ b/Minecraft.World/ResultSlot.h @@ -5,22 +5,22 @@ class ResultSlot : public Slot { private: - shared_ptr craftSlots; - Player *player; // This can't be a shared_ptr, as we create a result slot in the inventorymenu in the Player ctor + std::shared_ptr craftSlots; + Player *player; // This can't be a std::shared_ptr, as we create a result slot in the inventorymenu in the Player ctor int removeCount; public: - ResultSlot(Player *player, shared_ptr craftSlots, shared_ptr container, int id, int x, int y); + ResultSlot(Player *player, std::shared_ptr craftSlots, std::shared_ptr container, int id, int x, int y); virtual ~ResultSlot() {} - virtual bool mayPlace(shared_ptr item); - virtual shared_ptr remove(int c); + virtual bool mayPlace(std::shared_ptr item); + virtual std::shared_ptr remove(int c); protected: - virtual void onQuickCraft(shared_ptr picked, int count); - virtual void checkTakeAchievements(shared_ptr carried); + virtual void onQuickCraft(std::shared_ptr picked, int count); + virtual void checkTakeAchievements(std::shared_ptr carried); public: - virtual void onTake(shared_ptr player, shared_ptr carried); - virtual bool mayCombine(shared_ptr item); // 4J Added + virtual void onTake(std::shared_ptr player, std::shared_ptr carried); + virtual bool mayCombine(std::shared_ptr item); // 4J Added }; \ No newline at end of file diff --git a/Minecraft.World/RiverInitLayer.cpp b/Minecraft.World/RiverInitLayer.cpp index 86110e13..33afa47d 100644 --- a/Minecraft.World/RiverInitLayer.cpp +++ b/Minecraft.World/RiverInitLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverInitLayer::RiverInitLayer(int64_t seed, shared_ptrparent) : Layer(seed) +RiverInitLayer::RiverInitLayer(int64_t seed, std::shared_ptrparent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/RiverInitLayer.h b/Minecraft.World/RiverInitLayer.h index bc8dca1b..7c9e8ef8 100644 --- a/Minecraft.World/RiverInitLayer.h +++ b/Minecraft.World/RiverInitLayer.h @@ -5,7 +5,7 @@ class RiverInitLayer : public Layer { public: - RiverInitLayer(int64_t seed, shared_ptrparent); + RiverInitLayer(int64_t seed, std::shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RiverLayer.cpp b/Minecraft.World/RiverLayer.cpp index 14cf3142..09880f00 100644 --- a/Minecraft.World/RiverLayer.cpp +++ b/Minecraft.World/RiverLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverLayer::RiverLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) +RiverLayer::RiverLayer(int64_t seedMixup, std::shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/RiverLayer.h b/Minecraft.World/RiverLayer.h index a76d3fab..3e2db6af 100644 --- a/Minecraft.World/RiverLayer.h +++ b/Minecraft.World/RiverLayer.h @@ -5,6 +5,6 @@ class RiverLayer : public Layer { public: - RiverLayer(int64_t seedMixup, shared_ptrparent); + RiverLayer(int64_t seedMixup, std::shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RiverMixerLayer.cpp b/Minecraft.World/RiverMixerLayer.cpp index 4de49245..935832a6 100644 --- a/Minecraft.World/RiverMixerLayer.cpp +++ b/Minecraft.World/RiverMixerLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverMixerLayer::RiverMixerLayer(int64_t seed, shared_ptrbiomes, shared_ptrrivers) : Layer(seed) +RiverMixerLayer::RiverMixerLayer(int64_t seed, std::shared_ptrbiomes, std::shared_ptrrivers) : Layer(seed) { this->biomes = biomes; this->rivers = rivers; diff --git a/Minecraft.World/RiverMixerLayer.h b/Minecraft.World/RiverMixerLayer.h index 3a069c41..4cad36a3 100644 --- a/Minecraft.World/RiverMixerLayer.h +++ b/Minecraft.World/RiverMixerLayer.h @@ -5,11 +5,11 @@ class RiverMixerLayer : public Layer { private: - shared_ptrbiomes; - shared_ptrrivers; + std::shared_ptrbiomes; + std::shared_ptrrivers; public: - RiverMixerLayer(int64_t seed, shared_ptrbiomes, shared_ptrrivers); + RiverMixerLayer(int64_t seed, std::shared_ptrbiomes, std::shared_ptrrivers); virtual void init(int64_t seed); virtual intArray getArea(int xo, int yo, int w, int h); diff --git a/Minecraft.World/RotateHeadPacket.cpp b/Minecraft.World/RotateHeadPacket.cpp index a0cd02d7..46d48a99 100644 --- a/Minecraft.World/RotateHeadPacket.cpp +++ b/Minecraft.World/RotateHeadPacket.cpp @@ -39,9 +39,9 @@ bool RotateHeadPacket::canBeInvalidated() return true; } -bool RotateHeadPacket::isInvalidatedBy(shared_ptr packet) +bool RotateHeadPacket::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target->id == id; } diff --git a/Minecraft.World/RotateHeadPacket.h b/Minecraft.World/RotateHeadPacket.h index 19ccf97f..78bd7a16 100644 --- a/Minecraft.World/RotateHeadPacket.h +++ b/Minecraft.World/RotateHeadPacket.h @@ -18,10 +18,10 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); virtual bool isAync(); public: - static shared_ptr create() { return shared_ptr(new RotateHeadPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new RotateHeadPacket()); } virtual int getId() { return 35; } }; \ No newline at end of file diff --git a/Minecraft.World/SaddleItem.cpp b/Minecraft.World/SaddleItem.cpp index 0effeb53..1f9c580d 100644 --- a/Minecraft.World/SaddleItem.cpp +++ b/Minecraft.World/SaddleItem.cpp @@ -9,12 +9,12 @@ SaddleItem::SaddleItem(int id) : Item(id) maxStackSize = 1; } -bool SaddleItem::interactEnemy(shared_ptr itemInstance, shared_ptr mob) +bool SaddleItem::interactEnemy(std::shared_ptr itemInstance, std::shared_ptr mob) { if ( dynamic_pointer_cast(mob) ) { - shared_ptr pig = dynamic_pointer_cast(mob); - if (!pig->hasSaddle() && !pig->isBaby()) + std::shared_ptr pig = dynamic_pointer_cast(mob); + if (!pig->hasSaddle() && !pig->isBaby()) { pig->setSaddle(true); itemInstance->count--; @@ -24,7 +24,7 @@ bool SaddleItem::interactEnemy(shared_ptr itemInstance, shared_ptr return false; } -bool SaddleItem::hurtEnemy(shared_ptr itemInstance, shared_ptr mob, shared_ptr attacker) +bool SaddleItem::hurtEnemy(std::shared_ptr itemInstance, std::shared_ptr mob, std::shared_ptr attacker) { interactEnemy(itemInstance, mob); return true; diff --git a/Minecraft.World/SaddleItem.h b/Minecraft.World/SaddleItem.h index 129922db..de65ff50 100644 --- a/Minecraft.World/SaddleItem.h +++ b/Minecraft.World/SaddleItem.h @@ -8,6 +8,6 @@ class SaddleItem : public Item public: SaddleItem(int id); - virtual bool interactEnemy(shared_ptr itemInstance, shared_ptr mob); - virtual bool hurtEnemy(shared_ptr itemInstance, shared_ptr mob, shared_ptr attacker); + virtual bool interactEnemy(std::shared_ptr itemInstance, std::shared_ptr mob); + virtual bool hurtEnemy(std::shared_ptr itemInstance, std::shared_ptr mob, std::shared_ptr attacker); }; \ No newline at end of file diff --git a/Minecraft.World/SaplingTileItem.cpp b/Minecraft.World/SaplingTileItem.cpp index c88275f3..000955a1 100644 --- a/Minecraft.World/SaplingTileItem.cpp +++ b/Minecraft.World/SaplingTileItem.cpp @@ -9,18 +9,18 @@ SaplingTileItem::SaplingTileItem(int id) : TileItem(id) setStackedByData(true); } -int SaplingTileItem::getLevelDataForAuxValue(int auxValue) +int SaplingTileItem::getLevelDataForAuxValue(int auxValue) { return auxValue; } -Icon *SaplingTileItem::getIcon(int itemAuxValue) +Icon *SaplingTileItem::getIcon(int itemAuxValue) { return Tile::sapling->getTexture(0, itemAuxValue); } // 4J brought forward to have unique names for different sapling types -unsigned int SaplingTileItem::getDescriptionId(shared_ptr instance) +unsigned int SaplingTileItem::getDescriptionId(std::shared_ptr instance) { int auxValue = instance->getAuxValue(); if (auxValue < 0 || auxValue >= Sapling::SAPLING_NAMES_SIZE) diff --git a/Minecraft.World/SaplingTileItem.h b/Minecraft.World/SaplingTileItem.h index f0b03cc4..feabb0de 100644 --- a/Minecraft.World/SaplingTileItem.h +++ b/Minecraft.World/SaplingTileItem.h @@ -12,5 +12,5 @@ public: virtual Icon *getIcon(int itemAuxValue); // 4J brought forward to have unique names for different sapling types - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); }; \ No newline at end of file diff --git a/Minecraft.World/SavedDataStorage.cpp b/Minecraft.World/SavedDataStorage.cpp index cacfa688..67b15c51 100644 --- a/Minecraft.World/SavedDataStorage.cpp +++ b/Minecraft.World/SavedDataStorage.cpp @@ -8,11 +8,11 @@ #include "ConsoleSaveFileIO.h" -SavedDataStorage::SavedDataStorage(LevelStorage *levelStorage) +SavedDataStorage::SavedDataStorage(LevelStorage *levelStorage) { /* - cache = new unordered_map >; - savedDatas = new vector >; + cache = new unordered_map >; + savedDatas = new vector >; usedAuxIds = new unordered_map; */ @@ -20,28 +20,28 @@ SavedDataStorage::SavedDataStorage(LevelStorage *levelStorage) loadAuxValues(); } -shared_ptr SavedDataStorage::get(const type_info& clazz, const wstring& id) +std::shared_ptr SavedDataStorage::get(const type_info& clazz, const wstring& id) { AUTO_VAR(it, cache.find( id )); if (it != cache.end()) return (*it).second; - shared_ptr data = nullptr; + std::shared_ptr data = nullptr; if (levelStorage != NULL) { //File file = levelStorage->getDataFile(id); ConsoleSavePath file = levelStorage->getDataFile(id); - if (!file.getName().empty() && levelStorage->getSaveFile()->doesFileExist( file ) ) + if (!file.getName().empty() && levelStorage->getSaveFile()->doesFileExist( file ) ) { // mob = dynamic_pointer_cast(Mob::_class->newInstance( level )); //data = clazz.getConstructor(String.class).newInstance(id); if( clazz == typeid(MapItemSavedData) ) { - data = dynamic_pointer_cast( shared_ptr(new MapItemSavedData(id)) ); + data = dynamic_pointer_cast( std::shared_ptr(new MapItemSavedData(id)) ); } else if( clazz == typeid(Villages) ) { - data = dynamic_pointer_cast( shared_ptr(new Villages(id) ) ); + data = dynamic_pointer_cast( std::shared_ptr(new Villages(id) ) ); } else { @@ -59,13 +59,13 @@ shared_ptr SavedDataStorage::get(const type_info& clazz, const wstrin if (data != NULL) { - cache.insert( unordered_map >::value_type( id , data ) ); + cache.insert( unordered_map >::value_type( id , data ) ); savedDatas.push_back(data); } return data; } -void SavedDataStorage::set(const wstring& id, shared_ptr data) +void SavedDataStorage::set(const wstring& id, std::shared_ptr data) { if (data == NULL) { @@ -91,7 +91,7 @@ void SavedDataStorage::save() AUTO_VAR(itEnd, savedDatas.end()); for (AUTO_VAR(it, savedDatas.begin()); it != itEnd; it++) { - shared_ptr data = *it; //savedDatas->at(i); + std::shared_ptr data = *it; //savedDatas->at(i); if (data->isDirty()) { save(data); @@ -100,7 +100,7 @@ void SavedDataStorage::save() } } -void SavedDataStorage::save(shared_ptr data) +void SavedDataStorage::save(std::shared_ptr data) { if (levelStorage == NULL) return; //File file = levelStorage->getDataFile(data->id); diff --git a/Minecraft.World/SavedDataStorage.h b/Minecraft.World/SavedDataStorage.h index 9a342ab6..14d9776a 100644 --- a/Minecraft.World/SavedDataStorage.h +++ b/Minecraft.World/SavedDataStorage.h @@ -4,27 +4,27 @@ using namespace std; class ConsoleSaveFile; #include "SavedData.h" -class SavedDataStorage +class SavedDataStorage { private: LevelStorage *levelStorage; - typedef unordered_map > cacheMapType; + typedef unordered_map > cacheMapType; cacheMapType cache; - vector > savedDatas; + vector > savedDatas; typedef unordered_map uaiMapType; uaiMapType usedAuxIds; public: SavedDataStorage(LevelStorage *); - shared_ptr get(const type_info& clazz, const wstring& id); - void set(const wstring& id, shared_ptr data); + std::shared_ptr get(const type_info& clazz, const wstring& id); + void set(const wstring& id, std::shared_ptr data); void save(); private: - void save(shared_ptr data); + void save(std::shared_ptr data); void loadAuxValues(); public: diff --git a/Minecraft.World/SeedFoodItem.cpp b/Minecraft.World/SeedFoodItem.cpp index 4ba9a14a..d46b77c7 100644 --- a/Minecraft.World/SeedFoodItem.cpp +++ b/Minecraft.World/SeedFoodItem.cpp @@ -11,7 +11,7 @@ SeedFoodItem::SeedFoodItem(int id, int nutrition, float saturationMod, int resul } -bool SeedFoodItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool SeedFoodItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { if (face != Facing::UP) return false; diff --git a/Minecraft.World/SeedFoodItem.h b/Minecraft.World/SeedFoodItem.h index fe24430f..0b9b79b5 100644 --- a/Minecraft.World/SeedFoodItem.h +++ b/Minecraft.World/SeedFoodItem.h @@ -11,5 +11,5 @@ private: public: SeedFoodItem(int id, int nutrition, float saturationMod, int resultId, int targetLand); - bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly); + bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly); }; \ No newline at end of file diff --git a/Minecraft.World/SeedItem.cpp b/Minecraft.World/SeedItem.cpp index 7a5ac1b8..63fa9ac4 100644 --- a/Minecraft.World/SeedItem.cpp +++ b/Minecraft.World/SeedItem.cpp @@ -14,7 +14,7 @@ SeedItem::SeedItem(int id, int resultId, int targetLand) : Item(id) this->targetLand = targetLand; } -bool SeedItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool SeedItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { // 4J-PB - Adding a test only version to allow tooltips to be displayed if (face != 1) return false; @@ -23,7 +23,7 @@ bool SeedItem::useOn(shared_ptr instance, shared_ptr playe int targetType = level->getTile(x, y, z); - if (targetType == targetLand && level->isEmptyTile(x, y + 1, z)) + if (targetType == targetLand && level->isEmptyTile(x, y + 1, z)) { if(!bTestUseOnOnly) { diff --git a/Minecraft.World/SeedItem.h b/Minecraft.World/SeedItem.h index c16a76ce..820d9a8d 100644 --- a/Minecraft.World/SeedItem.h +++ b/Minecraft.World/SeedItem.h @@ -3,7 +3,7 @@ using namespace std; #include "Item.h" -class SeedItem : public Item +class SeedItem : public Item { private: int resultId; @@ -12,5 +12,5 @@ private: public: SeedItem(int id, int resultId, int targetLand); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); }; \ No newline at end of file diff --git a/Minecraft.World/Sensing.cpp b/Minecraft.World/Sensing.cpp index d451f483..f5d1cddc 100644 --- a/Minecraft.World/Sensing.cpp +++ b/Minecraft.World/Sensing.cpp @@ -13,7 +13,7 @@ void Sensing::tick() unseen.clear(); } -bool Sensing::canSee(shared_ptr target) +bool Sensing::canSee(std::shared_ptr target) { //if ( find(seen.begin(), seen.end(), target) != seen.end() ) return true; //if ( find(unseen.begin(), unseen.end(), target) != unseen.end()) return false; diff --git a/Minecraft.World/Sensing.h b/Minecraft.World/Sensing.h index d6428515..844a3e60 100644 --- a/Minecraft.World/Sensing.h +++ b/Minecraft.World/Sensing.h @@ -11,5 +11,5 @@ public: Sensing(Mob *mob); void tick(); - bool canSee(shared_ptr target); + bool canSee(std::shared_ptr target); }; \ No newline at end of file diff --git a/Minecraft.World/ServerSettingsChangedPacket.h b/Minecraft.World/ServerSettingsChangedPacket.h index e6ab7356..b929348f 100644 --- a/Minecraft.World/ServerSettingsChangedPacket.h +++ b/Minecraft.World/ServerSettingsChangedPacket.h @@ -26,6 +26,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new ServerSettingsChangedPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new ServerSettingsChangedPacket()); } virtual int getId() { return 153; } }; \ No newline at end of file diff --git a/Minecraft.World/SetCarriedItemPacket.cpp b/Minecraft.World/SetCarriedItemPacket.cpp index 2c640609..f9fd8b08 100644 --- a/Minecraft.World/SetCarriedItemPacket.cpp +++ b/Minecraft.World/SetCarriedItemPacket.cpp @@ -6,12 +6,12 @@ -SetCarriedItemPacket::SetCarriedItemPacket() +SetCarriedItemPacket::SetCarriedItemPacket() { slot = 0; } -SetCarriedItemPacket::SetCarriedItemPacket(int slot) +SetCarriedItemPacket::SetCarriedItemPacket(int slot) { this->slot = slot; } @@ -21,27 +21,27 @@ void SetCarriedItemPacket::read(DataInputStream *dis) //throws IOException slot = dis->readShort(); } -void SetCarriedItemPacket::write(DataOutputStream *dos) //throws IOException +void SetCarriedItemPacket::write(DataOutputStream *dos) //throws IOException { dos->writeShort(slot); } -void SetCarriedItemPacket::handle(PacketListener *listener) +void SetCarriedItemPacket::handle(PacketListener *listener) { listener->handleSetCarriedItem(shared_from_this()); } -int SetCarriedItemPacket::getEstimatedSize() +int SetCarriedItemPacket::getEstimatedSize() { return 2; } -bool SetCarriedItemPacket::canBeInvalidated() +bool SetCarriedItemPacket::canBeInvalidated() { return true; } -bool SetCarriedItemPacket::isInvalidatedBy(shared_ptr packet) +bool SetCarriedItemPacket::isInvalidatedBy(std::shared_ptr packet) { return true; } \ No newline at end of file diff --git a/Minecraft.World/SetCarriedItemPacket.h b/Minecraft.World/SetCarriedItemPacket.h index 06fb3c30..d9b6c94a 100644 --- a/Minecraft.World/SetCarriedItemPacket.h +++ b/Minecraft.World/SetCarriedItemPacket.h @@ -16,9 +16,9 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new SetCarriedItemPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetCarriedItemPacket()); } virtual int getId() { return 16; } }; \ No newline at end of file diff --git a/Minecraft.World/SetCreativeModeSlotPacket.cpp b/Minecraft.World/SetCreativeModeSlotPacket.cpp index 17e36b37..d650327b 100644 --- a/Minecraft.World/SetCreativeModeSlotPacket.cpp +++ b/Minecraft.World/SetCreativeModeSlotPacket.cpp @@ -11,11 +11,11 @@ SetCreativeModeSlotPacket::SetCreativeModeSlotPacket() this->item = nullptr; } -SetCreativeModeSlotPacket::SetCreativeModeSlotPacket(int slotNum, shared_ptr item) +SetCreativeModeSlotPacket::SetCreativeModeSlotPacket(int slotNum, std::shared_ptr item) { this->slotNum = slotNum; // 4J - take copy of item as we want our packets to have full ownership of any referenced data - this->item = item ? item->copy() : shared_ptr(); + this->item = item ? item->copy() : std::shared_ptr(); } void SetCreativeModeSlotPacket::handle(PacketListener *listener) diff --git a/Minecraft.World/SetCreativeModeSlotPacket.h b/Minecraft.World/SetCreativeModeSlotPacket.h index 94ae7807..ca46bf98 100644 --- a/Minecraft.World/SetCreativeModeSlotPacket.h +++ b/Minecraft.World/SetCreativeModeSlotPacket.h @@ -6,10 +6,10 @@ class SetCreativeModeSlotPacket : public Packet, public enable_shared_from_this< { public: int slotNum; - shared_ptr item; + std::shared_ptr item; SetCreativeModeSlotPacket(); - SetCreativeModeSlotPacket(int slotNum, shared_ptr item); + SetCreativeModeSlotPacket(int slotNum, std::shared_ptr item); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis); @@ -18,6 +18,6 @@ class SetCreativeModeSlotPacket : public Packet, public enable_shared_from_this< public: - static shared_ptr create() { return shared_ptr(new SetCreativeModeSlotPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetCreativeModeSlotPacket()); } virtual int getId() { return 107; } }; \ No newline at end of file diff --git a/Minecraft.World/SetEntityDataPacket.cpp b/Minecraft.World/SetEntityDataPacket.cpp index 1538c152..6384200e 100644 --- a/Minecraft.World/SetEntityDataPacket.cpp +++ b/Minecraft.World/SetEntityDataPacket.cpp @@ -7,7 +7,7 @@ -SetEntityDataPacket::SetEntityDataPacket() +SetEntityDataPacket::SetEntityDataPacket() { id = -1; packedItems = NULL; @@ -18,7 +18,7 @@ SetEntityDataPacket::~SetEntityDataPacket() delete packedItems; } -SetEntityDataPacket::SetEntityDataPacket(int id, shared_ptr entityData, bool notJustDirty) +SetEntityDataPacket::SetEntityDataPacket(int id, std::shared_ptr entityData, bool notJustDirty) { this->id = id; if(notJustDirty) @@ -37,7 +37,7 @@ void SetEntityDataPacket::read(DataInputStream *dis) //throws IOException packedItems = SynchedEntityData::unpack(dis); } -void SetEntityDataPacket::write(DataOutputStream *dos) //throws IOException +void SetEntityDataPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(id); SynchedEntityData::pack(packedItems, dos); @@ -48,7 +48,7 @@ void SetEntityDataPacket::handle(PacketListener *listener) listener->handleSetEntityData(shared_from_this()); } -int SetEntityDataPacket::getEstimatedSize() +int SetEntityDataPacket::getEstimatedSize() { return 5; } @@ -58,7 +58,7 @@ bool SetEntityDataPacket::isAync() return true; } -vector > *SetEntityDataPacket::getUnpackedData() +vector > *SetEntityDataPacket::getUnpackedData() { return packedItems; } diff --git a/Minecraft.World/SetEntityDataPacket.h b/Minecraft.World/SetEntityDataPacket.h index 1b31aa4c..6978aac4 100644 --- a/Minecraft.World/SetEntityDataPacket.h +++ b/Minecraft.World/SetEntityDataPacket.h @@ -10,12 +10,12 @@ public: int id; private: - vector > *packedItems; + vector > *packedItems; public: SetEntityDataPacket(); ~SetEntityDataPacket(); - SetEntityDataPacket(int id, shared_ptr, bool notJustDirty); + SetEntityDataPacket(int id, std::shared_ptr, bool notJustDirty); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); @@ -23,9 +23,9 @@ public: virtual int getEstimatedSize(); virtual bool isAync(); - vector > *getUnpackedData(); + vector > *getUnpackedData(); public: - static shared_ptr create() { return shared_ptr(new SetEntityDataPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetEntityDataPacket()); } virtual int getId() { return 40; } }; \ No newline at end of file diff --git a/Minecraft.World/SetEntityMotionPacket.cpp b/Minecraft.World/SetEntityMotionPacket.cpp index a0749b74..49dd7d6b 100644 --- a/Minecraft.World/SetEntityMotionPacket.cpp +++ b/Minecraft.World/SetEntityMotionPacket.cpp @@ -32,22 +32,22 @@ void SetEntityMotionPacket::_init(int id, double xd, double yd, double zd) } } -SetEntityMotionPacket::SetEntityMotionPacket() +SetEntityMotionPacket::SetEntityMotionPacket() { _init(0, 0.0f, 0.0f, 0.0f); } -SetEntityMotionPacket::SetEntityMotionPacket(shared_ptr e) +SetEntityMotionPacket::SetEntityMotionPacket(std::shared_ptr e) { _init(e->entityId, e->xd, e->yd, e->zd); } SetEntityMotionPacket::SetEntityMotionPacket(int id, double xd, double yd, double zd) { - _init(id, xd, yd, zd); + _init(id, xd, yd, zd); } -void SetEntityMotionPacket::read(DataInputStream *dis) //throws IOException +void SetEntityMotionPacket::read(DataInputStream *dis) //throws IOException { short idAndFlag = dis->readShort(); id = idAndFlag & 0x07ff; @@ -73,7 +73,7 @@ void SetEntityMotionPacket::read(DataInputStream *dis) //throws IOException } } -void SetEntityMotionPacket::write(DataOutputStream *dos) //throws IOException +void SetEntityMotionPacket::write(DataOutputStream *dos) //throws IOException { if( useBytes ) { @@ -106,8 +106,8 @@ bool SetEntityMotionPacket::canBeInvalidated() return true; } -bool SetEntityMotionPacket::isInvalidatedBy(shared_ptr packet) +bool SetEntityMotionPacket::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target->id == id; } diff --git a/Minecraft.World/SetEntityMotionPacket.h b/Minecraft.World/SetEntityMotionPacket.h index 00c019da..ef9fefc5 100644 --- a/Minecraft.World/SetEntityMotionPacket.h +++ b/Minecraft.World/SetEntityMotionPacket.h @@ -15,7 +15,7 @@ private: public: SetEntityMotionPacket(); - SetEntityMotionPacket(shared_ptr e); + SetEntityMotionPacket(std::shared_ptr e); SetEntityMotionPacket(int id, double xd, double yd, double zd); virtual void read(DataInputStream *dis); @@ -23,9 +23,9 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new SetEntityMotionPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetEntityMotionPacket()); } virtual int getId() { return 28; } }; \ No newline at end of file diff --git a/Minecraft.World/SetEquippedItemPacket.cpp b/Minecraft.World/SetEquippedItemPacket.cpp index 1da93b84..cbb71803 100644 --- a/Minecraft.World/SetEquippedItemPacket.cpp +++ b/Minecraft.World/SetEquippedItemPacket.cpp @@ -14,7 +14,7 @@ SetEquippedItemPacket::SetEquippedItemPacket() item = nullptr; } -SetEquippedItemPacket::SetEquippedItemPacket(int entity, int slot, shared_ptr item) +SetEquippedItemPacket::SetEquippedItemPacket(int entity, int slot, std::shared_ptr item) { this->entity = entity; this->slot = slot; @@ -23,7 +23,7 @@ SetEquippedItemPacket::SetEquippedItemPacket(int entity, int slot, shared_ptritem = item == NULL ? nullptr : item->copy(); } -void SetEquippedItemPacket::read(DataInputStream *dis) //throws IOException +void SetEquippedItemPacket::read(DataInputStream *dis) //throws IOException { entity = dis->readInt(); slot = dis->readShort(); @@ -32,7 +32,7 @@ void SetEquippedItemPacket::read(DataInputStream *dis) //throws IOException item = readItem(dis); } -void SetEquippedItemPacket::write(DataOutputStream *dos) //throws IOException +void SetEquippedItemPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(entity); dos->writeShort(slot); @@ -41,7 +41,7 @@ void SetEquippedItemPacket::write(DataOutputStream *dos) //throws IOException writeItem(item, dos); } -void SetEquippedItemPacket::handle(PacketListener *listener) +void SetEquippedItemPacket::handle(PacketListener *listener) { listener->handleSetEquippedItem(shared_from_this()); } @@ -52,7 +52,7 @@ int SetEquippedItemPacket::getEstimatedSize() } // 4J Stu - Brought forward from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game -shared_ptr SetEquippedItemPacket::getItem() +std::shared_ptr SetEquippedItemPacket::getItem() { return item; } @@ -62,8 +62,8 @@ bool SetEquippedItemPacket::canBeInvalidated() return true; } -bool SetEquippedItemPacket::isInvalidatedBy(shared_ptr packet) +bool SetEquippedItemPacket::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target->entity == entity && target->slot == slot; } \ No newline at end of file diff --git a/Minecraft.World/SetEquippedItemPacket.h b/Minecraft.World/SetEquippedItemPacket.h index def39120..9b907acc 100644 --- a/Minecraft.World/SetEquippedItemPacket.h +++ b/Minecraft.World/SetEquippedItemPacket.h @@ -11,23 +11,23 @@ public: private: // 4J Stu - Brought forward from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game - shared_ptr item; + std::shared_ptr item; public: SetEquippedItemPacket(); - SetEquippedItemPacket(int entity, int slot, shared_ptr item); + SetEquippedItemPacket(int entity, int slot, std::shared_ptr item); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); - + virtual bool isInvalidatedBy(std::shared_ptr packet); + // 4J Stu - Brought forward from 1.3 to fix #64688 - Customer Encountered: TU7: Content: Art: Aura of enchanted item is not displayed for other players in online game - shared_ptr getItem(); + std::shared_ptr getItem(); public: - static shared_ptr create() { return shared_ptr(new SetEquippedItemPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetEquippedItemPacket()); } virtual int getId() { return 5; } }; \ No newline at end of file diff --git a/Minecraft.World/SetExperiencePacket.cpp b/Minecraft.World/SetExperiencePacket.cpp index ffe90a67..bd96a926 100644 --- a/Minecraft.World/SetExperiencePacket.cpp +++ b/Minecraft.World/SetExperiencePacket.cpp @@ -48,7 +48,7 @@ bool SetExperiencePacket::canBeInvalidated() return true; } -bool SetExperiencePacket::isInvalidatedBy(shared_ptr packet) +bool SetExperiencePacket::isInvalidatedBy(std::shared_ptr packet) { return true; } diff --git a/Minecraft.World/SetExperiencePacket.h b/Minecraft.World/SetExperiencePacket.h index 499b7efd..c8aff620 100644 --- a/Minecraft.World/SetExperiencePacket.h +++ b/Minecraft.World/SetExperiencePacket.h @@ -17,10 +17,10 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); virtual bool isAync(); public: - static shared_ptr create() { return shared_ptr(new SetExperiencePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetExperiencePacket()); } virtual int getId() { return 43; } }; \ No newline at end of file diff --git a/Minecraft.World/SetHealthPacket.cpp b/Minecraft.World/SetHealthPacket.cpp index 55d7ccc3..63e1a593 100644 --- a/Minecraft.World/SetHealthPacket.cpp +++ b/Minecraft.World/SetHealthPacket.cpp @@ -25,7 +25,7 @@ SetHealthPacket::SetHealthPacket(int health, int food, float saturation, ETeleme this->damageSource = damageSource; } -void SetHealthPacket::read(DataInputStream *dis) //throws IOException +void SetHealthPacket::read(DataInputStream *dis) //throws IOException { health = dis->readShort(); food = dis->readShort(); @@ -35,7 +35,7 @@ void SetHealthPacket::read(DataInputStream *dis) //throws IOException damageSource = (ETelemetryChallenges)dis->readByte(); } -void SetHealthPacket::write(DataOutputStream *dos) //throws IOException +void SetHealthPacket::write(DataOutputStream *dos) //throws IOException { dos->writeShort(health); dos->writeShort(food); @@ -45,7 +45,7 @@ void SetHealthPacket::write(DataOutputStream *dos) //throws IOException dos->writeByte(damageSource); } -void SetHealthPacket::handle(PacketListener *listener) +void SetHealthPacket::handle(PacketListener *listener) { listener->handleSetHealth(shared_from_this()); } @@ -60,7 +60,7 @@ bool SetHealthPacket::canBeInvalidated() return true; } -bool SetHealthPacket::isInvalidatedBy(shared_ptr packet) +bool SetHealthPacket::isInvalidatedBy(std::shared_ptr packet) { return true; } \ No newline at end of file diff --git a/Minecraft.World/SetHealthPacket.h b/Minecraft.World/SetHealthPacket.h index de8f4cb9..0f74075b 100644 --- a/Minecraft.World/SetHealthPacket.h +++ b/Minecraft.World/SetHealthPacket.h @@ -21,10 +21,10 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new SetHealthPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetHealthPacket()); } virtual int getId() { return 8; } }; diff --git a/Minecraft.World/SetRidingPacket.cpp b/Minecraft.World/SetRidingPacket.cpp index 454da047..de7b0bf2 100644 --- a/Minecraft.World/SetRidingPacket.cpp +++ b/Minecraft.World/SetRidingPacket.cpp @@ -13,13 +13,13 @@ SetRidingPacket::SetRidingPacket() riddenId = -1; } -SetRidingPacket::SetRidingPacket(shared_ptr rider, shared_ptr riding) +SetRidingPacket::SetRidingPacket(std::shared_ptr rider, std::shared_ptr riding) { this->riderId = rider->entityId; this->riddenId = riding != NULL ? riding->entityId : -1; } -int SetRidingPacket::getEstimatedSize() +int SetRidingPacket::getEstimatedSize() { return 8; } @@ -46,8 +46,8 @@ bool SetRidingPacket::canBeInvalidated() return true; } -bool SetRidingPacket::isInvalidatedBy(shared_ptr packet) +bool SetRidingPacket::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target->riderId == riderId; } diff --git a/Minecraft.World/SetRidingPacket.h b/Minecraft.World/SetRidingPacket.h index 60c3ac43..049b9d13 100644 --- a/Minecraft.World/SetRidingPacket.h +++ b/Minecraft.World/SetRidingPacket.h @@ -9,17 +9,17 @@ public: int riderId, riddenId; SetRidingPacket(); - SetRidingPacket(shared_ptr rider, shared_ptr riding); + SetRidingPacket(std::shared_ptr rider, std::shared_ptr riding); virtual int getEstimatedSize(); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); virtual void handle(PacketListener *listener); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new SetRidingPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetRidingPacket()); } virtual int getId() { return 39; } }; \ No newline at end of file diff --git a/Minecraft.World/SetSpawnPositionPacket.cpp b/Minecraft.World/SetSpawnPositionPacket.cpp index 035da347..07ad2622 100644 --- a/Minecraft.World/SetSpawnPositionPacket.cpp +++ b/Minecraft.World/SetSpawnPositionPacket.cpp @@ -6,7 +6,7 @@ -SetSpawnPositionPacket::SetSpawnPositionPacket() +SetSpawnPositionPacket::SetSpawnPositionPacket() { x = 0; y = 0; @@ -27,19 +27,19 @@ void SetSpawnPositionPacket::read(DataInputStream *dis) //throws IOException z = dis->readInt(); } -void SetSpawnPositionPacket::write(DataOutputStream *dos) //throws IOException +void SetSpawnPositionPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(x); dos->writeInt(y); dos->writeInt(z); } -void SetSpawnPositionPacket::handle(PacketListener *listener) +void SetSpawnPositionPacket::handle(PacketListener *listener) { listener->handleSetSpawn(shared_from_this()); } -int SetSpawnPositionPacket::getEstimatedSize() +int SetSpawnPositionPacket::getEstimatedSize() { return 3*4; } @@ -49,7 +49,7 @@ bool SetSpawnPositionPacket::canBeInvalidated() return true; } -bool SetSpawnPositionPacket::isInvalidatedBy(shared_ptr packet) +bool SetSpawnPositionPacket::isInvalidatedBy(std::shared_ptr packet) { return true; } diff --git a/Minecraft.World/SetSpawnPositionPacket.h b/Minecraft.World/SetSpawnPositionPacket.h index 3ba66af8..e9e5c7cd 100644 --- a/Minecraft.World/SetSpawnPositionPacket.h +++ b/Minecraft.World/SetSpawnPositionPacket.h @@ -16,10 +16,10 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); virtual bool isAync(); public: - static shared_ptr create() { return shared_ptr(new SetSpawnPositionPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetSpawnPositionPacket()); } virtual int getId() { return 6; } }; \ No newline at end of file diff --git a/Minecraft.World/SetTimePacket.cpp b/Minecraft.World/SetTimePacket.cpp index 1f0701eb..0a5fe621 100644 --- a/Minecraft.World/SetTimePacket.cpp +++ b/Minecraft.World/SetTimePacket.cpp @@ -41,7 +41,7 @@ bool SetTimePacket::canBeInvalidated() return true; } -bool SetTimePacket::isInvalidatedBy(shared_ptr packet) +bool SetTimePacket::isInvalidatedBy(std::shared_ptr packet) { return true; } diff --git a/Minecraft.World/SetTimePacket.h b/Minecraft.World/SetTimePacket.h index b7d3e645..8074ce9e 100644 --- a/Minecraft.World/SetTimePacket.h +++ b/Minecraft.World/SetTimePacket.h @@ -16,10 +16,10 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); virtual bool isAync(); public: - static shared_ptr create() { return shared_ptr(new SetTimePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SetTimePacket()); } virtual int getId() { return 4; } }; \ No newline at end of file diff --git a/Minecraft.World/ShapedRecipy.cpp b/Minecraft.World/ShapedRecipy.cpp index 15ccca2d..4e22dcd2 100644 --- a/Minecraft.World/ShapedRecipy.cpp +++ b/Minecraft.World/ShapedRecipy.cpp @@ -1,5 +1,5 @@ // package net.minecraft.world.item.crafting; -// +// // import net.minecraft.world.inventory.CraftingContainer; // import net.minecraft.world.item.ItemInstance; @@ -12,7 +12,7 @@ #include "ShapedRecipy.h" // 4J-PB - for new crafting - Adding group to define type of item that the recipe produces -ShapedRecipy::ShapedRecipy(int width, int height, ItemInstance **recipeItems, ItemInstance *result, int iGroup) +ShapedRecipy::ShapedRecipy(int width, int height, ItemInstance **recipeItems, ItemInstance *result, int iGroup) : resultId(result->id) { this->width = width; @@ -23,21 +23,21 @@ ShapedRecipy::ShapedRecipy(int width, int height, ItemInstance **recipeItems, It _keepTag = false; } -const int ShapedRecipy::getGroup() +const int ShapedRecipy::getGroup() { return group; } -const ItemInstance *ShapedRecipy::getResultItem() +const ItemInstance *ShapedRecipy::getResultItem() { return result; } -bool ShapedRecipy::matches(shared_ptr craftSlots, Level *level) +bool ShapedRecipy::matches(std::shared_ptr craftSlots, Level *level) { - for (int xOffs = 0; xOffs <= (3 - width); xOffs++) + for (int xOffs = 0; xOffs <= (3 - width); xOffs++) { - for (int yOffs = 0; yOffs <= (3 - height); yOffs++) + for (int yOffs = 0; yOffs <= (3 - height); yOffs++) { if (matches(craftSlots, xOffs, yOffs, true)) return true; if (matches(craftSlots, xOffs, yOffs, false)) return true; @@ -46,32 +46,32 @@ bool ShapedRecipy::matches(shared_ptr craftSlots, Level *leve return false; } -bool ShapedRecipy::matches(shared_ptr craftSlots, int xOffs, int yOffs, bool xFlip) +bool ShapedRecipy::matches(std::shared_ptr craftSlots, int xOffs, int yOffs, bool xFlip) { for (int x = 0; x < 3; x++) { for (int y = 0; y < 3; y++) { int xs = x - xOffs; int ys = y - yOffs; ItemInstance *expected = NULL; - if (xs >= 0 && ys >= 0 && xs < width && ys < height) + if (xs >= 0 && ys >= 0 && xs < width && ys < height) { if (xFlip) expected = recipeItems[(width - xs - 1) + ys * width]; else expected = recipeItems[xs + ys * width]; } - shared_ptr item = craftSlots->getItem(x, y); - if (item == NULL && expected == NULL) + std::shared_ptr item = craftSlots->getItem(x, y); + if (item == NULL && expected == NULL) { continue; } - if ((item == NULL && expected != NULL) || (item != NULL && expected == NULL)) + if ((item == NULL && expected != NULL) || (item != NULL && expected == NULL)) { return false; } - if (expected->id != item->id) + if (expected->id != item->id) { return false; } - if (expected->getAuxValue() != Recipes::ANY_AUX_VALUE && expected->getAuxValue() != item->getAuxValue()) + if (expected->getAuxValue() != Recipes::ANY_AUX_VALUE && expected->getAuxValue() != item->getAuxValue()) { return false; } @@ -80,15 +80,15 @@ bool ShapedRecipy::matches(shared_ptr craftSlots, int xOffs, return true; } -shared_ptr ShapedRecipy::assemble(shared_ptr craftSlots) +std::shared_ptr ShapedRecipy::assemble(std::shared_ptr craftSlots) { - shared_ptr result = getResultItem()->copy(); + std::shared_ptr result = getResultItem()->copy(); if (_keepTag && craftSlots != NULL) { for (int i = 0; i < craftSlots->getContainerSize(); i++) { - shared_ptr item = craftSlots->getItem(i); + std::shared_ptr item = craftSlots->getItem(i); if (item != NULL && item->hasTag()) { @@ -100,25 +100,25 @@ shared_ptr ShapedRecipy::assemble(shared_ptr cr return result; } -int ShapedRecipy::size() +int ShapedRecipy::size() { return width * height; } // 4J-PB -bool ShapedRecipy::requires(int iRecipe) +bool ShapedRecipy::requires(int iRecipe) { app.DebugPrintf("ShapedRecipy %d\n",iRecipe); int iCount=0; - for (int x = 0; x < 3; x++) + for (int x = 0; x < 3; x++) { - for (int y = 0; y < 3; y++) + for (int y = 0; y < 3; y++) { - if (x < width && y < height) + if (x < width && y < height) { ItemInstance *expected = recipeItems[x+y*width]; - if (expected!=NULL) - { + if (expected!=NULL) + { //printf("\tIngredient %d is %d\n",iCount++,expected->id); } } @@ -130,7 +130,7 @@ bool ShapedRecipy::requires(int iRecipe) return false; } -void ShapedRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) +void ShapedRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) { //printf("ShapedRecipy %d\n",iRecipe); @@ -151,16 +151,16 @@ void ShapedRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) memset(TempIngReq.iIngAuxValA,Recipes::ANY_AUX_VALUE,sizeof(int)*9); ZeroMemory(TempIngReq.uiGridA,sizeof(unsigned int)*9); - for (int x = 0; x < 3; x++) + for (int x = 0; x < 3; x++) { - for (int y = 0; y < 3; y++) + for (int y = 0; y < 3; y++) { - if (x < width && y < height) + if (x < width && y < height) { ItemInstance *expected = recipeItems[x+y*width]; - if (expected!=NULL) - { + if (expected!=NULL) + { int iAuxVal = expected->getAuxValue(); TempIngReq.uiGridA[x+y*3]=expected->id | iAuxVal<<24; diff --git a/Minecraft.World/ShapedRecipy.h b/Minecraft.World/ShapedRecipy.h index 56cae3fd..387cf17b 100644 --- a/Minecraft.World/ShapedRecipy.h +++ b/Minecraft.World/ShapedRecipy.h @@ -1,6 +1,6 @@ #pragma once -class ShapedRecipy : public Recipy +class ShapedRecipy : public Recipy { private: int width, height, group; @@ -15,13 +15,13 @@ public: virtual const ItemInstance *getResultItem(); virtual const int getGroup(); - virtual bool matches(shared_ptr craftSlots, Level *level); + virtual bool matches(std::shared_ptr craftSlots, Level *level); private: - bool matches(shared_ptr craftSlots, int xOffs, int yOffs, bool xFlip); + bool matches(std::shared_ptr craftSlots, int xOffs, int yOffs, bool xFlip); public: - virtual shared_ptr assemble(shared_ptr craftSlots); + virtual std::shared_ptr assemble(std::shared_ptr craftSlots); virtual int size(); ShapedRecipy *keepTag(); diff --git a/Minecraft.World/ShapelessRecipy.cpp b/Minecraft.World/ShapelessRecipy.cpp index 67ed0381..46a58524 100644 --- a/Minecraft.World/ShapelessRecipy.cpp +++ b/Minecraft.World/ShapelessRecipy.cpp @@ -1,7 +1,7 @@ // package net.minecraft.world.item.crafting; -// +// // import java.util.*; -// +// // import net.minecraft.world.inventory.CraftingContainer; // import net.minecraft.world.item.ItemInstance; #include "stdafx.h" @@ -19,27 +19,27 @@ ShapelessRecipy::ShapelessRecipy(ItemInstance *result, vector *i { } -const int ShapelessRecipy::getGroup() -{ +const int ShapelessRecipy::getGroup() +{ return group; } -const ItemInstance *ShapelessRecipy::getResultItem() +const ItemInstance *ShapelessRecipy::getResultItem() { return result; } -bool ShapelessRecipy::matches(shared_ptr craftSlots, Level *level) +bool ShapelessRecipy::matches(std::shared_ptr craftSlots, Level *level) { vector tempList = *ingredients; - - for (int y = 0; y < 3; y++) - { - for (int x = 0; x < 3; x++) - { - shared_ptr item = craftSlots->getItem(x, y); - if (item != NULL) + for (int y = 0; y < 3; y++) + { + for (int x = 0; x < 3; x++) + { + std::shared_ptr item = craftSlots->getItem(x, y); + + if (item != NULL) { bool found = false; @@ -47,7 +47,7 @@ bool ShapelessRecipy::matches(shared_ptr craftSlots, Level *l for (AUTO_VAR(cit, ingredients->begin()); cit != citEnd; ++cit) { ItemInstance *ingredient = *cit; - if (item->id == ingredient->id && (ingredient->getAuxValue() == Recipes::ANY_AUX_VALUE || item->getAuxValue() == ingredient->getAuxValue())) + if (item->id == ingredient->id && (ingredient->getAuxValue() == Recipes::ANY_AUX_VALUE || item->getAuxValue() == ingredient->getAuxValue())) { found = true; AUTO_VAR( it, find(tempList.begin(), tempList.end(), ingredient ) ); @@ -56,7 +56,7 @@ bool ShapelessRecipy::matches(shared_ptr craftSlots, Level *l } } - if (!found) + if (!found) { return false; } @@ -67,18 +67,18 @@ bool ShapelessRecipy::matches(shared_ptr craftSlots, Level *l return tempList.empty(); } -shared_ptr ShapelessRecipy::assemble(shared_ptr craftSlots) +std::shared_ptr ShapelessRecipy::assemble(std::shared_ptr craftSlots) { return result->copy(); } -int ShapelessRecipy::size() +int ShapelessRecipy::size() { return (int)ingredients->size(); } // 4J-PB -bool ShapelessRecipy::requires(int iRecipe) +bool ShapelessRecipy::requires(int iRecipe) { vector *tempList = new vector; @@ -91,7 +91,7 @@ bool ShapelessRecipy::requires(int iRecipe) for (vector::iterator ingredient = ingredients->begin(); ingredient != citEnd; ingredient++) { //printf("\tIngredient %d is %d\n",iCount++,(*ingredient)->id); - //if (item->id == (*ingredient)->id && ((*ingredient)->getAuxValue() == Recipes::ANY_AUX_VALUE || item->getAuxValue() == (*ingredient)->getAuxValue())) + //if (item->id == (*ingredient)->id && ((*ingredient)->getAuxValue() == Recipes::ANY_AUX_VALUE || item->getAuxValue() == (*ingredient)->getAuxValue())) tempList->erase(ingredient); } @@ -99,7 +99,7 @@ bool ShapelessRecipy::requires(int iRecipe) return false; } -void ShapelessRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) +void ShapelessRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) { int iCount=0; bool bFound; @@ -125,8 +125,8 @@ void ShapelessRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) { ItemInstance *expected = *ingredient; - if (expected!=NULL) - { + if (expected!=NULL) + { int iAuxVal = (*ingredient)->getAuxValue(); TempIngReq.uiGridA[iCount++]=expected->id | iAuxVal<<24; // 4J-PB - put the ingredients in boxes 1,2,4,5 so we can see them in a 2x2 crafting screen diff --git a/Minecraft.World/ShapelessRecipy.h b/Minecraft.World/ShapelessRecipy.h index 5f7f6076..88de0060 100644 --- a/Minecraft.World/ShapelessRecipy.h +++ b/Minecraft.World/ShapelessRecipy.h @@ -1,6 +1,6 @@ #pragma once -class ShapelessRecipy : public Recipy +class ShapelessRecipy : public Recipy { private: _eGroupType group; @@ -12,12 +12,12 @@ public: virtual const ItemInstance *getResultItem(); virtual const int getGroup(); - virtual bool matches(shared_ptr craftSlots, Level *level); - virtual shared_ptr assemble(shared_ptr craftSlots); + virtual bool matches(std::shared_ptr craftSlots, Level *level); + virtual std::shared_ptr assemble(std::shared_ptr craftSlots); virtual int size(); // 4J-PB - to return the items required to make a recipe virtual bool requires(int iRecipe); - virtual void requires(INGREDIENTS_REQUIRED *pIngReq); + virtual void requires(INGREDIENTS_REQUIRED *pIngReq); }; diff --git a/Minecraft.World/ShearsItem.cpp b/Minecraft.World/ShearsItem.cpp index 7f4d8d51..00372e29 100644 --- a/Minecraft.World/ShearsItem.cpp +++ b/Minecraft.World/ShearsItem.cpp @@ -9,7 +9,7 @@ ShearsItem::ShearsItem(int itemId) : Item(itemId) setMaxDamage(238); } -bool ShearsItem::mineBlock(shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr owner) +bool ShearsItem::mineBlock(std::shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, std::shared_ptr owner) { if (tile == Tile::leaves_Id || tile == Tile::web_Id || tile == Tile::tallgrass_Id || tile == Tile::vine_Id || tile == Tile::tripWire_Id) { @@ -24,7 +24,7 @@ bool ShearsItem::canDestroySpecial(Tile *tile) return tile->id == Tile::web_Id || tile->id == Tile::redStoneDust_Id || tile->id == Tile::tripWire_Id; } -float ShearsItem::getDestroySpeed(shared_ptr itemInstance, Tile *tile) +float ShearsItem::getDestroySpeed(std::shared_ptr itemInstance, Tile *tile) { if (tile->id == Tile::web_Id || tile->id == Tile::leaves_Id) { diff --git a/Minecraft.World/ShearsItem.h b/Minecraft.World/ShearsItem.h index 06078645..fe713eaa 100644 --- a/Minecraft.World/ShearsItem.h +++ b/Minecraft.World/ShearsItem.h @@ -3,11 +3,11 @@ using namespace std; #include "Item.h" -class ShearsItem : public Item +class ShearsItem : public Item { public: ShearsItem(int itemId); - virtual bool mineBlock(shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr owner); + virtual bool mineBlock(std::shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, std::shared_ptr owner); virtual bool canDestroySpecial(Tile *tile); - virtual float getDestroySpeed(shared_ptr itemInstance, Tile *tile); + virtual float getDestroySpeed(std::shared_ptr itemInstance, Tile *tile); }; \ No newline at end of file diff --git a/Minecraft.World/Sheep.cpp b/Minecraft.World/Sheep.cpp index 30eeefcd..cc1d69ed 100644 --- a/Minecraft.World/Sheep.cpp +++ b/Minecraft.World/Sheep.cpp @@ -68,9 +68,9 @@ Sheep::Sheep(Level *level) : Animal( level ) goalSelector.addGoal(7, new LookAtPlayerGoal(this, typeid(Player), 6)); goalSelector.addGoal(8, new RandomLookAroundGoal(this)); - container = shared_ptr(new CraftingContainer(new SheepContainer(), 2, 1)); - container->setItem(0, shared_ptr( new ItemInstance(Item::dye_powder, 1, 0))); - container->setItem(1, shared_ptr( new ItemInstance(Item::dye_powder, 1, 0))); + container = std::shared_ptr(new CraftingContainer(new SheepContainer(), 2, 1)); + container->setItem(0, std::shared_ptr( new ItemInstance(Item::dye_powder, 1, 0))); + container->setItem(1, std::shared_ptr( new ItemInstance(Item::dye_powder, 1, 0))); } bool Sheep::useNewAi() @@ -95,7 +95,7 @@ int Sheep::getMaxHealth() return 8; } -void Sheep::defineSynchedData() +void Sheep::defineSynchedData() { Animal::defineSynchedData(); @@ -108,7 +108,7 @@ void Sheep::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) if(!isSheared()) { // killing a non-sheared sheep will drop a single block of cloth - spawnAtLocation(shared_ptr( new ItemInstance(Tile::cloth_Id, 1, getColor()) ), 0.0f); + spawnAtLocation(std::shared_ptr( new ItemInstance(Tile::cloth_Id, 1, getColor()) ), 0.0f); } } @@ -160,9 +160,9 @@ float Sheep::getHeadEatAngleScale(float a) return ((xRot / (180.0f / PI))); } -bool Sheep::interact(shared_ptr player) +bool Sheep::interact(std::shared_ptr player) { - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); // 4J-JEV: Fix for #88212, // Untrusted players shouldn't be able to sheer sheep. @@ -177,7 +177,7 @@ bool Sheep::interact(shared_ptr player) int count = 1 + random->nextInt(3); for (int i = 0; i < count; i++) { - shared_ptr ie = spawnAtLocation(shared_ptr( new ItemInstance(Tile::cloth_Id, 1, getColor()) ), 1.0f); + std::shared_ptr ie = spawnAtLocation(std::shared_ptr( new ItemInstance(Tile::cloth_Id, 1, getColor()) ), 1.0f); ie->yd += random->nextFloat() * 0.05f; ie->xd += (random->nextFloat() - random->nextFloat()) * 0.1f; ie->zd += (random->nextFloat() - random->nextFloat()) * 0.1f; @@ -191,80 +191,80 @@ bool Sheep::interact(shared_ptr player) return Animal::interact(player); } -void Sheep::addAdditonalSaveData(CompoundTag *tag) +void Sheep::addAdditonalSaveData(CompoundTag *tag) { Animal::addAdditonalSaveData(tag); tag->putBoolean(L"Sheared", isSheared()); tag->putByte(L"Color", (byte) getColor()); } -void Sheep::readAdditionalSaveData(CompoundTag *tag) +void Sheep::readAdditionalSaveData(CompoundTag *tag) { Animal::readAdditionalSaveData(tag); setSheared(tag->getBoolean(L"Sheared")); setColor((int) tag->getByte(L"Color")); } -int Sheep::getAmbientSound() +int Sheep::getAmbientSound() { return eSoundType_MOB_SHEEP_AMBIENT; } -int Sheep::getHurtSound() +int Sheep::getHurtSound() { return eSoundType_MOB_SHEEP_AMBIENT; } -int Sheep::getDeathSound() +int Sheep::getDeathSound() { return eSoundType_MOB_SHEEP_AMBIENT; } -int Sheep::getColor() +int Sheep::getColor() { return (entityData->getByte(DATA_WOOL_ID) & 0x0f); } -void Sheep::setColor(int color) +void Sheep::setColor(int color) { byte current = entityData->getByte(DATA_WOOL_ID); entityData->set(DATA_WOOL_ID, (byte) ((current & 0xf0) | (color & 0x0f))); } -bool Sheep::isSheared() +bool Sheep::isSheared() { return (entityData->getByte(DATA_WOOL_ID) & 0x10) != 0; } -void Sheep::setSheared(bool value) +void Sheep::setSheared(bool value) { byte current = entityData->getByte(DATA_WOOL_ID); - if (value) + if (value) { entityData->set(DATA_WOOL_ID, (byte) (current | 0x10)); - } - else + } + else { entityData->set(DATA_WOOL_ID, (byte) (current & ~0x10)); } } -int Sheep::getSheepColor(Random *random) +int Sheep::getSheepColor(Random *random) { int nextInt = random->nextInt(100); - if (nextInt < 5) + if (nextInt < 5) { return 15 - DyePowderItem::BLACK; } - if (nextInt < 10) + if (nextInt < 10) { return 15 - DyePowderItem::GRAY; } - if (nextInt < 15) + if (nextInt < 15) { return 15 - DyePowderItem::SILVER; } - if (nextInt < 18) + if (nextInt < 18) { return 15 - DyePowderItem::BROWN; } @@ -272,13 +272,13 @@ int Sheep::getSheepColor(Random *random) return 0; // white } -shared_ptr Sheep::getBreedOffspring(shared_ptr target) +std::shared_ptr Sheep::getBreedOffspring(std::shared_ptr target) { // 4J - added limit to number of animals that can be bred if( level->canCreateMore( GetType(), Level::eSpawnType_Breed) ) { - shared_ptr otherSheep = dynamic_pointer_cast( target ); - shared_ptr sheep = shared_ptr( new Sheep(level) ); + std::shared_ptr otherSheep = dynamic_pointer_cast( target ); + std::shared_ptr sheep = std::shared_ptr( new Sheep(level) ); int color = getOffspringColor(dynamic_pointer_cast(shared_from_this()), otherSheep); sheep->setColor(15 - color); return sheep; @@ -309,7 +309,7 @@ void Sheep::finalizeMobSpawn() setColor(Sheep::getSheepColor(level->random)); } -int Sheep::getOffspringColor(shared_ptr animal, shared_ptr partner) +int Sheep::getOffspringColor(std::shared_ptr animal, std::shared_ptr partner) { int parent1DyeColor = getDyeColor(animal); int parent2DyeColor = getDyeColor(partner); @@ -317,7 +317,7 @@ int Sheep::getOffspringColor(shared_ptr animal, shared_ptr partn container->getItem(0)->setAuxValue(parent1DyeColor); container->getItem(1)->setAuxValue(parent2DyeColor); - shared_ptr instance = Recipes::getInstance()->getItemFor(container, animal->level); + std::shared_ptr instance = Recipes::getInstance()->getItemFor(container, animal->level); int color = 0; if (instance != NULL && instance->getItem()->id == Item::dye_powder_Id) @@ -331,7 +331,7 @@ int Sheep::getOffspringColor(shared_ptr animal, shared_ptr partn return color; } -int Sheep::getDyeColor(shared_ptr animal) +int Sheep::getDyeColor(std::shared_ptr animal) { return 15 - dynamic_pointer_cast(animal)->getColor(); } diff --git a/Minecraft.World/Sheep.h b/Minecraft.World/Sheep.h index 666e1d57..098183e8 100644 --- a/Minecraft.World/Sheep.h +++ b/Minecraft.World/Sheep.h @@ -15,10 +15,10 @@ class Sheep : public Animal private: class SheepContainer : public AbstractContainerMenu { - bool stillValid(shared_ptr player) { return false; } + bool stillValid(std::shared_ptr player) { return false; } }; - shared_ptr container; + std::shared_ptr container; public: eINSTANCEOF GetType() { return eTYPE_SHEEP; } static Entity *create(Level *level) { return new Sheep(level); } @@ -58,7 +58,7 @@ public: float getHeadEatPositionScale(float a); float getHeadEatAngleScale(float a); - virtual bool interact(shared_ptr player); + virtual bool interact(std::shared_ptr player); virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); @@ -74,13 +74,13 @@ public: void setSheared(bool value); static int getSheepColor(Random *random); - virtual shared_ptr getBreedOffspring(shared_ptr target); + virtual std::shared_ptr getBreedOffspring(std::shared_ptr target); virtual void ate(); void finalizeMobSpawn(); private: - int getOffspringColor(shared_ptr animal, shared_ptr partner); - int getDyeColor(shared_ptr animal); + int getOffspringColor(std::shared_ptr animal, std::shared_ptr partner); + int getDyeColor(std::shared_ptr animal); }; diff --git a/Minecraft.World/ShoreLayer.cpp b/Minecraft.World/ShoreLayer.cpp index 7ae52557..9640c736 100644 --- a/Minecraft.World/ShoreLayer.cpp +++ b/Minecraft.World/ShoreLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -ShoreLayer::ShoreLayer(int64_t seed, shared_ptr parent) : Layer(seed) +ShoreLayer::ShoreLayer(int64_t seed, std::shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/ShoreLayer.h b/Minecraft.World/ShoreLayer.h index a7053004..a8aff680 100644 --- a/Minecraft.World/ShoreLayer.h +++ b/Minecraft.World/ShoreLayer.h @@ -4,6 +4,6 @@ class ShoreLayer : public Layer { public: - ShoreLayer(int64_t seed, shared_ptr parent); + ShoreLayer(int64_t seed, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SignItem.cpp b/Minecraft.World/SignItem.cpp index 02ccf83d..fa9d6772 100644 --- a/Minecraft.World/SignItem.cpp +++ b/Minecraft.World/SignItem.cpp @@ -13,7 +13,7 @@ SignItem::SignItem(int id) : Item(id) maxStackSize = 16; } -bool SignItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool SignItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { // 4J-PB - Adding a test only version to allow tooltips to be displayed if (face == 0) return false; @@ -32,24 +32,24 @@ bool SignItem::useOn(shared_ptr instance, shared_ptr playe if(!bTestUseOnOnly) { - if (face == 1) + if (face == 1) { int rot = Mth::floor(((player->yRot + 180) * 16) / 360 + 0.5) & 15; level->setTileAndData(x, y, z, Tile::sign_Id, rot); - } + } else { level->setTileAndData(x, y, z, Tile::wallSign_Id, face); } instance->count--; - shared_ptr ste = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); + std::shared_ptr ste = dynamic_pointer_cast( level->getTileEntity(x, y, z) ); if (ste != NULL) player->openTextEdit(ste); // 4J-JEV: Hook for durango 'BlockPlaced' event. player->awardStat( GenericStats::blocksPlaced((face==1) ? Tile::sign_Id : Tile::wallSign_Id), - GenericStats::param_blocksPlaced( + GenericStats::param_blocksPlaced( (face==1) ? Tile::sign_Id : Tile::wallSign_Id, instance->getAuxValue(), 1) diff --git a/Minecraft.World/SignItem.h b/Minecraft.World/SignItem.h index 6265e759..98e39c0f 100644 --- a/Minecraft.World/SignItem.h +++ b/Minecraft.World/SignItem.h @@ -3,10 +3,10 @@ using namespace std; #include "Item.h" -class SignItem : public Item +class SignItem : public Item { public: SignItem(int id); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); }; \ No newline at end of file diff --git a/Minecraft.World/SignTile.cpp b/Minecraft.World/SignTile.cpp index 52dc1260..363ef5be 100644 --- a/Minecraft.World/SignTile.cpp +++ b/Minecraft.World/SignTile.cpp @@ -35,7 +35,7 @@ AABB *SignTile::getTileAABB(Level *level, int x, int y, int z) return EntityTile::getTileAABB(level, x, y, z); } -void SignTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void SignTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { if (onGround) return; @@ -75,11 +75,11 @@ bool SignTile::isSolidRender(bool isServerLevel) return false; } -shared_ptr SignTile::newTileEntity(Level *level) +std::shared_ptr SignTile::newTileEntity(Level *level) { //try { // 4J Stu - For some reason the newInstance wasn't working right, but doing it like the other TileEntities is fine - return shared_ptr( new SignTileEntity() ); + return std::shared_ptr( new SignTileEntity() ); //return dynamic_pointer_cast( clas->newInstance() ); //} catch (Exception e) { // TODO 4J Stu - Exception handling diff --git a/Minecraft.World/SignTile.h b/Minecraft.World/SignTile.h index 92163973..75d723ad 100644 --- a/Minecraft.World/SignTile.h +++ b/Minecraft.World/SignTile.h @@ -21,14 +21,14 @@ public: virtual void updateDefaultShape(); AABB *getAABB(Level *level, int x, int y, int z); AABB *getTileAABB(Level *level, int x, int y, int z); - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param int getRenderShape(); bool isCubeShaped(); virtual bool isPathfindable(LevelSource *level, int x, int y, int z); bool isSolidRender(bool isServerLevel = false); protected: - shared_ptr newTileEntity(Level *level); + std::shared_ptr newTileEntity(Level *level); public: int getResource(int data, Random *random, int playerBonusLevel); diff --git a/Minecraft.World/SignTileEntity.cpp b/Minecraft.World/SignTileEntity.cpp index 09b8e022..b2219c94 100644 --- a/Minecraft.World/SignTileEntity.cpp +++ b/Minecraft.World/SignTileEntity.cpp @@ -40,7 +40,7 @@ SignTileEntity::~SignTileEntity() #endif } -void SignTileEntity::save(CompoundTag *tag) +void SignTileEntity::save(CompoundTag *tag) { TileEntity::save(tag); tag->putString(L"Text1", m_wsmessages[0] ); @@ -61,7 +61,7 @@ void SignTileEntity::load(CompoundTag *tag) { _isEditable = false; TileEntity::load(tag); - for (int i = 0; i < MAX_SIGN_LINES; i++) + for (int i = 0; i < MAX_SIGN_LINES; i++) { wchar_t *buf = new wchar_t[256]; swprintf(buf, 256, L"Text%d", (i+1) ); @@ -84,17 +84,17 @@ void SignTileEntity::load(CompoundTag *tag) setChanged(); } -shared_ptr SignTileEntity::getUpdatePacket() +std::shared_ptr SignTileEntity::getUpdatePacket() { wstring copy[MAX_SIGN_LINES]; - for (int i = 0; i < MAX_SIGN_LINES; i++) + for (int i = 0; i < MAX_SIGN_LINES; i++) { copy[i] = m_wsmessages[i]; } - return shared_ptr( new SignUpdatePacket(x, y, z, m_bVerified, m_bCensored, copy) ); + return std::shared_ptr( new SignUpdatePacket(x, y, z, m_bVerified, m_bCensored, copy) ); } -bool SignTileEntity::isEditable() +bool SignTileEntity::isEditable() { return _isEditable; } @@ -115,10 +115,10 @@ void SignTileEntity::setChanged() //if (pMinecraft->level->isClientSide) { WCHAR *wcMessages[MAX_SIGN_LINES]; - for (int i = 0; i < MAX_SIGN_LINES; ++i) + for (int i = 0; i < MAX_SIGN_LINES; ++i) { wcMessages[i]=new WCHAR [MAX_LINE_LENGTH+1]; - ZeroMemory(wcMessages[i],sizeof(WCHAR)*(MAX_LINE_LENGTH+1)); + ZeroMemory(wcMessages[i],sizeof(WCHAR)*(MAX_LINE_LENGTH+1)); if(m_wsmessages[i].length()>0) { memcpy(wcMessages[i],m_wsmessages[i].c_str(),m_wsmessages[i].length()*sizeof(WCHAR)); @@ -149,8 +149,8 @@ void SignTileEntity::setChanged() } -void SignTileEntity::SetMessage(int iIndex,wstring &wsText) -{ +void SignTileEntity::SetMessage(int iIndex,wstring &wsText) +{ m_wsmessages[iIndex]=wsText; } @@ -183,9 +183,9 @@ int SignTileEntity::StringVerifyCallback(LPVOID lpParam,STRING_VERIFY_RESPONSE * } // 4J Added -shared_ptr SignTileEntity::clone() +std::shared_ptr SignTileEntity::clone() { - shared_ptr result = shared_ptr( new SignTileEntity() ); + std::shared_ptr result = std::shared_ptr( new SignTileEntity() ); TileEntity::clone(result); result->m_wsmessages[0] = m_wsmessages[0]; diff --git a/Minecraft.World/SignTileEntity.h b/Minecraft.World/SignTileEntity.h index b963f12f..8713c627 100644 --- a/Minecraft.World/SignTileEntity.h +++ b/Minecraft.World/SignTileEntity.h @@ -38,12 +38,12 @@ private: public: virtual void save(CompoundTag *tag); virtual void load(CompoundTag *tag); - virtual shared_ptr getUpdatePacket(); + virtual std::shared_ptr getUpdatePacket(); bool isEditable(); void setEditable(bool isEditable); virtual void setChanged(); static int StringVerifyCallback(LPVOID lpParam,STRING_VERIFY_RESPONSE *pResults); // 4J Added - virtual shared_ptr clone(); + virtual std::shared_ptr clone(); }; \ No newline at end of file diff --git a/Minecraft.World/SignUpdatePacket.h b/Minecraft.World/SignUpdatePacket.h index 80cc2968..e3284ab1 100644 --- a/Minecraft.World/SignUpdatePacket.h +++ b/Minecraft.World/SignUpdatePacket.h @@ -21,6 +21,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new SignUpdatePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new SignUpdatePacket()); } virtual int getId() { return 130; } }; \ No newline at end of file diff --git a/Minecraft.World/Silverfish.cpp b/Minecraft.World/Silverfish.cpp index 117dc41b..24745b6c 100644 --- a/Minecraft.World/Silverfish.cpp +++ b/Minecraft.World/Silverfish.cpp @@ -37,12 +37,12 @@ bool Silverfish::makeStepSound() return false; } -shared_ptr Silverfish::findAttackTarget() +std::shared_ptr Silverfish::findAttackTarget() { #ifndef _FINAL_BUILD if(app.GetMobsDontAttackEnabled()) { - return shared_ptr(); + return std::shared_ptr(); } #endif @@ -79,7 +79,7 @@ bool Silverfish::hurt(DamageSource *source, int dmg) return Monster::hurt(source, dmg); } -void Silverfish::checkHurtTarget(shared_ptr target, float d) +void Silverfish::checkHurtTarget(std::shared_ptr target, float d) { // super.checkHurtTarget(target, d); @@ -199,7 +199,7 @@ bool Silverfish::canSpawn() { if (Monster::canSpawn()) { - shared_ptr nearestPlayer = level->getNearestPlayer(shared_from_this(), 5.0); + std::shared_ptr nearestPlayer = level->getNearestPlayer(shared_from_this(), 5.0); return nearestPlayer == NULL; } return false; diff --git a/Minecraft.World/Silverfish.h b/Minecraft.World/Silverfish.h index 0fd0cc06..34d10842 100644 --- a/Minecraft.World/Silverfish.h +++ b/Minecraft.World/Silverfish.h @@ -17,7 +17,7 @@ public: protected: virtual bool makeStepSound(); - virtual shared_ptr findAttackTarget(); + virtual std::shared_ptr findAttackTarget(); virtual int getAmbientSound(); virtual int getHurtSound(); @@ -27,7 +27,7 @@ public: virtual bool hurt(DamageSource *source, int dmg); protected: - virtual void checkHurtTarget(shared_ptr target, float d); + virtual void checkHurtTarget(std::shared_ptr target, float d); virtual void playStepSound(int xt, int yt, int zt, int t); virtual int getDeathLoot(); diff --git a/Minecraft.World/SimpleContainer.cpp b/Minecraft.World/SimpleContainer.cpp index e29bc790..20c253dc 100644 --- a/Minecraft.World/SimpleContainer.cpp +++ b/Minecraft.World/SimpleContainer.cpp @@ -34,24 +34,24 @@ void SimpleContainer::removeListener(net_minecraft_world::ContainerListener *lis listeners->erase( it ); } -shared_ptr SimpleContainer::getItem(unsigned int slot) +std::shared_ptr SimpleContainer::getItem(unsigned int slot) { return (*items)[slot]; } -shared_ptr SimpleContainer::removeItem(unsigned int slot, int count) +std::shared_ptr SimpleContainer::removeItem(unsigned int slot, int count) { if ((*items)[slot] != NULL) { if ((*items)[slot]->count <= count) { - shared_ptr item = (*items)[slot]; + std::shared_ptr item = (*items)[slot]; (*items)[slot] = nullptr; this->setChanged(); return item; } else { - shared_ptr i = (*items)[slot]->remove(count); + std::shared_ptr i = (*items)[slot]->remove(count); if ((*items)[slot]->count == 0) (*items)[slot] = nullptr; this->setChanged(); return i; @@ -60,18 +60,18 @@ shared_ptr SimpleContainer::removeItem(unsigned int slot, int coun return nullptr; } -shared_ptr SimpleContainer::removeItemNoUpdate(int slot) +std::shared_ptr SimpleContainer::removeItemNoUpdate(int slot) { if ((*items)[slot] != NULL) { - shared_ptr item = (*items)[slot]; + std::shared_ptr item = (*items)[slot]; (*items)[slot] = nullptr; return item; } return nullptr; } -void SimpleContainer::setItem(unsigned int slot, shared_ptr item) +void SimpleContainer::setItem(unsigned int slot, std::shared_ptr item) { (*items)[slot] = item; if (item != NULL && item->count > getMaxStackSize()) item->count = getMaxStackSize(); @@ -104,7 +104,7 @@ void SimpleContainer::setChanged() #endif } -bool SimpleContainer::stillValid(shared_ptr player) +bool SimpleContainer::stillValid(std::shared_ptr player) { return true; } \ No newline at end of file diff --git a/Minecraft.World/SimpleContainer.h b/Minecraft.World/SimpleContainer.h index 98c193d3..1dfade29 100644 --- a/Minecraft.World/SimpleContainer.h +++ b/Minecraft.World/SimpleContainer.h @@ -19,12 +19,12 @@ public: void removeListener(net_minecraft_world::ContainerListener *listener); - shared_ptr getItem(unsigned int slot); + std::shared_ptr getItem(unsigned int slot); - shared_ptr removeItem(unsigned int slot, int count); - shared_ptr removeItemNoUpdate(int slot); + std::shared_ptr removeItem(unsigned int slot, int count); + std::shared_ptr removeItemNoUpdate(int slot); - void setItem(unsigned int slot, shared_ptr item); + void setItem(unsigned int slot, std::shared_ptr item); unsigned int getContainerSize(); @@ -34,7 +34,7 @@ public: void setChanged(); - bool stillValid(shared_ptr player); + bool stillValid(std::shared_ptr player); void startOpen() { } // TODO Auto-generated method stub void stopOpen() { } // TODO Auto-generated method stub diff --git a/Minecraft.World/SitGoal.cpp b/Minecraft.World/SitGoal.cpp index 90180201..b01bb86a 100644 --- a/Minecraft.World/SitGoal.cpp +++ b/Minecraft.World/SitGoal.cpp @@ -20,7 +20,7 @@ bool SitGoal::canUse() if (mob->isInWater()) return false; if (!mob->onGround) return false; - shared_ptr owner = mob->getOwner(); + std::shared_ptr owner = mob->getOwner(); if (owner == NULL) return true; // owner not on level if (mob->distanceToSqr(owner) < FollowOwnerGoal::TeleportDistance * FollowOwnerGoal::TeleportDistance && owner->getLastHurtByMob() != NULL) return false; diff --git a/Minecraft.World/Skeleton.cpp b/Minecraft.World/Skeleton.cpp index b6dbab1f..4f28327c 100644 --- a/Minecraft.World/Skeleton.cpp +++ b/Minecraft.World/Skeleton.cpp @@ -53,7 +53,7 @@ int Skeleton::getMaxHealth() return 20; } -int Skeleton::getAmbientSound() +int Skeleton::getAmbientSound() { return eSoundType_MOB_SKELETON_AMBIENT; } @@ -63,19 +63,19 @@ int Skeleton::getHurtSound() return eSoundType_MOB_SKELETON_HURT; } -int Skeleton::getDeathSound() +int Skeleton::getDeathSound() { return eSoundType_MOB_SKELETON_HURT; } -shared_ptr Skeleton::bow; +std::shared_ptr Skeleton::bow; -shared_ptr Skeleton::getCarriedItem() +std::shared_ptr Skeleton::getCarriedItem() { return bow; } -MobType Skeleton::getMobType() +MobType Skeleton::getMobType() { return UNDEAD; } @@ -83,7 +83,7 @@ MobType Skeleton::getMobType() void Skeleton::aiStep() { // isClientSide check brought forward from 1.8 (I assume it's related to the lighting changes) - if (level->isDay() && !level->isClientSide) + if (level->isDay() && !level->isClientSide) { float br = getBrightness(1); if (br > 0.5f) @@ -101,7 +101,7 @@ void Skeleton::aiStep() void Skeleton::die(DamageSource *source) { Monster::die(source); - shared_ptr player = dynamic_pointer_cast( source->getEntity() ); + std::shared_ptr player = dynamic_pointer_cast( source->getEntity() ); if ( dynamic_pointer_cast( source->getDirectEntity() ) != NULL && player != NULL) { double xd = player->x - x; @@ -113,7 +113,7 @@ void Skeleton::die(DamageSource *source) } } -int Skeleton::getDeathLoot() +int Skeleton::getDeathLoot() { return Item::arrow->id; } @@ -122,7 +122,7 @@ void Skeleton::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) { // drop some arrows int count = random->nextInt(3 + playerBonusLevel); - for (int i = 0; i < count; i++) + for (int i = 0; i < count; i++) { spawnAtLocation(Item::arrow->id, 1); } @@ -138,7 +138,7 @@ void Skeleton::dropRareDeathLoot(int rareLootLevel) { if (rareLootLevel > 0) { - shared_ptr bow = shared_ptr( new ItemInstance(Item::bow) ); + std::shared_ptr bow = std::shared_ptr( new ItemInstance(Item::bow) ); EnchantmentHelper::enchantItem(random, bow, 5); spawnAtLocation(bow, 0); } @@ -150,5 +150,5 @@ void Skeleton::dropRareDeathLoot(int rareLootLevel) void Skeleton::staticCtor() { - Skeleton::bow = shared_ptr( new ItemInstance(Item::bow, 1) ); + Skeleton::bow = std::shared_ptr( new ItemInstance(Item::bow, 1) ); } diff --git a/Minecraft.World/Skeleton.h b/Minecraft.World/Skeleton.h index b85d9afe..d5760e9a 100644 --- a/Minecraft.World/Skeleton.h +++ b/Minecraft.World/Skeleton.h @@ -20,7 +20,7 @@ protected: virtual int getDeathSound(); public: - virtual shared_ptr getCarriedItem(); + virtual std::shared_ptr getCarriedItem(); virtual MobType getMobType(); virtual void aiStep(); virtual void die(DamageSource *source); @@ -31,7 +31,7 @@ protected: virtual void dropRareDeathLoot(int rareLootLevel); private: - static shared_ptr bow; + static std::shared_ptr bow; public: diff --git a/Minecraft.World/SkullItem.cpp b/Minecraft.World/SkullItem.cpp index 643021dc..36825d9f 100644 --- a/Minecraft.World/SkullItem.cpp +++ b/Minecraft.World/SkullItem.cpp @@ -18,7 +18,7 @@ SkullItem::SkullItem(int id) : Item(id) setStackedByData(true); } -bool SkullItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) //float clickX, float clickY, float clickZ) +bool SkullItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) //float clickX, float clickY, float clickZ) { if (face == 0) return false; if (!level->getMaterial(x, y, z)->isSolid()) return false; @@ -45,8 +45,8 @@ bool SkullItem::useOn(shared_ptr instance, shared_ptr play rot = Mth::floor(((player->yRot) * 16) / 360 + 0.5) & 15; } - shared_ptr skullTE = level->getTileEntity(x, y, z); - shared_ptr skull = dynamic_pointer_cast(skullTE); + std::shared_ptr skullTE = level->getTileEntity(x, y, z); + std::shared_ptr skull = dynamic_pointer_cast(skullTE); if (skull != NULL) { @@ -65,7 +65,7 @@ bool SkullItem::useOn(shared_ptr instance, shared_ptr play return true; } -bool SkullItem::mayPlace(Level *level, int x, int y, int z, int face, shared_ptr player, shared_ptr item) +bool SkullItem::mayPlace(Level *level, int x, int y, int z, int face, std::shared_ptr player, std::shared_ptr item) { int currentTile = level->getTile(x, y, z); if (currentTile == Tile::topSnow_Id) @@ -108,7 +108,7 @@ unsigned int SkullItem::getDescriptionId(int iData) return NAMES[iData]; } -unsigned int SkullItem::getDescriptionId(shared_ptr instance) +unsigned int SkullItem::getDescriptionId(std::shared_ptr instance) { int auxValue = instance->getAuxValue(); if (auxValue < 0 || auxValue >= SKULL_COUNT) @@ -118,7 +118,7 @@ unsigned int SkullItem::getDescriptionId(shared_ptr instance) return NAMES[auxValue]; } -wstring SkullItem::getHoverName(shared_ptr itemInstance) +wstring SkullItem::getHoverName(std::shared_ptr itemInstance) { #if 0 if (itemInstance->getAuxValue() == SkullTileEntity::TYPE_CHAR && itemInstance->hasTag() && itemInstance->getTag()->contains(L"SkullOwner")) diff --git a/Minecraft.World/SkullItem.h b/Minecraft.World/SkullItem.h index fc23be2f..2cd828e9 100644 --- a/Minecraft.World/SkullItem.h +++ b/Minecraft.World/SkullItem.h @@ -18,12 +18,12 @@ private: public: SkullItem(int id); - bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - bool mayPlace(Level *level, int x, int y, int z, int face, shared_ptr player, shared_ptr item); + bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + bool mayPlace(Level *level, int x, int y, int z, int face, std::shared_ptr player, std::shared_ptr item); Icon *getIcon(int itemAuxValue); int getLevelDataForAuxValue(int auxValue); virtual unsigned int getDescriptionId(int iData = -1); - unsigned int getDescriptionId(shared_ptr instance); - wstring getHoverName(shared_ptr itemInstance); + unsigned int getDescriptionId(std::shared_ptr instance); + wstring getHoverName(std::shared_ptr itemInstance); void registerIcons(IconRegister *iconRegister); }; \ No newline at end of file diff --git a/Minecraft.World/SkullTile.cpp b/Minecraft.World/SkullTile.cpp index 73aef0e1..38c47479 100644 --- a/Minecraft.World/SkullTile.cpp +++ b/Minecraft.World/SkullTile.cpp @@ -25,7 +25,7 @@ bool SkullTile::isCubeShaped() return false; } -void SkullTile::updateShape(LevelSource *level, int x, int y, int z, int forceData , shared_ptr forceEntity) +void SkullTile::updateShape(LevelSource *level, int x, int y, int z, int forceData , std::shared_ptr forceEntity) { int data = level->getData(x, y, z) & PLACEMENT_MASK; @@ -56,15 +56,15 @@ AABB *SkullTile::getAABB(Level *level, int x, int y, int z) return EntityTile::getAABB(level, x, y, z); } -void SkullTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void SkullTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int dir = Mth::floor(by->yRot * 4 / (360) + 2.5) & 3; level->setData(x, y, z, dir); } -shared_ptr SkullTile::newTileEntity(Level *level) +std::shared_ptr SkullTile::newTileEntity(Level *level) { - return shared_ptr(new SkullTileEntity()); + return std::shared_ptr(new SkullTileEntity()); } int SkullTile::cloneTileId(Level *level, int x, int y, int z) @@ -74,8 +74,8 @@ int SkullTile::cloneTileId(Level *level, int x, int y, int z) int SkullTile::cloneTileData(Level *level, int x, int y, int z) { - shared_ptr tileEntity = level->getTileEntity(x, y, z); - shared_ptr skull = dynamic_pointer_cast(tileEntity); + std::shared_ptr tileEntity = level->getTileEntity(x, y, z); + std::shared_ptr skull = dynamic_pointer_cast(tileEntity); if (skull != NULL) { return skull->getSkullType(); @@ -96,7 +96,7 @@ void SkullTile::spawnResources(Level *level, int x, int y, int z, int data, floa // ... because the tile entity is removed prior to spawnResources } -void SkullTile::playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player) +void SkullTile::playerWillDestroy(Level *level, int x, int y, int z, int data, std::shared_ptr player) { // 4J Stu - Not implemented #if 0 @@ -116,8 +116,8 @@ void SkullTile::onRemove(Level *level, int x, int y, int z)//, int id, int data) int data = level->getData(x, y, z); if ((data & NO_DROP_BIT) == 0) { - shared_ptr item = shared_ptr(new ItemInstance(Item::skull_Id, 1, cloneTileData(level, x, y, z))); - shared_ptr entity = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + std::shared_ptr item = std::shared_ptr(new ItemInstance(Item::skull_Id, 1, cloneTileData(level, x, y, z))); + std::shared_ptr entity = dynamic_pointer_cast(level->getTileEntity(x, y, z)); if (entity->getSkullType() == SkullTileEntity::TYPE_CHAR && !entity->getExtraType().empty()) { @@ -135,7 +135,7 @@ int SkullTile::getResource(int data, Random *random, int playerBonusLevel) return Item::skull_Id; } -void SkullTile::checkMobSpawn(Level *level, int x, int y, int z, shared_ptr placedSkull) +void SkullTile::checkMobSpawn(Level *level, int x, int y, int z, std::shared_ptr placedSkull) { // 4J Stu - Don't have Withers yet, so don't need this #if 0 @@ -244,8 +244,8 @@ bool SkullTile::isSkullAt(Level *level, int x, int y, int z, int skullType) { return false; } - shared_ptr te = level->getTileEntity(x, y, z); - shared_ptr skull = dynamic_pointer_cast(te); + std::shared_ptr te = level->getTileEntity(x, y, z); + std::shared_ptr skull = dynamic_pointer_cast(te); if (skull == NULL) { return false; diff --git a/Minecraft.World/SkullTile.h b/Minecraft.World/SkullTile.h index 1d514acd..0d33723f 100644 --- a/Minecraft.World/SkullTile.h +++ b/Minecraft.World/SkullTile.h @@ -21,18 +21,18 @@ public: int getRenderShape(); bool isSolidRender(bool isServerLevel = false); bool isCubeShaped(); - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); AABB *getAABB(Level *level, int x, int y, int z); - void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); - shared_ptr newTileEntity(Level *level); + void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); + std::shared_ptr newTileEntity(Level *level); int cloneTileId(Level *level, int x, int y, int z); int cloneTileData(Level *level, int x, int y, int z); int getSpawnResourcesAuxValue(int data); void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel); - void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player); + void playerWillDestroy(Level *level, int x, int y, int z, int data, std::shared_ptr player); void onRemove(Level *level, int x, int y, int z); //, int id, int data); int getResource(int data, Random *random, int playerBonusLevel); - void checkMobSpawn(Level *level, int x, int y, int z, shared_ptr placedSkull); + void checkMobSpawn(Level *level, int x, int y, int z, std::shared_ptr placedSkull); private: bool isSkullAt(Level *level, int x, int y, int z, int skullType); diff --git a/Minecraft.World/SkullTileEntity.cpp b/Minecraft.World/SkullTileEntity.cpp index ea19b446..e36f4e6a 100644 --- a/Minecraft.World/SkullTileEntity.cpp +++ b/Minecraft.World/SkullTileEntity.cpp @@ -26,11 +26,11 @@ void SkullTileEntity::load(CompoundTag *tag) if (tag->contains(L"ExtraType")) extraType = tag->getString(L"ExtraType"); } -shared_ptr SkullTileEntity::getUpdatePacket() +std::shared_ptr SkullTileEntity::getUpdatePacket() { CompoundTag *tag = new CompoundTag(); save(tag); - return shared_ptr(new TileEntityDataPacket(x, y, z, TileEntityDataPacket::TYPE_SKULL, tag)); + return std::shared_ptr(new TileEntityDataPacket(x, y, z, TileEntityDataPacket::TYPE_SKULL, tag)); } void SkullTileEntity::setSkullType(int skullType, const wstring &extra) @@ -60,11 +60,11 @@ wstring SkullTileEntity::getExtraType() } // 4J Added -shared_ptr SkullTileEntity::clone() +std::shared_ptr SkullTileEntity::clone() { - shared_ptr result = shared_ptr( new SkullTileEntity() ); + std::shared_ptr result = std::shared_ptr( new SkullTileEntity() ); TileEntity::clone(result); - + result->skullType = skullType; result->rotation = rotation; result->extraType = extraType; diff --git a/Minecraft.World/SkullTileEntity.h b/Minecraft.World/SkullTileEntity.h index 4b24457b..db1580fa 100644 --- a/Minecraft.World/SkullTileEntity.h +++ b/Minecraft.World/SkullTileEntity.h @@ -24,7 +24,7 @@ public: void save(CompoundTag *tag); void load(CompoundTag *tag); - shared_ptr getUpdatePacket(); + std::shared_ptr getUpdatePacket(); void setSkullType(int skullType, const wstring &extra); int getSkullType(); int getRotation(); @@ -32,5 +32,5 @@ public: wstring getExtraType(); // 4J Added - virtual shared_ptr clone(); + virtual std::shared_ptr clone(); }; \ No newline at end of file diff --git a/Minecraft.World/Slime.cpp b/Minecraft.World/Slime.cpp index 7941fbe0..47b64482 100644 --- a/Minecraft.World/Slime.cpp +++ b/Minecraft.World/Slime.cpp @@ -116,7 +116,7 @@ void Slime::tick() level->addParticle(getParticleName(), x + xd, bb->y0, z + zd, 0, 0, 0); } - if (doPlayLandSound()) + if (doPlayLandSound()) { level->playSound(shared_from_this(), getSquishSound(), getSoundVolume(), ((random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f) / 0.8f); } @@ -130,15 +130,15 @@ void Slime::tick() decreaseSquish(); } -void Slime::serverAiStep() +void Slime::serverAiStep() { checkDespawn(); - shared_ptr player = level->getNearestAttackablePlayer(shared_from_this(), 16); + std::shared_ptr player = level->getNearestAttackablePlayer(shared_from_this(), 16); if (player != NULL) { lookAt(player, 10, 20); } - if (onGround && jumpDelay-- <= 0) + if (onGround && jumpDelay-- <= 0) { jumpDelay = getJumpDelay(); if (player != NULL) @@ -155,7 +155,7 @@ void Slime::serverAiStep() //targetSquish = 1; xxa = 1 - random->nextFloat() * 2; yya = (float) 1 * getSize(); - } + } else { jumping = false; @@ -176,9 +176,9 @@ int Slime::getJumpDelay() return random->nextInt(20) + 10; } -shared_ptr Slime::createChild() +std::shared_ptr Slime::createChild() { - return shared_ptr( new Slime(level) ); + return std::shared_ptr( new Slime(level) ); } void Slime::remove() @@ -196,7 +196,7 @@ void Slime::remove() { float xd = (i % 2 - 0.5f) * size / 4.0f; float zd = (i / 2 - 0.5f) * size / 4.0f; - shared_ptr slime = createChild(); + std::shared_ptr slime = createChild(); slime->setSize(size / 2); slime->moveTo(x + xd, y + 0.5, z + zd, random->nextFloat() * 360, 0); level->addEntity(slime); @@ -206,7 +206,7 @@ void Slime::remove() Mob::remove(); } -void Slime::playerTouch(shared_ptr player) +void Slime::playerTouch(std::shared_ptr player) { if (isDealsDamage()) { @@ -233,7 +233,7 @@ int Slime::getAttackDamage() return getSize(); } -int Slime::getHurtSound() +int Slime::getHurtSound() { return eSoundType_MOB_SLIME; } @@ -266,7 +266,7 @@ bool Slime::canSpawn() return false; } -float Slime::getSoundVolume() +float Slime::getSoundVolume() { return 0.4f * getSize(); } diff --git a/Minecraft.World/Slime.h b/Minecraft.World/Slime.h index 6fa56056..b9ea741f 100644 --- a/Minecraft.World/Slime.h +++ b/Minecraft.World/Slime.h @@ -27,7 +27,7 @@ private: public: Slime(Level *level); -protected: +protected: virtual void defineSynchedData(); public: @@ -50,11 +50,11 @@ protected: virtual void serverAiStep(); virtual void decreaseSquish(); virtual int getJumpDelay(); - virtual shared_ptr createChild(); + virtual std::shared_ptr createChild(); public: virtual void remove(); - virtual void playerTouch(shared_ptr player); + virtual void playerTouch(std::shared_ptr player); protected: virtual bool isDealsDamage(); diff --git a/Minecraft.World/Slot.cpp b/Minecraft.World/Slot.cpp index 30fd9125..1f7415f2 100644 --- a/Minecraft.World/Slot.cpp +++ b/Minecraft.World/Slot.cpp @@ -5,7 +5,7 @@ #include "net.minecraft.world.item.crafting.h" #include "Slot.h" -Slot::Slot(shared_ptr container, int slot, int x, int y) : container( container ), slot( slot ) +Slot::Slot(std::shared_ptr container, int slot, int x, int y) : container( container ), slot( slot ) { this->x = x; this->y = y; @@ -13,7 +13,7 @@ Slot::Slot(shared_ptr container, int slot, int x, int y) : container( this->index = 0; } -void Slot::onQuickCraft(shared_ptr picked, shared_ptr original) +void Slot::onQuickCraft(std::shared_ptr picked, std::shared_ptr original) { if (picked == NULL || original == NULL) { @@ -31,18 +31,18 @@ void Slot::onQuickCraft(shared_ptr picked, shared_ptr picked, int count) +void Slot::onQuickCraft(std::shared_ptr picked, int count) { } -void Slot::checkTakeAchievements(shared_ptr picked) +void Slot::checkTakeAchievements(std::shared_ptr picked) { } void Slot::swap(Slot *other) { - shared_ptr item1 = container->getItem(slot); - shared_ptr item2 = other->container->getItem(other->slot); + std::shared_ptr item1 = container->getItem(slot); + std::shared_ptr item2 = other->container->getItem(other->slot); if (item1 != NULL && item1->count > other->getMaxStackSize()) { @@ -60,17 +60,17 @@ void Slot::swap(Slot *other) setChanged(); } -void Slot::onTake(shared_ptr player, shared_ptr carried) +void Slot::onTake(std::shared_ptr player, std::shared_ptr carried) { setChanged(); } -bool Slot::mayPlace(shared_ptr item) +bool Slot::mayPlace(std::shared_ptr item) { return true; } -shared_ptr Slot::getItem() +std::shared_ptr Slot::getItem() { return container->getItem(slot); } @@ -80,7 +80,7 @@ bool Slot::hasItem() return getItem() != NULL; } -void Slot::set(shared_ptr item) +void Slot::set(std::shared_ptr item) { container->setItem(slot, item); setChanged(); @@ -101,24 +101,24 @@ Icon *Slot::getNoItemIcon() return NULL; } -shared_ptr Slot::remove(int c) +std::shared_ptr Slot::remove(int c) { return container->removeItem(slot, c); } -bool Slot::isAt(shared_ptr c, int s) +bool Slot::isAt(std::shared_ptr c, int s) { return c == container && s == slot; } -bool Slot::mayPickup(shared_ptr player) +bool Slot::mayPickup(std::shared_ptr player) { return true; } -bool Slot::mayCombine(shared_ptr second) +bool Slot::mayCombine(std::shared_ptr second) { - shared_ptr first = getItem(); + std::shared_ptr first = getItem(); if(first == NULL || second == NULL) return false; @@ -138,12 +138,12 @@ bool Slot::mayCombine(shared_ptr second) return false; } -shared_ptr Slot::combine(shared_ptr item) +std::shared_ptr Slot::combine(std::shared_ptr item) { - shared_ptr result = nullptr; - shared_ptr first = getItem(); + std::shared_ptr result = nullptr; + std::shared_ptr first = getItem(); - shared_ptr craftSlots = shared_ptr( new CraftingContainer(NULL, 2, 2) ); + std::shared_ptr craftSlots = std::shared_ptr( new CraftingContainer(NULL, 2, 2) ); craftSlots->setItem(0, item); craftSlots->setItem(1, first); diff --git a/Minecraft.World/Slot.h b/Minecraft.World/Slot.h index 6289ec0e..13827b5a 100644 --- a/Minecraft.World/Slot.h +++ b/Minecraft.World/Slot.h @@ -8,34 +8,34 @@ private: int slot; public: - shared_ptr container; + std::shared_ptr container; public: int index; int x, y; - Slot(shared_ptr container, int slot, int x, int y); + Slot(std::shared_ptr container, int slot, int x, int y); virtual ~Slot() {} - void onQuickCraft(shared_ptr picked, shared_ptr original); + void onQuickCraft(std::shared_ptr picked, std::shared_ptr original); protected: - virtual void onQuickCraft(shared_ptr picked, int count); - virtual void checkTakeAchievements(shared_ptr picked); + virtual void onQuickCraft(std::shared_ptr picked, int count); + virtual void checkTakeAchievements(std::shared_ptr picked); public: void swap(Slot *other); - virtual void onTake(shared_ptr player, shared_ptr carried); - virtual bool mayPlace(shared_ptr item); - virtual shared_ptr getItem(); + virtual void onTake(std::shared_ptr player, std::shared_ptr carried); + virtual bool mayPlace(std::shared_ptr item); + virtual std::shared_ptr getItem(); virtual bool hasItem(); - virtual void set(shared_ptr item); + virtual void set(std::shared_ptr item); virtual void setChanged(); virtual int getMaxStackSize(); virtual Icon *getNoItemIcon(); - virtual shared_ptr remove(int c); - virtual bool isAt(shared_ptr c, int s); - virtual bool mayPickup(shared_ptr player); - virtual bool mayCombine(shared_ptr item); // 4J Added - virtual shared_ptr combine(shared_ptr item); // 4J Added + virtual std::shared_ptr remove(int c); + virtual bool isAt(std::shared_ptr c, int s); + virtual bool mayPickup(std::shared_ptr player); + virtual bool mayCombine(std::shared_ptr item); // 4J Added + virtual std::shared_ptr combine(std::shared_ptr item); // 4J Added }; \ No newline at end of file diff --git a/Minecraft.World/SmallFireball.cpp b/Minecraft.World/SmallFireball.cpp index a1fa5cb1..be84e82c 100644 --- a/Minecraft.World/SmallFireball.cpp +++ b/Minecraft.World/SmallFireball.cpp @@ -11,7 +11,7 @@ SmallFireball::SmallFireball(Level *level) : Fireball(level) setSize(5 / 16.0f, 5 / 16.0f); } -SmallFireball::SmallFireball(Level *level, shared_ptr mob, double xa, double ya, double za) : Fireball(level, mob, xa, ya, za) +SmallFireball::SmallFireball(Level *level, std::shared_ptr mob, double xa, double ya, double za) : Fireball(level, mob, xa, ya, za) { setSize(5 / 16.0f, 5 / 16.0f); } diff --git a/Minecraft.World/SmallFireball.h b/Minecraft.World/SmallFireball.h index 38ad8efd..3b63e2e0 100644 --- a/Minecraft.World/SmallFireball.h +++ b/Minecraft.World/SmallFireball.h @@ -12,7 +12,7 @@ public: public: SmallFireball(Level *level); - SmallFireball(Level *level, shared_ptr mob, double xa, double ya, double za); + SmallFireball(Level *level, std::shared_ptr mob, double xa, double ya, double za); SmallFireball(Level *level, double x, double y, double z, double xa, double ya, double za); protected: diff --git a/Minecraft.World/SmoothLayer.cpp b/Minecraft.World/SmoothLayer.cpp index e94ae36d..698a9428 100644 --- a/Minecraft.World/SmoothLayer.cpp +++ b/Minecraft.World/SmoothLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -SmoothLayer::SmoothLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) +SmoothLayer::SmoothLayer(int64_t seedMixup, std::shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/SmoothLayer.h b/Minecraft.World/SmoothLayer.h index 14e3d152..a6ac07d8 100644 --- a/Minecraft.World/SmoothLayer.h +++ b/Minecraft.World/SmoothLayer.h @@ -5,7 +5,7 @@ class SmoothLayer : public Layer { public: - SmoothLayer(int64_t seedMixup, shared_ptrparent); + SmoothLayer(int64_t seedMixup, std::shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SmoothStoneBrickTileItem.cpp b/Minecraft.World/SmoothStoneBrickTileItem.cpp index e0326130..7d18bfc0 100644 --- a/Minecraft.World/SmoothStoneBrickTileItem.cpp +++ b/Minecraft.World/SmoothStoneBrickTileItem.cpp @@ -21,7 +21,7 @@ int SmoothStoneBrickTileItem::getLevelDataForAuxValue(int auxValue) return auxValue; } -unsigned int SmoothStoneBrickTileItem::getDescriptionId(shared_ptr instance) +unsigned int SmoothStoneBrickTileItem::getDescriptionId(std::shared_ptr instance) { int auxValue = instance->getAuxValue(); if (auxValue < 0 || auxValue >= SmoothStoneBrickTile::SMOOTH_STONE_BRICK_NAMES_LENGTH) diff --git a/Minecraft.World/SmoothStoneBrickTileItem.h b/Minecraft.World/SmoothStoneBrickTileItem.h index 18b640a3..94f71ec0 100644 --- a/Minecraft.World/SmoothStoneBrickTileItem.h +++ b/Minecraft.World/SmoothStoneBrickTileItem.h @@ -13,5 +13,5 @@ public: virtual Icon *getIcon(int itemAuxValue); virtual int getLevelDataForAuxValue(int auxValue); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); }; \ No newline at end of file diff --git a/Minecraft.World/SmoothZoomLayer.cpp b/Minecraft.World/SmoothZoomLayer.cpp index 2df34a3b..66429658 100644 --- a/Minecraft.World/SmoothZoomLayer.cpp +++ b/Minecraft.World/SmoothZoomLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) +SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, std::shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -50,12 +50,12 @@ intArray SmoothZoomLayer::getArea(int xo, int yo, int w, int h) return result; } -shared_ptrSmoothZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) +std::shared_ptrSmoothZoomLayer::zoom(int64_t seed, std::shared_ptrsup, int count) { - shared_ptrresult = sup; + std::shared_ptrresult = sup; for (int i = 0; i < count; i++) { - result = shared_ptr(new SmoothZoomLayer(seed + i, result)); + result = std::shared_ptr(new SmoothZoomLayer(seed + i, result)); } return result; } \ No newline at end of file diff --git a/Minecraft.World/SmoothZoomLayer.h b/Minecraft.World/SmoothZoomLayer.h index 90cc292e..59d81f40 100644 --- a/Minecraft.World/SmoothZoomLayer.h +++ b/Minecraft.World/SmoothZoomLayer.h @@ -5,8 +5,8 @@ class SmoothZoomLayer : public Layer { public: - SmoothZoomLayer(int64_t seedMixup, shared_ptrparent); + SmoothZoomLayer(int64_t seedMixup, std::shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); - static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); + static std::shared_ptrzoom(int64_t seed, std::shared_ptrsup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/Snowball.cpp b/Minecraft.World/Snowball.cpp index cdcefb1b..37983a68 100644 --- a/Minecraft.World/Snowball.cpp +++ b/Minecraft.World/Snowball.cpp @@ -19,7 +19,7 @@ Snowball::Snowball(Level *level) : Throwable(level) _init(); } -Snowball::Snowball(Level *level, shared_ptr mob) : Throwable(level,mob) +Snowball::Snowball(Level *level, std::shared_ptr mob) : Throwable(level,mob) { _init(); } diff --git a/Minecraft.World/Snowball.h b/Minecraft.World/Snowball.h index 82971726..d3ccfa1d 100644 --- a/Minecraft.World/Snowball.h +++ b/Minecraft.World/Snowball.h @@ -16,7 +16,7 @@ private: public: Snowball(Level *level); - Snowball(Level *level, shared_ptr mob); + Snowball(Level *level, std::shared_ptr mob); Snowball(Level *level, double x, double y, double z); protected: diff --git a/Minecraft.World/SnowballItem.cpp b/Minecraft.World/SnowballItem.cpp index 41dd2b7c..706cd75d 100644 --- a/Minecraft.World/SnowballItem.cpp +++ b/Minecraft.World/SnowballItem.cpp @@ -11,13 +11,13 @@ SnowballItem::SnowballItem(int id) : Item(id) this->maxStackSize = 16; } -shared_ptr SnowballItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr SnowballItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { if (!player->abilities.instabuild) { instance->count--; } - level->playSound((shared_ptr ) player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f)); - if (!level->isClientSide) level->addEntity( shared_ptr( new Snowball(level, player) ) ); + level->playSound((std::shared_ptr ) player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f)); + if (!level->isClientSide) level->addEntity( std::shared_ptr( new Snowball(level, player) ) ); return instance; } \ No newline at end of file diff --git a/Minecraft.World/SnowballItem.h b/Minecraft.World/SnowballItem.h index bf2d20cb..97680968 100644 --- a/Minecraft.World/SnowballItem.h +++ b/Minecraft.World/SnowballItem.h @@ -8,5 +8,5 @@ class SnowballItem : public Item public: SnowballItem(int id); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/Spider.cpp b/Minecraft.World/Spider.cpp index ba58ce54..a80543e4 100644 --- a/Minecraft.World/Spider.cpp +++ b/Minecraft.World/Spider.cpp @@ -61,13 +61,13 @@ bool Spider::makeStepSound() return false; } -shared_ptr Spider::findAttackTarget() +std::shared_ptr Spider::findAttackTarget() { #ifndef _FINAL_BUILD #ifdef _DEBUG_MENUS_ENABLED if(app.GetMobsDontAttackEnabled()) { - return shared_ptr(); + return std::shared_ptr(); } #endif #endif @@ -78,7 +78,7 @@ shared_ptr Spider::findAttackTarget() double maxDist = 16; return level->getNearestAttackablePlayer(shared_from_this(), maxDist); } - return shared_ptr(); + return std::shared_ptr(); } int Spider::getAmbientSound() @@ -96,7 +96,7 @@ int Spider::getDeathSound() return eSoundType_MOB_SPIDER_DEATH; } -void Spider::checkHurtTarget(shared_ptr target, float d) +void Spider::checkHurtTarget(std::shared_ptr target, float d) { float br = getBrightness(1); if (br > 0.5f && random->nextInt(100) == 0) @@ -107,7 +107,7 @@ void Spider::checkHurtTarget(shared_ptr target, float d) if (d > 2 && d < 6 && random->nextInt(10) == 0) { - if (onGround) + if (onGround) { double xdd = target->x - x; double zdd = target->z - z; @@ -116,7 +116,7 @@ void Spider::checkHurtTarget(shared_ptr target, float d) zd = (zdd / dd * 0.5f) * 0.8f + zd * 0.2f; yd = 0.4f; } - } + } else { Monster::checkHurtTarget(target, d); @@ -143,11 +143,11 @@ void Spider::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) * to climb walls. */ -bool Spider::onLadder() +bool Spider::onLadder() { return isClimbing(); } - + void Spider::makeStuckInWeb() { // do nothing - spiders don't get stuck in web diff --git a/Minecraft.World/Spider.h b/Minecraft.World/Spider.h index f0257d6c..e73555cc 100644 --- a/Minecraft.World/Spider.h +++ b/Minecraft.World/Spider.h @@ -25,17 +25,17 @@ public: protected: virtual bool makeStepSound(); - virtual shared_ptr findAttackTarget(); + virtual std::shared_ptr findAttackTarget(); virtual int getAmbientSound(); virtual int getHurtSound(); virtual int getDeathSound(); - virtual void checkHurtTarget(shared_ptr target, float d); + virtual void checkHurtTarget(std::shared_ptr target, float d); virtual int getDeathLoot(); virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel); public: virtual bool onLadder(); - + virtual void makeStuckInWeb(); virtual float getModelScale(); virtual MobType getMobType(); diff --git a/Minecraft.World/SpikeFeature.cpp b/Minecraft.World/SpikeFeature.cpp index e8886d00..cb24e457 100644 --- a/Minecraft.World/SpikeFeature.cpp +++ b/Minecraft.World/SpikeFeature.cpp @@ -26,7 +26,7 @@ bool SpikeFeature::place(Level *level, Random *random, int x, int y, int z) int zd = zz - z; if (xd * xd + zd * zd <= r * r + 1) { - if (level->getTile(xx, y - 1, zz) != tile) + if (level->getTile(xx, y - 1, zz) != tile) { return false; } @@ -50,7 +50,7 @@ bool SpikeFeature::place(Level *level, Random *random, int x, int y, int z) } else break; } - shared_ptr enderCrystal = shared_ptr(new EnderCrystal(level)); + std::shared_ptr enderCrystal = std::shared_ptr(new EnderCrystal(level)); enderCrystal->moveTo(x + 0.5f, y + hh, z + 0.5f, random->nextFloat() * 360, 0); level->addEntity(enderCrystal); level->setTile(x, y + hh, z, Tile::unbreakable_Id); @@ -111,8 +111,8 @@ bool SpikeFeature::placeWithIndex(Level *level, Random *random, int x, int y, in } } } - } - else + } + else { app.DebugPrintf("Breaking out of spike feature\n"); break; @@ -145,8 +145,8 @@ bool SpikeFeature::placeWithIndex(Level *level, Random *random, int x, int y, in } } } - } - else + } + else { app.DebugPrintf("Breaking out of spike feature\n"); break; @@ -155,7 +155,7 @@ bool SpikeFeature::placeWithIndex(Level *level, Random *random, int x, int y, in // and cap off the top int yy = y + hh + 3; - + if (yy < Level::genDepth) { for (int xx = x - 2; xx <= x + 2; xx++) @@ -168,7 +168,7 @@ bool SpikeFeature::placeWithIndex(Level *level, Random *random, int x, int y, in } } - shared_ptr enderCrystal = shared_ptr(new EnderCrystal(level)); + std::shared_ptr enderCrystal = std::shared_ptr(new EnderCrystal(level)); enderCrystal->moveTo(x + 0.5f, y + hh, z + 0.5f, random->nextFloat() * 360, 0); level->addEntity(enderCrystal); placeBlock(level, x, y + hh, z, Tile::unbreakable_Id, 0); diff --git a/Minecraft.World/Squid.cpp b/Minecraft.World/Squid.cpp index 3e36777c..06d0318d 100644 --- a/Minecraft.World/Squid.cpp +++ b/Minecraft.World/Squid.cpp @@ -47,27 +47,27 @@ int Squid::getMaxHealth() return 10; } -int Squid::getAmbientSound() +int Squid::getAmbientSound() { return -1; } -int Squid::getHurtSound() +int Squid::getHurtSound() { return -1; } -int Squid::getDeathSound() +int Squid::getDeathSound() { return -1; } -float Squid::getSoundVolume() +float Squid::getSoundVolume() { return 0.4f; } -int Squid::getDeathLoot() +int Squid::getDeathLoot() { return 0; } @@ -75,18 +75,18 @@ int Squid::getDeathLoot() void Squid::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) { int count = random->nextInt(3 + playerBonusLevel) + 1; - for (int i = 0; i < count; i++) + for (int i = 0; i < count; i++) { - spawnAtLocation(shared_ptr( new ItemInstance(Item::dye_powder, 1, DyePowderItem::BLACK) ), 0.0f); + spawnAtLocation(std::shared_ptr( new ItemInstance(Item::dye_powder, 1, DyePowderItem::BLACK) ), 0.0f); } } -bool Squid::isInWater() +bool Squid::isInWater() { return level->checkAndHandleWater(bb->grow(0, -0.6f, 0), Material::water, shared_from_this() ); } -void Squid::aiStep() +void Squid::aiStep() { WaterAnimal::aiStep(); @@ -97,37 +97,37 @@ void Squid::aiStep() oldTentacleAngle = tentacleAngle; tentacleMovement += tentacleSpeed; - if (tentacleMovement > (float) PI * 2.0f) + if (tentacleMovement > (float) PI * 2.0f) { tentacleMovement -= (float) PI * 2.0f; if (random->nextInt(10) == 0) tentacleSpeed = 1 / (random->nextFloat() + 1) * 0.2f; } - if (isInWater()) + if (isInWater()) { - if (tentacleMovement < PI) + if (tentacleMovement < PI) { float tentacleScale = tentacleMovement / PI; tentacleAngle = Mth::sin(tentacleScale * tentacleScale * PI) * PI * 0.25f; - if (tentacleScale > .75) + if (tentacleScale > .75) { speed = 1.0f; rotateSpeed = 1.0f; - } - else + } + else { rotateSpeed = rotateSpeed * 0.8f; } - } - else + } + else { tentacleAngle = 0.0f; speed = speed * 0.9f; rotateSpeed = rotateSpeed * 0.99f; } - if (!level->isClientSide) + if (!level->isClientSide) { xd = tx * speed; yd = ty * speed; @@ -141,11 +141,11 @@ void Squid::aiStep() zBodyRot = zBodyRot + (float) PI * rotateSpeed * 1.5f; xBodyRot += ((-(float) atan2(horizontalMovement, this->yd) * 180 / PI) - xBodyRot) * 0.1f; } - else + else { tentacleAngle = Mth::abs(Mth::sin(tentacleMovement)) * PI * 0.25f; - if (!level->isClientSide) + if (!level->isClientSide) { // unable to move, apply gravity xd = 0.0f; @@ -173,7 +173,7 @@ void Squid::serverAiStep() { tx = ty = tz = 0; } - else if (random->nextInt(50) == 0 || !wasInWater || (tx == 0 && ty == 0 && tz == 0)) + else if (random->nextInt(50) == 0 || !wasInWater || (tx == 0 && ty == 0 && tz == 0)) { float angle = random->nextFloat() * PI * 2.0f; tx = Mth::cos(angle) * 0.2f; diff --git a/Minecraft.World/StairTile.cpp b/Minecraft.World/StairTile.cpp index 7a80e9ff..ca617494 100644 --- a/Minecraft.World/StairTile.cpp +++ b/Minecraft.World/StairTile.cpp @@ -22,7 +22,7 @@ StairTile::StairTile(int id, Tile *base,int basedata) : Tile(id, base->material, setLightBlock(255); } -void StairTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void StairTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { if (isClipping) { @@ -309,7 +309,7 @@ bool StairTile::setInnerPieceShape(LevelSource *level, int x, int y, int z) return hasInnerPiece; } -void StairTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void StairTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { setBaseShape(level, x, y, z); Tile::addAABBs(level, x, y, z, box, boxes, source); @@ -380,7 +380,7 @@ void StairTile::animateTick(Level *level, int x, int y, int z, Random *random) base->animateTick(level, x, y, z, random); } -void StairTile::attack(Level *level, int x, int y, int z, shared_ptr player) +void StairTile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { base->attack(level, x, y, z, player); } @@ -401,7 +401,7 @@ float StairTile::getBrightness(LevelSource *level, int x, int y, int z) return base->getBrightness(level, x, y, z); } -float StairTile::getExplosionResistance(shared_ptr source) +float StairTile::getExplosionResistance(std::shared_ptr source) { return base->getExplosionResistance(source); } @@ -426,7 +426,7 @@ AABB *StairTile::getTileAABB(Level *level, int x, int y, int z) return base->getTileAABB(level, x, y, z); } -void StairTile::handleEntityInside(Level *level, int x, int y, int z, shared_ptr e, Vec3 *current) +void StairTile::handleEntityInside(Level *level, int x, int y, int z, std::shared_ptr e, Vec3 *current) { base->handleEntityInside(level, x, y, z, e, current); } @@ -462,7 +462,7 @@ void StairTile::prepareRender(Level *level, int x, int y, int z) base->prepareRender(level, x, y, z); } -void StairTile::stepOn(Level *level, int x, int y, int z, shared_ptr entity) +void StairTile::stepOn(Level *level, int x, int y, int z, std::shared_ptr entity) { base->stepOn(level, x, y, z, entity); } @@ -479,7 +479,7 @@ void StairTile::tick(Level *level, int x, int y, int z, Random *random) // return true; //} -bool StairTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool StairTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if (soundOnly) return false; return base->use(level, x, y, z, player, 0, 0, 0, 0); @@ -490,7 +490,7 @@ void StairTile::wasExploded(Level *level, int x, int y, int z) base->wasExploded(level, x, y, z); } -void StairTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void StairTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int dir = ( Mth::floor(by->yRot * 4 / (360) + 0.5) ) & 3; int usd = level->getData(x, y, z) & UPSIDEDOWN_BIT; diff --git a/Minecraft.World/StairTile.h b/Minecraft.World/StairTile.h index d4797f04..33c5a30e 100644 --- a/Minecraft.World/StairTile.h +++ b/Minecraft.World/StairTile.h @@ -32,7 +32,7 @@ protected: StairTile(int id, Tile *base, int basedata); public: - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param bool isSolidRender(bool isServerLevel = false); bool isCubeShaped(); @@ -49,7 +49,7 @@ public: bool setStepShape(LevelSource *level, int x, int y, int z); bool setInnerPieceShape(LevelSource *level, int x, int y, int z); - void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); /** DELEGATES: **/ @@ -58,14 +58,14 @@ public: void animateTick(Level *level, int x, int y, int z, Random *random); - void attack(Level *level, int x, int y, int z, shared_ptr player); + void attack(Level *level, int x, int y, int z, std::shared_ptr player); void destroy(Level *level, int x, int y, int z, int data); int getLightColor(LevelSource *level, int x, int y, int z, int tileId = -1); float getBrightness(LevelSource *level, int x, int y, int z); - float getExplosionResistance(shared_ptr source); + float getExplosionResistance(std::shared_ptr source); int getRenderLayer(); @@ -75,7 +75,7 @@ public: AABB *getTileAABB(Level *level, int x, int y, int z); - void handleEntityInside(Level *level, int x, int y, int z, shared_ptr e, Vec3 *current); + void handleEntityInside(Level *level, int x, int y, int z, std::shared_ptr e, Vec3 *current); bool mayPick(); @@ -89,15 +89,15 @@ public: void prepareRender(Level *level, int x, int y, int z); - void stepOn(Level *level, int x, int y, int z, shared_ptr entity); + void stepOn(Level *level, int x, int y, int z, std::shared_ptr entity); void tick(Level *level, int x, int y, int z, Random *random); - bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param void wasExploded(Level *level, int x, int y, int z); - void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue); HitResult *clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b); diff --git a/Minecraft.World/Stat.h b/Minecraft.World/Stat.h index 3c2ab071..c9751d1c 100644 --- a/Minecraft.World/Stat.h +++ b/Minecraft.World/Stat.h @@ -57,5 +57,5 @@ public: public: // 4J-JEV, for Durango stats - virtual void handleParamBlob(shared_ptr plr, byteArray param) { app.DebugPrintf("'Stat.h', Unhandled AwardStat blob.\n"); return; } + virtual void handleParamBlob(std::shared_ptr plr, byteArray param) { app.DebugPrintf("'Stat.h', Unhandled AwardStat blob.\n"); return; } }; diff --git a/Minecraft.World/StemTile.cpp b/Minecraft.World/StemTile.cpp index 15c412eb..7ddbacef 100644 --- a/Minecraft.World/StemTile.cpp +++ b/Minecraft.World/StemTile.cpp @@ -145,7 +145,7 @@ void StemTile::updateDefaultShape() this->setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, 0.25f, 0.5f + ss); } -void StemTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void StemTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { ThreadStorage *tls = (ThreadStorage *)TlsGetValue(Tile::tlsIdxShape); tls->yy1 = (level->getData(x, y, z) * 2 + 2) / 16.0f; @@ -192,7 +192,7 @@ void StemTile::spawnResources(Level *level, int x, int y, int z, int data, float float xo = level->random->nextFloat() * s + (1 - s) * 0.5f; float yo = level->random->nextFloat() * s + (1 - s) * 0.5f; float zo = level->random->nextFloat() * s + (1 - s) * 0.5f; - shared_ptr item = shared_ptr(new ItemEntity(level, x + xo, y + yo, z + zo, shared_ptr(new ItemInstance(seed)))); + std::shared_ptr item = std::shared_ptr(new ItemEntity(level, x + xo, y + yo, z + zo, std::shared_ptr(new ItemInstance(seed)))); item->throwTime = 10; level->addEntity(item); } diff --git a/Minecraft.World/StemTile.h b/Minecraft.World/StemTile.h index ac4fc40c..2f726c17 100644 --- a/Minecraft.World/StemTile.h +++ b/Minecraft.World/StemTile.h @@ -29,7 +29,7 @@ public: virtual int getColor(LevelSource *level, int x, int y, int z); virtual void updateDefaultShape(); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual int getRenderShape(); int getConnectDir(LevelSource *level, int x, int y, int z); diff --git a/Minecraft.World/StoneMonsterTile.cpp b/Minecraft.World/StoneMonsterTile.cpp index d3d6a846..ad5982f8 100644 --- a/Minecraft.World/StoneMonsterTile.cpp +++ b/Minecraft.World/StoneMonsterTile.cpp @@ -41,7 +41,7 @@ void StoneMonsterTile::destroy(Level *level, int x, int y, int z, int data) // Also limit the amount of silverfish specifically if(level->countInstanceOf( eTYPE_SILVERFISH, true) < 15 ) { - shared_ptr silverfish = shared_ptr(new Silverfish(level)); + std::shared_ptr silverfish = std::shared_ptr(new Silverfish(level)); silverfish->moveTo(x + .5, y, z + .5, 0, 0); level->addEntity(silverfish); @@ -88,7 +88,7 @@ Tile *StoneMonsterTile::getHostBlockForData(int data) } } -shared_ptr StoneMonsterTile::getSilkTouchItemInstance(int data) +std::shared_ptr StoneMonsterTile::getSilkTouchItemInstance(int data) { Tile *tile = Tile::rock; if (data == HOST_COBBLE) @@ -99,7 +99,7 @@ shared_ptr StoneMonsterTile::getSilkTouchItemInstance(int data) { tile = Tile::stoneBrickSmooth; } - return shared_ptr(new ItemInstance(tile)); + return std::shared_ptr(new ItemInstance(tile)); } int StoneMonsterTile::cloneTileData(Level *level, int x, int y, int z) diff --git a/Minecraft.World/StoneMonsterTile.h b/Minecraft.World/StoneMonsterTile.h index 9c0b58fd..96063a14 100644 --- a/Minecraft.World/StoneMonsterTile.h +++ b/Minecraft.World/StoneMonsterTile.h @@ -31,7 +31,7 @@ public: virtual unsigned int getDescriptionId(int iData = -1); protected: - virtual shared_ptr getSilkTouchItemInstance(int data); + virtual std::shared_ptr getSilkTouchItemInstance(int data); public: int cloneTileData(Level *level, int x, int y, int z); diff --git a/Minecraft.World/StoneMonsterTileItem.cpp b/Minecraft.World/StoneMonsterTileItem.cpp index 4ecdf627..fd6f1ee4 100644 --- a/Minecraft.World/StoneMonsterTileItem.cpp +++ b/Minecraft.World/StoneMonsterTileItem.cpp @@ -19,7 +19,7 @@ Icon *StoneMonsterTileItem::getIcon(int itemAuxValue) return Tile::monsterStoneEgg->getTexture(0, itemAuxValue); } -unsigned int StoneMonsterTileItem::getDescriptionId(shared_ptr instance) +unsigned int StoneMonsterTileItem::getDescriptionId(std::shared_ptr instance) { int auxValue = instance->getAuxValue(); if (auxValue < 0 || auxValue >= StoneMonsterTile::STONE_MONSTER_NAMES_LENGTH) diff --git a/Minecraft.World/StoneMonsterTileItem.h b/Minecraft.World/StoneMonsterTileItem.h index bb12d2e1..6a4ec228 100644 --- a/Minecraft.World/StoneMonsterTileItem.h +++ b/Minecraft.World/StoneMonsterTileItem.h @@ -12,5 +12,5 @@ public: virtual int getLevelDataForAuxValue(int auxValue); virtual Icon *getIcon(int itemAuxValue); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); }; \ No newline at end of file diff --git a/Minecraft.World/StoneSlabTile.cpp b/Minecraft.World/StoneSlabTile.cpp index 5c8d8b07..1a51ef11 100644 --- a/Minecraft.World/StoneSlabTile.cpp +++ b/Minecraft.World/StoneSlabTile.cpp @@ -32,7 +32,7 @@ Icon *StoneSlabTile::getTexture(int face, int data) case STONE_SLAB: if (face == Facing::UP || face == Facing::DOWN) return icon; return iconSide; - break; + break; case SAND_SLAB: return Tile::sandStone->getTexture(face); case WOOD_SLAB: @@ -48,7 +48,7 @@ Icon *StoneSlabTile::getTexture(int face, int data) case QUARTZ_SLAB: return Tile::quartzBlock->getTexture(face); } - + return icon; } @@ -69,16 +69,16 @@ unsigned int StoneSlabTile::getDescriptionId(int iData /*= -1*/) return StoneSlabTile::SLAB_NAMES[iData]; } -int StoneSlabTile::getAuxName(int auxValue) +int StoneSlabTile::getAuxName(int auxValue) { - if (auxValue < 0 || auxValue >= SLAB_NAMES_LENGTH) + if (auxValue < 0 || auxValue >= SLAB_NAMES_LENGTH) { auxValue = 0; } return SLAB_NAMES[auxValue];//super.getDescriptionId() + "." + SLAB_NAMES[auxValue]; } -shared_ptr StoneSlabTile::getSilkTouchItemInstance(int data) +std::shared_ptr StoneSlabTile::getSilkTouchItemInstance(int data) { - return shared_ptr(new ItemInstance(Tile::stoneSlabHalf_Id, 2, data & TYPE_MASK)); + return std::shared_ptr(new ItemInstance(Tile::stoneSlabHalf_Id, 2, data & TYPE_MASK)); } diff --git a/Minecraft.World/StoneSlabTile.h b/Minecraft.World/StoneSlabTile.h index 4380b04c..42972c40 100644 --- a/Minecraft.World/StoneSlabTile.h +++ b/Minecraft.World/StoneSlabTile.h @@ -35,5 +35,5 @@ public: virtual unsigned int getDescriptionId(int iData = -1); virtual int getAuxName(int auxValue); protected: - virtual shared_ptr getSilkTouchItemInstance(int data); + virtual std::shared_ptr getSilkTouchItemInstance(int data); }; \ No newline at end of file diff --git a/Minecraft.World/StoneSlabTileItem.cpp b/Minecraft.World/StoneSlabTileItem.cpp index ea636f65..8113600e 100644 --- a/Minecraft.World/StoneSlabTileItem.cpp +++ b/Minecraft.World/StoneSlabTileItem.cpp @@ -17,24 +17,24 @@ StoneSlabTileItem::StoneSlabTileItem(int id, HalfSlabTile *halfTile, HalfSlabTil setStackedByData(true); } -Icon *StoneSlabTileItem::getIcon(int itemAuxValue) +Icon *StoneSlabTileItem::getIcon(int itemAuxValue) { return Tile::tiles[id]->getTexture(2, itemAuxValue); } -int StoneSlabTileItem::getLevelDataForAuxValue(int auxValue) +int StoneSlabTileItem::getLevelDataForAuxValue(int auxValue) { return auxValue; } -unsigned int StoneSlabTileItem::getDescriptionId(shared_ptr instance) +unsigned int StoneSlabTileItem::getDescriptionId(std::shared_ptr instance) { return halfTile->getAuxName(instance->getAuxValue()); } -bool StoneSlabTileItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool StoneSlabTileItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { - if (isFull) + if (isFull) { return TileItem::useOn(instance, player, level, x, y, z, face, clickX, clickY, clickZ, bTestUseOnOnly); } @@ -47,14 +47,14 @@ bool StoneSlabTileItem::useOn(shared_ptr instance, shared_ptrid && slabType == instance->getAuxValue()) + if (((face == Facing::UP && !isUpper) || (face == Facing::DOWN && isUpper)) && currentTile == halfTile->id && slabType == instance->getAuxValue()) { if(bTestUseOnOnly) { return true; } - if (level->isUnobstructed(fullTile->getAABB(level, x, y, z)) && level->setTileAndData(x, y, z, fullTile->id, slabType)) + if (level->isUnobstructed(fullTile->getAABB(level, x, y, z)) && level->setTileAndData(x, y, z, fullTile->id, slabType)) { // level.playSound(x + 0.5f, y + 0.5f, z + 0.5f, fullTile.soundType.getPlaceSound(), (fullTile.soundType.getVolume() + 1) / 2, fullTile.soundType.getPitch() * 0.8f); // instance.count--; @@ -62,19 +62,19 @@ bool StoneSlabTileItem::useOn(shared_ptr instance, shared_ptrcount--; } return true; - } - else if (tryConvertTargetTile(instance, player, level, x, y, z, face, bTestUseOnOnly)) + } + else if (tryConvertTargetTile(instance, player, level, x, y, z, face, bTestUseOnOnly)) { return true; - } - else + } + else { return TileItem::useOn(instance, player, level, x, y, z, face, clickX, clickY, clickZ, bTestUseOnOnly); } } -bool StoneSlabTileItem::mayPlace(Level *level, int x, int y, int z, int face,shared_ptr player, shared_ptr item) +bool StoneSlabTileItem::mayPlace(Level *level, int x, int y, int z, int face,std::shared_ptr player, std::shared_ptr item) { int ox = x, oy = y, oz = z; @@ -83,7 +83,7 @@ bool StoneSlabTileItem::mayPlace(Level *level, int x, int y, int z, int face,sha int slabType = currentData & HalfSlabTile::TYPE_MASK; boolean isUpper = (currentData & HalfSlabTile::TOP_SLOT_BIT) != 0; - if (((face == Facing::UP && !isUpper) || (face == Facing::DOWN && isUpper)) && currentTile == halfTile->id && slabType == item->getAuxValue()) + if (((face == Facing::UP && !isUpper) || (face == Facing::DOWN && isUpper)) && currentTile == halfTile->id && slabType == item->getAuxValue()) { return true; } @@ -100,7 +100,7 @@ bool StoneSlabTileItem::mayPlace(Level *level, int x, int y, int z, int face,sha slabType = currentData & HalfSlabTile::TYPE_MASK; isUpper = (currentData & HalfSlabTile::TOP_SLOT_BIT) != 0; - if (currentTile == halfTile->id && slabType == item->getAuxValue()) + if (currentTile == halfTile->id && slabType == item->getAuxValue()) { return true; } @@ -108,7 +108,7 @@ bool StoneSlabTileItem::mayPlace(Level *level, int x, int y, int z, int face,sha return TileItem::mayPlace(level, ox, oy, oz, face, player, item); } -bool StoneSlabTileItem::tryConvertTargetTile(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly) +bool StoneSlabTileItem::tryConvertTargetTile(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly) { if (face == 0) y--; if (face == 1) y++; @@ -121,17 +121,17 @@ bool StoneSlabTileItem::tryConvertTargetTile(shared_ptr instance, int currentData = level->getData(x, y, z); int slabType = currentData & HalfSlabTile::TYPE_MASK; - if (currentTile == halfTile->id && slabType == instance->getAuxValue()) + if (currentTile == halfTile->id && slabType == instance->getAuxValue()) { if(bTestUseOnOnly) { return true; - } - if (level->isUnobstructed(fullTile->getAABB(level, x, y, z)) && level->setTileAndData(x, y, z, fullTile->id, slabType)) + } + if (level->isUnobstructed(fullTile->getAABB(level, x, y, z)) && level->setTileAndData(x, y, z, fullTile->id, slabType)) { //level.playSound(x + 0.5f, y + 0.5f, z + 0.5f, fullTile.soundType.getPlaceSound(), (fullTile.soundType.getVolume() + 1) / 2, fullTile.soundType.getPitch() * 0.8f); level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, fullTile->soundType->getStepSound(), (fullTile->soundType->getVolume() + 1) / 2, fullTile->soundType->getPitch() * 0.8f); - instance->count--; + instance->count--; } return true; } diff --git a/Minecraft.World/StoneSlabTileItem.h b/Minecraft.World/StoneSlabTileItem.h index 417dcba0..a54c7802 100644 --- a/Minecraft.World/StoneSlabTileItem.h +++ b/Minecraft.World/StoneSlabTileItem.h @@ -15,10 +15,10 @@ public: virtual Icon *getIcon(int itemAuxValue); virtual int getLevelDataForAuxValue(int auxValue); - virtual unsigned int getDescriptionId(shared_ptr instance); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual unsigned int getDescriptionId(std::shared_ptr instance); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - virtual bool mayPlace(Level *level, int x, int y, int z, int face,shared_ptr player, shared_ptr item); + virtual bool mayPlace(Level *level, int x, int y, int z, int face,std::shared_ptr player, std::shared_ptr item); private: - bool tryConvertTargetTile(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly); + bool tryConvertTargetTile(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, bool bTestUseOnOnly); }; \ No newline at end of file diff --git a/Minecraft.World/StrongholdPieces.cpp b/Minecraft.World/StrongholdPieces.cpp index 0168b2ba..05ccec39 100644 --- a/Minecraft.World/StrongholdPieces.cpp +++ b/Minecraft.World/StrongholdPieces.cpp @@ -352,13 +352,13 @@ StructurePiece *StrongholdPieces::StrongholdPiece::generateSmallDoorChildRight(S } return NULL; } - + bool StrongholdPieces::StrongholdPiece::isOkBox(BoundingBox *box, StartPiece *startRoom) { //return box != NULL && box->y0 > LOWEST_Y_POSITION; - + bool bIsOk = false; - + if(box != NULL) { if( box->y0 > LOWEST_Y_POSITION ) bIsOk = true; @@ -393,7 +393,7 @@ BoundingBox *StrongholdPieces::FillerCorridor::findPieceBox(listfront()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -582,7 +582,7 @@ StrongholdPieces::Straight *StrongholdPieces::Straight::createPiece(listfront()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -625,7 +625,7 @@ bool StrongholdPieces::Straight::postProcess(Level *level, Random *random, Bound return true; } -WeighedTreasure *StrongholdPieces::ChestCorridor::treasureItems[TREASURE_ITEMS_COUNT] = +WeighedTreasure *StrongholdPieces::ChestCorridor::treasureItems[TREASURE_ITEMS_COUNT] = { new WeighedTreasure(Item::enderPearl_Id, 0, 1, 1, 10), new WeighedTreasure(Item::diamond_Id, 0, 1, 3, 3), @@ -658,7 +658,7 @@ StrongholdPieces::ChestCorridor *StrongholdPieces::ChestCorridor::createPiece(li { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -1, -1, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((StrongholdPieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -724,7 +724,7 @@ StrongholdPieces::StraightStairsDown *StrongholdPieces::StraightStairsDown::crea { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -1, 4 - height, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((StrongholdPieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -790,7 +790,7 @@ StrongholdPieces::LeftTurn *StrongholdPieces::LeftTurn::createPiece(listfront()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -870,7 +870,7 @@ bool StrongholdPieces::RightTurn::postProcess(Level *level, Random *random, Boun StrongholdPieces::RoomCrossing::RoomCrossing(int genDepth, Random *random, BoundingBox *stairsBox, int direction) : StrongholdPiece(genDepth), entryDoor(randomSmallDoor(random)), type(random->nextInt(5)) { orientation = direction; - boundingBox = stairsBox; + boundingBox = stairsBox; } void StrongholdPieces::RoomCrossing::addChildren(StructurePiece *startPiece, list *pieces, Random *random) @@ -884,7 +884,7 @@ StrongholdPieces::RoomCrossing *StrongholdPieces::RoomCrossing::createPiece(list { BoundingBox *box = BoundingBox::orientBox(footX, footY, footZ, -4, -1, 0, width, height, depth, direction); - StartPiece *startPiece = NULL; + StartPiece *startPiece = NULL; if(pieces != NULL) startPiece = ((StrongholdPieces::StartPiece *) pieces->front()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -896,7 +896,7 @@ StrongholdPieces::RoomCrossing *StrongholdPieces::RoomCrossing::createPiece(list return new RoomCrossing(genDepth, random, box, direction); } -WeighedTreasure *StrongholdPieces::RoomCrossing::smallTreasureItems[SMALL_TREASURE_ITEMS_COUNT] = +WeighedTreasure *StrongholdPieces::RoomCrossing::smallTreasureItems[SMALL_TREASURE_ITEMS_COUNT] = { new WeighedTreasure(Item::ironIngot_Id, 0, 1, 5, 10), new WeighedTreasure(Item::goldIngot_Id, 0, 1, 3, 5), @@ -1030,7 +1030,7 @@ StrongholdPieces::PrisonHall *StrongholdPieces::PrisonHall::createPiece(listfront()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1091,7 +1091,7 @@ StrongholdPieces::Library *StrongholdPieces::Library::createPiece(listfront()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1110,7 +1110,7 @@ StrongholdPieces::Library *StrongholdPieces::Library::createPiece(listfront()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1358,7 +1358,7 @@ StrongholdPieces::PortalRoom *StrongholdPieces::PortalRoom::createPiece(listfront()); if (!isOkBox(box, startPiece) || StructurePiece::findCollisionPiece(pieces, box) != NULL) @@ -1443,7 +1443,7 @@ bool StrongholdPieces::PortalRoom::postProcess(Level *level, Random *random, Bou } // 4J-PB - Removed for Christmas update since we don't have The End - + // 4J-PB - not going to remove it, so that maps generated will have it in, but it can't be activated placeBlock(level, Tile::endPortalFrameTile_Id, north + ((random->nextFloat() > 0.9f) ? TheEndPortalFrameTile::EYE_BIT : 0), 4, 3, 8, chunkBB); placeBlock(level, Tile::endPortalFrameTile_Id, north + ((random->nextFloat() > 0.9f) ? TheEndPortalFrameTile::EYE_BIT : 0), 5, 3, 8, chunkBB); @@ -1457,7 +1457,7 @@ bool StrongholdPieces::PortalRoom::postProcess(Level *level, Random *random, Bou placeBlock(level, Tile::endPortalFrameTile_Id, west + ((random->nextFloat() > 0.9f) ? TheEndPortalFrameTile::EYE_BIT : 0), 7, 3, 9, chunkBB); placeBlock(level, Tile::endPortalFrameTile_Id, west + ((random->nextFloat() > 0.9f) ? TheEndPortalFrameTile::EYE_BIT : 0), 7, 3, 10, chunkBB); placeBlock(level, Tile::endPortalFrameTile_Id, west + ((random->nextFloat() > 0.9f) ? TheEndPortalFrameTile::EYE_BIT : 0), 7, 3, 11, chunkBB); - + if (!hasPlacedMobSpawner) { @@ -1466,14 +1466,14 @@ bool StrongholdPieces::PortalRoom::postProcess(Level *level, Random *random, Bou if (chunkBB->isInside(x, y, z)) { // 4J Stu - The mob spawner location is close enough for the map icon display, and this ensures that we only need to set the position once - app.AddTerrainFeaturePosition(eTerrainFeature_StrongholdEndPortal,x,z); + app.AddTerrainFeaturePosition(eTerrainFeature_StrongholdEndPortal,x,z); level->getLevelData()->setXStrongholdEndPortal(x); level->getLevelData()->setZStrongholdEndPortal(z); level->getLevelData()->setHasStrongholdEndPortal(); hasPlacedMobSpawner = true; level->setTile(x, y, z, Tile::mobSpawner_Id); - shared_ptr entity = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + std::shared_ptr entity = dynamic_pointer_cast(level->getTileEntity(x, y, z)); if (entity != NULL) entity->setEntityId(L"Silverfish"); } } diff --git a/Minecraft.World/StructurePiece.cpp b/Minecraft.World/StructurePiece.cpp index 1d41a608..e4fd3fab 100644 --- a/Minecraft.World/StructurePiece.cpp +++ b/Minecraft.World/StructurePiece.cpp @@ -13,7 +13,7 @@ #include "DoorItem.h" /** -* +* * A structure piece is a construction or room, located somewhere in the world * with a given orientatino (out of Direction.java). Structure pieces have a * bounding box that says where the piece is located and its bounds, and the @@ -89,7 +89,7 @@ StructurePiece* StructurePiece::findCollisionPiece( list< StructurePiece* > *pie } // 4J-PB - Added from 1.2.3 -TilePos *StructurePiece::getLocatorPosition() +TilePos *StructurePiece::getLocatorPosition() { return new TilePos(boundingBox->getXCenter(), boundingBox->getYCenter(), boundingBox->getZCenter()); } @@ -523,7 +523,7 @@ void StructurePiece::placeBlock( Level* level, int block, int data, int x, int y * The purpose of this method is to wrap the getTile call on Level, in order * to prevent the level from generating chunks that shouldn't be loaded yet. * Returns 0 if the call is out of bounds. -* +* * @param level * @param x * @param y @@ -781,7 +781,7 @@ bool StructurePiece::createChest( Level* level, BoundingBox* chunkBB, Random* ra if ( level->getTile( worldX, worldY, worldZ ) != Tile::chest->id ) { level->setTile( worldX, worldY, worldZ, Tile::chest->id ); - shared_ptr chest = dynamic_pointer_cast(level->getTileEntity( worldX, worldY, worldZ )); + std::shared_ptr chest = dynamic_pointer_cast(level->getTileEntity( worldX, worldY, worldZ )); if ( chest != NULL ) WeighedTreasure::addChestItems( random, treasure, chest, numRolls ); return true; } @@ -800,7 +800,7 @@ bool StructurePiece::createDispenser(Level *level, BoundingBox *chunkBB, Random if (level->getTile(worldX, worldY, worldZ) != Tile::dispenser_Id) { level->setTileAndData(worldX, worldY, worldZ, Tile::dispenser_Id, getOrientationData(Tile::dispenser_Id, facing)); - shared_ptr dispenser = dynamic_pointer_cast(level->getTileEntity(worldX, worldY, worldZ)); + std::shared_ptr dispenser = dynamic_pointer_cast(level->getTileEntity(worldX, worldY, worldZ)); if (dispenser != NULL) WeighedTreasure::addDispenserItems(random, items, dispenser, numRolls); return true; } diff --git a/Minecraft.World/SwampRiversLayer.cpp b/Minecraft.World/SwampRiversLayer.cpp index cd22cae8..4840a434 100644 --- a/Minecraft.World/SwampRiversLayer.cpp +++ b/Minecraft.World/SwampRiversLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "SwampRiversLayer.h" -SwampRiversLayer::SwampRiversLayer(int64_t seed, shared_ptr parent) : Layer(seed) +SwampRiversLayer::SwampRiversLayer(int64_t seed, std::shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/SwampRiversLayer.h b/Minecraft.World/SwampRiversLayer.h index 97bab0f4..3ede59d5 100644 --- a/Minecraft.World/SwampRiversLayer.h +++ b/Minecraft.World/SwampRiversLayer.h @@ -5,7 +5,7 @@ class SwampRiversLayer : public Layer { public: - SwampRiversLayer(int64_t seed, shared_ptr parent); + SwampRiversLayer(int64_t seed, std::shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SwellGoal.cpp b/Minecraft.World/SwellGoal.cpp index 9065ba16..289ada73 100644 --- a/Minecraft.World/SwellGoal.cpp +++ b/Minecraft.World/SwellGoal.cpp @@ -15,7 +15,7 @@ SwellGoal::SwellGoal(Creeper *creeper) bool SwellGoal::canUse() { - shared_ptr target = creeper->getTarget(); + std::shared_ptr target = creeper->getTarget(); return creeper->getSwellDir() > 0 || (target != NULL && (creeper->distanceToSqr(target) < 3 * 3)); } diff --git a/Minecraft.World/SynchedEntityData.cpp b/Minecraft.World/SynchedEntityData.cpp index 9f1aa1f7..b5f31bfa 100644 --- a/Minecraft.World/SynchedEntityData.cpp +++ b/Minecraft.World/SynchedEntityData.cpp @@ -19,7 +19,7 @@ void SynchedEntityData::define(int id, int value) MemSect(17); checkId(id); int type = TYPE_INT; - shared_ptr dataItem = shared_ptr( new DataItem(type, id, value) ); + std::shared_ptr dataItem = std::shared_ptr( new DataItem(type, id, value) ); itemsById[id] = dataItem; MemSect(0); m_isEmpty = false; @@ -30,7 +30,7 @@ void SynchedEntityData::define(int id, byte value) MemSect(17); checkId(id); int type = TYPE_BYTE; - shared_ptr dataItem = shared_ptr( new DataItem(type, id, value) ); + std::shared_ptr dataItem = std::shared_ptr( new DataItem(type, id, value) ); itemsById[id] = dataItem; MemSect(0); m_isEmpty = false; @@ -41,7 +41,7 @@ void SynchedEntityData::define(int id, short value) MemSect(17); checkId(id); int type = TYPE_SHORT; - shared_ptr dataItem = shared_ptr( new DataItem(type, id, value) ); + std::shared_ptr dataItem = std::shared_ptr( new DataItem(type, id, value) ); itemsById[id] = dataItem; MemSect(0); m_isEmpty = false; @@ -52,7 +52,7 @@ void SynchedEntityData::define(int id, const wstring& value) MemSect(17); checkId(id); int type = TYPE_STRING; - shared_ptr dataItem = shared_ptr( new DataItem(type, id, value) ); + std::shared_ptr dataItem = std::shared_ptr( new DataItem(type, id, value) ); itemsById[id] = dataItem; MemSect(0); m_isEmpty = false; @@ -63,7 +63,7 @@ void SynchedEntityData::defineNULL(int id, void *pVal) MemSect(17); checkId(id); int type = TYPE_ITEMINSTANCE; - shared_ptr dataItem = shared_ptr( new DataItem(type, id, shared_ptr()) ); + std::shared_ptr dataItem = std::shared_ptr( new DataItem(type, id, std::shared_ptr()) ); itemsById[id] = dataItem; MemSect(0); m_isEmpty = false; @@ -109,7 +109,7 @@ wstring SynchedEntityData::getString(int id) return itemsById[id]->getValue_wstring(); } -shared_ptr SynchedEntityData::getItemInstance(int id) +std::shared_ptr SynchedEntityData::getItemInstance(int id) { //assert(false); // 4J - not currently implemented return itemsById[id]->getValue_itemInstance(); @@ -123,7 +123,7 @@ Pos *SynchedEntityData::getPos(int id) void SynchedEntityData::set(int id, int value) { - shared_ptr dataItem = itemsById[id]; + std::shared_ptr dataItem = itemsById[id]; // update the value if it has changed if (value != dataItem->getValue_int()) @@ -136,7 +136,7 @@ void SynchedEntityData::set(int id, int value) void SynchedEntityData::set(int id, byte value) { - shared_ptr dataItem = itemsById[id]; + std::shared_ptr dataItem = itemsById[id]; // update the value if it has changed if (value != dataItem->getValue_byte()) @@ -149,7 +149,7 @@ void SynchedEntityData::set(int id, byte value) void SynchedEntityData::set(int id, short value) { - shared_ptr dataItem = itemsById[id]; + std::shared_ptr dataItem = itemsById[id]; // update the value if it has changed if (value != dataItem->getValue_short()) @@ -162,7 +162,7 @@ void SynchedEntityData::set(int id, short value) void SynchedEntityData::set(int id, const wstring& value) { - shared_ptr dataItem = itemsById[id]; + std::shared_ptr dataItem = itemsById[id]; // update the value if it has changed if (value != dataItem->getValue_wstring()) @@ -173,9 +173,9 @@ void SynchedEntityData::set(int id, const wstring& value) } } -void SynchedEntityData::set(int id, shared_ptr value) +void SynchedEntityData::set(int id, std::shared_ptr value) { - shared_ptr dataItem = itemsById[id]; + std::shared_ptr dataItem = itemsById[id]; // update the value if it has changed if (value != dataItem->getValue_itemInstance()) @@ -197,7 +197,7 @@ bool SynchedEntityData::isDirty() return m_isDirty; } -void SynchedEntityData::pack(vector > *items, DataOutputStream *output) // TODO throws IOException +void SynchedEntityData::pack(vector > *items, DataOutputStream *output) // TODO throws IOException { if (items != NULL) @@ -205,7 +205,7 @@ void SynchedEntityData::pack(vector > *items, DataOutputStr AUTO_VAR(itEnd, items->end()); for (AUTO_VAR(it, items->begin()); it != itEnd; it++) { - shared_ptr dataItem = *it; + std::shared_ptr dataItem = *it; writeDataItem(output, dataItem); } } @@ -214,24 +214,24 @@ void SynchedEntityData::pack(vector > *items, DataOutputStr output->writeByte(EOF_MARKER); } -vector > *SynchedEntityData::packDirty() +vector > *SynchedEntityData::packDirty() { - vector > *result = NULL; + vector > *result = NULL; if (m_isDirty) { AUTO_VAR(itEnd, itemsById.end()); for ( AUTO_VAR(it, itemsById.begin()); it != itEnd; it++ ) { - shared_ptr dataItem = (*it).second; + std::shared_ptr dataItem = (*it).second; if (dataItem->isDirty()) { dataItem->setDirty(false); if (result == NULL) { - result = new vector >(); + result = new vector >(); } result->push_back(dataItem); } @@ -247,7 +247,7 @@ void SynchedEntityData::packAll(DataOutputStream *output) // throws IOException AUTO_VAR(itEnd, itemsById.end()); for (AUTO_VAR(it, itemsById.begin()); it != itEnd; it++ ) { - shared_ptr dataItem = (*it).second; + std::shared_ptr dataItem = (*it).second; writeDataItem(output, dataItem); } @@ -255,18 +255,18 @@ void SynchedEntityData::packAll(DataOutputStream *output) // throws IOException output->writeByte(EOF_MARKER); } -vector > *SynchedEntityData::getAll() +vector > *SynchedEntityData::getAll() { - vector > *result = NULL; + vector > *result = NULL; AUTO_VAR(itEnd, itemsById.end()); for (AUTO_VAR(it, itemsById.begin()); it != itEnd; it++ ) { if (result == NULL) { - result = new vector >(); + result = new vector >(); } - shared_ptr dataItem = (*it).second; + std::shared_ptr dataItem = (*it).second; result->push_back(dataItem); } @@ -274,7 +274,7 @@ vector > *SynchedEntityData::getAll() } -void SynchedEntityData::writeDataItem(DataOutputStream *output, shared_ptr dataItem) //throws IOException +void SynchedEntityData::writeDataItem(DataOutputStream *output, std::shared_ptr dataItem) //throws IOException { // pack type and id int header = ((dataItem->getType() << TYPE_SHIFT) | (dataItem->getId() & MAX_ID_VALUE)) & 0xff; @@ -285,7 +285,7 @@ void SynchedEntityData::writeDataItem(DataOutputStream *output, shared_ptrwriteByte( dataItem->getValue_byte()); - break; + break; case TYPE_INT: output->writeInt( dataItem->getValue_int()); break; @@ -295,23 +295,23 @@ void SynchedEntityData::writeDataItem(DataOutputStream *output, shared_ptrgetValue_wstring(), output); break; - case TYPE_ITEMINSTANCE: + case TYPE_ITEMINSTANCE: { - shared_ptr instance = (shared_ptr )dataItem->getValue_itemInstance(); + std::shared_ptr instance = (std::shared_ptr )dataItem->getValue_itemInstance(); Packet::writeItem(instance, output); } break; - + default: assert(false); // 4J - not implemented break; } } -vector > *SynchedEntityData::unpack(DataInputStream *input) //throws IOException +vector > *SynchedEntityData::unpack(DataInputStream *input) //throws IOException { - vector > *result = NULL; + vector > *result = NULL; int currentHeader = input->readByte(); @@ -320,40 +320,40 @@ vector > *SynchedEntityData::unpack(Data if (result == NULL) { - result = new vector >(); + result = new vector >(); } // split type and id int itemType = (currentHeader & TYPE_MASK) >> TYPE_SHIFT; int itemId = (currentHeader & MAX_ID_VALUE); - shared_ptr item = shared_ptr(); + std::shared_ptr item = std::shared_ptr(); switch (itemType) { case TYPE_BYTE: { byte dataRead = input->readByte(); - item = shared_ptr( new DataItem(itemType, itemId, dataRead) ); + item = std::shared_ptr( new DataItem(itemType, itemId, dataRead) ); } break; case TYPE_SHORT: { short dataRead = input->readShort(); - item = shared_ptr( new DataItem(itemType, itemId, dataRead) ); + item = std::shared_ptr( new DataItem(itemType, itemId, dataRead) ); } break; case TYPE_INT: { int dataRead = input->readInt(); - item = shared_ptr( new DataItem(itemType, itemId, dataRead) ); + item = std::shared_ptr( new DataItem(itemType, itemId, dataRead) ); } break; case TYPE_STRING: - item = shared_ptr( new DataItem(itemType, itemId, Packet::readUtf(input, MAX_STRING_DATA_LENGTH)) ); + item = std::shared_ptr( new DataItem(itemType, itemId, Packet::readUtf(input, MAX_STRING_DATA_LENGTH)) ); break; - case TYPE_ITEMINSTANCE: + case TYPE_ITEMINSTANCE: { - item = shared_ptr(new DataItem(itemType, itemId, Packet::readItem(input))); + item = std::shared_ptr(new DataItem(itemType, itemId, Packet::readItem(input))); } break; default: @@ -372,16 +372,16 @@ vector > *SynchedEntityData::unpack(Data /** * Assigns values from a list of data items. -* +* * @param items */ -void SynchedEntityData::assignValues(vector > *items) +void SynchedEntityData::assignValues(vector > *items) { AUTO_VAR(itEnd, items->end()); for (AUTO_VAR(it, items->begin()); it != itEnd; it++) { - shared_ptr item = *it; + std::shared_ptr item = *it; AUTO_VAR(itemFromId, itemsById.find(item->getId())); if (itemFromId != itemsById.end() ) { @@ -418,11 +418,11 @@ bool SynchedEntityData::isEmpty() int SynchedEntityData::getSizeInBytes() { int size = 1; - + AUTO_VAR(itEnd, itemsById.end()); for (AUTO_VAR(it, itemsById.begin()); it != itEnd; it++ ) { - shared_ptr dataItem = (*it).second; + std::shared_ptr dataItem = (*it).second; size += 1; @@ -431,7 +431,7 @@ int SynchedEntityData::getSizeInBytes() { case TYPE_BYTE: size += 1; - break; + break; case TYPE_SHORT: size += 2; break; @@ -481,7 +481,7 @@ SynchedEntityData::DataItem::DataItem(int type, int id, const wstring& value) : this->dirty = true; } -SynchedEntityData::DataItem::DataItem(int type, int id, shared_ptr itemInstance) : type( type ), id( id ) +SynchedEntityData::DataItem::DataItem(int type, int id, std::shared_ptr itemInstance) : type( type ), id( id ) { this->value_itemInstance = itemInstance; this->dirty = true; @@ -512,7 +512,7 @@ void SynchedEntityData::DataItem::setValue(const wstring& value) this->value_wstring = value; } -void SynchedEntityData::DataItem::setValue(shared_ptr itemInstance) +void SynchedEntityData::DataItem::setValue(std::shared_ptr itemInstance) { this->value_itemInstance = itemInstance; } @@ -537,7 +537,7 @@ wstring SynchedEntityData::DataItem::getValue_wstring() return value_wstring; } -shared_ptr SynchedEntityData::DataItem::getValue_itemInstance() +std::shared_ptr SynchedEntityData::DataItem::getValue_itemInstance() { return value_itemInstance; } diff --git a/Minecraft.World/SynchedEntityData.h b/Minecraft.World/SynchedEntityData.h index e79a10b8..05a6fef2 100644 --- a/Minecraft.World/SynchedEntityData.h +++ b/Minecraft.World/SynchedEntityData.h @@ -19,7 +19,7 @@ public: int value_int; short value_short; wstring value_wstring; - shared_ptr value_itemInstance; + std::shared_ptr value_itemInstance; bool dirty; public: @@ -27,7 +27,7 @@ public: DataItem(int type, int id, byte value); DataItem(int type, int id, int value); DataItem(int type, int id, const wstring& value); - DataItem(int type, int id, shared_ptr itemInstance); + DataItem(int type, int id, std::shared_ptr itemInstance); DataItem(int type, int id, short value); int getId(); @@ -35,12 +35,12 @@ public: void setValue(int value); void setValue(short value); void setValue(const wstring& value); - void setValue(shared_ptr value); + void setValue(std::shared_ptr value); byte getValue_byte(); int getValue_int(); short getValue_short(); wstring getValue_wstring(); - shared_ptr getValue_itemInstance(); + std::shared_ptr getValue_itemInstance(); int getType(); bool isDirty(); void setDirty(bool dirty); @@ -71,7 +71,7 @@ private: // the id value must fit in the remaining bits static const int MAX_ID_VALUE = ~TYPE_MASK & 0xff; - unordered_map > itemsById; + unordered_map > itemsById; bool m_isDirty; public: @@ -91,35 +91,35 @@ public: int getInteger(int id); float getFloat(int id); wstring getString(int id); - shared_ptr getItemInstance(int id); + std::shared_ptr getItemInstance(int id); Pos *getPos(int id); // 4J - using overloads rather than template here void set(int id, byte value); void set(int id, int value); void set(int id, short value); void set(int id, const wstring& value); - void set(int id, shared_ptr); + void set(int id, std::shared_ptr); void markDirty(int id); bool isDirty(); - static void pack(vector > *items, DataOutputStream *output); // TODO throws IOException - vector > *packDirty(); + static void pack(vector > *items, DataOutputStream *output); // TODO throws IOException + vector > *packDirty(); void packAll(DataOutputStream *output); // throws IOException - vector > *getAll(); + vector > *getAll(); private: - static void writeDataItem(DataOutputStream *output, shared_ptr dataItem); //throws IOException + static void writeDataItem(DataOutputStream *output, std::shared_ptr dataItem); //throws IOException public: - static vector > *unpack(DataInputStream *input); // throws IOException + static vector > *unpack(DataInputStream *input); // throws IOException /** * Assigns values from a list of data items. - * + * * @param items */ public: - void assignValues(vector > *items); + void assignValues(vector > *items); bool isEmpty(); // 4J Added diff --git a/Minecraft.World/TakeFlowerGoal.cpp b/Minecraft.World/TakeFlowerGoal.cpp index 34c584c6..e67edd86 100644 --- a/Minecraft.World/TakeFlowerGoal.cpp +++ b/Minecraft.World/TakeFlowerGoal.cpp @@ -23,7 +23,7 @@ bool TakeFlowerGoal::canUse() if (villager->getAge() >= 0) return false; if (!villager->level->isDay()) return false; - vector > *golems = villager->level->getEntitiesOfClass(typeid(VillagerGolem), villager->bb->grow(6, 2, 6)); + vector > *golems = villager->level->getEntitiesOfClass(typeid(VillagerGolem), villager->bb->grow(6, 2, 6)); if (golems->size() == 0) { delete golems; @@ -33,7 +33,7 @@ bool TakeFlowerGoal::canUse() //for (Entity e : golems) for(AUTO_VAR(it,golems->begin()); it != golems->end(); ++it) { - shared_ptr vg = dynamic_pointer_cast(*it); + std::shared_ptr vg = dynamic_pointer_cast(*it); if (vg->getOfferFlowerTick() > 0) { golem = weak_ptr(vg); diff --git a/Minecraft.World/TakeItemEntityPacket.h b/Minecraft.World/TakeItemEntityPacket.h index 7c4b45fe..da785696 100644 --- a/Minecraft.World/TakeItemEntityPacket.h +++ b/Minecraft.World/TakeItemEntityPacket.h @@ -17,6 +17,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new TakeItemEntityPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TakeItemEntityPacket()); } virtual int getId() { return 22; } }; \ No newline at end of file diff --git a/Minecraft.World/TallGrass.cpp b/Minecraft.World/TallGrass.cpp index e2e7cb19..d4a3d027 100644 --- a/Minecraft.World/TallGrass.cpp +++ b/Minecraft.World/TallGrass.cpp @@ -79,17 +79,17 @@ int TallGrass::getResourceCountForLootBonus(int bonusLevel, Random *random) return 1 + random->nextInt(bonusLevel * 2 + 1); } -void TallGrass::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +void TallGrass::playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data) { if (!level->isClientSide && player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::shears->id) { player->awardStat( - GenericStats::blocksMined(id), + GenericStats::blocksMined(id), GenericStats::param_blocksMined(id,data,1) ); // drop leaf block instead of sapling - popResource(level, x, y, z, shared_ptr(new ItemInstance(Tile::tallgrass, 1, data))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(Tile::tallgrass, 1, data))); } else { diff --git a/Minecraft.World/TallGrass.h b/Minecraft.World/TallGrass.h index 9b4c5515..78019c01 100644 --- a/Minecraft.World/TallGrass.h +++ b/Minecraft.World/TallGrass.h @@ -35,7 +35,7 @@ public: virtual int getResource(int data, Random *random, int playerBonusLevel); virtual int getResourceCountForLootBonus(int bonusLevel, Random *random); - virtual void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data); + virtual void playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data); virtual int cloneTileData(Level *level, int x, int y, int z); virtual unsigned int getDescriptionId(int iData = -1); diff --git a/Minecraft.World/TamableAnimal.cpp b/Minecraft.World/TamableAnimal.cpp index b065d7bd..abefb097 100644 --- a/Minecraft.World/TamableAnimal.cpp +++ b/Minecraft.World/TamableAnimal.cpp @@ -148,7 +148,7 @@ void TamableAnimal::setOwnerUUID(const wstring &name) entityData->set(DATA_OWNERUUID_ID, name); } -shared_ptr TamableAnimal::getOwner() +std::shared_ptr TamableAnimal::getOwner() { return level->getPlayerByUUID(getOwnerUUID()); } diff --git a/Minecraft.World/TamableAnimal.h b/Minecraft.World/TamableAnimal.h index 71502788..5b4938cc 100644 --- a/Minecraft.World/TamableAnimal.h +++ b/Minecraft.World/TamableAnimal.h @@ -33,6 +33,6 @@ public: virtual void setSitting(bool value); virtual wstring getOwnerUUID(); virtual void setOwnerUUID(const wstring &name); - virtual shared_ptr getOwner(); + virtual std::shared_ptr getOwner(); virtual SitGoal *getSitGoal(); }; \ No newline at end of file diff --git a/Minecraft.World/TargetGoal.cpp b/Minecraft.World/TargetGoal.cpp index c3ac4f59..28102c60 100644 --- a/Minecraft.World/TargetGoal.cpp +++ b/Minecraft.World/TargetGoal.cpp @@ -32,7 +32,7 @@ TargetGoal::TargetGoal(Mob *mob, float within, bool mustSee, bool mustReach) bool TargetGoal::canContinueToUse() { - shared_ptr target = mob->getTarget(); + std::shared_ptr target = mob->getTarget(); if (target == NULL) return false; if (!target->isAlive()) return false; if (mob->distanceToSqr(target) > within * within) return false; @@ -62,17 +62,17 @@ void TargetGoal::stop() mob->setTarget(nullptr); } -bool TargetGoal::canAttack(shared_ptr target, bool allowInvulnerable) +bool TargetGoal::canAttack(std::shared_ptr target, bool allowInvulnerable) { if (target == NULL) return false; if (target == mob->shared_from_this()) return false; if (!target->isAlive()) return false; if (!mob->canAttackType(target->GetType())) return false; - shared_ptr tamableAnimal = dynamic_pointer_cast(mob->shared_from_this()); + std::shared_ptr tamableAnimal = dynamic_pointer_cast(mob->shared_from_this()); if (tamableAnimal != NULL && tamableAnimal->isTame()) { - shared_ptr tamableTarget = dynamic_pointer_cast(target); + std::shared_ptr tamableTarget = dynamic_pointer_cast(target); if (tamableTarget != NULL && tamableTarget->isTame()) return false; if (target == tamableAnimal->getOwner()) return false; } @@ -95,7 +95,7 @@ bool TargetGoal::canAttack(shared_ptr target, bool allowInvulnerable) return true; } -bool TargetGoal::canReach(shared_ptr target) +bool TargetGoal::canReach(std::shared_ptr target) { reachCacheTime = 10 + mob->getRandom()->nextInt(5); Path *path = mob->getNavigation()->createPath(target); diff --git a/Minecraft.World/TargetGoal.h b/Minecraft.World/TargetGoal.h index 3bb9da09..2e6765fe 100644 --- a/Minecraft.World/TargetGoal.h +++ b/Minecraft.World/TargetGoal.h @@ -37,8 +37,8 @@ public: virtual void stop(); protected: - virtual bool canAttack(shared_ptr target, bool allowInvulnerable); + virtual bool canAttack(std::shared_ptr target, bool allowInvulnerable); private: - bool canReach(shared_ptr target); + bool canReach(std::shared_ptr target); }; \ No newline at end of file diff --git a/Minecraft.World/TeleportEntityPacket.cpp b/Minecraft.World/TeleportEntityPacket.cpp index f0ed1e95..1ca53966 100644 --- a/Minecraft.World/TeleportEntityPacket.cpp +++ b/Minecraft.World/TeleportEntityPacket.cpp @@ -17,7 +17,7 @@ TeleportEntityPacket::TeleportEntityPacket() xRot = 0; } -TeleportEntityPacket::TeleportEntityPacket(shared_ptr e) +TeleportEntityPacket::TeleportEntityPacket(std::shared_ptr e) { id = e->entityId; x = Mth::floor(e->x * 32); @@ -53,7 +53,7 @@ void TeleportEntityPacket::read(DataInputStream *dis) //throws IOException xRot = (byte) dis->read(); } -void TeleportEntityPacket::write(DataOutputStream *dos) //throws IOException +void TeleportEntityPacket::write(DataOutputStream *dos) //throws IOException { dos->writeShort(id); #ifdef _LARGE_WORLDS @@ -69,12 +69,12 @@ void TeleportEntityPacket::write(DataOutputStream *dos) //throws IOException dos->write(xRot); } -void TeleportEntityPacket::handle(PacketListener *listener) +void TeleportEntityPacket::handle(PacketListener *listener) { listener->handleTeleportEntity(shared_from_this()); } -int TeleportEntityPacket::getEstimatedSize() +int TeleportEntityPacket::getEstimatedSize() { return 2 + 2 + 2 + 2 + 1 + 1; } @@ -84,8 +84,8 @@ bool TeleportEntityPacket::canBeInvalidated() return true; } -bool TeleportEntityPacket::isInvalidatedBy(shared_ptr packet) +bool TeleportEntityPacket::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target->id == id; } \ No newline at end of file diff --git a/Minecraft.World/TeleportEntityPacket.h b/Minecraft.World/TeleportEntityPacket.h index 6fc28732..cccc1ce0 100644 --- a/Minecraft.World/TeleportEntityPacket.h +++ b/Minecraft.World/TeleportEntityPacket.h @@ -11,7 +11,7 @@ public: byte yRot, xRot; TeleportEntityPacket(); - TeleportEntityPacket(shared_ptr e); + TeleportEntityPacket(std::shared_ptr e); TeleportEntityPacket(int id, int x, int y, int z, byte yRot, byte xRot); virtual void read(DataInputStream *dis); @@ -19,9 +19,9 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new TeleportEntityPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TeleportEntityPacket()); } virtual int getId() { return 34; } }; \ No newline at end of file diff --git a/Minecraft.World/TemperatureLayer.cpp b/Minecraft.World/TemperatureLayer.cpp index b4963925..484f9506 100644 --- a/Minecraft.World/TemperatureLayer.cpp +++ b/Minecraft.World/TemperatureLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -TemperatureLayer::TemperatureLayer(shared_ptr parent) : Layer(0) +TemperatureLayer::TemperatureLayer(std::shared_ptr parent) : Layer(0) { this->parent = parent; } diff --git a/Minecraft.World/TemperatureLayer.h b/Minecraft.World/TemperatureLayer.h index 34791caa..0da46402 100644 --- a/Minecraft.World/TemperatureLayer.h +++ b/Minecraft.World/TemperatureLayer.h @@ -5,7 +5,7 @@ class TemperatureLayer : public Layer { public: - TemperatureLayer(shared_ptr parent); + TemperatureLayer(std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/TemperatureMixerLayer.cpp b/Minecraft.World/TemperatureMixerLayer.cpp index 27fbdf68..38358e92 100644 --- a/Minecraft.World/TemperatureMixerLayer.cpp +++ b/Minecraft.World/TemperatureMixerLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -TemperatureMixerLayer::TemperatureMixerLayer(shared_ptrtemp, shared_ptrparent, int layer) : Layer(0) +TemperatureMixerLayer::TemperatureMixerLayer(std::shared_ptrtemp, std::shared_ptrparent, int layer) : Layer(0) { this->parent = parent; this->temp = temp; diff --git a/Minecraft.World/TemperatureMixerLayer.h b/Minecraft.World/TemperatureMixerLayer.h index 3b3f56e0..0e7abf93 100644 --- a/Minecraft.World/TemperatureMixerLayer.h +++ b/Minecraft.World/TemperatureMixerLayer.h @@ -5,11 +5,11 @@ class TemperatureMixerLayer : public Layer { private: - shared_ptrtemp; + std::shared_ptrtemp; int layer; public: - TemperatureMixerLayer(shared_ptrtemp, shared_ptrparent, int layer); + TemperatureMixerLayer(std::shared_ptrtemp, std::shared_ptrparent, int layer); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/TemptGoal.cpp b/Minecraft.World/TemptGoal.cpp index cf0ee3d2..d17c02bc 100644 --- a/Minecraft.World/TemptGoal.cpp +++ b/Minecraft.World/TemptGoal.cpp @@ -31,7 +31,7 @@ bool TemptGoal::canUse() player = weak_ptr(mob->level->getNearestPlayer(mob->shared_from_this(), 10)); if (player.lock() == NULL) return false; mob->setDespawnProtected(); // If we've got a nearby player, then consider this mob as something we'd miss if it despawned - shared_ptr item = player.lock()->getSelectedItem(); + std::shared_ptr item = player.lock()->getSelectedItem(); if (item == NULL) return false; if (item->id != itemId) return false; return true; diff --git a/Minecraft.World/TextureAndGeometryChangePacket.cpp b/Minecraft.World/TextureAndGeometryChangePacket.cpp index 04c88bed..d3279ba2 100644 --- a/Minecraft.World/TextureAndGeometryChangePacket.cpp +++ b/Minecraft.World/TextureAndGeometryChangePacket.cpp @@ -15,7 +15,7 @@ TextureAndGeometryChangePacket::TextureAndGeometryChangePacket() dwSkinID = 0; } -TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(shared_ptr e, const wstring &path) +TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(std::shared_ptr e, const wstring &path) { id = e->entityId; this->path = path; @@ -28,26 +28,26 @@ TextureAndGeometryChangePacket::TextureAndGeometryChangePacket(shared_ptrreadInt(); dwSkinID = dis->readInt(); path = dis->readUTF(); } -void TextureAndGeometryChangePacket::write(DataOutputStream *dos) //throws IOException +void TextureAndGeometryChangePacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(id); dos->writeInt(dwSkinID); dos->writeUTF(path); } -void TextureAndGeometryChangePacket::handle(PacketListener *listener) +void TextureAndGeometryChangePacket::handle(PacketListener *listener) { listener->handleTextureAndGeometryChange(shared_from_this()); } -int TextureAndGeometryChangePacket::getEstimatedSize() +int TextureAndGeometryChangePacket::getEstimatedSize() { return 8 + (int)path.size(); } diff --git a/Minecraft.World/TextureAndGeometryChangePacket.h b/Minecraft.World/TextureAndGeometryChangePacket.h index dabe78fa..e13b547e 100644 --- a/Minecraft.World/TextureAndGeometryChangePacket.h +++ b/Minecraft.World/TextureAndGeometryChangePacket.h @@ -12,7 +12,7 @@ public: DWORD dwSkinID; TextureAndGeometryChangePacket(); - TextureAndGeometryChangePacket(shared_ptr e, const wstring &path); + TextureAndGeometryChangePacket(std::shared_ptr e, const wstring &path); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); @@ -20,6 +20,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new TextureAndGeometryChangePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TextureAndGeometryChangePacket()); } virtual int getId() { return 161; } }; \ No newline at end of file diff --git a/Minecraft.World/TextureAndGeometryPacket.h b/Minecraft.World/TextureAndGeometryPacket.h index 8577f03d..d2f8def0 100644 --- a/Minecraft.World/TextureAndGeometryPacket.h +++ b/Minecraft.World/TextureAndGeometryPacket.h @@ -20,9 +20,9 @@ public: TextureAndGeometryPacket(); ~TextureAndGeometryPacket(); - TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes); - TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile); - TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask); + TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes); + TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile); + TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis); @@ -30,6 +30,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new TextureAndGeometryPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TextureAndGeometryPacket()); } virtual int getId() { return 160; } }; \ No newline at end of file diff --git a/Minecraft.World/TextureChangePacket.cpp b/Minecraft.World/TextureChangePacket.cpp index 2368136c..8a5dd9c0 100644 --- a/Minecraft.World/TextureChangePacket.cpp +++ b/Minecraft.World/TextureChangePacket.cpp @@ -14,33 +14,33 @@ TextureChangePacket::TextureChangePacket() path = L""; } -TextureChangePacket::TextureChangePacket(shared_ptr e, ETextureChangeType action, const wstring &path) +TextureChangePacket::TextureChangePacket(std::shared_ptr e, ETextureChangeType action, const wstring &path) { id = e->entityId; this->action = action; this->path = path; } -void TextureChangePacket::read(DataInputStream *dis) //throws IOException +void TextureChangePacket::read(DataInputStream *dis) //throws IOException { id = dis->readInt(); action = (ETextureChangeType)dis->readByte(); path = dis->readUTF(); } -void TextureChangePacket::write(DataOutputStream *dos) //throws IOException +void TextureChangePacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(id); dos->writeByte(action); dos->writeUTF(path); } -void TextureChangePacket::handle(PacketListener *listener) +void TextureChangePacket::handle(PacketListener *listener) { listener->handleTextureChange(shared_from_this()); } -int TextureChangePacket::getEstimatedSize() +int TextureChangePacket::getEstimatedSize() { return 5 + (int)path.size(); } diff --git a/Minecraft.World/TextureChangePacket.h b/Minecraft.World/TextureChangePacket.h index 959fc4fe..7d99b3b3 100644 --- a/Minecraft.World/TextureChangePacket.h +++ b/Minecraft.World/TextureChangePacket.h @@ -17,7 +17,7 @@ public: wstring path; TextureChangePacket(); - TextureChangePacket(shared_ptr e, ETextureChangeType action, const wstring &path); + TextureChangePacket(std::shared_ptr e, ETextureChangeType action, const wstring &path); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); @@ -25,6 +25,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new TextureChangePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TextureChangePacket()); } virtual int getId() { return 157; } }; \ No newline at end of file diff --git a/Minecraft.World/TexturePacket.h b/Minecraft.World/TexturePacket.h index c2dce25f..587a094e 100644 --- a/Minecraft.World/TexturePacket.h +++ b/Minecraft.World/TexturePacket.h @@ -11,7 +11,7 @@ public: DWORD dwBytes; TexturePacket(); - ~TexturePacket(); + ~TexturePacket(); TexturePacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes); virtual void handle(PacketListener *listener); @@ -20,6 +20,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new TexturePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TexturePacket()); } virtual int getId() { return 154; } }; \ No newline at end of file diff --git a/Minecraft.World/TheEndBiomeDecorator.cpp b/Minecraft.World/TheEndBiomeDecorator.cpp index 31823c80..a6360a73 100644 --- a/Minecraft.World/TheEndBiomeDecorator.cpp +++ b/Minecraft.World/TheEndBiomeDecorator.cpp @@ -58,14 +58,14 @@ void TheEndBiomeDecorator::decorate() } if (xo == 0 && zo == 0) { - shared_ptr enderDragon = shared_ptr(new EnderDragon(level)); + std::shared_ptr enderDragon = std::shared_ptr(new EnderDragon(level)); enderDragon->moveTo(0, 128, 0, random->nextFloat() * 360, 0); level->addEntity(enderDragon); } // end podium radius is 4, position is 0,0, so chunk needs to be the -16,-16 one since this guarantees that all chunks required for the podium are loaded if (xo == -16 && zo == -16) - { + { endPodiumFeature->place(level, random, 0, Level::genDepth / 2, 0); } } \ No newline at end of file diff --git a/Minecraft.World/TheEndPortal.cpp b/Minecraft.World/TheEndPortal.cpp index 19d95b1f..78e154f4 100644 --- a/Minecraft.World/TheEndPortal.cpp +++ b/Minecraft.World/TheEndPortal.cpp @@ -26,12 +26,12 @@ TheEndPortal::TheEndPortal(int id, Material *material) : EntityTile(id, material this->setLightEmission(1.0f); } -shared_ptr TheEndPortal::newTileEntity(Level *level) +std::shared_ptr TheEndPortal::newTileEntity(Level *level) { - return shared_ptr(new TheEndPortalTileEntity()); + return std::shared_ptr(new TheEndPortalTileEntity()); } -void TheEndPortal::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void TheEndPortal::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { float r = 1 / 16.0f; this->setShape(0, 0, 0, 1, r, 1); @@ -43,7 +43,7 @@ bool TheEndPortal::shouldRenderFace(LevelSource *level, int x, int y, int z, int return EntityTile::shouldRenderFace(level, x, y, z, face); } -void TheEndPortal::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void TheEndPortal::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { } @@ -62,7 +62,7 @@ int TheEndPortal::getResourceCount(Random *random) return 0; } -void TheEndPortal::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void TheEndPortal::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { if (entity->riding == NULL && entity->rider.lock() == NULL) { diff --git a/Minecraft.World/TheEndPortal.h b/Minecraft.World/TheEndPortal.h index 31cddb2d..5715fbd4 100644 --- a/Minecraft.World/TheEndPortal.h +++ b/Minecraft.World/TheEndPortal.h @@ -6,19 +6,19 @@ class TheEndPortal : public EntityTile public: static DWORD tlsIdx; // 4J - was just a static but implemented with TLS for our version - static bool allowAnywhere(); - static void allowAnywhere(bool set); + static bool allowAnywhere(); + static void allowAnywhere(bool set); TheEndPortal(int id, Material *material); - virtual shared_ptr newTileEntity(Level *level); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual std::shared_ptr newTileEntity(Level *level); + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); virtual int getResourceCount(Random *random); - virtual void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + virtual void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); virtual void animateTick(Level *level, int xt, int yt, int zt, Random *random); virtual int getRenderShape(); virtual void onPlace(Level *level, int x, int y, int z); diff --git a/Minecraft.World/TheEndPortalFrameTile.cpp b/Minecraft.World/TheEndPortalFrameTile.cpp index cab8319f..2bf557f8 100644 --- a/Minecraft.World/TheEndPortalFrameTile.cpp +++ b/Minecraft.World/TheEndPortalFrameTile.cpp @@ -52,7 +52,7 @@ void TheEndPortalFrameTile::updateDefaultShape() setShape(0, 0, 0, 1, 13.0f / 16.0f, 1); } -void TheEndPortalFrameTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void TheEndPortalFrameTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { setShape(0, 0, 0, 1, 13.0f / 16.0f, 1); Tile::addAABBs(level, x, y, z, box, boxes, source); @@ -76,7 +76,7 @@ int TheEndPortalFrameTile::getResource(int data, Random *random, int playerBonus return 0; } -void TheEndPortalFrameTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void TheEndPortalFrameTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int dir = (((Mth::floor(by->yRot * 4 / (360) + 0.5)) & 3) + 2) % 4; level->setData(x, y, z, dir); diff --git a/Minecraft.World/TheEndPortalFrameTile.h b/Minecraft.World/TheEndPortalFrameTile.h index b48d3c09..bedad14d 100644 --- a/Minecraft.World/TheEndPortalFrameTile.h +++ b/Minecraft.World/TheEndPortalFrameTile.h @@ -19,8 +19,8 @@ public: virtual bool isSolidRender(bool isServerLevel = false); virtual int getRenderShape(); virtual void updateDefaultShape(); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); static bool hasEye(int data); virtual int getResource(int data, Random *random, int playerBonusLevel); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); }; \ No newline at end of file diff --git a/Minecraft.World/TheEndPortalTileEntity.cpp b/Minecraft.World/TheEndPortalTileEntity.cpp index fa9b3544..2dee6a6a 100644 --- a/Minecraft.World/TheEndPortalTileEntity.cpp +++ b/Minecraft.World/TheEndPortalTileEntity.cpp @@ -2,9 +2,9 @@ #include "TheEndPortalTileEntity.h" // 4J Added -shared_ptr TheEndPortalTileEntity::clone() +std::shared_ptr TheEndPortalTileEntity::clone() { - shared_ptr result = shared_ptr( new TheEndPortalTileEntity() ); + std::shared_ptr result = std::shared_ptr( new TheEndPortalTileEntity() ); TileEntity::clone(result); return result; } \ No newline at end of file diff --git a/Minecraft.World/TheEndPortalTileEntity.h b/Minecraft.World/TheEndPortalTileEntity.h index 29752d44..0bc0b46c 100644 --- a/Minecraft.World/TheEndPortalTileEntity.h +++ b/Minecraft.World/TheEndPortalTileEntity.h @@ -8,5 +8,5 @@ public: static TileEntity *create() { return new TheEndPortalTileEntity(); } // 4J Added - shared_ptr clone(); + std::shared_ptr clone(); }; \ No newline at end of file diff --git a/Minecraft.World/ThinFenceTile.cpp b/Minecraft.World/ThinFenceTile.cpp index bd1f1687..3a102abe 100644 --- a/Minecraft.World/ThinFenceTile.cpp +++ b/Minecraft.World/ThinFenceTile.cpp @@ -42,7 +42,7 @@ bool ThinFenceTile::shouldRenderFace(LevelSource *level, int x, int y, int z, in return Tile::shouldRenderFace(level, x, y, z, face); } -void ThinFenceTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void ThinFenceTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { bool n = attachsTo(level->getTile(x, y, z - 1)); bool s = attachsTo(level->getTile(x, y, z + 1)); @@ -86,7 +86,7 @@ void ThinFenceTile::updateDefaultShape() setShape(0, 0, 0, 1, 1, 1); } -void ThinFenceTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void ThinFenceTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { float minX = 7.0f / 16.0f; float maxX = 9.0f / 16.0f; @@ -142,9 +142,9 @@ bool ThinFenceTile::isSilkTouchable() return true; } -shared_ptr ThinFenceTile::getSilkTouchItemInstance(int data) +std::shared_ptr ThinFenceTile::getSilkTouchItemInstance(int data) { - return shared_ptr(new ItemInstance(id, 1, data)); + return std::shared_ptr(new ItemInstance(id, 1, data)); } void ThinFenceTile::registerIcons(IconRegister *iconRegister) diff --git a/Minecraft.World/ThinFenceTile.h b/Minecraft.World/ThinFenceTile.h index ca3c501f..ab3829ba 100644 --- a/Minecraft.World/ThinFenceTile.h +++ b/Minecraft.World/ThinFenceTile.h @@ -12,20 +12,20 @@ private: public: ThinFenceTile(int id, const wstring &tex, const wstring &edgeTex, Material *material, bool dropsResources); - virtual int getResource(int data, Random *random, int playerBonusLevel); + virtual int getResource(int data, Random *random, int playerBonusLevel); virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); virtual int getRenderShape(); virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); virtual void updateDefaultShape(); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual Icon *getEdgeTexture(); bool attachsTo(int tile); protected: bool isSilkTouchable(); - shared_ptr getSilkTouchItemInstance(int data); + std::shared_ptr getSilkTouchItemInstance(int data); public: void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/ThornsEnchantment.cpp b/Minecraft.World/ThornsEnchantment.cpp index e2d9f1fa..8fbfab63 100644 --- a/Minecraft.World/ThornsEnchantment.cpp +++ b/Minecraft.World/ThornsEnchantment.cpp @@ -27,7 +27,7 @@ int ThornsEnchantment::getMaxLevel() return 3; } -bool ThornsEnchantment::canEnchant(shared_ptr item) +bool ThornsEnchantment::canEnchant(std::shared_ptr item) { ArmorItem *armor = dynamic_cast(item->getItem()); if (armor) return true; @@ -52,10 +52,10 @@ int ThornsEnchantment::getDamage(int level, Random *random) } } -void ThornsEnchantment::doThornsAfterAttack(shared_ptr source, shared_ptr target, Random *random) +void ThornsEnchantment::doThornsAfterAttack(std::shared_ptr source, std::shared_ptr target, Random *random) { int level = EnchantmentHelper::getArmorThorns(target); - shared_ptr item = EnchantmentHelper::getRandomItemWith(Enchantment::thorns, target); + std::shared_ptr item = EnchantmentHelper::getRandomItemWith(Enchantment::thorns, target); if (shouldHit(level, random)) { diff --git a/Minecraft.World/ThornsEnchantment.h b/Minecraft.World/ThornsEnchantment.h index 42f4326b..240888a0 100644 --- a/Minecraft.World/ThornsEnchantment.h +++ b/Minecraft.World/ThornsEnchantment.h @@ -13,8 +13,8 @@ public: virtual int getMinCost(int level); virtual int getMaxCost(int level); virtual int getMaxLevel(); - virtual bool canEnchant(shared_ptr item); + virtual bool canEnchant(std::shared_ptr item); static bool shouldHit(int level, Random *random); static int getDamage(int level, Random *random); - static void doThornsAfterAttack(shared_ptr source, shared_ptr target, Random *random); + static void doThornsAfterAttack(std::shared_ptr source, std::shared_ptr target, Random *random); }; \ No newline at end of file diff --git a/Minecraft.World/Throwable.cpp b/Minecraft.World/Throwable.cpp index 2f9567a1..7c5beb7d 100644 --- a/Minecraft.World/Throwable.cpp +++ b/Minecraft.World/Throwable.cpp @@ -37,7 +37,7 @@ bool Throwable::shouldRenderAtSqrDistance(double distance) return distance < size * size; } -Throwable::Throwable(Level *level, shared_ptr mob) : Entity(level) +Throwable::Throwable(Level *level, std::shared_ptr mob) : Entity(level) { _throwableInit(); this->owner = mob; @@ -171,12 +171,12 @@ void Throwable::tick() if (!level->isClientSide) { - shared_ptr hitEntity = nullptr; - vector > *objects = level->getEntities(shared_from_this(), this->bb->expand(xd, yd, zd)->grow(1, 1, 1)); + std::shared_ptr hitEntity = nullptr; + vector > *objects = level->getEntities(shared_from_this(), this->bb->expand(xd, yd, zd)->grow(1, 1, 1)); double nearest = 0; for (int i = 0; i < objects->size(); i++) { - shared_ptr e = objects->at(i); + std::shared_ptr e = objects->at(i); if (!e->isPickable() || (e == owner && flightTime < 5)) continue; float rr = 0.3f; diff --git a/Minecraft.World/Throwable.h b/Minecraft.World/Throwable.h index 4d7daea0..81f4cacc 100644 --- a/Minecraft.World/Throwable.h +++ b/Minecraft.World/Throwable.h @@ -20,7 +20,7 @@ public: int shakeTime; protected: - shared_ptr owner; + std::shared_ptr owner; private: int life; @@ -37,7 +37,7 @@ protected: public: virtual bool shouldRenderAtSqrDistance(double distance); - Throwable(Level *level, shared_ptr mob); + Throwable(Level *level, std::shared_ptr mob); Throwable(Level *level, double x, double y, double z); protected: diff --git a/Minecraft.World/ThrownEgg.cpp b/Minecraft.World/ThrownEgg.cpp index 45e5ca8c..dbdbf431 100644 --- a/Minecraft.World/ThrownEgg.cpp +++ b/Minecraft.World/ThrownEgg.cpp @@ -21,7 +21,7 @@ ThrownEgg::ThrownEgg(Level *level) : Throwable(level) _init(); } -ThrownEgg::ThrownEgg(Level *level, shared_ptr mob) : Throwable(level,mob) +ThrownEgg::ThrownEgg(Level *level, std::shared_ptr mob) : Throwable(level,mob) { _init(); } @@ -47,7 +47,7 @@ void ThrownEgg::onHit(HitResult *res) if (random->nextInt(32) == 0) count = 4; for (int i = 0; i < count; i++) { - shared_ptr chicken = shared_ptr( new Chicken(level) ); + std::shared_ptr chicken = std::shared_ptr( new Chicken(level) ); chicken->setAge(-20 * 60 * 20); chicken->moveTo(x, y, z, yRot, 0); diff --git a/Minecraft.World/ThrownEgg.h b/Minecraft.World/ThrownEgg.h index 864755b7..691ad5ae 100644 --- a/Minecraft.World/ThrownEgg.h +++ b/Minecraft.World/ThrownEgg.h @@ -15,7 +15,7 @@ private: public: ThrownEgg(Level *level); - ThrownEgg(Level *level, shared_ptr mob); + ThrownEgg(Level *level, std::shared_ptr mob); ThrownEgg(Level *level, double x, double y, double z); protected: diff --git a/Minecraft.World/ThrownEnderpearl.cpp b/Minecraft.World/ThrownEnderpearl.cpp index 1cddfb1f..778a4701 100644 --- a/Minecraft.World/ThrownEnderpearl.cpp +++ b/Minecraft.World/ThrownEnderpearl.cpp @@ -16,7 +16,7 @@ ThrownEnderpearl::ThrownEnderpearl(Level *level) : Throwable(level) this->defineSynchedData(); } -ThrownEnderpearl::ThrownEnderpearl(Level *level, shared_ptr mob) : Throwable(level,mob) +ThrownEnderpearl::ThrownEnderpearl(Level *level, std::shared_ptr mob) : Throwable(level,mob) { // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that // the derived version of the function is called @@ -47,7 +47,7 @@ void ThrownEnderpearl::onHit(HitResult *res) { // Fix for #67486 - TCR #001: BAS Game Stability: Customer Encountered: TU8: Code: Gameplay: The title crashes on Host's console when Client Player leaves the game before the Ender Pearl thrown by him touches the ground. // If the owner has been removed, then ignore - shared_ptr serverPlayer = dynamic_pointer_cast(owner); + std::shared_ptr serverPlayer = dynamic_pointer_cast(owner); if (serverPlayer != NULL && !serverPlayer->removed) { if(!serverPlayer->connection->done && serverPlayer->level == this->level) diff --git a/Minecraft.World/ThrownEnderpearl.h b/Minecraft.World/ThrownEnderpearl.h index 6f16ebfc..fc4035f2 100644 --- a/Minecraft.World/ThrownEnderpearl.h +++ b/Minecraft.World/ThrownEnderpearl.h @@ -11,7 +11,7 @@ public: static Entity *create(Level *level) { return new ThrownEnderpearl(level); } ThrownEnderpearl(Level *level); - ThrownEnderpearl(Level *level, shared_ptr mob); + ThrownEnderpearl(Level *level, std::shared_ptr mob); ThrownEnderpearl(Level *level, double x, double y, double z); protected: diff --git a/Minecraft.World/ThrownExpBottle.cpp b/Minecraft.World/ThrownExpBottle.cpp index 75d3d9a1..9640895e 100644 --- a/Minecraft.World/ThrownExpBottle.cpp +++ b/Minecraft.World/ThrownExpBottle.cpp @@ -11,7 +11,7 @@ ThrownExpBottle::ThrownExpBottle(Level *level) : Throwable(level) { } -ThrownExpBottle::ThrownExpBottle(Level *level, shared_ptr mob) : Throwable(level,mob) +ThrownExpBottle::ThrownExpBottle(Level *level, std::shared_ptr mob) : Throwable(level,mob) { } @@ -47,7 +47,7 @@ void ThrownExpBottle::onHit(HitResult *res) { int newCount = ExperienceOrb::getExperienceValue(xpCount); xpCount -= newCount; - level->addEntity(shared_ptr( new ExperienceOrb(level, x, y, z, newCount) ) ); + level->addEntity(std::shared_ptr( new ExperienceOrb(level, x, y, z, newCount) ) ); } remove(); diff --git a/Minecraft.World/ThrownExpBottle.h b/Minecraft.World/ThrownExpBottle.h index 8430794b..555c51ae 100644 --- a/Minecraft.World/ThrownExpBottle.h +++ b/Minecraft.World/ThrownExpBottle.h @@ -11,7 +11,7 @@ public: static Entity *create(Level *level) { return new ThrownExpBottle(level); } public: ThrownExpBottle(Level *level); - ThrownExpBottle(Level *level, shared_ptr mob); + ThrownExpBottle(Level *level, std::shared_ptr mob); ThrownExpBottle(Level *level, double x, double y, double z); protected: diff --git a/Minecraft.World/ThrownPotion.cpp b/Minecraft.World/ThrownPotion.cpp index 7375d661..09280476 100644 --- a/Minecraft.World/ThrownPotion.cpp +++ b/Minecraft.World/ThrownPotion.cpp @@ -14,7 +14,7 @@ const double ThrownPotion::SPLASH_RANGE = 4.0; const double ThrownPotion::SPLASH_RANGE_SQ = ThrownPotion::SPLASH_RANGE * ThrownPotion::SPLASH_RANGE; void ThrownPotion::_init() -{ +{ // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that // the derived version of the function is called this->defineSynchedData(); @@ -27,7 +27,7 @@ ThrownPotion::ThrownPotion(Level *level) : Throwable(level) _init(); } -ThrownPotion::ThrownPotion(Level *level, shared_ptr mob, int potionValue) : Throwable(level,mob) +ThrownPotion::ThrownPotion(Level *level, std::shared_ptr mob, int potionValue) : Throwable(level,mob) { _init(); @@ -74,15 +74,15 @@ void ThrownPotion::onHit(HitResult *res) if (mobEffects != NULL && !mobEffects->empty()) { AABB *aoe = bb->grow(SPLASH_RANGE, SPLASH_RANGE / 2, SPLASH_RANGE); - vector > *entitiesOfClass = level->getEntitiesOfClass(typeid(Mob), aoe); + vector > *entitiesOfClass = level->getEntitiesOfClass(typeid(Mob), aoe); if (entitiesOfClass != NULL && !entitiesOfClass->empty()) { //for (Entity e : entitiesOfClass) for(AUTO_VAR(it, entitiesOfClass->begin()); it != entitiesOfClass->end(); ++it) { - //shared_ptr e = *it; - shared_ptr e = dynamic_pointer_cast( *it ); + //std::shared_ptr e = *it; + std::shared_ptr e = dynamic_pointer_cast( *it ); double dist = distanceToSqr(e); if (dist < SPLASH_RANGE_SQ) { diff --git a/Minecraft.World/ThrownPotion.h b/Minecraft.World/ThrownPotion.h index cf27491c..517b05ef 100644 --- a/Minecraft.World/ThrownPotion.h +++ b/Minecraft.World/ThrownPotion.h @@ -22,7 +22,7 @@ private: public: ThrownPotion(Level *level); - ThrownPotion(Level *level, shared_ptr mob, int potionValue); + ThrownPotion(Level *level, std::shared_ptr mob, int potionValue); ThrownPotion(Level *level, double x, double y, double z, int potionValue); protected: diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index 77a62c8d..5862c934 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -798,7 +798,7 @@ AABB *Tile::getTileAABB(Level *level, int x, int y, int z) return AABB::newTemp(x + tls->xx0, y + tls->yy0, z + tls->zz0, x + tls->xx1, y + tls->yy1, z + tls->zz1); } -void Tile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void Tile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { AABB *aabb = getAABB(level, x, y, z); if (aabb != NULL && box->intersects(aabb)) boxes->push_back(aabb); @@ -870,7 +870,7 @@ int Tile::getResource(int data, Random *random, int playerBonusLevel) return id; } -float Tile::getDestroyProgress(shared_ptr player, Level *level, int x, int y, int z) +float Tile::getDestroyProgress(std::shared_ptr player, Level *level, int x, int y, int z) { float destroySpeed = getDestroySpeed(level, x, y, z); if (destroySpeed < 0) return 0; @@ -893,11 +893,11 @@ void Tile::spawnResources(Level *level, int x, int y, int z, int data, float odd int type = getResource(data, level->random, playerBonusLevel); if (type <= 0) continue; - popResource(level, x, y, z, shared_ptr( new ItemInstance(type, 1, getSpawnResourcesAuxValue(data) ) ) ); + popResource(level, x, y, z, std::shared_ptr( new ItemInstance(type, 1, getSpawnResourcesAuxValue(data) ) ) ); } } -void Tile::popResource(Level *level, int x, int y, int z, shared_ptr itemInstance) +void Tile::popResource(Level *level, int x, int y, int z, std::shared_ptr itemInstance) { if( level->isClientSide ) return; @@ -905,7 +905,7 @@ void Tile::popResource(Level *level, int x, int y, int z, shared_ptrrandom->nextFloat() * s + (1 - s) * 0.5; double yo = level->random->nextFloat() * s + (1 - s) * 0.5; double zo = level->random->nextFloat() * s + (1 - s) * 0.5; - shared_ptr item = shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, itemInstance ) ); + std::shared_ptr item = std::shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, itemInstance ) ); item->throwTime = 10; level->addEntity(item); } @@ -919,7 +919,7 @@ void Tile::popExperience(Level *level, int x, int y, int z, int amount) { int newCount = ExperienceOrb::getExperienceValue(amount); amount -= newCount; - level->addEntity(shared_ptr( new ExperienceOrb(level, x + .5, y + .5, z + .5, newCount))); + level->addEntity(std::shared_ptr( new ExperienceOrb(level, x + .5, y + .5, z + .5, newCount))); } } } @@ -929,7 +929,7 @@ int Tile::getSpawnResourcesAuxValue(int data) return 0; } -float Tile::getExplosionResistance(shared_ptr source) +float Tile::getExplosionResistance(std::shared_ptr source) { return explosionResistance / 5.0f; } @@ -1030,17 +1030,17 @@ bool Tile::TestUse() return false; } -bool Tile::TestUse(Level *level, int x, int y, int z, shared_ptr player) +bool Tile::TestUse(Level *level, int x, int y, int z, std::shared_ptr player) { return false; } -bool Tile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool Tile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { return false; } -void Tile::stepOn(Level *level, int x, int y, int z, shared_ptr entity) +void Tile::stepOn(Level *level, int x, int y, int z, std::shared_ptr entity) { } @@ -1053,15 +1053,15 @@ void Tile::prepareRender(Level *level, int x, int y, int z) { } -void Tile::attack(Level *level, int x, int y, int z, shared_ptr player) +void Tile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { } -void Tile::handleEntityInside(Level *level, int x, int y, int z, shared_ptr e, Vec3 *current) +void Tile::handleEntityInside(Level *level, int x, int y, int z, std::shared_ptr e, Vec3 *current) { } -void Tile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void Tile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { ThreadStorage *tls = (ThreadStorage *)TlsGetValue(Tile::tlsIdxShape); // 4J Stu - Added this so that the TLS shape is correct for this tile @@ -1151,7 +1151,7 @@ bool Tile::isSignalSource() return false; } -void Tile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void Tile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { } @@ -1165,7 +1165,7 @@ void Tile::updateDefaultShape() setShape(0,0,0,1,1,1); } -void Tile::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +void Tile::playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data) { // 4J Stu - Special case - only record a crop destroy if is fully grown if( id==Tile::crops_Id ) @@ -1208,7 +1208,7 @@ void Tile::playerDestroy(Level *level, shared_ptr player, int x, int y, if (isSilkTouchable() && EnchantmentHelper::hasSilkTouch(player->inventory)) { - shared_ptr item = getSilkTouchItemInstance(data); + std::shared_ptr item = getSilkTouchItemInstance(data); if (item != NULL) { popResource(level, x, y, z, item); @@ -1226,14 +1226,14 @@ bool Tile::isSilkTouchable() return isCubeShaped() && !_isEntityTile; } -shared_ptr Tile::getSilkTouchItemInstance(int data) +std::shared_ptr Tile::getSilkTouchItemInstance(int data) { int popData = 0; if (id >= 0 && id < Item::items.length && Item::items[id]->isStackedByData()) { popData = data; } - return shared_ptr(new ItemInstance(id, 1, popData)); + return std::shared_ptr(new ItemInstance(id, 1, popData)); } int Tile::getResourceCountForLootBonus(int bonusLevel, Random *random) @@ -1246,7 +1246,7 @@ bool Tile::canSurvive(Level *level, int x, int y, int z) return true; } -void Tile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void Tile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { } @@ -1307,7 +1307,7 @@ float Tile::getShadeBrightness(LevelSource *level, int x, int y, int z) return level->isSolidBlockingTile(x, y, z) ? 0.2f : 1.0f; } -void Tile::fallOn(Level *level, int x, int y, int z, shared_ptr entity, float fallDistance) +void Tile::fallOn(Level *level, int x, int y, int z, std::shared_ptr entity, float fallDistance) { } @@ -1321,7 +1321,7 @@ int Tile::cloneTileData(Level *level, int x, int y, int z) return getSpawnResourcesAuxValue(level->getData(x, y, z)); } -void Tile::playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player) +void Tile::playerWillDestroy(Level *level, int x, int y, int z, int data, std::shared_ptr player) { } diff --git a/Minecraft.World/Tile.h b/Minecraft.World/Tile.h index fb17f917..999f10c9 100644 --- a/Minecraft.World/Tile.h +++ b/Minecraft.World/Tile.h @@ -545,7 +545,7 @@ public: virtual Icon *getTexture(int face, int data); virtual Icon *getTexture(int face); virtual AABB *getTileAABB(Level *level, int x, int y, int z); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); virtual AABB *getAABB(Level *level, int x, int y, int z); virtual bool isSolidRender(bool isServerLevel = false); // 4J - Added isServerLevel param virtual bool mayPick(int data, bool liquid); @@ -560,16 +560,16 @@ public: virtual void onRemove(Level *level, int x, int y, int z, int id, int data); virtual int getResourceCount(Random *random); virtual int getResource(int data, Random *random, int playerBonusLevel); - virtual float getDestroyProgress(shared_ptr player, Level *level, int x, int y, int z); + virtual float getDestroyProgress(std::shared_ptr player, Level *level, int x, int y, int z); virtual void spawnResources(Level *level, int x, int y, int z, int data, int playerBonusLevel); virtual void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel); protected: - virtual void popResource(Level *level, int x, int y, int z, shared_ptr itemInstance); + virtual void popResource(Level *level, int x, int y, int z, std::shared_ptr itemInstance); virtual void popExperience(Level *level, int x, int y, int z, int amount); public: virtual int getSpawnResourcesAuxValue(int data); - virtual float getExplosionResistance(shared_ptr source); + virtual float getExplosionResistance(std::shared_ptr source); virtual HitResult *clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b); private: virtual bool containsX(Vec3 *v); @@ -581,14 +581,14 @@ public: virtual bool mayPlace(Level *level, int x, int y, int z, int face); virtual bool mayPlace(Level *level, int x, int y, int z); virtual bool TestUse(); - virtual bool TestUse(Level *level, int x, int y, int z, shared_ptr player); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param - virtual void stepOn(Level *level, int x, int y, int z, shared_ptr entity); + virtual bool TestUse(Level *level, int x, int y, int z, std::shared_ptr player); + virtual bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual void stepOn(Level *level, int x, int y, int z, std::shared_ptr entity); virtual int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue); virtual void prepareRender(Level *level, int x, int y, int z); - virtual void attack(Level *level, int x, int y, int z, shared_ptr player); - virtual void handleEntityInside(Level *level, int x, int y, int z, shared_ptr e, Vec3 *current); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void attack(Level *level, int x, int y, int z, std::shared_ptr player); + virtual void handleEntityInside(Level *level, int x, int y, int z, std::shared_ptr e, Vec3 *current); + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual double getShapeX0(); virtual double getShapeX1(); virtual double getShapeY0(); @@ -602,17 +602,17 @@ public: virtual bool getSignal(LevelSource *level, int x, int y, int z); virtual bool getSignal(LevelSource *level, int x, int y, int z, int dir); virtual bool isSignalSource(); - virtual void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + virtual void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); virtual bool getDirectSignal(Level *level, int x, int y, int z, int dir); virtual void updateDefaultShape(); - virtual void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data); + virtual void playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data); virtual bool canSurvive(Level *level, int x, int y, int z); protected: virtual bool isSilkTouchable(); - virtual shared_ptr getSilkTouchItemInstance(int data); + virtual std::shared_ptr getSilkTouchItemInstance(int data); public: virtual int getResourceCountForLootBonus(int bonusLevel, Random *random); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); virtual void finalizePlacement(Level *level, int x, int y, int z, int data); virtual Tile *setDescriptionId(unsigned int id); virtual wstring getName(); @@ -630,10 +630,10 @@ protected: public: virtual int getPistonPushReaction(); virtual float getShadeBrightness(LevelSource *level, int x, int y, int z); // 4J - brought forward from 1.8.2 - virtual void fallOn(Level *level, int x, int y, int z, shared_ptr entity, float fallDistance); + virtual void fallOn(Level *level, int x, int y, int z, std::shared_ptr entity, float fallDistance); virtual int cloneTileId(Level *level, int x, int y, int z); virtual int cloneTileData(Level *level, int x, int y, int z); - virtual void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player); + virtual void playerWillDestroy(Level *level, int x, int y, int z, int data, std::shared_ptr player); virtual void onRemoving(Level *level, int x, int y, int z, int data); virtual void handleRain(Level *level, int x, int y, int z); virtual void levelTimeChanged(Level *level, int64_t delta, int64_t newTime); diff --git a/Minecraft.World/TileDestructionPacket.cpp b/Minecraft.World/TileDestructionPacket.cpp index e009e0e0..98aa4ad5 100644 --- a/Minecraft.World/TileDestructionPacket.cpp +++ b/Minecraft.World/TileDestructionPacket.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.network.packet.h" #include "TileDestructionPacket.h" -TileDestructionPacket::TileDestructionPacket() +TileDestructionPacket::TileDestructionPacket() { id = 0; x = 0; @@ -78,8 +78,8 @@ bool TileDestructionPacket::canBeInvalidated() return true; } -bool TileDestructionPacket::isInvalidatedBy(shared_ptr packet) +bool TileDestructionPacket::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target->id == id; } \ No newline at end of file diff --git a/Minecraft.World/TileDestructionPacket.h b/Minecraft.World/TileDestructionPacket.h index 20cd7db9..394ffaa1 100644 --- a/Minecraft.World/TileDestructionPacket.h +++ b/Minecraft.World/TileDestructionPacket.h @@ -27,9 +27,9 @@ public: int getState(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new TileDestructionPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TileDestructionPacket()); } virtual int getId() { return 55; } }; \ No newline at end of file diff --git a/Minecraft.World/TileEntity.cpp b/Minecraft.World/TileEntity.cpp index 0790601d..d4874928 100644 --- a/Minecraft.World/TileEntity.cpp +++ b/Minecraft.World/TileEntity.cpp @@ -89,14 +89,14 @@ void TileEntity::tick() { } -shared_ptr TileEntity::loadStatic(CompoundTag *tag) +std::shared_ptr TileEntity::loadStatic(CompoundTag *tag) { - shared_ptr entity = nullptr; + std::shared_ptr entity = nullptr; //try //{ AUTO_VAR(it, idCreateMap.find(tag->getString(L"id"))); - if (it != idCreateMap.end() ) entity = shared_ptr(it->second()); + if (it != idCreateMap.end() ) entity = std::shared_ptr(it->second()); //} //catch (Exception e) //{ @@ -152,7 +152,7 @@ Tile *TileEntity::getTile() return tile; } -shared_ptr TileEntity::getUpdatePacket() +std::shared_ptr TileEntity::getUpdatePacket() { return nullptr; } @@ -200,7 +200,7 @@ void TileEntity::upgradeRenderRemoveStage() } // 4J Added -void TileEntity::clone(shared_ptr tileEntity) +void TileEntity::clone(std::shared_ptr tileEntity) { tileEntity->level = this->level; tileEntity->x = this->x; diff --git a/Minecraft.World/TileEntity.h b/Minecraft.World/TileEntity.h index aa3ced4f..87a3483a 100644 --- a/Minecraft.World/TileEntity.h +++ b/Minecraft.World/TileEntity.h @@ -54,13 +54,13 @@ public: virtual void load(CompoundTag *tag); virtual void save(CompoundTag *tag); virtual void tick(); - static shared_ptr loadStatic(CompoundTag *tag); + static std::shared_ptr loadStatic(CompoundTag *tag); int getData(); void setData(int data); void setChanged(); double distanceToSqr(double xPlayer, double yPlayer, double zPlayer); Tile *getTile(); - virtual shared_ptr getUpdatePacket(); + virtual std::shared_ptr getUpdatePacket(); virtual bool isRemoved(); virtual void setRemoved(); virtual void clearRemoved(); @@ -68,7 +68,7 @@ public: virtual void clearCache(); // 4J Added - virtual shared_ptr clone() = 0; + virtual std::shared_ptr clone() = 0; protected: - void clone(shared_ptr tileEntity); + void clone(std::shared_ptr tileEntity); }; \ No newline at end of file diff --git a/Minecraft.World/TileEntityDataPacket.h b/Minecraft.World/TileEntityDataPacket.h index 2ee998f3..522392ed 100644 --- a/Minecraft.World/TileEntityDataPacket.h +++ b/Minecraft.World/TileEntityDataPacket.h @@ -31,6 +31,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new TileEntityDataPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TileEntityDataPacket()); } virtual int getId() { return 132; } }; \ No newline at end of file diff --git a/Minecraft.World/TileEventPacket.h b/Minecraft.World/TileEventPacket.h index ca2685fa..b1d60bad 100644 --- a/Minecraft.World/TileEventPacket.h +++ b/Minecraft.World/TileEventPacket.h @@ -17,6 +17,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new TileEventPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TileEventPacket()); } virtual int getId() { return 54; } }; \ No newline at end of file diff --git a/Minecraft.World/TileItem.cpp b/Minecraft.World/TileItem.cpp index 8f624bff..12ed3257 100644 --- a/Minecraft.World/TileItem.cpp +++ b/Minecraft.World/TileItem.cpp @@ -17,13 +17,13 @@ using namespace std; #include -TileItem::TileItem(int id) : Item(id) +TileItem::TileItem(int id) : Item(id) { this->tileId = id + 256; itemIcon = NULL; } -int TileItem::getTileId() +int TileItem::getTileId() { return tileId; } @@ -46,18 +46,18 @@ Icon *TileItem::getIcon(int auxValue) return Tile::tiles[tileId]->getTexture(Facing::UP, auxValue); } -bool TileItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool TileItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { // 4J-PB - Adding a test only version to allow tooltips to be displayed int currentTile = level->getTile(x, y, z); - if (currentTile == Tile::topSnow_Id) + if (currentTile == Tile::topSnow_Id) { face = Facing::UP; } else if (currentTile == Tile::vine_Id || currentTile == Tile::tallgrass_Id || currentTile == Tile::deadBush_Id) { } - else + else { if (face == 0) y--; if (face == 1) y++; @@ -75,7 +75,7 @@ bool TileItem::useOn(shared_ptr instance, shared_ptr playe int undertile = level->getTile(x,y-1,z); // For 'BodyGuard' achievement. - if (level->mayPlace(tileId, x, y, z, false, face, player)) + if (level->mayPlace(tileId, x, y, z, false, face, player)) { if(!bTestUseOnOnly) { @@ -83,7 +83,7 @@ bool TileItem::useOn(shared_ptr instance, shared_ptr playe // 4J - Adding this from 1.6 int itemValue = getLevelDataForAuxValue(instance->getAuxValue()); int dataValue = Tile::tiles[tileId]->getPlacedOnFaceDataValue(level, x, y, z, face, clickX, clickY, clickZ, itemValue); - if (level->setTileAndData(x, y, z, tileId, dataValue)) + if (level->setTileAndData(x, y, z, tileId, dataValue)) { // 4J-JEV: Snow/Iron Golems do not have owners apparently. int newTileId = level->getTile(x,y,z); @@ -115,7 +115,7 @@ bool TileItem::useOn(shared_ptr instance, shared_ptr playe Tile::tiles[tileId]->setPlacedBy(level, x, y, z, player); Tile::tiles[tileId]->finalizePlacement(level, x, y, z, dataValue); } - + // 4J-PB - Java 1.4 change - getStepSound replaced with getPlaceSound //level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, tile->soundType->getStepSound(), (tile->soundType->getVolume() + 1) / 2, tile->soundType->getPitch() * 0.8f); #ifdef _DEBUG @@ -125,7 +125,7 @@ bool TileItem::useOn(shared_ptr instance, shared_ptr playe // char szPlaceSoundName[256]; // char szStepSoundName[256]; // Minecraft *pMinecraft = Minecraft::GetInstance(); -// +// // if(iPlaceSound==-1) // { // strcpy(szPlaceSoundName,"NULL"); @@ -162,14 +162,14 @@ bool TileItem::useOn(shared_ptr instance, shared_ptr playe } -bool TileItem::mayPlace(Level *level, int x, int y, int z, int face, shared_ptr player, shared_ptr item) +bool TileItem::mayPlace(Level *level, int x, int y, int z, int face, std::shared_ptr player, std::shared_ptr item) { int currentTile = level->getTile(x, y, z); - if (currentTile == Tile::topSnow_Id) + if (currentTile == Tile::topSnow_Id) { face = Facing::UP; - } - else if (currentTile != Tile::vine_Id && currentTile != Tile::tallgrass_Id && currentTile != Tile::deadBush_Id) + } + else if (currentTile != Tile::vine_Id && currentTile != Tile::tallgrass_Id && currentTile != Tile::deadBush_Id) { if (face == 0) y--; if (face == 1) y++; @@ -188,25 +188,25 @@ int TileItem::getColor(int itemAuxValue, int spriteLayer) return Tile::tiles[tileId]->getColor(); } -unsigned int TileItem::getDescriptionId(shared_ptr instance) +unsigned int TileItem::getDescriptionId(std::shared_ptr instance) { return Tile::tiles[tileId]->getDescriptionId(); } -unsigned int TileItem::getDescriptionId(int iData /*= -1*/) +unsigned int TileItem::getDescriptionId(int iData /*= -1*/) { return Tile::tiles[tileId]->getDescriptionId(iData); } -unsigned int TileItem::getUseDescriptionId(shared_ptr instance) +unsigned int TileItem::getUseDescriptionId(std::shared_ptr instance) { return Tile::tiles[tileId]->getUseDescriptionId(); } -unsigned int TileItem::getUseDescriptionId() +unsigned int TileItem::getUseDescriptionId() { return Tile::tiles[tileId]->getUseDescriptionId(); } diff --git a/Minecraft.World/TileItem.h b/Minecraft.World/TileItem.h index ac341acc..c1492c38 100644 --- a/Minecraft.World/TileItem.h +++ b/Minecraft.World/TileItem.h @@ -11,13 +11,13 @@ class TileItem : public Item public: static const int _class = 0; using Item::getColor; -private: +private: int tileId; Icon *itemIcon; public: - TileItem(int id); - + TileItem(int id); + virtual int getTileId(); //@Override @@ -26,18 +26,18 @@ public: //@Override Icon *getIcon(int auxValue); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual unsigned int getDescriptionId(std::shared_ptr instance); virtual unsigned int getDescriptionId(int iData = -1); // 4J Added virtual int getColor(int itemAuxValue, int spriteLayer); // 4J Added - virtual unsigned int getUseDescriptionId(shared_ptr instance); + virtual unsigned int getUseDescriptionId(std::shared_ptr instance); virtual unsigned int getUseDescriptionId(); - virtual bool mayPlace(Level *level, int x, int y, int z, int face, shared_ptr player, shared_ptr item); + virtual bool mayPlace(Level *level, int x, int y, int z, int face, std::shared_ptr player, std::shared_ptr item); //@Override virtual void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/TilePlanterItem.cpp b/Minecraft.World/TilePlanterItem.cpp index 883da76e..3b281ba9 100644 --- a/Minecraft.World/TilePlanterItem.cpp +++ b/Minecraft.World/TilePlanterItem.cpp @@ -15,14 +15,14 @@ TilePlanterItem::TilePlanterItem(int id, Tile *tile) : Item(id) this->tileId = tile->id; } -bool TilePlanterItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +bool TilePlanterItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { // 4J-PB - Adding a test only version to allow tooltips to be displayed int currentTile = level->getTile(x, y, z); - if (currentTile == Tile::topSnow_Id) + if (currentTile == Tile::topSnow_Id) { face = Facing::UP; - } + } else if (currentTile == Tile::vine_Id || currentTile == Tile::tallgrass_Id || currentTile == Tile::deadBush_Id) { } @@ -39,7 +39,7 @@ bool TilePlanterItem::useOn(shared_ptr instance, shared_ptrmayBuild(x, y, z)) return false; if (instance->count == 0) return false; - if (level->mayPlace(tileId, x, y, z, false, face, nullptr)) + if (level->mayPlace(tileId, x, y, z, false, face, nullptr)) { if(!bTestUseOnOnly) { @@ -63,13 +63,13 @@ bool TilePlanterItem::useOn(shared_ptr instance, shared_ptrcount--; } } - } + } } else { diff --git a/Minecraft.World/TilePlanterItem.h b/Minecraft.World/TilePlanterItem.h index d1577cd1..a7cb4386 100644 --- a/Minecraft.World/TilePlanterItem.h +++ b/Minecraft.World/TilePlanterItem.h @@ -11,5 +11,5 @@ private: public: TilePlanterItem(int id, Tile *tile); - virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); + virtual bool useOn(std::shared_ptr instance, std::shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); }; \ No newline at end of file diff --git a/Minecraft.World/TileUpdatePacket.h b/Minecraft.World/TileUpdatePacket.h index fe69c763..4ed1a9c8 100644 --- a/Minecraft.World/TileUpdatePacket.h +++ b/Minecraft.World/TileUpdatePacket.h @@ -18,6 +18,6 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new TileUpdatePacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TileUpdatePacket()); } virtual int getId() { return 53; } }; \ No newline at end of file diff --git a/Minecraft.World/TimeCommand.cpp b/Minecraft.World/TimeCommand.cpp index e667a420..0c387b79 100644 --- a/Minecraft.World/TimeCommand.cpp +++ b/Minecraft.World/TimeCommand.cpp @@ -10,7 +10,7 @@ EGameCommand TimeCommand::getId() return eGameCommand_Time; } -void TimeCommand::execute(shared_ptr source, byteArray commandData) +void TimeCommand::execute(std::shared_ptr source, byteArray commandData) { ByteArrayInputStream bais(commandData); DataInputStream dis(&bais); @@ -52,7 +52,7 @@ void TimeCommand::execute(shared_ptr source, byteArray commandDat //throw new UsageException("commands.time.usage"); } -void TimeCommand::doSetTime(shared_ptr source, int value) +void TimeCommand::doSetTime(std::shared_ptr source, int value) { for (int i = 0; i < MinecraftServer::getInstance()->levels.length; i++) { @@ -60,7 +60,7 @@ void TimeCommand::doSetTime(shared_ptr source, int value) } } -void TimeCommand::doAddTime(shared_ptr source, int value) +void TimeCommand::doAddTime(std::shared_ptr source, int value) { for (int i = 0; i < MinecraftServer::getInstance()->levels.length; i++) { @@ -69,12 +69,12 @@ void TimeCommand::doAddTime(shared_ptr source, int value) } } -shared_ptr TimeCommand::preparePacket(bool night) +std::shared_ptr TimeCommand::preparePacket(bool night) { ByteArrayOutputStream baos; DataOutputStream dos(&baos); dos.writeBoolean(night); - return shared_ptr( new GameCommandPacket(eGameCommand_Time, baos.toByteArray() )); + return std::shared_ptr( new GameCommandPacket(eGameCommand_Time, baos.toByteArray() )); } \ No newline at end of file diff --git a/Minecraft.World/TimeCommand.h b/Minecraft.World/TimeCommand.h index f87fb27c..da7008b2 100644 --- a/Minecraft.World/TimeCommand.h +++ b/Minecraft.World/TimeCommand.h @@ -6,12 +6,12 @@ class TimeCommand : public Command { public: virtual EGameCommand getId(); - virtual void execute(shared_ptr source, byteArray commandData); + virtual void execute(std::shared_ptr source, byteArray commandData); protected: - void doSetTime(shared_ptr source, int value); - void doAddTime(shared_ptr source, int value); + void doSetTime(std::shared_ptr source, int value); + void doAddTime(std::shared_ptr source, int value); public: - static shared_ptr preparePacket(bool night); + static std::shared_ptr preparePacket(bool night); }; \ No newline at end of file diff --git a/Minecraft.World/TntTile.cpp b/Minecraft.World/TntTile.cpp index b422959c..5d47a2ac 100644 --- a/Minecraft.World/TntTile.cpp +++ b/Minecraft.World/TntTile.cpp @@ -53,13 +53,13 @@ void TntTile::wasExploded(Level *level, int x, int y, int z) { // 4J - added - don't every create on the client, I think this must be the cause of a bug reported in the java // version where white tnts are created in the network game - if (level->isClientSide) return; + if (level->isClientSide) return; // 4J - added condition to have finite limit of these // 4J-JEV: Fix for #90934 - Customer Encountered: TU11: Content: Gameplay: TNT blocks are triggered by explosions even though "TNT explodes" option is unchecked. if( level->newPrimedTntAllowed() && app.GetGameHostOption(eGameHostOption_TNT) ) { - shared_ptr primed = shared_ptr( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) ); + std::shared_ptr primed = std::shared_ptr( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) ); primed->life = level->random->nextInt(primed->life / 4) + primed->life / 8; level->addEntity(primed); } @@ -74,14 +74,14 @@ void TntTile::destroy(Level *level, int x, int y, int z, int data) // 4J - added condition to have finite limit of these if( level->newPrimedTntAllowed() && app.GetGameHostOption(eGameHostOption_TNT) ) { - shared_ptr tnt = shared_ptr( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) ); + std::shared_ptr tnt = std::shared_ptr( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) ); level->addEntity(tnt); level->playSound(tnt, eSoundType_RANDOM_FUSE, 1, 1.0f); } } } -bool TntTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool TntTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if (soundOnly) return false; if (player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::flintAndSteel_Id) @@ -93,12 +93,12 @@ bool TntTile::use(Level *level, int x, int y, int z, shared_ptr player, return Tile::use(level, x, y, z, player, clickedFace, clickX, clickY, clickZ); } -void TntTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void TntTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { if (entity->GetType() == eTYPE_ARROW && !level->isClientSide) { // 4J Stu - Don't need to cast this - //shared_ptr arrow = dynamic_pointer_cast(entity); + //std::shared_ptr arrow = dynamic_pointer_cast(entity); if (entity->isOnFire()) { destroy(level, x, y, z, EXPLODE_BIT); @@ -107,12 +107,12 @@ void TntTile::entityInside(Level *level, int x, int y, int z, shared_ptr } } -shared_ptr TntTile::getSilkTouchItemInstance(int data) +std::shared_ptr TntTile::getSilkTouchItemInstance(int data) { return nullptr; } -void TntTile::registerIcons(IconRegister *iconRegister) +void TntTile::registerIcons(IconRegister *iconRegister) { icon = iconRegister->registerIcon(L"tnt_side"); iconTop = iconRegister->registerIcon(L"tnt_top"); diff --git a/Minecraft.World/TntTile.h b/Minecraft.World/TntTile.h index 27b788c6..b628e01c 100644 --- a/Minecraft.World/TntTile.h +++ b/Minecraft.World/TntTile.h @@ -23,9 +23,9 @@ public: void destroy(Level *level, int x, int y, int z, int data); - bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param - void entityInside(Level *level, int x, int y, int z, shared_ptr entity); - virtual shared_ptr getSilkTouchItemInstance(int data); + void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); + virtual std::shared_ptr getSilkTouchItemInstance(int data); void registerIcons(IconRegister *iconRegister); }; \ No newline at end of file diff --git a/Minecraft.World/ToggleDownfallCommand.cpp b/Minecraft.World/ToggleDownfallCommand.cpp index 1ae2f3a9..9eebc3f3 100644 --- a/Minecraft.World/ToggleDownfallCommand.cpp +++ b/Minecraft.World/ToggleDownfallCommand.cpp @@ -12,7 +12,7 @@ EGameCommand ToggleDownfallCommand::getId() return eGameCommand_ToggleDownfall; } -void ToggleDownfallCommand::execute(shared_ptr source, byteArray commandData) +void ToggleDownfallCommand::execute(std::shared_ptr source, byteArray commandData) { doToggleDownfall(); logAdminAction(source, ChatPacket::e_ChatCustom, L"commands.downfall.success"); @@ -24,7 +24,7 @@ void ToggleDownfallCommand::doToggleDownfall() MinecraftServer::getInstance()->levels[0]->getLevelData()->setThundering(true); } -shared_ptr ToggleDownfallCommand::preparePacket() +std::shared_ptr ToggleDownfallCommand::preparePacket() { - return shared_ptr( new GameCommandPacket(eGameCommand_ToggleDownfall, byteArray() )); + return std::shared_ptr( new GameCommandPacket(eGameCommand_ToggleDownfall, byteArray() )); } \ No newline at end of file diff --git a/Minecraft.World/ToggleDownfallCommand.h b/Minecraft.World/ToggleDownfallCommand.h index 2954962b..a19b7251 100644 --- a/Minecraft.World/ToggleDownfallCommand.h +++ b/Minecraft.World/ToggleDownfallCommand.h @@ -7,11 +7,11 @@ class ToggleDownfallCommand : public Command { public: virtual EGameCommand getId(); - virtual void execute(shared_ptr source, byteArray commandData); + virtual void execute(std::shared_ptr source, byteArray commandData); protected: void doToggleDownfall(); public: - static shared_ptr preparePacket(); + static std::shared_ptr preparePacket(); }; \ No newline at end of file diff --git a/Minecraft.World/TopSnowTile.cpp b/Minecraft.World/TopSnowTile.cpp index 9bcf5527..c9e92f4a 100644 --- a/Minecraft.World/TopSnowTile.cpp +++ b/Minecraft.World/TopSnowTile.cpp @@ -64,7 +64,7 @@ void TopSnowTile::updateDefaultShape() updateShape(0); } -void TopSnowTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void TopSnowTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { updateShape(level->getData(x, y, z)); } @@ -104,14 +104,14 @@ bool TopSnowTile::checkCanSurvive(Level *level, int x, int y, int z) } -void TopSnowTile::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +void TopSnowTile::playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data) { int type = Item::snowBall->id; float s = 0.7f; double xo = level->random->nextFloat() * s + (1 - s) * 0.5; double yo = level->random->nextFloat() * s + (1 - s) * 0.5; double zo = level->random->nextFloat() * s + (1 - s) * 0.5; - shared_ptr item = shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, shared_ptr( new ItemInstance(type, 1, 0) ) ) ); + std::shared_ptr item = std::shared_ptr( new ItemEntity(level, x + xo, y + yo, z + zo, std::shared_ptr( new ItemInstance(type, 1, 0) ) ) ); item->throwTime = 10; level->addEntity(item); level->setTile(x, y, z, 0); diff --git a/Minecraft.World/TopSnowTile.h b/Minecraft.World/TopSnowTile.h index 059f0f42..ba4c69a5 100644 --- a/Minecraft.World/TopSnowTile.h +++ b/Minecraft.World/TopSnowTile.h @@ -32,7 +32,7 @@ public: public: void updateDefaultShape(); - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param protected: void updateShape(int data); @@ -47,7 +47,7 @@ private: bool checkCanSurvive(Level *level, int x, int y, int z); public: - void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data); + void playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data); public: int getResource(int data, Random *random, int playerBonusLevel); @@ -60,7 +60,7 @@ public: public: bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face); - + // 4J Added so we can check before we try to add a tile to the tick list if it's actually going to do seomthing virtual bool shouldTileTick(Level *level, int x,int y,int z); }; diff --git a/Minecraft.World/TorchTile.cpp b/Minecraft.World/TorchTile.cpp index ea1d2ab7..5cbeeae7 100644 --- a/Minecraft.World/TorchTile.cpp +++ b/Minecraft.World/TorchTile.cpp @@ -20,7 +20,7 @@ AABB *TorchTile::getTileAABB(Level *level, int x, int y, int z) return Tile::getTileAABB(level, x, y, z); } -void TorchTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void TorchTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { setShape(level->getData(x, y, z)); } @@ -75,7 +75,7 @@ bool TorchTile::isConnection(Level *level, int x, int y, int z) return true; } int tile = level->getTile(x, y, z); - if (tile == Tile::fence_Id || tile == Tile::netherFence_Id + if (tile == Tile::fence_Id || tile == Tile::netherFence_Id || tile == Tile::glass_Id || tile == Tile::cobbleWall_Id) { return true; diff --git a/Minecraft.World/TorchTile.h b/Minecraft.World/TorchTile.h index 7e27f2ee..7b6c8bac 100644 --- a/Minecraft.World/TorchTile.h +++ b/Minecraft.World/TorchTile.h @@ -13,7 +13,7 @@ protected: public: virtual AABB *getAABB(Level *level, int x, int y, int z); virtual AABB *getTileAABB(Level *level, int x, int y, int z); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param using Tile::setShape; virtual void setShape(int data); virtual bool isSolidRender(bool isServerLevel = false); @@ -30,7 +30,7 @@ private: public: virtual HitResult *clip(Level *level, int x, int y, int z, Vec3 *a, Vec3 *b); virtual void animateTick(Level *level, int xt, int yt, int zt, Random *random); - + // 4J Added so we can check before we try to add a tile to the tick list if it's actually going to do seomthing virtual bool shouldTileTick(Level *level, int x,int y,int z); }; diff --git a/Minecraft.World/TradeItemPacket.h b/Minecraft.World/TradeItemPacket.h index ecd0f707..c6c8ae28 100644 --- a/Minecraft.World/TradeItemPacket.h +++ b/Minecraft.World/TradeItemPacket.h @@ -25,7 +25,7 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new TradeItemPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new TradeItemPacket()); } virtual int getId() { return 151; } }; diff --git a/Minecraft.World/TradeWithPlayerGoal.cpp b/Minecraft.World/TradeWithPlayerGoal.cpp index e8b791d1..97d417e5 100644 --- a/Minecraft.World/TradeWithPlayerGoal.cpp +++ b/Minecraft.World/TradeWithPlayerGoal.cpp @@ -18,7 +18,7 @@ bool TradeWithPlayerGoal::canUse() if (!mob->onGround) return false; if (mob->hurtMarked) return false; - shared_ptr trader = mob->getTradingPlayer(); + std::shared_ptr trader = mob->getTradingPlayer(); if (trader == NULL) { // no interaction diff --git a/Minecraft.World/TrapDoorTile.cpp b/Minecraft.World/TrapDoorTile.cpp index fc9d6580..b8afca43 100644 --- a/Minecraft.World/TrapDoorTile.cpp +++ b/Minecraft.World/TrapDoorTile.cpp @@ -55,7 +55,7 @@ AABB *TrapDoorTile::getAABB(Level *level, int x, int y, int z) } -void TrapDoorTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void TrapDoorTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { setShape(level->getData(x, y, z)); } @@ -83,7 +83,7 @@ void TrapDoorTile::setShape(int data) } -void TrapDoorTile::attack(Level *level, int x, int y, int z, shared_ptr player) +void TrapDoorTile::attack(Level *level, int x, int y, int z, std::shared_ptr player) { use(level, x, y, z, player, 0, 0, 0, 0); } @@ -94,7 +94,7 @@ bool TrapDoorTile::TestUse() return true; } -bool TrapDoorTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool TrapDoorTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if (material == Material::metal) return true; diff --git a/Minecraft.World/TrapDoorTile.h b/Minecraft.World/TrapDoorTile.h index 19cec150..5f6a52e7 100644 --- a/Minecraft.World/TrapDoorTile.h +++ b/Minecraft.World/TrapDoorTile.h @@ -43,7 +43,7 @@ public: AABB *getAABB(Level *level, int x, int y, int z); public: - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param public: void updateDefaultShape(); @@ -53,11 +53,11 @@ public: void setShape(int data); public: - void attack(Level *level, int x, int y, int z, shared_ptr player); + void attack(Level *level, int x, int y, int z, std::shared_ptr player); public: virtual bool TestUse(); - bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param public: void setOpen(Level *level, int x, int y, int z, bool shouldOpen); diff --git a/Minecraft.World/TrapMenu.cpp b/Minecraft.World/TrapMenu.cpp index 5e59c6fe..da43347a 100644 --- a/Minecraft.World/TrapMenu.cpp +++ b/Minecraft.World/TrapMenu.cpp @@ -5,7 +5,7 @@ #include "Slot.h" #include "TrapMenu.h" -TrapMenu::TrapMenu(shared_ptr inventory, shared_ptr trap) +TrapMenu::TrapMenu(std::shared_ptr inventory, std::shared_ptr trap) { this->trap = trap; @@ -30,19 +30,19 @@ TrapMenu::TrapMenu(shared_ptr inventory, shared_ptr player) +bool TrapMenu::stillValid(std::shared_ptr player) { return trap->stillValid(player); } // 4J Stu - Brought forward from 1.2 -shared_ptr TrapMenu::quickMoveStack(shared_ptr player, int slotIndex) +std::shared_ptr TrapMenu::quickMoveStack(std::shared_ptr player, int slotIndex) { - shared_ptr clicked = nullptr; + std::shared_ptr clicked = nullptr; Slot *slot = slots->at(slotIndex); if (slot != NULL && slot->hasItem()) { - shared_ptr stack = slot->getItem(); + std::shared_ptr stack = slot->getItem(); clicked = stack->copy(); if (slotIndex < INV_SLOT_START) diff --git a/Minecraft.World/TrapMenu.h b/Minecraft.World/TrapMenu.h index e3fb4965..6e5cc517 100644 --- a/Minecraft.World/TrapMenu.h +++ b/Minecraft.World/TrapMenu.h @@ -12,11 +12,11 @@ private: static const int USE_ROW_SLOT_START = INV_SLOT_END; static const int USE_ROW_SLOT_END = USE_ROW_SLOT_START + 9; private: - shared_ptr trap; + std::shared_ptr trap; public: - TrapMenu(shared_ptr inventory, shared_ptr trap); + TrapMenu(std::shared_ptr inventory, std::shared_ptr trap); - virtual bool stillValid(shared_ptr player); - virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); + virtual bool stillValid(std::shared_ptr player); + virtual std::shared_ptr quickMoveStack(std::shared_ptr player, int slotIndex); }; \ No newline at end of file diff --git a/Minecraft.World/TreeTile.cpp b/Minecraft.World/TreeTile.cpp index 29871625..fa734a7c 100644 --- a/Minecraft.World/TreeTile.cpp +++ b/Minecraft.World/TreeTile.cpp @@ -60,7 +60,7 @@ void TreeTile::onRemove(Level *level, int x, int y, int z, int id, int data) } } -void TreeTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by) +void TreeTile::setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by) { int type = level->getData(x, y, z) & MASK_TYPE; int dir = PistonBaseTile::getNewFacing(level, x, y, z, dynamic_pointer_cast(by)); @@ -93,7 +93,7 @@ Icon *TreeTile::getTexture(int face, int data) if (dir == FACING_Y && (face == Facing::UP || face == Facing::DOWN)) { return iconTop; - } + } else if (dir == FACING_X && (face == Facing::EAST || face == Facing::WEST)) { return iconTop; @@ -123,10 +123,10 @@ int TreeTile::getWoodType(int data) return data & MASK_TYPE; } -shared_ptr TreeTile::getSilkTouchItemInstance(int data) +std::shared_ptr TreeTile::getSilkTouchItemInstance(int data) { // fix to avoid getting silktouched sideways logs - return shared_ptr(new ItemInstance(id, 1, getWoodType(data))); + return std::shared_ptr(new ItemInstance(id, 1, getWoodType(data))); } void TreeTile::registerIcons(IconRegister *iconRegister) diff --git a/Minecraft.World/TreeTile.h b/Minecraft.World/TreeTile.h index b7e0d56d..5a4f0a29 100644 --- a/Minecraft.World/TreeTile.h +++ b/Minecraft.World/TreeTile.h @@ -6,7 +6,7 @@ class ChunkRebuildData; class Player; class TreeTile : public Tile -{ +{ friend class Tile; friend class ChunkRebuildData; public: @@ -39,7 +39,7 @@ public: virtual int getResourceCount(Random *random); virtual int getResource(int data, Random *random, int playerBonusLevel); virtual void onRemove(Level *level, int x, int y, int z, int id, int data); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); + virtual void setPlacedBy(Level *level, int x, int y, int z, std::shared_ptr by); virtual Icon *getTexture(int face, int data); virtual unsigned int getDescriptionId(int iData = -1); @@ -51,5 +51,5 @@ public: void registerIcons(IconRegister *iconRegister); protected: - virtual shared_ptr getSilkTouchItemInstance(int data); + virtual std::shared_ptr getSilkTouchItemInstance(int data); }; \ No newline at end of file diff --git a/Minecraft.World/TreeTileItem.cpp b/Minecraft.World/TreeTileItem.cpp index 30406821..d260a556 100644 --- a/Minecraft.World/TreeTileItem.cpp +++ b/Minecraft.World/TreeTileItem.cpp @@ -15,12 +15,12 @@ Icon *TreeTileItem::getIcon(int itemAuxValue) return parentTile->getTexture(2, itemAuxValue); } -int TreeTileItem::getLevelDataForAuxValue(int auxValue) +int TreeTileItem::getLevelDataForAuxValue(int auxValue) { return auxValue; } -unsigned int TreeTileItem::getDescriptionId(shared_ptr instance) +unsigned int TreeTileItem::getDescriptionId(std::shared_ptr instance) { int auxValue = instance->getAuxValue(); if (auxValue < 0 || auxValue >= TreeTile::TREE_NAMES_LENGTH) diff --git a/Minecraft.World/TreeTileItem.h b/Minecraft.World/TreeTileItem.h index 7f7b2825..dea75075 100644 --- a/Minecraft.World/TreeTileItem.h +++ b/Minecraft.World/TreeTileItem.h @@ -3,7 +3,7 @@ using namespace std; #include "TileItem.h" -class TreeTileItem : public TileItem +class TreeTileItem : public TileItem { private: Tile *parentTile; @@ -14,5 +14,5 @@ public: virtual Icon *getIcon(int itemAuxValue); virtual int getLevelDataForAuxValue(int auxValue); - virtual unsigned int getDescriptionId(shared_ptr instance); + virtual unsigned int getDescriptionId(std::shared_ptr instance); }; \ No newline at end of file diff --git a/Minecraft.World/TripWireSourceTile.cpp b/Minecraft.World/TripWireSourceTile.cpp index 33f857fa..1b560019 100644 --- a/Minecraft.World/TripWireSourceTile.cpp +++ b/Minecraft.World/TripWireSourceTile.cpp @@ -108,7 +108,7 @@ void TripWireSourceTile::neighborChanged(Level *level, int x, int y, int z, int } } -void TripWireSourceTile::calculateState(Level *level, int x, int y, int z, int id, int data, bool canUpdate, +void TripWireSourceTile::calculateState(Level *level, int x, int y, int z, int id, int data, bool canUpdate, /*4J-Jev, these parameters only used with 'updateSource' -->*/ int wireSource, int wireSourceData) { @@ -116,7 +116,7 @@ void TripWireSourceTile::calculateState(Level *level, int x, int y, int z, int i int dir = data & MASK_DIR; bool wasAttached = (data & MASK_ATTACHED) == MASK_ATTACHED; bool wasPowered = (data & MASK_POWERED) == MASK_POWERED; - bool attached = id == Tile::tripWireSource_Id; // id is only != TripwireSource_id when 'onRemove' + bool attached = id == Tile::tripWireSource_Id; // id is only != TripwireSource_id when 'onRemove' bool powered = false; bool suspended = !level->isTopSolidBlocking(x, y - 1, z); int stepX = Direction::STEP_X[dir]; @@ -208,7 +208,7 @@ void TripWireSourceTile::calculateState(Level *level, int x, int y, int z, int i wireData &= ~TripWireTile::MASK_ATTACHED; } - + level->setData(xx, y, zz, wireData); } } @@ -273,7 +273,7 @@ bool TripWireSourceTile::checkCanSurvive(Level *level, int x, int y, int z) return true; } -void TripWireSourceTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +void TripWireSourceTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) { int dir = level->getData(x, y, z) & MASK_DIR; float r = 3 / 16.0f; diff --git a/Minecraft.World/TripWireSourceTile.h b/Minecraft.World/TripWireSourceTile.h index c86e781d..a5a26ad1 100644 --- a/Minecraft.World/TripWireSourceTile.h +++ b/Minecraft.World/TripWireSourceTile.h @@ -35,7 +35,7 @@ private: bool checkCanSurvive(Level *level, int x, int y, int z); public: - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); void onRemove(Level *level, int x, int y, int z, int id, int data); virtual bool getSignal(LevelSource *level, int x, int y, int z, int dir); virtual bool getDirectSignal(Level *level, int x, int y, int z, int dir); diff --git a/Minecraft.World/TripWireTile.cpp b/Minecraft.World/TripWireTile.cpp index 40ad93f8..92560185 100644 --- a/Minecraft.World/TripWireTile.cpp +++ b/Minecraft.World/TripWireTile.cpp @@ -13,7 +13,7 @@ TripWireTile::TripWireTile(int id) : Tile(id, Material::decoration, isSolidRende int TripWireTile::getTickDelay(Level *level) { - // 4J: Increased (x2); quick update caused problems with shared + // 4J: Increased (x2); quick update caused problems with shared // data between client and server. return 20; // 10; } @@ -70,7 +70,7 @@ void TripWireTile::neighborChanged(Level *level, int x, int y, int z, int type) } } -void TripWireTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +void TripWireTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) { int data = level->getData(x, y, z); bool attached = (data & MASK_ATTACHED) == MASK_ATTACHED; @@ -102,7 +102,7 @@ void TripWireTile::onRemove(Level *level, int x, int y, int z, int id, int data) updateSource(level, x, y, z, data | MASK_POWERED); } -void TripWireTile::playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player) +void TripWireTile::playerWillDestroy(Level *level, int x, int y, int z, int data, std::shared_ptr player) { if (level->isClientSide) return; @@ -141,7 +141,7 @@ void TripWireTile::updateSource(Level *level, int x, int y, int z, int data) } } -void TripWireTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void TripWireTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { if (level->isClientSide) return; @@ -164,9 +164,9 @@ void TripWireTile::checkPressed(Level *level, int x, int y, int z) int data = level->getData(x, y, z); bool wasPressed = (data & MASK_POWERED) == MASK_POWERED; bool shouldBePressed = false; - + ThreadStorage *tls = (ThreadStorage *)TlsGetValue(Tile::tlsIdxShape); - vector > *entities = level->getEntities(nullptr, AABB::newTemp(x + tls->xx0, y + tls->yy0, z + tls->zz0, x + tls->xx1, y + tls->yy1, z + tls->zz1)); + vector > *entities = level->getEntities(nullptr, AABB::newTemp(x + tls->xx0, y + tls->yy0, z + tls->zz0, x + tls->xx1, y + tls->yy1, z + tls->zz1)); if (!entities->empty()) { shouldBePressed = true; diff --git a/Minecraft.World/TripWireTile.h b/Minecraft.World/TripWireTile.h index 7880e664..664541c5 100644 --- a/Minecraft.World/TripWireTile.h +++ b/Minecraft.World/TripWireTile.h @@ -23,16 +23,16 @@ public: int getResource(int data, Random *random, int playerBonusLevel); int cloneTileId(Level *level, int x, int y, int z); void neighborChanged(Level *level, int x, int y, int z, int type); - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); void onPlace(Level *level, int x, int y, int z); void onRemove(Level *level, int x, int y, int z, int id, int data); - void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player); + void playerWillDestroy(Level *level, int x, int y, int z, int data, std::shared_ptr player); private: void updateSource(Level *level, int x, int y, int z, int data); public: - void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); void tick(Level *level, int x, int y, int z, Random *random); private: diff --git a/Minecraft.World/UntouchingEnchantment.cpp b/Minecraft.World/UntouchingEnchantment.cpp index 1e5a41b7..b0e2e295 100644 --- a/Minecraft.World/UntouchingEnchantment.cpp +++ b/Minecraft.World/UntouchingEnchantment.cpp @@ -27,7 +27,7 @@ bool UntouchingEnchantment::isCompatibleWith(Enchantment *other) const return Enchantment::isCompatibleWith(other) && other->id != resourceBonus->id; } -bool UntouchingEnchantment::canEnchant(shared_ptr item) +bool UntouchingEnchantment::canEnchant(std::shared_ptr item) { if (item->getItem()->id == Item::shears_Id) return true; return Enchantment::canEnchant(item); diff --git a/Minecraft.World/UntouchingEnchantment.h b/Minecraft.World/UntouchingEnchantment.h index db827c27..14ce0b49 100644 --- a/Minecraft.World/UntouchingEnchantment.h +++ b/Minecraft.World/UntouchingEnchantment.h @@ -11,5 +11,5 @@ public: virtual int getMaxCost(int level); virtual int getMaxLevel(); virtual bool isCompatibleWith(Enchantment *other) const; - virtual bool canEnchant(shared_ptr item); + virtual bool canEnchant(std::shared_ptr item); }; \ No newline at end of file diff --git a/Minecraft.World/UpdateGameRuleProgressPacket.h b/Minecraft.World/UpdateGameRuleProgressPacket.h index b3384fa1..65df6dfe 100644 --- a/Minecraft.World/UpdateGameRuleProgressPacket.h +++ b/Minecraft.World/UpdateGameRuleProgressPacket.h @@ -21,6 +21,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new UpdateGameRuleProgressPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new UpdateGameRuleProgressPacket()); } virtual int getId() { return 158; } }; \ No newline at end of file diff --git a/Minecraft.World/UpdateMobEffectPacket.cpp b/Minecraft.World/UpdateMobEffectPacket.cpp index dec8d79f..7274152e 100644 --- a/Minecraft.World/UpdateMobEffectPacket.cpp +++ b/Minecraft.World/UpdateMobEffectPacket.cpp @@ -53,8 +53,8 @@ bool UpdateMobEffectPacket::canBeInvalidated() return true; } -bool UpdateMobEffectPacket::isInvalidatedBy(shared_ptr packet) +bool UpdateMobEffectPacket::isInvalidatedBy(std::shared_ptr packet) { - shared_ptr target = dynamic_pointer_cast(packet); + std::shared_ptr target = dynamic_pointer_cast(packet); return target->entityId == entityId && target->effectId == effectId; } \ No newline at end of file diff --git a/Minecraft.World/UpdateMobEffectPacket.h b/Minecraft.World/UpdateMobEffectPacket.h index d17d1be4..a69d32b2 100644 --- a/Minecraft.World/UpdateMobEffectPacket.h +++ b/Minecraft.World/UpdateMobEffectPacket.h @@ -20,9 +20,9 @@ public: virtual void handle(PacketListener *listener); virtual int getEstimatedSize(); virtual bool canBeInvalidated(); - virtual bool isInvalidatedBy(shared_ptr packet); + virtual bool isInvalidatedBy(std::shared_ptr packet); public: - static shared_ptr create() { return shared_ptr(new UpdateMobEffectPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new UpdateMobEffectPacket()); } virtual int getId() { return 41; } }; \ No newline at end of file diff --git a/Minecraft.World/UpdateProgressPacket.h b/Minecraft.World/UpdateProgressPacket.h index beca6509..edfaef96 100644 --- a/Minecraft.World/UpdateProgressPacket.h +++ b/Minecraft.World/UpdateProgressPacket.h @@ -20,6 +20,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new UpdateProgressPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new UpdateProgressPacket()); } virtual int getId() { return 156; } }; \ No newline at end of file diff --git a/Minecraft.World/UseItemPacket.cpp b/Minecraft.World/UseItemPacket.cpp index d9699130..87180610 100644 --- a/Minecraft.World/UseItemPacket.cpp +++ b/Minecraft.World/UseItemPacket.cpp @@ -7,11 +7,11 @@ const float UseItemPacket::CLICK_ACCURACY = 16.0f; -UseItemPacket::~UseItemPacket() +UseItemPacket::~UseItemPacket() { } -UseItemPacket::UseItemPacket() +UseItemPacket::UseItemPacket() { x = 0; y = 0; @@ -23,20 +23,20 @@ UseItemPacket::UseItemPacket() clickZ = 0.0f; } -UseItemPacket::UseItemPacket(int x, int y, int z, int face, shared_ptr item, float clickX, float clickY, float clickZ) +UseItemPacket::UseItemPacket(int x, int y, int z, int face, std::shared_ptr item, float clickX, float clickY, float clickZ) { this->x = x; this->y = y; this->z = z; this->face = face; // 4J - take copy of item as we want our packets to have full ownership of any referenced data - this->item = item ? item->copy() : shared_ptr(); + this->item = item ? item->copy() : std::shared_ptr(); this->clickX = clickX; this->clickY = clickY; this->clickZ = clickZ; } -void UseItemPacket::read(DataInputStream *dis) //throws IOException +void UseItemPacket::read(DataInputStream *dis) //throws IOException { x = dis->readInt(); y = dis->read(); @@ -48,7 +48,7 @@ void UseItemPacket::read(DataInputStream *dis) //throws IOException clickZ = dis->read() / CLICK_ACCURACY; } -void UseItemPacket::write(DataOutputStream *dos) //throws IOException +void UseItemPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(x); dos->write(y); @@ -91,7 +91,7 @@ int UseItemPacket::getFace() return face; } -shared_ptr UseItemPacket::getItem() +std::shared_ptr UseItemPacket::getItem() { return item; } diff --git a/Minecraft.World/UseItemPacket.h b/Minecraft.World/UseItemPacket.h index 44e20457..2619ce94 100644 --- a/Minecraft.World/UseItemPacket.h +++ b/Minecraft.World/UseItemPacket.h @@ -8,12 +8,12 @@ class UseItemPacket : public Packet, public enable_shared_from_this item; + std::shared_ptr item; float clickX, clickY, clickZ; public: UseItemPacket(); - UseItemPacket(int x, int y, int z, int face, shared_ptr item, float clickX, float clickY, float clickZ); + UseItemPacket(int x, int y, int z, int face, std::shared_ptr item, float clickX, float clickY, float clickZ); ~UseItemPacket(); virtual void read(DataInputStream *dis); @@ -25,12 +25,12 @@ public: int getY(); int getZ(); int getFace(); - shared_ptr getItem(); + std::shared_ptr getItem(); float getClickX(); float getClickY(); float getClickZ(); public: - static shared_ptr create() { return shared_ptr(new UseItemPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new UseItemPacket()); } virtual int getId() { return 15; } }; diff --git a/Minecraft.World/Village.cpp b/Minecraft.World/Village.cpp index aef38066..51e89c25 100644 --- a/Minecraft.World/Village.cpp +++ b/Minecraft.World/Village.cpp @@ -8,7 +8,7 @@ #include "BasicTypeContainers.h" #include "Village.h" -Village::Aggressor::Aggressor(shared_ptr mob, int timeStamp) +Village::Aggressor::Aggressor(std::shared_ptr mob, int timeStamp) { this->mob = mob; this->timeStamp = timeStamp; @@ -71,7 +71,7 @@ void Village::tick(int tick) Vec3 *spawnPos = findRandomSpawnPos(center->x, center->y, center->z, 2, 4, 2); if (spawnPos != NULL) { - shared_ptr vg = shared_ptr( new VillagerGolem(level) ); + std::shared_ptr vg = std::shared_ptr( new VillagerGolem(level) ); vg->setPos(spawnPos->x, spawnPos->y, spawnPos->z); level->addEntity(vg); ++golemCount; @@ -123,14 +123,14 @@ bool Village::canSpawnAt(int x, int y, int z, int sx, int sy, int sz) void Village::countGolem() { // Fix - let bots report themselves? - vector > *golems = level->getEntitiesOfClass(typeid(VillagerGolem), AABB::newTemp(center->x - radius, center->y - 4, center->z - radius, center->x + radius, center->y + 4, center->z + radius)); + vector > *golems = level->getEntitiesOfClass(typeid(VillagerGolem), AABB::newTemp(center->x - radius, center->y - 4, center->z - radius, center->x + radius, center->y + 4, center->z + radius)); golemCount = golems->size(); delete golems; } void Village::countPopulation() { - vector > *villagers = level->getEntitiesOfClass(typeid(Villager), AABB::newTemp(center->x - radius, center->y - 4, center->z - radius, center->x + radius, center->y + 4, center->z + radius)); + vector > *villagers = level->getEntitiesOfClass(typeid(Villager), AABB::newTemp(center->x - radius, center->y - 4, center->z - radius, center->x + radius, center->y + 4, center->z + radius)); populationSize = villagers->size(); delete villagers; @@ -171,19 +171,19 @@ bool Village::isInside(int xx, int yy, int zz) return center->distSqr(xx, yy, zz) < radius * radius; } -vector > *Village::getDoorInfos() +vector > *Village::getDoorInfos() { return &doorInfos; } -shared_ptr Village::getClosestDoorInfo(int x, int y, int z) +std::shared_ptr Village::getClosestDoorInfo(int x, int y, int z) { - shared_ptr closest = nullptr; + std::shared_ptr closest = nullptr; int closestDistSqr = Integer::MAX_VALUE; //for (DoorInfo dm : doorInfos) for(AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end(); ++it) { - shared_ptr dm = *it; + std::shared_ptr dm = *it; int distSqr = dm->distanceToSqr(x, y, z); if (distSqr < closestDistSqr) { @@ -194,14 +194,14 @@ shared_ptr Village::getClosestDoorInfo(int x, int y, int z) return closest; } -shared_ptrVillage::getBestDoorInfo(int x, int y, int z) +std::shared_ptrVillage::getBestDoorInfo(int x, int y, int z) { - shared_ptr closest = nullptr; + std::shared_ptr closest = nullptr; int closestDist = Integer::MAX_VALUE; //for (DoorInfo dm : doorInfos) for(AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end(); ++it) { - shared_ptrdm = *it; + std::shared_ptrdm = *it; int distSqr = dm->distanceToSqr(x, y, z); if (distSqr > 16 * 16) distSqr *= 1000; @@ -221,19 +221,19 @@ bool Village::hasDoorInfo(int x, int y, int z) return getDoorInfo(x, y, z) != NULL; } -shared_ptrVillage::getDoorInfo(int x, int y, int z) +std::shared_ptrVillage::getDoorInfo(int x, int y, int z) { if (center->distSqr(x, y, z) > radius * radius) return nullptr; //for (DoorInfo di : doorInfos) for(AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end(); ++it) { - shared_ptr di = *it; + std::shared_ptr di = *it; if (di->x == x && di->z == z && abs(di->y - y) <= 1) return di; } return nullptr; } -void Village::addDoorInfo(shared_ptr di) +void Village::addDoorInfo(std::shared_ptr di) { doorInfos.push_back(di); accCenter->x += di->x; @@ -248,7 +248,7 @@ bool Village::canRemove() return doorInfos.empty(); } -void Village::addAggressor(shared_ptr mob) +void Village::addAggressor(std::shared_ptr mob) { //for (Aggressor a : aggressors) for(AUTO_VAR(it, aggressors.begin()); it != aggressors.end(); ++it) @@ -263,7 +263,7 @@ void Village::addAggressor(shared_ptr mob) aggressors.push_back(new Aggressor(mob, _tick)); } -shared_ptr Village::getClosestAggressor(shared_ptr from) +std::shared_ptr Village::getClosestAggressor(std::shared_ptr from) { double closestSqr = Double::MAX_VALUE; Aggressor *closest = NULL; @@ -279,10 +279,10 @@ shared_ptr Village::getClosestAggressor(shared_ptr from) return closest != NULL ? closest->mob : nullptr; } -shared_ptr Village::getClosestBadStandingPlayer(shared_ptr from) // 4J Stu - Should be LivingEntity when we add that +std::shared_ptr Village::getClosestBadStandingPlayer(std::shared_ptr from) // 4J Stu - Should be LivingEntity when we add that { double closestSqr = Double::MAX_VALUE; - shared_ptr closest = nullptr; + std::shared_ptr closest = nullptr; //for (String player : playerStanding.keySet()) for(AUTO_VAR(it,playerStanding.begin()); it != playerStanding.end(); ++it) @@ -290,7 +290,7 @@ shared_ptr Village::getClosestBadStandingPlayer(shared_ptr from) // wstring player = it->first; if (isVeryBadStanding(player)) { - shared_ptr mob = level->getPlayerByName(player); + std::shared_ptr mob = level->getPlayerByName(player); if (mob != NULL) { double distSqr = mob->distanceToSqr(from); @@ -330,7 +330,7 @@ void Village::updateDoors() //for (Iterator it = doorInfos.iterator(); it.hasNext();) for(AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end();) { - shared_ptr dm = *it; //it.next(); + std::shared_ptr dm = *it; //it.next(); if (resetBookings) dm->resetBookingCount(); if (!isDoor(dm->x, dm->y, dm->z) || abs(_tick - dm->timeStamp) > 1200) { @@ -373,7 +373,7 @@ void Village::calcInfo() //for (DoorInfo dm : doorInfos) for(AUTO_VAR(it, doorInfos.begin()); it != doorInfos.end(); ++it) { - shared_ptr dm = *it; + std::shared_ptr dm = *it; maxRadiusSqr = max(dm->distanceToSqr(center->x, center->y, center->z), maxRadiusSqr); } int doorDist= Villages::MaxDoorDist; // Take into local int for PS4 as max takes a reference to the const int there and then needs the value to exist for the linker @@ -433,7 +433,7 @@ void Village::readAdditionalSaveData(CompoundTag *tag) { CompoundTag *dTag = doorTags->get(i); - shared_ptr door = shared_ptr(new DoorInfo(dTag->getInt(L"X"), dTag->getInt(L"Y"), dTag->getInt(L"Z"), dTag->getInt(L"IDX"), dTag->getInt(L"IDZ"), dTag->getInt(L"TS"))); + std::shared_ptr door = std::shared_ptr(new DoorInfo(dTag->getInt(L"X"), dTag->getInt(L"Y"), dTag->getInt(L"Z"), dTag->getInt(L"IDX"), dTag->getInt(L"IDZ"), dTag->getInt(L"TS"))); doorInfos.push_back(door); } @@ -464,7 +464,7 @@ void Village::addAdditonalSaveData(CompoundTag *tag) //for (DoorInfo dm : doorInfos) for(AUTO_VAR(it,doorInfos.begin()); it != doorInfos.end(); ++it) { - shared_ptr dm = *it; + std::shared_ptr dm = *it; CompoundTag *doorTag = new CompoundTag(L"Door"); doorTag->putInt(L"X", dm->x); doorTag->putInt(L"Y", dm->y); diff --git a/Minecraft.World/Village.h b/Minecraft.World/Village.h index 07858ef9..27839d4e 100644 --- a/Minecraft.World/Village.h +++ b/Minecraft.World/Village.h @@ -4,7 +4,7 @@ class Village { private: Level *level; - vector > doorInfos; + vector > doorInfos; Pos *accCenter; Pos *center; @@ -19,10 +19,10 @@ private: class Aggressor { public: - shared_ptr mob; + std::shared_ptr mob; int timeStamp; - Aggressor(shared_ptr mob, int timeStamp); + Aggressor(std::shared_ptr mob, int timeStamp); }; vector aggressors; @@ -50,16 +50,16 @@ public: int getStableAge(); int getPopulationSize(); bool isInside(int xx, int yy, int zz); - vector > *getDoorInfos(); - shared_ptr getClosestDoorInfo(int x, int y, int z); - shared_ptr getBestDoorInfo(int x, int y, int z); + vector > *getDoorInfos(); + std::shared_ptr getClosestDoorInfo(int x, int y, int z); + std::shared_ptr getBestDoorInfo(int x, int y, int z); bool hasDoorInfo(int x, int y, int z); - shared_ptr getDoorInfo(int x, int y, int z); - void addDoorInfo(shared_ptr di); + std::shared_ptr getDoorInfo(int x, int y, int z); + void addDoorInfo(std::shared_ptr di); bool canRemove(); - void addAggressor(shared_ptr mob); - shared_ptr getClosestAggressor(shared_ptr from); - shared_ptr getClosestBadStandingPlayer(shared_ptr from); // 4J Stu - Should be LivingEntity when we add that + void addAggressor(std::shared_ptr mob); + std::shared_ptr getClosestAggressor(std::shared_ptr from); + std::shared_ptr getClosestBadStandingPlayer(std::shared_ptr from); // 4J Stu - Should be LivingEntity when we add that private: void updateAggressors(); diff --git a/Minecraft.World/VillagePieces.cpp b/Minecraft.World/VillagePieces.cpp index 27b21aa5..e535675d 100644 --- a/Minecraft.World/VillagePieces.cpp +++ b/Minecraft.World/VillagePieces.cpp @@ -347,7 +347,7 @@ void VillagePieces::VillagePiece::spawnVillagers(Level *level, BoundingBox *chun { spawnedVillagerCount++; - shared_ptr villager = shared_ptr(new Villager(level, getVillagerProfession(i))); + std::shared_ptr villager = std::shared_ptr(new Villager(level, getVillagerProfession(i))); villager->moveTo(worldX + 0.5, worldY, worldZ + 0.5, 0, 0); level->addEntity(villager); } @@ -620,14 +620,14 @@ void VillagePieces::StraightRoad::addChildren(StructurePiece *startPiece, listx1 + 1, boundingBox->y0, boundingBox->z0, Direction::EAST, getGenDepth()); - break; - case Direction::SOUTH: + break; + case Direction::SOUTH: generateAndAddRoadPiece((StartPiece *) startPiece, pieces, random, boundingBox->x1 + 1, boundingBox->y0, boundingBox->z1 - 2, Direction::EAST, getGenDepth()); - break; - case Direction::EAST: + break; + case Direction::EAST: generateAndAddRoadPiece((StartPiece *) startPiece, pieces, random, boundingBox->x1 - 2, boundingBox->y0, boundingBox->z1 + 1, Direction::SOUTH, getGenDepth()); - break; - case Direction::WEST: + break; + case Direction::WEST: generateAndAddRoadPiece((StartPiece *) startPiece, pieces, random, boundingBox->x0, boundingBox->y0, boundingBox->z1 + 1, Direction::SOUTH, getGenDepth()); break; } @@ -914,7 +914,7 @@ bool VillagePieces::SmallTemple::postProcess(Level *level, Random *random, Bound } - for (int z = 0; z < depth; z++) + for (int z = 0; z < depth; z++) { for (int x = 0; x < width; x++) { diff --git a/Minecraft.World/VillageSiege.cpp b/Minecraft.World/VillageSiege.cpp index 55b2a3e8..afd378fc 100644 --- a/Minecraft.World/VillageSiege.cpp +++ b/Minecraft.World/VillageSiege.cpp @@ -77,12 +77,12 @@ void VillageSiege::tick() bool VillageSiege::tryToSetupSiege() { - vector > *players = &level->players; + vector > *players = &level->players; //for (Player player : players) for(AUTO_VAR(it, players->begin()); it != players->end(); ++it) { - shared_ptr player = *it; - shared_ptr _village = level->villages->getClosestVillage((int) player->x, (int) player->y, (int) player->z, 1); + std::shared_ptr player = *it; + std::shared_ptr _village = level->villages->getClosestVillage((int) player->x, (int) player->y, (int) player->z, 1); village = _village; if (_village == NULL) continue; @@ -101,11 +101,11 @@ bool VillageSiege::tryToSetupSiege() spawnY = center->y; spawnZ = center->z + (int) (Mth::sin(level->random->nextFloat() * PI * 2.f) * radius * 0.9); overlaps = false; - vector > *villages = level->villages->getVillages(); + vector > *villages = level->villages->getVillages(); //for (Village v : level.villages.getVillages()) for(AUTO_VAR(itV, villages->begin()); itV != villages->end(); ++itV) { - shared_ptrv = *itV; + std::shared_ptrv = *itV; if (v == _village) continue; if (v->isInside(spawnX, spawnY, spawnZ)) { @@ -131,10 +131,10 @@ bool VillageSiege::trySpawn() { Vec3 *spawnPos = findRandomSpawnPos(spawnX, spawnY, spawnZ); if (spawnPos == NULL) return false; - shared_ptr mob; + std::shared_ptr mob; //try { - mob = shared_ptr( new Zombie(level) ); + mob = std::shared_ptr( new Zombie(level) ); mob->finalizeMobSpawn(); mob->setVillager(false); } @@ -144,7 +144,7 @@ bool VillageSiege::trySpawn() //} mob->moveTo(spawnPos->x, spawnPos->y, spawnPos->z, level->random->nextFloat() * 360, 0); level->addEntity(mob); - shared_ptr _village = village.lock(); + std::shared_ptr _village = village.lock(); if( _village == NULL ) return false; Pos *center = _village->getCenter(); @@ -154,7 +154,7 @@ bool VillageSiege::trySpawn() Vec3 *VillageSiege::findRandomSpawnPos(int x, int y, int z) { - shared_ptr _village = village.lock(); + std::shared_ptr _village = village.lock(); if( _village == NULL ) return NULL; for (int i = 0; i < 10; ++i) diff --git a/Minecraft.World/Villager.cpp b/Minecraft.World/Villager.cpp index 328c0c70..4618e4be 100644 --- a/Minecraft.World/Villager.cpp +++ b/Minecraft.World/Villager.cpp @@ -94,7 +94,7 @@ void Villager::serverAiMobStep() level->villages->queryUpdateAround(Mth::floor(x), Mth::floor(y), Mth::floor(z)); villageUpdateInterval = 70 + random->nextInt(50); - shared_ptr _village = level->villages->getClosestVillage(Mth::floor(x), Mth::floor(y), Mth::floor(z), Villages::MaxDoorDist); + std::shared_ptr _village = level->villages->getClosestVillage(Mth::floor(x), Mth::floor(y), Mth::floor(z), Villages::MaxDoorDist); village = _village; if (_village == NULL) clearRestriction(); else @@ -145,10 +145,10 @@ void Villager::serverAiMobStep() AgableMob::serverAiMobStep(); } -bool Villager::interact(shared_ptr player) +bool Villager::interact(std::shared_ptr player) { // [EB]: Truly dislike this code but I don't see another easy way - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); bool holdingSpawnEgg = item != NULL && item->id == Item::monsterPlacer_Id; if (!holdingSpawnEgg && isAlive() && !isTrading() && !isBaby()) @@ -281,15 +281,15 @@ bool Villager::isChasing() return chasing; } -void Villager::setLastHurtByMob(shared_ptr mob) +void Villager::setLastHurtByMob(std::shared_ptr mob) { AgableMob::setLastHurtByMob(mob); - shared_ptr _village = village.lock(); + std::shared_ptr _village = village.lock(); if (_village != NULL && mob != NULL) { _village->addAggressor(mob); - shared_ptr player = dynamic_pointer_cast(mob); + std::shared_ptr player = dynamic_pointer_cast(mob); if (player) { int amount = -1; @@ -308,15 +308,15 @@ void Villager::setLastHurtByMob(shared_ptr mob) void Villager::die(DamageSource *source) { - shared_ptr _village = village.lock(); + std::shared_ptr _village = village.lock(); if (_village != NULL) { - shared_ptr sourceEntity = source->getEntity(); + std::shared_ptr sourceEntity = source->getEntity(); if (sourceEntity != NULL) { if ((sourceEntity->GetType() & eTYPE_PLAYER) == eTYPE_PLAYER) { - shared_ptr player = dynamic_pointer_cast(sourceEntity); + std::shared_ptr player = dynamic_pointer_cast(sourceEntity); _village->modifyStanding(player->getName(), -2); } else if ((sourceEntity->GetType() & eTYPE_ENEMY) == eTYPE_ENEMY) @@ -328,7 +328,7 @@ void Villager::die(DamageSource *source) { // if the villager was killed by the world (such as lava or falling), blame // the nearest player by not reproducing for a while - shared_ptr nearestPlayer = level->getNearestPlayer(shared_from_this(), 16.0f); + std::shared_ptr nearestPlayer = level->getNearestPlayer(shared_from_this(), 16.0f); if (nearestPlayer != NULL) { _village->resetNoBreedTimer(); @@ -339,12 +339,12 @@ void Villager::die(DamageSource *source) AgableMob::die(source); } -void Villager::setTradingPlayer(shared_ptr player) +void Villager::setTradingPlayer(std::shared_ptr player) { tradingPlayer = weak_ptr(player); } -shared_ptr Villager::getTradingPlayer() +std::shared_ptr Villager::getTradingPlayer() { return tradingPlayer.lock(); } @@ -381,7 +381,7 @@ void Villager::notifyTrade(MerchantRecipe *activeRecipe) } } -void Villager::notifyTradeUpdated(shared_ptr item) +void Villager::notifyTradeUpdated(std::shared_ptr item) { if (!level->isClientSide && (ambientSoundTime > (-getAmbientSoundInterval() + SharedConstants::TICKS_PER_SECOND))) { @@ -397,7 +397,7 @@ void Villager::notifyTradeUpdated(shared_ptr item) } } -MerchantRecipeList *Villager::getOffers(shared_ptr forPlayer) +MerchantRecipeList *Villager::getOffers(std::shared_ptr forPlayer) { if (offers == NULL) { @@ -436,7 +436,7 @@ void Villager::addOffers(int addCount) addItemForPurchase(newOffers, Item::arrow_Id, random, getRecipeChance(.5f)); if (random->nextFloat() < .5f) { - newOffers->push_back(new MerchantRecipe(shared_ptr( new ItemInstance(Tile::gravel, 10) ), shared_ptr( new ItemInstance(Item::emerald) ), shared_ptr( new ItemInstance(Item::flint_Id, 2 + random->nextInt(2), 0)))); + newOffers->push_back(new MerchantRecipe(std::shared_ptr( new ItemInstance(Tile::gravel, 10) ), std::shared_ptr( new ItemInstance(Item::emerald) ), std::shared_ptr( new ItemInstance(Item::flint_Id, 2 + random->nextInt(2), 0)))); } break; case PROFESSION_BUTCHER: @@ -493,10 +493,10 @@ void Villager::addOffers(int addCount) { Enchantment *enchantment = Enchantment::validEnchantments[random->nextInt(Enchantment::validEnchantments.size())]; int level = Mth::nextInt(random, enchantment->getMinLevel(), enchantment->getMaxLevel()); - shared_ptr book = Item::enchantedBook->createForEnchantment(new EnchantmentInstance(enchantment, level)); + std::shared_ptr book = Item::enchantedBook->createForEnchantment(new EnchantmentInstance(enchantment, level)); int cost = 2 + random->nextInt(5 + (level * 10)) + 3 * level; - newOffers->push_back(new MerchantRecipe(shared_ptr(new ItemInstance(Item::book)), shared_ptr(new ItemInstance(Item::emerald, cost)), book)); + newOffers->push_back(new MerchantRecipe(std::shared_ptr(new ItemInstance(Item::book)), std::shared_ptr(new ItemInstance(Item::emerald, cost)), book)); } break; case PROFESSION_PRIEST: @@ -514,9 +514,9 @@ void Villager::addOffers(int addCount) int id = enchantItems[i]; if (random->nextFloat() < getRecipeChance(.05f)) { - newOffers->push_back(new MerchantRecipe(shared_ptr(new ItemInstance(id, 1, 0)), - shared_ptr(new ItemInstance(Item::emerald, 2 + random->nextInt(3), 0)), - EnchantmentHelper::enchantItem(random, shared_ptr(new ItemInstance(id, 1, 0)), 5 + random->nextInt(15)))); + newOffers->push_back(new MerchantRecipe(std::shared_ptr(new ItemInstance(id, 1, 0)), + std::shared_ptr(new ItemInstance(Item::emerald, 2 + random->nextInt(3), 0)), + EnchantmentHelper::enchantItem(random, std::shared_ptr(new ItemInstance(id, 1, 0)), 5 + random->nextInt(15)))); } } } @@ -636,9 +636,9 @@ void Villager::addItemForTradeIn(MerchantRecipeList *list, int itemId, Random *r } } -shared_ptr Villager::getItemTradeInValue(int itemId, Random *random) +std::shared_ptr Villager::getItemTradeInValue(int itemId, Random *random) { - return shared_ptr(new ItemInstance(itemId, getTradeInValue(itemId, random), 0)); + return std::shared_ptr(new ItemInstance(itemId, getTradeInValue(itemId, random), 0)); } int Villager::getTradeInValue(int itemId, Random *random) @@ -670,17 +670,17 @@ void Villager::addItemForPurchase(MerchantRecipeList *list, int itemId, Random * if (random->nextFloat() < likelyHood) { int purchaseCost = getPurchaseCost(itemId, random); - shared_ptr rubyItem; - shared_ptr resultItem; + std::shared_ptr rubyItem; + std::shared_ptr resultItem; if (purchaseCost < 0) { - rubyItem = shared_ptr( new ItemInstance(Item::emerald_Id, 1, 0) ); - resultItem = shared_ptr( new ItemInstance(itemId, -purchaseCost, 0) ); + rubyItem = std::shared_ptr( new ItemInstance(Item::emerald_Id, 1, 0) ); + resultItem = std::shared_ptr( new ItemInstance(itemId, -purchaseCost, 0) ); } else { - rubyItem = shared_ptr( new ItemInstance(Item::emerald_Id, purchaseCost, 0) ); - resultItem = shared_ptr( new ItemInstance(itemId, 1, 0) ); + rubyItem = std::shared_ptr( new ItemInstance(Item::emerald_Id, purchaseCost, 0) ); + resultItem = std::shared_ptr( new ItemInstance(itemId, 1, 0) ); } list->push_back(new MerchantRecipe(rubyItem, resultItem)); } @@ -705,7 +705,7 @@ void Villager::handleEntityEvent(byte id) { if (id == EntityEvent::LOVE_HEARTS) { - addParticlesAroundSelf(eParticleType_heart); + addParticlesAroundSelf(eParticleType_heart); } else if (id == EntityEvent::VILLAGER_ANGRY) { @@ -742,12 +742,12 @@ void Villager::setRewardPlayersInVillage() rewardPlayersOnFirstVillage = true; } -shared_ptr Villager::getBreedOffspring(shared_ptr target) +std::shared_ptr Villager::getBreedOffspring(std::shared_ptr target) { // 4J - added limit to villagers that can be bred if(level->canCreateMore(GetType(), Level::eSpawnType_Breed) ) { - shared_ptr villager = shared_ptr(new Villager(level)); + std::shared_ptr villager = std::shared_ptr(new Villager(level)); villager->finalizeMobSpawn(); return villager; } diff --git a/Minecraft.World/Villager.h b/Minecraft.World/Villager.h index b6ad7d1c..98bfa692 100644 --- a/Minecraft.World/Villager.h +++ b/Minecraft.World/Villager.h @@ -58,7 +58,7 @@ protected: virtual void serverAiMobStep(); public: - virtual bool interact(shared_ptr player); + virtual bool interact(std::shared_ptr player); protected: virtual void defineSynchedData(); @@ -83,7 +83,7 @@ public: void setInLove(bool inLove); void setChasing(bool chasing); bool isChasing(); - void setLastHurtByMob(shared_ptr mob); + void setLastHurtByMob(std::shared_ptr mob); void die(DamageSource *source); void handleEntityEvent(byte id); @@ -92,12 +92,12 @@ private: void addParticlesAroundSelf(ePARTICLE_TYPE particle); public: - void setTradingPlayer(shared_ptr player); - shared_ptr getTradingPlayer(); + void setTradingPlayer(std::shared_ptr player); + std::shared_ptr getTradingPlayer(); bool isTrading(); void notifyTrade(MerchantRecipe *activeRecipe); - void notifyTradeUpdated(shared_ptr item); - MerchantRecipeList *getOffers(shared_ptr forPlayer); + void notifyTradeUpdated(std::shared_ptr item); + MerchantRecipeList *getOffers(std::shared_ptr forPlayer); private: float baseRecipeChanceMod; @@ -125,7 +125,7 @@ private: * @param likelyHood */ static void addItemForTradeIn(MerchantRecipeList *list, int itemId, Random *random, float likelyHood); - static shared_ptr getItemTradeInValue(int itemId, Random *random); + static std::shared_ptr getItemTradeInValue(int itemId, Random *random); static int getTradeInValue(int itemId, Random *random); /** @@ -143,7 +143,7 @@ private: public: void finalizeMobSpawn(); void setRewardPlayersInVillage(); - shared_ptr getBreedOffspring(shared_ptr target); + std::shared_ptr getBreedOffspring(std::shared_ptr target); virtual int getDisplayName(); }; \ No newline at end of file diff --git a/Minecraft.World/VillagerGolem.cpp b/Minecraft.World/VillagerGolem.cpp index a0f05472..3856aff6 100644 --- a/Minecraft.World/VillagerGolem.cpp +++ b/Minecraft.World/VillagerGolem.cpp @@ -69,7 +69,7 @@ void VillagerGolem::serverAiMobStep() if (--villageUpdateInterval <= 0) { villageUpdateInterval = 70 + random->nextInt(50); - shared_ptr _village = level->villages->getClosestVillage(Mth::floor(x), Mth::floor(y), Mth::floor(z), Villages::MaxDoorDist); + std::shared_ptr _village = level->villages->getClosestVillage(Mth::floor(x), Mth::floor(y), Mth::floor(z), Villages::MaxDoorDist); village = _village; if (_village == NULL) clearRestriction(); else @@ -133,7 +133,7 @@ void VillagerGolem::readAdditionalSaveData(CompoundTag *tag) setPlayerCreated(tag->getBoolean(L"PlayerCreated")); } -bool VillagerGolem::doHurtTarget(shared_ptr target) +bool VillagerGolem::doHurtTarget(std::shared_ptr target) { attackAnimationTick = 10; level->broadcastEntityEvent(shared_from_this(), EntityEvent::START_ATTACKING); @@ -157,7 +157,7 @@ void VillagerGolem::handleEntityEvent(byte id) else Golem::handleEntityEvent(id); } -shared_ptr VillagerGolem::getVillage() +std::shared_ptr VillagerGolem::getVillage() { return village.lock(); } diff --git a/Minecraft.World/VillagerGolem.h b/Minecraft.World/VillagerGolem.h index dfcd3ac0..c5e4b4e8 100644 --- a/Minecraft.World/VillagerGolem.h +++ b/Minecraft.World/VillagerGolem.h @@ -43,9 +43,9 @@ public: virtual bool canAttackType(eINSTANCEOF targetType); virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); - virtual bool doHurtTarget(shared_ptr target); + virtual bool doHurtTarget(std::shared_ptr target); virtual void handleEntityEvent(byte id); - virtual shared_ptr getVillage(); + virtual std::shared_ptr getVillage(); virtual int getAttackAnimationTick(); virtual void offerFlower(bool offer); diff --git a/Minecraft.World/Villages.cpp b/Minecraft.World/Villages.cpp index 995befe8..826e9bbe 100644 --- a/Minecraft.World/Villages.cpp +++ b/Minecraft.World/Villages.cpp @@ -32,7 +32,7 @@ void Villages::setLevel(Level *level) //for (Village village : villages) for(AUTO_VAR(it, villages.begin()); it != villages.end(); ++it) { - shared_ptr village = *it; + std::shared_ptr village = *it; village->setLevel(level); } } @@ -49,7 +49,7 @@ void Villages::tick() //for (Village village : villages) for(AUTO_VAR(it, villages.begin()); it != villages.end(); ++it) { - shared_ptr village = *it; + std::shared_ptr village = *it; village->tick(_tick); } removeVillages(); @@ -67,7 +67,7 @@ void Villages::removeVillages() //for (Iterator it = villages.iterator(); it.hasNext();) for(AUTO_VAR(it, villages.begin()); it != villages.end(); ) { - shared_ptr village = *it; //it.next(); + std::shared_ptr village = *it; //it.next(); if (village->canRemove()) { it = villages.erase(it); @@ -81,19 +81,19 @@ void Villages::removeVillages() } } -vector > *Villages::getVillages() +vector > *Villages::getVillages() { return &villages; } -shared_ptr Villages::getClosestVillage(int x, int y, int z, int maxDist) +std::shared_ptr Villages::getClosestVillage(int x, int y, int z, int maxDist) { - shared_ptr closest = nullptr; + std::shared_ptr closest = nullptr; float closestDistSqr = Float::MAX_VALUE; //for (Village village : villages) for(AUTO_VAR(it, villages.begin()); it != villages.end(); ++it) { - shared_ptr village = *it; + std::shared_ptr village = *it; float distSqr = village->getCenter()->distSqr(x, y, z); if (distSqr >= closestDistSqr) continue; @@ -121,13 +121,13 @@ void Villages::cluster() //for (int i = 0; i < unclustered.size(); ++i) for(AUTO_VAR(it, unclustered.begin()); it != unclustered.end(); ++it) { - shared_ptr di = *it; //unclustered.get(i); + std::shared_ptr di = *it; //unclustered.get(i); bool found = false; //for (Village village : villages) for(AUTO_VAR(itV, villages.begin()); itV != villages.end(); ++itV) { - shared_ptr village = *itV; + std::shared_ptr village = *itV; int dist = (int) village->getCenter()->distSqr(di->x, di->y, di->z); int radius = MaxDoorDist + village->getRadius(); if (dist > radius * radius) continue; @@ -138,7 +138,7 @@ void Villages::cluster() if (found) continue; // create new Village - shared_ptr village = shared_ptr(new Village(level)); + std::shared_ptr village = std::shared_ptr(new Village(level)); village->addDoorInfo(di); villages.push_back(village); setDirty(); @@ -157,7 +157,7 @@ void Villages::addDoorInfos(Pos *pos) { if (isDoor(xx, yy, zz)) { - shared_ptr currentDoor = getDoorInfo(xx, yy, zz); + std::shared_ptr currentDoor = getDoorInfo(xx, yy, zz); if (currentDoor == NULL) createDoorInfo(xx, yy, zz); else currentDoor->timeStamp = _tick; } @@ -166,19 +166,19 @@ void Villages::addDoorInfos(Pos *pos) } } -shared_ptr Villages::getDoorInfo(int x, int y, int z) +std::shared_ptr Villages::getDoorInfo(int x, int y, int z) { //for (DoorInfo di : unclustered) for(AUTO_VAR(it,unclustered.begin()); it != unclustered.end(); ++it) { - shared_ptr di = *it; + std::shared_ptr di = *it; if (di->x == x && di->z == z && abs(di->y - y) <= 1) return di; } //for (Village v : villages) for(AUTO_VAR(it,villages.begin()); it != villages.end(); ++it) { - shared_ptr v = *it; - shared_ptr di = v->getDoorInfo(x, y, z); + std::shared_ptr v = *it; + std::shared_ptr di = v->getDoorInfo(x, y, z); if (di != NULL) return di; } return nullptr; @@ -194,7 +194,7 @@ void Villages::createDoorInfo(int x, int y, int z) if (level->canSeeSky(x + i, y, z)) canSeeX--; for (int i = 1; i <= 5; ++i) if (level->canSeeSky(x + i, y, z)) canSeeX++; - if (canSeeX != 0) unclustered.push_back(shared_ptr(new DoorInfo(x, y, z, canSeeX > 0 ? -2 : 2, 0, _tick))); + if (canSeeX != 0) unclustered.push_back(std::shared_ptr(new DoorInfo(x, y, z, canSeeX > 0 ? -2 : 2, 0, _tick))); } else { @@ -203,7 +203,7 @@ void Villages::createDoorInfo(int x, int y, int z) if (level->canSeeSky(x, y, z + i)) canSeeZ--; for (int i = 1; i <= 5; ++i) if (level->canSeeSky(x, y, z + i)) canSeeZ++; - if (canSeeZ != 0) unclustered.push_back(shared_ptr(new DoorInfo(x, y, z, 0, canSeeZ > 0 ? -2 : 2, _tick))); + if (canSeeZ != 0) unclustered.push_back(std::shared_ptr(new DoorInfo(x, y, z, 0, canSeeZ > 0 ? -2 : 2, _tick))); } } @@ -231,7 +231,7 @@ void Villages::load(CompoundTag *tag) for (int i = 0; i < villageTags->size(); i++) { CompoundTag *compoundTag = villageTags->get(i); - shared_ptr village = shared_ptr(new Village()); + std::shared_ptr village = std::shared_ptr(new Village()); village->readAdditionalSaveData(compoundTag); villages.push_back(village); } @@ -244,7 +244,7 @@ void Villages::save(CompoundTag *tag) //for (Village village : villages) for(AUTO_VAR(it, villages.begin()); it != villages.end(); ++it) { - shared_ptr village = *it; + std::shared_ptr village = *it; CompoundTag *villageTag = new CompoundTag(L"Village"); village->addAdditonalSaveData(villageTag); villageTags->add(villageTag); diff --git a/Minecraft.World/Villages.h b/Minecraft.World/Villages.h index 030edc33..e6715372 100644 --- a/Minecraft.World/Villages.h +++ b/Minecraft.World/Villages.h @@ -12,8 +12,8 @@ public: private: Level *level; deque queries; - vector > unclustered; - vector > villages; + vector > unclustered; + vector > villages; int _tick; public: @@ -29,14 +29,14 @@ private: void removeVillages(); public: - vector > *getVillages(); - shared_ptr getClosestVillage(int x, int y, int z, int maxDist); + vector > *getVillages(); + std::shared_ptr getClosestVillage(int x, int y, int z, int maxDist); private: void processNextQuery(); void cluster(); void addDoorInfos(Pos *pos); - shared_ptrgetDoorInfo(int x, int y, int z); + std::shared_ptrgetDoorInfo(int x, int y, int z); void createDoorInfo(int x, int y, int z); bool hasQuery(int x, int y, int z); bool isDoor(int x, int y, int z); diff --git a/Minecraft.World/VineTile.cpp b/Minecraft.World/VineTile.cpp index 1170caf2..a5e4ad7e 100644 --- a/Minecraft.World/VineTile.cpp +++ b/Minecraft.World/VineTile.cpp @@ -33,7 +33,7 @@ bool VineTile::isCubeShaped() return false; } -void VineTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param +void VineTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) // 4J added forceData, forceEntity param { const float thickness = 1.0f / 16.0f; @@ -368,7 +368,7 @@ int VineTile::getResourceCount(Random *random) return 0; } -void VineTile::playerDestroy(Level *level, shared_ptrplayer, int x, int y, int z, int data) +void VineTile::playerDestroy(Level *level, std::shared_ptrplayer, int x, int y, int z, int data) { if (!level->isClientSide && player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::shears->id) { @@ -378,7 +378,7 @@ void VineTile::playerDestroy(Level *level, shared_ptrplayer, int x, int ); // drop leaf block instead of sapling - popResource(level, x, y, z, shared_ptr(new ItemInstance(Tile::vine, 1, 0))); + popResource(level, x, y, z, std::shared_ptr(new ItemInstance(Tile::vine, 1, 0))); } else { diff --git a/Minecraft.World/VineTile.h b/Minecraft.World/VineTile.h index bdea2cdc..c4e891d0 100644 --- a/Minecraft.World/VineTile.h +++ b/Minecraft.World/VineTile.h @@ -18,7 +18,7 @@ public: virtual int getRenderShape(); virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); - virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); // 4J added forceData, forceEntity param + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); // 4J added forceData, forceEntity param virtual AABB *getAABB(Level *level, int x, int y, int z); virtual bool mayPlace(Level *level, int x, int y, int z, int face); private: @@ -34,5 +34,5 @@ public: virtual int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue); virtual int getResource(int data, Random *random, int playerBonusLevel); virtual int getResourceCount(Random *random); - virtual void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data); + virtual void playerDestroy(Level *level, std::shared_ptr player, int x, int y, int z, int data); }; \ No newline at end of file diff --git a/Minecraft.World/VoronoiZoom.cpp b/Minecraft.World/VoronoiZoom.cpp index f62cc9b6..58f27d53 100644 --- a/Minecraft.World/VoronoiZoom.cpp +++ b/Minecraft.World/VoronoiZoom.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -VoronoiZoom::VoronoiZoom(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) +VoronoiZoom::VoronoiZoom(int64_t seedMixup, std::shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/VoronoiZoom.h b/Minecraft.World/VoronoiZoom.h index 43a8de66..131388d1 100644 --- a/Minecraft.World/VoronoiZoom.h +++ b/Minecraft.World/VoronoiZoom.h @@ -5,7 +5,7 @@ class VoronoiZoom : public Layer { public: - VoronoiZoom(int64_t seedMixup, shared_ptrparent); + VoronoiZoom(int64_t seedMixup, std::shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); diff --git a/Minecraft.World/WallTile.cpp b/Minecraft.World/WallTile.cpp index 6275eef7..4e92b923 100644 --- a/Minecraft.World/WallTile.cpp +++ b/Minecraft.World/WallTile.cpp @@ -51,7 +51,7 @@ bool WallTile::isSolidRender(bool isServerLevel) return false; } -void WallTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +void WallTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) { bool n = connectsTo(level, x, y, z - 1); bool s = connectsTo(level, x, y, z + 1); @@ -131,7 +131,7 @@ AABB *WallTile::getAABB(Level *level, int x, int y, int z) /* 4J-JEV: Stopping the width changing here, it's causing cows/mobs/passers-by to 'jump' up when they are pressed against the - wall and then the wall section is upgraded to a wall post expanding the bounding box. + wall and then the wall section is upgraded to a wall post expanding the bounding box. It's only a 1/16 of a block difference, it shouldn't matter if we leave it a little larger. */ if (n && s && !w && !e) diff --git a/Minecraft.World/WallTile.h b/Minecraft.World/WallTile.h index a9a383d1..e693f9a4 100644 --- a/Minecraft.World/WallTile.h +++ b/Minecraft.World/WallTile.h @@ -22,7 +22,7 @@ public: bool isCubeShaped(); bool isPathfindable(LevelSource *level, int x, int y, int z); bool isSolidRender(bool isServerLevel = false); - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); AABB *getAABB(Level *level, int x, int y, int z); bool connectsTo(LevelSource *level, int x, int y, int z); int getSpawnResourcesAuxValue(int data); diff --git a/Minecraft.World/WaterAnimal.cpp b/Minecraft.World/WaterAnimal.cpp index 0a7313d1..654f930b 100644 --- a/Minecraft.World/WaterAnimal.cpp +++ b/Minecraft.World/WaterAnimal.cpp @@ -36,7 +36,7 @@ bool WaterAnimal::removeWhenFarAway() return true; } -int WaterAnimal::getExperienceReward(shared_ptr killedBy) +int WaterAnimal::getExperienceReward(std::shared_ptr killedBy) { return 1 + level->random->nextInt(3); } \ No newline at end of file diff --git a/Minecraft.World/WaterAnimal.h b/Minecraft.World/WaterAnimal.h index 23b984f5..db7272bb 100644 --- a/Minecraft.World/WaterAnimal.h +++ b/Minecraft.World/WaterAnimal.h @@ -14,5 +14,5 @@ public: protected: virtual bool removeWhenFarAway(); - virtual int getExperienceReward(shared_ptr killedBy); + virtual int getExperienceReward(std::shared_ptr killedBy); }; diff --git a/Minecraft.World/WaterLevelChunk.cpp b/Minecraft.World/WaterLevelChunk.cpp index 19f3e8a1..ba1414c9 100644 --- a/Minecraft.World/WaterLevelChunk.cpp +++ b/Minecraft.World/WaterLevelChunk.cpp @@ -53,15 +53,15 @@ void WaterLevelChunk::setBrightness(LightLayer::variety layer, int x, int y, int { } -void WaterLevelChunk::addEntity(shared_ptr e) +void WaterLevelChunk::addEntity(std::shared_ptr e) { } -void WaterLevelChunk::removeEntity(shared_ptr e) +void WaterLevelChunk::removeEntity(std::shared_ptr e) { } -void WaterLevelChunk::removeEntity(shared_ptr e, int yc) +void WaterLevelChunk::removeEntity(std::shared_ptr e, int yc) { } @@ -69,16 +69,16 @@ void WaterLevelChunk::skyBrightnessChanged() { } -shared_ptr WaterLevelChunk::getTileEntity(int x, int y, int z) +std::shared_ptr WaterLevelChunk::getTileEntity(int x, int y, int z) { - return shared_ptr(); + return std::shared_ptr(); } -void WaterLevelChunk::addTileEntity(shared_ptr te) +void WaterLevelChunk::addTileEntity(std::shared_ptr te) { } -void WaterLevelChunk::setTileEntity(int x, int y, int z, shared_ptr tileEntity) +void WaterLevelChunk::setTileEntity(int x, int y, int z, std::shared_ptr tileEntity) { } @@ -98,11 +98,11 @@ void WaterLevelChunk::markUnsaved() { } -void WaterLevelChunk::getEntities(shared_ptr except, AABB bb, vector > &es) +void WaterLevelChunk::getEntities(std::shared_ptr except, AABB bb, vector > &es) { } -void WaterLevelChunk::getEntitiesOfClass(const type_info& ec, AABB bb, vector > &es) +void WaterLevelChunk::getEntitiesOfClass(const type_info& ec, AABB bb, vector > &es) { } diff --git a/Minecraft.World/WaterLevelChunk.h b/Minecraft.World/WaterLevelChunk.h index 43e7e0c6..5014d8b3 100644 --- a/Minecraft.World/WaterLevelChunk.h +++ b/Minecraft.World/WaterLevelChunk.h @@ -21,19 +21,19 @@ public: bool setData(int x, int y, int z, int val, int mask, bool *maskedBitsChanged); // 4J added mask void setBrightness(LightLayer::variety layer, int x, int y, int z, int brightness); void setLevelChunkBrightness(LightLayer::variety layer, int x, int y, int z, int brightness); // 4J added - calls the setBrightness method of the parent class - void addEntity(shared_ptr e); - void removeEntity(shared_ptr e); - void removeEntity(shared_ptr e, int yc); + void addEntity(std::shared_ptr e); + void removeEntity(std::shared_ptr e); + void removeEntity(std::shared_ptr e, int yc); void skyBrightnessChanged(); - shared_ptr getTileEntity(int x, int y, int z); - void addTileEntity(shared_ptr te); - void setTileEntity(int x, int y, int z, shared_ptr tileEntity); + std::shared_ptr getTileEntity(int x, int y, int z); + void addTileEntity(std::shared_ptr te); + void setTileEntity(int x, int y, int z, std::shared_ptr tileEntity); void removeTileEntity(int x, int y, int z); void load(); void unload(bool unloadTileEntities) ; // 4J - added parameter void markUnsaved(); - void getEntities(shared_ptr except, AABB bb, vector > &es); - void getEntitiesOfClass(const type_info& ec, AABB bb, vector > &es); + void getEntities(std::shared_ptr except, AABB bb, vector > &es); + void getEntitiesOfClass(const type_info& ec, AABB bb, vector > &es); int countEntities(); bool shouldSave(bool force); void setBlocks(byteArray newBlocks, int sub); diff --git a/Minecraft.World/WaterLilyTile.cpp b/Minecraft.World/WaterLilyTile.cpp index 91203922..936005dd 100644 --- a/Minecraft.World/WaterLilyTile.cpp +++ b/Minecraft.World/WaterLilyTile.cpp @@ -23,7 +23,7 @@ int WaterlilyTile::getRenderShape() return Tile::SHAPE_LILYPAD; } -void WaterlilyTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void WaterlilyTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source) { if (source == NULL || !(dynamic_pointer_cast(source))) { diff --git a/Minecraft.World/WaterLilyTile.h b/Minecraft.World/WaterLilyTile.h index af07269c..213af5c5 100644 --- a/Minecraft.World/WaterLilyTile.h +++ b/Minecraft.World/WaterLilyTile.h @@ -11,7 +11,7 @@ public: virtual void updateDefaultShape(); // 4J Added override virtual int getRenderShape(); - virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, std::shared_ptr source); virtual AABB *getAABB(Level *level, int x, int y, int z); virtual int getColor() const; virtual int getColor(int auxData); diff --git a/Minecraft.World/WaterLilyTileItem.cpp b/Minecraft.World/WaterLilyTileItem.cpp index 13814e5c..de125008 100644 --- a/Minecraft.World/WaterLilyTileItem.cpp +++ b/Minecraft.World/WaterLilyTileItem.cpp @@ -10,7 +10,7 @@ WaterLilyTileItem::WaterLilyTileItem(int id) : ColoredTileItem(id, false) { } -bool WaterLilyTileItem::TestUse(Level *level, shared_ptr player) +bool WaterLilyTileItem::TestUse(Level *level, std::shared_ptr player) { HitResult *hr = getPlayerPOVHitResult(level, player, true); if (hr == NULL) return false; @@ -39,7 +39,7 @@ bool WaterLilyTileItem::TestUse(Level *level, shared_ptr player) return false; } -shared_ptr WaterLilyTileItem::use(shared_ptr itemInstance, Level *level, shared_ptr player) +std::shared_ptr WaterLilyTileItem::use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player) { HitResult *hr = getPlayerPOVHitResult(level, player, true); if (hr == NULL) return itemInstance; diff --git a/Minecraft.World/WaterLilyTileItem.h b/Minecraft.World/WaterLilyTileItem.h index c0c5db99..3fc23314 100644 --- a/Minecraft.World/WaterLilyTileItem.h +++ b/Minecraft.World/WaterLilyTileItem.h @@ -8,7 +8,7 @@ public: using ColoredTileItem::getColor; WaterLilyTileItem(int id); - virtual shared_ptr use(shared_ptr itemInstance, Level *level, shared_ptr player); - virtual bool TestUse(Level *level, shared_ptr player); + virtual std::shared_ptr use(std::shared_ptr itemInstance, Level *level, std::shared_ptr player); + virtual bool TestUse(Level *level, std::shared_ptr player); virtual int getColor(int data, int spriteLayer); }; diff --git a/Minecraft.World/WeaponItem.cpp b/Minecraft.World/WeaponItem.cpp index 82b16bde..0dd58d83 100644 --- a/Minecraft.World/WeaponItem.cpp +++ b/Minecraft.World/WeaponItem.cpp @@ -13,7 +13,7 @@ WeaponItem::WeaponItem(int id, const Tier *tier) : Item(id), tier( tier ) damage = 4 + tier->getAttackDamageBonus(); } -float WeaponItem::getDestroySpeed(shared_ptr itemInstance, Tile *tile) +float WeaponItem::getDestroySpeed(std::shared_ptr itemInstance, Tile *tile) { if (tile->id == Tile::web_Id) { @@ -23,20 +23,20 @@ float WeaponItem::getDestroySpeed(shared_ptr itemInstance, Tile *t return 1.5f; } -bool WeaponItem::hurtEnemy(shared_ptr itemInstance, shared_ptr mob, shared_ptr attacker) +bool WeaponItem::hurtEnemy(std::shared_ptr itemInstance, std::shared_ptr mob, std::shared_ptr attacker) { itemInstance->hurt(1, attacker); return true; } -bool WeaponItem::mineBlock(shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr owner) +bool WeaponItem::mineBlock(std::shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, std::shared_ptr owner) { // Don't damage weapons if the tile can be destroyed in one hit. if (Tile::tiles[tile]->getDestroySpeed(level, x, y, z) != 0.0) itemInstance->hurt(2, owner); return true; } -int WeaponItem::getAttackDamage(shared_ptr entity) +int WeaponItem::getAttackDamage(std::shared_ptr entity) { return damage; } @@ -46,17 +46,17 @@ bool WeaponItem::isHandEquipped() return true; } -UseAnim WeaponItem::getUseAnimation(shared_ptr itemInstance) +UseAnim WeaponItem::getUseAnimation(std::shared_ptr itemInstance) { return UseAnim_block; -} +} -int WeaponItem::getUseDuration(shared_ptr itemInstance) +int WeaponItem::getUseDuration(std::shared_ptr itemInstance) { return 20 * 60 * 60; // Block for a maximum of one hour! } -shared_ptr WeaponItem::use(shared_ptr instance, Level *level, shared_ptr player) +std::shared_ptr WeaponItem::use(std::shared_ptr instance, Level *level, std::shared_ptr player) { player->startUsingItem(instance, getUseDuration(instance)); return instance; @@ -77,7 +77,7 @@ const Item::Tier *WeaponItem::getTier() return tier; } -bool WeaponItem::isValidRepairItem(shared_ptr source, shared_ptr repairItem) +bool WeaponItem::isValidRepairItem(std::shared_ptr source, std::shared_ptr repairItem) { if (tier->getTierItemId() == repairItem->id) { diff --git a/Minecraft.World/WeaponItem.h b/Minecraft.World/WeaponItem.h index 2150f6e9..162866d6 100644 --- a/Minecraft.World/WeaponItem.h +++ b/Minecraft.World/WeaponItem.h @@ -12,17 +12,17 @@ private: public: WeaponItem(int id, const Tier *tier); - virtual float getDestroySpeed(shared_ptr itemInstance, Tile *tile); - virtual bool hurtEnemy(shared_ptr itemInstance, shared_ptr mob, shared_ptr attacker); - virtual bool mineBlock(shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr owner); - virtual int getAttackDamage(shared_ptr entity); + virtual float getDestroySpeed(std::shared_ptr itemInstance, Tile *tile); + virtual bool hurtEnemy(std::shared_ptr itemInstance, std::shared_ptr mob, std::shared_ptr attacker); + virtual bool mineBlock(std::shared_ptr itemInstance, Level *level, int tile, int x, int y, int z, std::shared_ptr owner); + virtual int getAttackDamage(std::shared_ptr entity); virtual bool isHandEquipped(); - virtual UseAnim getUseAnimation(shared_ptr itemInstance); - virtual int getUseDuration(shared_ptr itemInstance); - virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual UseAnim getUseAnimation(std::shared_ptr itemInstance); + virtual int getUseDuration(std::shared_ptr itemInstance); + virtual std::shared_ptr use(std::shared_ptr instance, Level *level, std::shared_ptr player); virtual bool canDestroySpecial(Tile *tile); virtual int getEnchantmentValue(); const Tier *getTier(); - bool isValidRepairItem(shared_ptr source, shared_ptr repairItem); + bool isValidRepairItem(std::shared_ptr source, std::shared_ptr repairItem); }; \ No newline at end of file diff --git a/Minecraft.World/WebTile.cpp b/Minecraft.World/WebTile.cpp index a724c36d..0642bb57 100644 --- a/Minecraft.World/WebTile.cpp +++ b/Minecraft.World/WebTile.cpp @@ -8,7 +8,7 @@ WebTile::WebTile(int id) : Tile(id, Material::web) } -void WebTile::entityInside(Level *level, int x, int y, int z, shared_ptr entity) +void WebTile::entityInside(Level *level, int x, int y, int z, std::shared_ptr entity) { entity->makeStuckInWeb(); } diff --git a/Minecraft.World/WebTile.h b/Minecraft.World/WebTile.h index ca1f4dae..54661717 100644 --- a/Minecraft.World/WebTile.h +++ b/Minecraft.World/WebTile.h @@ -10,7 +10,7 @@ public: public: - void entityInside(Level *level, int x, int y, int z, shared_ptr entity); + void entityInside(Level *level, int x, int y, int z, std::shared_ptr entity); public: diff --git a/Minecraft.World/WeighedTreasure.cpp b/Minecraft.World/WeighedTreasure.cpp index d7044644..540727e3 100644 --- a/Minecraft.World/WeighedTreasure.cpp +++ b/Minecraft.World/WeighedTreasure.cpp @@ -6,19 +6,19 @@ WeighedTreasure::WeighedTreasure(int itemId, int auxValue, int minCount, int maxCount, int weight) : WeighedRandomItem(weight) { - this->item = shared_ptr( new ItemInstance(itemId, 1, auxValue) ); + this->item = std::shared_ptr( new ItemInstance(itemId, 1, auxValue) ); this->minCount = minCount; this->maxCount = maxCount; } -WeighedTreasure::WeighedTreasure(shared_ptr item, int minCount, int maxCount, int weight) : WeighedRandomItem(weight) +WeighedTreasure::WeighedTreasure(std::shared_ptr item, int minCount, int maxCount, int weight) : WeighedRandomItem(weight) { this->item = item; this->minCount = minCount; this->maxCount = maxCount; } -void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, shared_ptr dest, int numRolls) +void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, std::shared_ptr dest, int numRolls) { for (int r = 0; r < numRolls; r++) { @@ -27,7 +27,7 @@ void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, int count = treasure->minCount + random->nextInt(treasure->maxCount - treasure->minCount + 1); if (treasure->item->getMaxStackSize() >= count) { - shared_ptr copy = treasure->item->copy(); + std::shared_ptr copy = treasure->item->copy(); copy->count = count; dest->setItem(random->nextInt(dest->getContainerSize()), copy); } @@ -36,7 +36,7 @@ void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, // use multiple slots for (int c = 0; c < count; c++) { - shared_ptr copy = treasure->item->copy(); + std::shared_ptr copy = treasure->item->copy(); copy->count = 1; dest->setItem(random->nextInt(dest->getContainerSize()), copy); } @@ -44,7 +44,7 @@ void WeighedTreasure::addChestItems(Random *random, WeighedTreasureArray items, } } -void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray items, shared_ptr dest, int numRolls) +void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray items, std::shared_ptr dest, int numRolls) { for (int r = 0; r < numRolls; r++) { @@ -53,7 +53,7 @@ void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray ite int count = treasure->minCount + random->nextInt(treasure->maxCount - treasure->minCount + 1); if (treasure->item->getMaxStackSize() >= count) { - shared_ptr copy = treasure->item->copy(); + std::shared_ptr copy = treasure->item->copy(); copy->count = count; dest->setItem(random->nextInt(dest->getContainerSize()), copy); } @@ -62,7 +62,7 @@ void WeighedTreasure::addDispenserItems(Random *random, WeighedTreasureArray ite // use multiple slots for (int c = 0; c < count; c++) { - shared_ptr copy = treasure->item->copy(); + std::shared_ptr copy = treasure->item->copy(); copy->count = 1; dest->setItem(random->nextInt(dest->getContainerSize()), copy); } diff --git a/Minecraft.World/WeighedTreasure.h b/Minecraft.World/WeighedTreasure.h index a37bc6ae..7b0ecd4c 100644 --- a/Minecraft.World/WeighedTreasure.h +++ b/Minecraft.World/WeighedTreasure.h @@ -5,15 +5,15 @@ class WeighedTreasure : public WeighedRandomItem { private: - shared_ptr item; + std::shared_ptr item; int minCount; int maxCount; public: WeighedTreasure(int itemId, int auxValue, int minCount, int maxCount, int weight); - WeighedTreasure(shared_ptr item, int minCount, int maxCount, int weight); + WeighedTreasure(std::shared_ptr item, int minCount, int maxCount, int weight); - static void addChestItems(Random *random, WeighedTreasureArray items, shared_ptr dest, int numRolls); - static void addDispenserItems(Random *random, WeighedTreasureArray items, shared_ptr dest, int numRolls); + static void addChestItems(Random *random, WeighedTreasureArray items, std::shared_ptr dest, int numRolls); + static void addDispenserItems(Random *random, WeighedTreasureArray items, std::shared_ptr dest, int numRolls); static WeighedTreasureArray addToTreasure(WeighedTreasureArray items, WeighedTreasure *extra); }; \ No newline at end of file diff --git a/Minecraft.World/Wolf.cpp b/Minecraft.World/Wolf.cpp index 8ffc45c6..2e98e7cc 100644 --- a/Minecraft.World/Wolf.cpp +++ b/Minecraft.World/Wolf.cpp @@ -60,7 +60,7 @@ bool Wolf::useNewAi() return true; } -void Wolf::setTarget(shared_ptr target) +void Wolf::setTarget(std::shared_ptr target) { TamableAnimal::setTarget(target); if ( dynamic_pointer_cast(target) == NULL ) @@ -87,7 +87,7 @@ int Wolf::getMaxHealth() return START_HEALTH; } -void Wolf::defineSynchedData() +void Wolf::defineSynchedData() { TamableAnimal::defineSynchedData(); entityData->define(DATA_HEALTH_ID, getHealth()); @@ -95,25 +95,25 @@ void Wolf::defineSynchedData() entityData->define(DATA_COLLAR_COLOR, (byte) ClothTile::getTileDataForItemAuxValue(DyePowderItem::RED)); } -bool Wolf::makeStepSound() +bool Wolf::makeStepSound() { return false; } -int Wolf::getTexture() +int Wolf::getTexture() { - if (isTame()) + if (isTame()) { return TN_MOB_WOLF_TAME; // 4J was L"/mob/wolf_tame.png"; } - if (isAngry()) + if (isAngry()) { return TN_MOB_WOLF_ANGRY; // 4J was L"/mob/wolf_angry.png"; } return TamableAnimal::getTexture(); } -void Wolf::addAdditonalSaveData(CompoundTag *tag) +void Wolf::addAdditonalSaveData(CompoundTag *tag) { TamableAnimal::addAdditonalSaveData(tag); @@ -121,7 +121,7 @@ void Wolf::addAdditonalSaveData(CompoundTag *tag) tag->putByte(L"CollarColor", (byte) getCollarColor()); } -void Wolf::readAdditionalSaveData(CompoundTag *tag) +void Wolf::readAdditionalSaveData(CompoundTag *tag) { TamableAnimal::readAdditionalSaveData(tag); @@ -129,20 +129,20 @@ void Wolf::readAdditionalSaveData(CompoundTag *tag) if (tag->contains(L"CollarColor")) setCollarColor(tag->getByte(L"CollarColor")); } -bool Wolf::removeWhenFarAway() +bool Wolf::removeWhenFarAway() { return !isTame(); } -int Wolf::getAmbientSound() +int Wolf::getAmbientSound() { - if (isAngry()) + if (isAngry()) { return eSoundType_MOB_WOLF_GROWL; } - if (random->nextInt(3) == 0) + if (random->nextInt(3) == 0) { - if (isTame() && entityData->getInteger(DATA_HEALTH_ID) < 10) + if (isTame() && entityData->getInteger(DATA_HEALTH_ID) < 10) { return eSoundType_MOB_WOLF_WHINE; } @@ -151,31 +151,31 @@ int Wolf::getAmbientSound() return eSoundType_MOB_WOLF_BARK; } -int Wolf::getHurtSound() +int Wolf::getHurtSound() { return eSoundType_MOB_WOLF_HURT; } -int Wolf::getDeathSound() +int Wolf::getDeathSound() { return eSoundType_MOB_WOLF_DEATH; } -float Wolf::getSoundVolume() +float Wolf::getSoundVolume() { return 0.4f; } -int Wolf::getDeathLoot() +int Wolf::getDeathLoot() { return -1; } -void Wolf::aiStep() +void Wolf::aiStep() { TamableAnimal::aiStep(); - if (!level->isClientSide && m_isWet && !isShaking && !isPathFinding() && onGround) + if (!level->isClientSide && m_isWet && !isShaking && !isPathFinding() && onGround) { isShaking = true; shakeAnim = 0; @@ -185,37 +185,37 @@ void Wolf::aiStep() } } -void Wolf::tick() +void Wolf::tick() { TamableAnimal::tick(); interestedAngleO = interestedAngle; - if (isInterested()) + if (isInterested()) { interestedAngle = interestedAngle + (1 - interestedAngle) * 0.4f; - } - else + } + else { interestedAngle = interestedAngle + (0 - interestedAngle) * 0.4f; } - if (isInterested()) + if (isInterested()) { lookTime = 10; } - if (isInWaterOrRain()) + if (isInWaterOrRain()) { m_isWet = true; isShaking = false; shakeAnim = 0; shakeAnimO = 0; - } - else if (m_isWet || isShaking) + } + else if (m_isWet || isShaking) { - if (isShaking) + if (isShaking) { - if (shakeAnim == 0) + if (shakeAnim == 0) { level->playSound(shared_from_this(), eSoundType_MOB_WOLF_SHAKE, getSoundVolume(), (random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f); } @@ -223,7 +223,7 @@ void Wolf::tick() shakeAnimO = shakeAnim; shakeAnim += 0.05f; - if (shakeAnimO >= 2) + if (shakeAnimO >= 2) { m_isWet = false; isShaking = false; @@ -231,11 +231,11 @@ void Wolf::tick() shakeAnim = 0; } - if (shakeAnim > 0.4f) + if (shakeAnim > 0.4f) { float yt = (float) bb->y0; int shakeCount = (int) (Mth::sin((shakeAnim - 0.4f) * PI) * 7.0f); - for (int i = 0; i < shakeCount; i++) + for (int i = 0; i < shakeCount; i++) { float xo = (random->nextFloat() * 2 - 1) * bbWidth * 0.5f; float zo = (random->nextFloat() * 2 - 1) * bbWidth * 0.5f; @@ -246,55 +246,55 @@ void Wolf::tick() } } -bool Wolf::isWet() +bool Wolf::isWet() { return m_isWet; } -float Wolf::getWetShade(float a) +float Wolf::getWetShade(float a) { return 0.75f + ((shakeAnimO + (shakeAnim - shakeAnimO) * a) / 2.0f) * 0.25f; } -float Wolf::getBodyRollAngle(float a, float offset) +float Wolf::getBodyRollAngle(float a, float offset) { float progress = ((shakeAnimO + (shakeAnim - shakeAnimO) * a) + offset) / 1.8f; - if (progress < 0) + if (progress < 0) { progress = 0; - } - else if (progress > 1) + } + else if (progress > 1) { progress = 1; } return Mth::sin(progress * PI) * Mth::sin(progress * PI * 11.0f) * 0.15f * PI; } -float Wolf::getHeadRollAngle(float a) +float Wolf::getHeadRollAngle(float a) { return (interestedAngleO + (interestedAngle - interestedAngleO) * a) * 0.15f * PI; } -float Wolf::getHeadHeight() +float Wolf::getHeadHeight() { return bbHeight * 0.8f; } -int Wolf::getMaxHeadXRot() +int Wolf::getMaxHeadXRot() { - if (isSitting()) + if (isSitting()) { return 20; } return TamableAnimal::getMaxHeadXRot(); } -bool Wolf::hurt(DamageSource *source, int dmg) +bool Wolf::hurt(DamageSource *source, int dmg) { if (isInvulnerable()) return false; - shared_ptr sourceEntity = source->getEntity(); + std::shared_ptr sourceEntity = source->getEntity(); sitGoal->wantToSit(false); - if (sourceEntity != NULL && !(dynamic_pointer_cast(sourceEntity) != NULL || dynamic_pointer_cast(sourceEntity) != NULL)) + if (sourceEntity != NULL && !(dynamic_pointer_cast(sourceEntity) != NULL || dynamic_pointer_cast(sourceEntity) != NULL)) { // take half damage from non-players and arrows dmg = (dmg + 1) / 2; @@ -302,13 +302,13 @@ bool Wolf::hurt(DamageSource *source, int dmg) return TamableAnimal::hurt(source, dmg); } -bool Wolf::doHurtTarget(shared_ptr target) +bool Wolf::doHurtTarget(std::shared_ptr target) { int damage = isTame() ? 4 : 2; return target->hurt(DamageSource::mobAttack(dynamic_pointer_cast(shared_from_this())), damage); } -void Wolf::tame(const wstring &wsOwnerUUID, bool bDisplayTamingParticles, bool bSetSitting) +void Wolf::tame(const wstring &wsOwnerUUID, bool bDisplayTamingParticles, bool bSetSitting) { setTame(true); setPath(NULL); @@ -322,11 +322,11 @@ void Wolf::tame(const wstring &wsOwnerUUID, bool bDisplayTamingParticles, bool b spawnTamingParticles(bDisplayTamingParticles); } -bool Wolf::interact(shared_ptr player) +bool Wolf::interact(std::shared_ptr player) { - shared_ptr item = player->inventory->getSelected(); + std::shared_ptr item = player->inventory->getSelected(); - if (isTame()) + if (isTame()) { if (item != NULL) { @@ -343,7 +343,7 @@ bool Wolf::interact(shared_ptr player) if (player->abilities.instabuild==false) { item->count--; - if (item->count <= 0) + if (item->count <= 0) { player->inventory->setItem(player->inventory->selected, nullptr); } @@ -351,7 +351,7 @@ bool Wolf::interact(shared_ptr player) return true; } else return TamableAnimal::interact(player); - } + } } else if (item->id == Item::dye_powder_Id) { @@ -381,7 +381,7 @@ bool Wolf::interact(shared_ptr player) } else { - if (item != NULL && item->id == Item::bone->id && !isAngry()) + if (item != NULL && item->id == Item::bone->id && !isAngry()) { // 4J-PB - don't lose the bone in creative mode if (player->abilities.instabuild==false) @@ -393,9 +393,9 @@ bool Wolf::interact(shared_ptr player) } } - if (!level->isClientSide) + if (!level->isClientSide) { - if (random->nextInt(3) == 0) + if (random->nextInt(3) == 0) { // 4J : WESTY: Added for new acheivements. player->awardStat(GenericStats::tamedEntity(eTYPE_WOLF),GenericStats::param_tamedEntity(eTYPE_WOLF)); @@ -404,8 +404,8 @@ bool Wolf::interact(shared_ptr player) tame(player->getUUID(),true,true); level->broadcastEntityEvent(shared_from_this(), EntityEvent::TAMING_SUCCEEDED); - } - else + } + else { spawnTamingParticles(false); level->broadcastEntityEvent(shared_from_this(), EntityEvent::TAMING_FAILED); @@ -424,15 +424,15 @@ bool Wolf::interact(shared_ptr player) return TamableAnimal::interact(player); } -void Wolf::handleEntityEvent(byte id) +void Wolf::handleEntityEvent(byte id) { if (id == EntityEvent::SHAKE_WETNESS) { isShaking = true; shakeAnim = 0; shakeAnimO = 0; - } - else + } + else { TamableAnimal::handleEntityEvent(id); } @@ -440,18 +440,18 @@ void Wolf::handleEntityEvent(byte id) float Wolf::getTailAngle() { - if (isAngry()) + if (isAngry()) { return 0.49f * PI; - } - else if (isTame()) + } + else if (isTame()) { return (0.55f - (MAX_HEALTH - entityData->getInteger(DATA_HEALTH_ID)) * 0.02f) * PI; } return 0.20f * PI; } -bool Wolf::isFood(shared_ptr item) +bool Wolf::isFood(std::shared_ptr item) { if (item == NULL) return false; if (dynamic_cast(Item::items[item->id]) == NULL) return false; @@ -464,18 +464,18 @@ int Wolf::getMaxSpawnClusterSize() return 4; } -bool Wolf::isAngry() +bool Wolf::isAngry() { return (entityData->getByte(DATA_FLAGS_ID) & 0x02) != 0; } -void Wolf::setAngry(bool value) +void Wolf::setAngry(bool value) { byte current = entityData->getByte(DATA_FLAGS_ID); - if (value) + if (value) { entityData->set(DATA_FLAGS_ID, (byte) (current | 0x02)); - } + } else { entityData->set(DATA_FLAGS_ID, (byte) (current & ~0x02)); @@ -493,17 +493,17 @@ void Wolf::setCollarColor(int color) } // 4J-PB added for tooltips -int Wolf::GetSynchedHealth() +int Wolf::GetSynchedHealth() { return getEntityData()->getInteger(DATA_HEALTH_ID); -} +} -shared_ptr Wolf::getBreedOffspring(shared_ptr target) +std::shared_ptr Wolf::getBreedOffspring(std::shared_ptr target) { // 4J - added limit to wolves that can be bred if( level->canCreateMore( GetType(), Level::eSpawnType_Breed) ) { - shared_ptr pBabyWolf = shared_ptr( new Wolf(level) ); + std::shared_ptr pBabyWolf = std::shared_ptr( new Wolf(level) ); if(!getOwnerUUID().empty()) { @@ -532,11 +532,11 @@ void Wolf::setIsInterested(bool value) } } -bool Wolf::canMate(shared_ptr animal) +bool Wolf::canMate(std::shared_ptr animal) { if (animal == shared_from_this()) return false; if (!isTame()) return false; - shared_ptr partner = dynamic_pointer_cast(animal); + std::shared_ptr partner = dynamic_pointer_cast(animal); if (partner == NULL) return false; if (!partner->isTame()) return false; if (partner->isSitting()) return false; diff --git a/Minecraft.World/Wolf.h b/Minecraft.World/Wolf.h index 52f2a23b..8667a0f5 100644 --- a/Minecraft.World/Wolf.h +++ b/Minecraft.World/Wolf.h @@ -26,7 +26,7 @@ private: public: Wolf(Level *level); virtual bool useNewAi(); - virtual void setTarget(shared_ptr target); + virtual void setTarget(std::shared_ptr target); protected: virtual void serverAiMobStep(); @@ -61,11 +61,11 @@ public: float getHeadHeight(); int getMaxHeadXRot(); virtual bool hurt(DamageSource *source, int dmg); - virtual bool doHurtTarget(shared_ptr target); - virtual bool interact(shared_ptr player); + virtual bool doHurtTarget(std::shared_ptr target); + virtual bool interact(std::shared_ptr player); virtual void handleEntityEvent(byte id); float getTailAngle(); - virtual bool isFood(shared_ptr item); + virtual bool isFood(std::shared_ptr item); virtual int getMaxSpawnClusterSize(); bool isAngry(); void setAngry(bool value); @@ -77,10 +77,10 @@ public: int GetSynchedHealth(); protected: - virtual shared_ptr getBreedOffspring(shared_ptr target); + virtual std::shared_ptr getBreedOffspring(std::shared_ptr target); public: virtual void setIsInterested(bool isInterested); - virtual bool canMate(shared_ptr animal); + virtual bool canMate(std::shared_ptr animal); bool isInterested(); }; diff --git a/Minecraft.World/WoodSlabTile.cpp b/Minecraft.World/WoodSlabTile.cpp index ba3a98e5..92244069 100644 --- a/Minecraft.World/WoodSlabTile.cpp +++ b/Minecraft.World/WoodSlabTile.cpp @@ -31,9 +31,9 @@ int WoodSlabTile::getResource(int data, Random *random, int playerBonusLevel) return Tile::woodSlabHalf_Id; } -shared_ptr WoodSlabTile::getSilkTouchItemInstance(int data) +std::shared_ptr WoodSlabTile::getSilkTouchItemInstance(int data) { - return shared_ptr(new ItemInstance(Tile::woodSlabHalf, 2, data & TYPE_MASK)); + return std::shared_ptr(new ItemInstance(Tile::woodSlabHalf, 2, data & TYPE_MASK)); } int WoodSlabTile::getAuxName(int auxValue) diff --git a/Minecraft.World/WoodSlabTile.h b/Minecraft.World/WoodSlabTile.h index b91f7136..bf78d2a9 100644 --- a/Minecraft.World/WoodSlabTile.h +++ b/Minecraft.World/WoodSlabTile.h @@ -6,7 +6,7 @@ class Player; class WoodSlabTile : HalfSlabTile -{ +{ friend class Tile; public: @@ -18,11 +18,11 @@ public: WoodSlabTile(int id, bool fullSize); virtual Icon *getTexture(int face, int data); virtual int getResource(int data, Random *random, int playerBonusLevel); - virtual int getAuxName(int auxValue); + virtual int getAuxName(int auxValue); - virtual shared_ptr getSilkTouchItemInstance(int data); + virtual std::shared_ptr getSilkTouchItemInstance(int data); void registerIcons(IconRegister *iconRegister); - + // 4J added virtual unsigned int getDescriptionId(int iData = -1); }; \ No newline at end of file diff --git a/Minecraft.World/WoolCarpetTile.cpp b/Minecraft.World/WoolCarpetTile.cpp index 16a3d0aa..b1534219 100644 --- a/Minecraft.World/WoolCarpetTile.cpp +++ b/Minecraft.World/WoolCarpetTile.cpp @@ -46,7 +46,7 @@ void WoolCarpetTile::updateDefaultShape() updateShape(0); } -void WoolCarpetTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +void WoolCarpetTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr forceEntity) { updateShape(level->getData(x, y, z)); } diff --git a/Minecraft.World/WoolCarpetTile.h b/Minecraft.World/WoolCarpetTile.h index af0cd28a..ef84514c 100644 --- a/Minecraft.World/WoolCarpetTile.h +++ b/Minecraft.World/WoolCarpetTile.h @@ -15,7 +15,7 @@ public: bool isSolidRender(bool isServerLevel = false); bool isCubeShaped(); void updateDefaultShape(); - void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, std::shared_ptr forceEntity = std::shared_ptr()); protected: void updateShape(int data); diff --git a/Minecraft.World/WorkbenchTile.cpp b/Minecraft.World/WorkbenchTile.cpp index 7af19755..108ec546 100644 --- a/Minecraft.World/WorkbenchTile.cpp +++ b/Minecraft.World/WorkbenchTile.cpp @@ -32,7 +32,7 @@ bool WorkbenchTile::TestUse() return true; } -bool WorkbenchTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param +bool WorkbenchTile::use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly ) return false; if (level->isClientSide) diff --git a/Minecraft.World/WorkbenchTile.h b/Minecraft.World/WorkbenchTile.h index 1e7fd4ec..bbbdcb85 100644 --- a/Minecraft.World/WorkbenchTile.h +++ b/Minecraft.World/WorkbenchTile.h @@ -22,5 +22,5 @@ public: public: virtual bool TestUse(); - bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + bool use(Level *level, int x, int y, int z, std::shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param }; \ No newline at end of file diff --git a/Minecraft.World/XZPacket.h b/Minecraft.World/XZPacket.h index 0c4115e0..4154084f 100644 --- a/Minecraft.World/XZPacket.h +++ b/Minecraft.World/XZPacket.h @@ -25,6 +25,6 @@ public: virtual int getEstimatedSize(); public: - static shared_ptr create() { return shared_ptr(new XZPacket()); } + static std::shared_ptr create() { return std::shared_ptr(new XZPacket()); } virtual int getId() { return 166; } }; \ No newline at end of file diff --git a/Minecraft.World/Zombie.cpp b/Minecraft.World/Zombie.cpp index b167635f..ba6d30a5 100644 --- a/Minecraft.World/Zombie.cpp +++ b/Minecraft.World/Zombie.cpp @@ -29,7 +29,7 @@ Zombie::Zombie(Level *level) : Monster( level ) attackDamage = 4; villagerConversionTime = 0; - + registeredBBWidth = -1; registeredBBHeight = 0; @@ -153,7 +153,7 @@ int Zombie::getHurtSound() int Zombie::getDeathSound() { return eSoundType_MOB_ZOMBIE_DEATH; -} +} int Zombie::getDeathLoot() { @@ -211,7 +211,7 @@ void Zombie::readAdditionalSaveData(CompoundTag *tag) if (tag->contains(L"ConversionTime") && tag->getInt(L"ConversionTime") > -1) startConverting(tag->getInt(L"ConversionTime")); } -void Zombie::killed(shared_ptr mob) +void Zombie::killed(std::shared_ptr mob) { Monster::killed(mob); @@ -220,7 +220,7 @@ void Zombie::killed(shared_ptr mob) if( !level->canCreateMore( GetType(), Level::eSpawnType_Egg) ) return; if (level->difficulty == Difficulty::NORMAL && random->nextBoolean()) return; - shared_ptr zombie = shared_ptr(new Zombie(level)); + std::shared_ptr zombie = std::shared_ptr(new Zombie(level)); zombie->copyPosition(mob); level->removeEntity(mob); zombie->finalizeMobSpawn(); @@ -263,9 +263,9 @@ void Zombie::finalizeMobSpawn() #endif } -bool Zombie::interact(shared_ptr player) +bool Zombie::interact(std::shared_ptr player) { - shared_ptr item = player->getSelectedItem(); + std::shared_ptr item = player->getSelectedItem(); if (item != NULL && item->getItem() == Item::apple_gold && item->getAuxValue() == 0 && isVillager() && hasEffect(MobEffect::weakness)) { @@ -319,7 +319,7 @@ bool Zombie::isConverting() void Zombie::finishConversion() { - shared_ptr villager = shared_ptr(new Villager(level)); + std::shared_ptr villager = std::shared_ptr(new Villager(level)); villager->copyPosition(shared_from_this()); villager->finalizeMobSpawn(); villager->setRewardPlayersInVillage(); diff --git a/Minecraft.World/Zombie.h b/Minecraft.World/Zombie.h index 237db15b..ffb48e5d 100644 --- a/Minecraft.World/Zombie.h +++ b/Minecraft.World/Zombie.h @@ -48,7 +48,7 @@ public: void setVillager(bool villager); virtual void aiStep(); virtual void tick(); - + protected: virtual int getAmbientSound(); virtual int getHurtSound(); @@ -64,9 +64,9 @@ protected: public: virtual void addAdditonalSaveData(CompoundTag *tag); virtual void readAdditionalSaveData(CompoundTag *tag); - void killed(shared_ptr mob); + void killed(std::shared_ptr mob); virtual void finalizeMobSpawn(); - bool interact(shared_ptr player); + bool interact(std::shared_ptr player); protected: void startConverting(int time); diff --git a/Minecraft.World/ZonedChunkStorage.cpp b/Minecraft.World/ZonedChunkStorage.cpp index aed408c6..0e3851c6 100644 --- a/Minecraft.World/ZonedChunkStorage.cpp +++ b/Minecraft.World/ZonedChunkStorage.cpp @@ -207,12 +207,12 @@ void ZonedChunkStorage::loadEntities(Level *level, LevelChunk *lc) int type = tag->getInt(L"_TYPE"); if (type == 0) { - shared_ptr e = EntityIO::loadStatic(tag, level); + std::shared_ptr e = EntityIO::loadStatic(tag, level); if (e != NULL) lc->addEntity(e); } else if (type == 1) { - shared_ptr te = TileEntity::loadStatic(tag); + std::shared_ptr te = TileEntity::loadStatic(tag); if (te != NULL) lc->addTileEntity(te); } } @@ -232,12 +232,12 @@ void ZonedChunkStorage::saveEntities(Level *level, LevelChunk *lc) #endif for (int i = 0; i < LevelChunk::ENTITY_BLOCKS_LENGTH; i++) { - vector > *entities = lc->entityBlocks[i]; + vector > *entities = lc->entityBlocks[i]; AUTO_VAR(itEndTags, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEndTags; it++) { - shared_ptr e = *it; //entities->at(j); + std::shared_ptr e = *it; //entities->at(j); CompoundTag *cp = new CompoundTag(); cp->putInt(L"_TYPE", 0); e->save(cp); @@ -250,10 +250,10 @@ void ZonedChunkStorage::saveEntities(Level *level, LevelChunk *lc) LeaveCriticalSection(&lc->m_csEntities); #endif - for( unordered_map , TilePosKeyHash, TilePosKeyEq>::iterator it = lc->tileEntities.begin(); + for( unordered_map , TilePosKeyHash, TilePosKeyEq>::iterator it = lc->tileEntities.begin(); it != lc->tileEntities.end(); it++) { - shared_ptr te = it->second; + std::shared_ptr te = it->second; CompoundTag *cp = new CompoundTag(); cp->putInt(L"_TYPE", 1); te->save(cp); diff --git a/Minecraft.World/ZoomLayer.cpp b/Minecraft.World/ZoomLayer.cpp index c2123785..cc6a6f1d 100644 --- a/Minecraft.World/ZoomLayer.cpp +++ b/Minecraft.World/ZoomLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -ZoomLayer::ZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) +ZoomLayer::ZoomLayer(int64_t seedMixup, std::shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -81,12 +81,12 @@ int ZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrZoomLayer::zoom(int64_t seed, shared_ptr sup, int count) +std::shared_ptrZoomLayer::zoom(int64_t seed, std::shared_ptr sup, int count) { - shared_ptrresult = sup; + std::shared_ptrresult = sup; for (int i = 0; i < count; i++) { - result = shared_ptr(new ZoomLayer(seed + i, result)); + result = std::shared_ptr(new ZoomLayer(seed + i, result)); } return result; } \ No newline at end of file diff --git a/Minecraft.World/ZoomLayer.h b/Minecraft.World/ZoomLayer.h index 8ec93c8a..76d41a4e 100644 --- a/Minecraft.World/ZoomLayer.h +++ b/Minecraft.World/ZoomLayer.h @@ -5,7 +5,7 @@ class ZoomLayer : public Layer { public: - ZoomLayer(int64_t seedMixup, shared_ptr parent); + ZoomLayer(int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); @@ -14,5 +14,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptr zoom(int64_t seed, shared_ptrsup, int count); + static std::shared_ptr zoom(int64_t seed, std::shared_ptrsup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/net.minecraft.world.ContainerListener.h b/Minecraft.World/net.minecraft.world.ContainerListener.h index 1ac036a5..8ef4d63a 100644 --- a/Minecraft.World/net.minecraft.world.ContainerListener.h +++ b/Minecraft.World/net.minecraft.world.ContainerListener.h @@ -3,7 +3,7 @@ class SimpleContainer; // TODO 4J Stu -// There are 2 classes called ContainerListener. One in net.minecraft.world.inventory and +// There are 2 classes called ContainerListener. One in net.minecraft.world.inventory and // another one in net.minecraft.world . To avoid clashes I have renamed both and put them in a namespace // to avoid confusion. @@ -13,6 +13,6 @@ namespace net_minecraft_world { friend class SimpleContainer; private: - virtual void containerChanged(shared_ptr simpleContainer) = 0; + virtual void containerChanged(std::shared_ptr simpleContainer) = 0; }; } \ No newline at end of file diff --git a/Minecraft.World/net.minecraft.world.inventory.ContainerListener.h b/Minecraft.World/net.minecraft.world.inventory.ContainerListener.h index ff9dfa2e..979311a3 100644 --- a/Minecraft.World/net.minecraft.world.inventory.ContainerListener.h +++ b/Minecraft.World/net.minecraft.world.inventory.ContainerListener.h @@ -3,7 +3,7 @@ using namespace std; class AbstractContainerMenu; // 4J Stu -// There are 2 classes called ContainerListener. Once here in net.minecraft.world.inventory and +// There are 2 classes called ContainerListener. Once here in net.minecraft.world.inventory and // another once in net.minecraft.world . To avoid clashes I have renamed both and put them in a namespace // to avoid confusion. @@ -12,9 +12,9 @@ namespace net_minecraft_world_inventory class ContainerListener { public: - virtual void refreshContainer(AbstractContainerMenu *container, vector > *items) = 0; + virtual void refreshContainer(AbstractContainerMenu *container, vector > *items) = 0; - virtual void slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr item) = 0; + virtual void slotChanged(AbstractContainerMenu *container, int slotIndex, std::shared_ptr item) = 0; virtual void setContainerData(AbstractContainerMenu *container, int id, int value) = 0; };